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

Commit 936f8479 authored by James O'Leary's avatar James O'Leary
Browse files

Add shadow to voice assistant handles

Test: Use Forrest to patch this CL onto qt-qpr1-dev.
Run ATP test that opens Clock app repeatedly, use bugreport taken after
testing to identify memory usage.
Bug: b/144022299
Change-Id: I2d6dc64c3c1a3580fd757985857eff794a810168
parent 243a6fa6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -772,4 +772,8 @@
    <dimen name="resolver_small_margin">18dp</dimen>
    <dimen name="resolver_edge_margin">24dp</dimen>
    <dimen name="resolver_elevation">1dp</dimen>

    <!-- Assistant handles -->
    <dimen name="assist_handle_shadow_radius">2dp</dimen>

</resources>
+5 −0
Original line number Diff line number Diff line
@@ -3775,4 +3775,9 @@
  <!-- For contacts provider. -->
  <java-symbol type="string" name="config_rawContactsLocalAccountName" />
  <java-symbol type="string" name="config_rawContactsLocalAccountType" />

  <!-- Assistant handles -->
  <java-symbol type="dimen" name="assist_handle_shadow_radius" />


</resources>
+8 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ public class CornerHandleView extends View {
        mPaint.setStyle(Paint.Style.STROKE);
        mPaint.setStrokeCap(Paint.Cap.ROUND);
        mPaint.setStrokeWidth(getStrokePx());
        setLayerType(View.LAYER_TYPE_SOFTWARE, mPaint);

        final int dualToneDarkTheme = Utils.getThemeAttr(mContext, R.attr.darkIconTheme);
        final int dualToneLightTheme = Utils.getThemeAttr(mContext, R.attr.lightIconTheme);
@@ -114,10 +115,17 @@ public class CornerHandleView extends View {
     * appropriately. Intention is to match the home handle color.
     */
    public void updateDarkness(float darkIntensity) {
        // Handle color is same as home handle color.
        int color = (int) ArgbEvaluator.getInstance().evaluate(darkIntensity,
                mLightColor, mDarkColor);
        // Shadow color is inverse of handle color.
        int shadowColor = (int) ArgbEvaluator.getInstance().evaluate(darkIntensity,
                mDarkColor, mLightColor);
        if (mPaint.getColor() != color) {
            mPaint.setColor(color);
            mPaint.setShadowLayer(/** radius */ getResources().getDimensionPixelSize(
                    com.android.internal.R.dimen.assist_handle_shadow_radius), /** shadowDx */ 0,
                    /** shadowDy */ 0, /** color */ shadowColor);
            if (getVisibility() == VISIBLE && getAlpha() > 0) {
                invalidate();
            } else {