Merge "Android U: GM3 Color Tokens for Taskbar and quickstep" into udc-dev am: 990aef6c00 am: 97ec1855a0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23220591 Change-Id: I410846f848704b706afb6af4d1b5718cbf0062f3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
ab7ea8a07a
20 files changed
+129
-52
No files matched your search
@@ -19,6 +19,7 @@ import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Rect
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.Gravity
|
||||
import android.view.MotionEvent
|
||||
@@ -138,9 +139,29 @@ constructor(
|
||||
|
||||
private fun populateForView(view: View): TaskbarDividerPopupView<*> {
|
||||
dividerView = view
|
||||
tryUpdateBackground()
|
||||
return this
|
||||
}
|
||||
|
||||
/** Updates the text background to match the shape of this background (when applicable). */
|
||||
private fun tryUpdateBackground() {
|
||||
if (background !is GradientDrawable) {
|
||||
return
|
||||
}
|
||||
val background = background as GradientDrawable
|
||||
val color = context.getColor(R.color.popup_shade_first)
|
||||
val backgroundMask = GradientDrawable()
|
||||
backgroundMask.setColor(color)
|
||||
backgroundMask.shape = GradientDrawable.RECTANGLE
|
||||
if (background.cornerRadii != null) {
|
||||
backgroundMask.cornerRadii = background.cornerRadii
|
||||
} else {
|
||||
backgroundMask.cornerRadius = background.cornerRadius
|
||||
}
|
||||
|
||||
setBackground(backgroundMask)
|
||||
}
|
||||
|
||||
override fun addArrow() {
|
||||
super.addArrow()
|
||||
// Change arrow location to the middle of popup.
|
||||
@@ -161,7 +182,7 @@ constructor(
|
||||
0f, // arrowOffsetY
|
||||
false, // isPointingUp
|
||||
true, // leftAligned
|
||||
Themes.getAttrColor(context, R.attr.popupColorPrimary),
|
||||
context.getColor(R.color.popup_shade_first),
|
||||
)
|
||||
elevation = mElevation
|
||||
mArrow.elevation = mElevation
|
||||
|
||||
@@ -53,7 +53,7 @@ constructor(
|
||||
private val activityContext: ActivityContext = ActivityContext.lookupContext(context)
|
||||
|
||||
private val backgroundColor =
|
||||
Themes.getAttrColor(context, com.android.internal.R.attr.colorSurface)
|
||||
Themes.getAttrColor(context, com.android.internal.R.attr.materialColorSurfaceBright)
|
||||
|
||||
private val tooltipCornerRadius = Themes.getDialogCornerRadius(context)
|
||||
private val arrowWidth = resources.getDimension(R.dimen.popup_arrow_width)
|
||||
|
||||
Reference in new issue
Block a user