Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34c697f5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[MagicAction] Update the button UI to address feedback from UX." into main

parents 5bd70774 2f4c2efc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
    android:background="@drawable/magic_action_button_background"
    android:drawablePadding="@dimen/magic_action_button_drawable_padding"
    android:ellipsize="none"
    android:fontFamily="google-sans-flex"
    android:fontFamily="google-sans-flex-medium"
    android:gravity="center"
    android:minWidth="0dp"
    android:paddingHorizontal="@dimen/magic_action_button_padding_horizontal"
+0 −11
Original line number Diff line number Diff line
@@ -42,14 +42,6 @@ class MagicActionBackgroundDrawable(

    private val buttonShape = Path()
    // Color and style
    private val bgPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
        val bgColor =
            context.getColor(
                com.android.internal.R.color.materialColorPrimaryContainer
            )
        color = bgColor
        style = Paint.Style.FILL
    }
    private val outlinePaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
        val outlineColor =
            context.getColor(
@@ -99,7 +91,6 @@ class MagicActionBackgroundDrawable(
        canvas.save()
        // Draw background
        canvas.clipPath(buttonShape)
        canvas.drawPath(buttonShape, bgPaint)
        // Apply gradient to outline
        canvas.drawPath(buttonShape, outlinePaint)
        updateGradient(boundsF)
@@ -128,13 +119,11 @@ class MagicActionBackgroundDrawable(
    }

    override fun setAlpha(alpha: Int) {
        bgPaint.alpha = alpha
        outlinePaint.alpha = alpha
        invalidateSelf()
    }

    override fun setColorFilter(colorFilter: ColorFilter?) {
        bgPaint.colorFilter = colorFilter
        outlinePaint.colorFilter = colorFilter
        invalidateSelf()
    }