Loading packages/SystemUI/src/com/android/systemui/CornerHandleView.java +20 −5 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ public class CornerHandleView extends View { private int mLightColor; private int mDarkColor; private Path mPath; private boolean mRequiresInvalidate; public CornerHandleView(Context context, AttributeSet attrs) { super(context, attrs); Loading @@ -67,6 +68,15 @@ public class CornerHandleView extends View { updatePath(); } @Override public void setAlpha(float alpha) { super.setAlpha(alpha); if (alpha > 0f && mRequiresInvalidate) { mRequiresInvalidate = false; invalidate(); } } private void updatePath() { mPath = new Path(); Loading Loading @@ -104,11 +114,16 @@ public class CornerHandleView extends View { * appropriately. Intention is to match the home handle color. */ public void updateDarkness(float darkIntensity) { mPaint.setColor((int) ArgbEvaluator.getInstance().evaluate(darkIntensity, mLightColor, mDarkColor)); if (getVisibility() == VISIBLE) { int color = (int) ArgbEvaluator.getInstance().evaluate(darkIntensity, mLightColor, mDarkColor); if (mPaint.getColor() != color) { mPaint.setColor(color); if (getVisibility() == VISIBLE && getAlpha() > 0) { invalidate(); } else { // If we are currently invisible, then invalidate when we are next made visible mRequiresInvalidate = true; } } } Loading packages/SystemUI/src/com/android/systemui/assist/ui/EdgeLight.java +3 −1 Original line number Diff line number Diff line Loading @@ -67,8 +67,10 @@ public final class EdgeLight { } /** Sets the edge light color. */ public void setColor(@ColorInt int color) { public boolean setColor(@ColorInt int color) { boolean changed = mColor != color; mColor = color; return changed; } /** Returns the edge light length, in units of the total device perimeter. */ Loading packages/SystemUI/src/com/android/systemui/assist/ui/InvocationLightsView.java +5 −2 Original line number Diff line number Diff line Loading @@ -259,12 +259,15 @@ public class InvocationLightsView extends View if (mUseNavBarColor) { @ColorInt int invocationColor = (int) ArgbEvaluator.getInstance().evaluate( darkIntensity, mLightColor, mDarkColor); boolean changed = true; for (EdgeLight light : mAssistInvocationLights) { light.setColor(invocationColor); changed &= light.setColor(invocationColor); } if (changed) { invalidate(); } } } private void renderLight(EdgeLight light, Canvas canvas) { if (light.getLength() > 0) { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ButtonDispatcher.java +10 −4 Original line number Diff line number Diff line Loading @@ -203,10 +203,16 @@ public class ButtonDispatcher { mFadeAnimator.addUpdateListener(mAlphaListener); mFadeAnimator.start(); } else { mAlpha = alpha; // Discretize the alpha updates to prevent too frequent updates when there is a long // alpha animation int prevAlpha = (int) (getAlpha() * 255); int nextAlpha = (int) (alpha * 255); if (prevAlpha != nextAlpha) { mAlpha = nextAlpha / 255f; final int N = mViews.size(); for (int i = 0; i < N; i++) { mViews.get(i).setAlpha(alpha); mViews.get(i).setAlpha(mAlpha); } } } } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationHandle.java +19 −6 Original line number Diff line number Diff line Loading @@ -31,13 +31,13 @@ import com.android.settingslib.Utils; import com.android.systemui.R; public class NavigationHandle extends View implements ButtonInterface { private float mDarkIntensity = -1; private final Paint mPaint = new Paint(); private @ColorInt final int mLightColor; private @ColorInt final int mDarkColor; private final int mRadius; private final int mBottom; private boolean mRequiresInvalidate; public NavigationHandle(Context context) { this(context, null); Loading @@ -59,6 +59,15 @@ public class NavigationHandle extends View implements ButtonInterface { setFocusable(false); } @Override public void setAlpha(float alpha) { super.setAlpha(alpha); if (alpha > 0f && mRequiresInvalidate) { mRequiresInvalidate = false; invalidate(); } } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); Loading @@ -85,11 +94,15 @@ public class NavigationHandle extends View implements ButtonInterface { @Override public void setDarkIntensity(float intensity) { if (mDarkIntensity != intensity) { mPaint.setColor((int) ArgbEvaluator.getInstance().evaluate(intensity, mLightColor, mDarkColor)); mDarkIntensity = intensity; int color = (int) ArgbEvaluator.getInstance().evaluate(intensity, mLightColor, mDarkColor); if (mPaint.getColor() != color) { mPaint.setColor(color); if (getVisibility() == VISIBLE && getAlpha() > 0) { invalidate(); } else { // If we are currently invisible, then invalidate when we are next made visible mRequiresInvalidate = true; } } } Loading Loading
packages/SystemUI/src/com/android/systemui/CornerHandleView.java +20 −5 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ public class CornerHandleView extends View { private int mLightColor; private int mDarkColor; private Path mPath; private boolean mRequiresInvalidate; public CornerHandleView(Context context, AttributeSet attrs) { super(context, attrs); Loading @@ -67,6 +68,15 @@ public class CornerHandleView extends View { updatePath(); } @Override public void setAlpha(float alpha) { super.setAlpha(alpha); if (alpha > 0f && mRequiresInvalidate) { mRequiresInvalidate = false; invalidate(); } } private void updatePath() { mPath = new Path(); Loading Loading @@ -104,11 +114,16 @@ public class CornerHandleView extends View { * appropriately. Intention is to match the home handle color. */ public void updateDarkness(float darkIntensity) { mPaint.setColor((int) ArgbEvaluator.getInstance().evaluate(darkIntensity, mLightColor, mDarkColor)); if (getVisibility() == VISIBLE) { int color = (int) ArgbEvaluator.getInstance().evaluate(darkIntensity, mLightColor, mDarkColor); if (mPaint.getColor() != color) { mPaint.setColor(color); if (getVisibility() == VISIBLE && getAlpha() > 0) { invalidate(); } else { // If we are currently invisible, then invalidate when we are next made visible mRequiresInvalidate = true; } } } Loading
packages/SystemUI/src/com/android/systemui/assist/ui/EdgeLight.java +3 −1 Original line number Diff line number Diff line Loading @@ -67,8 +67,10 @@ public final class EdgeLight { } /** Sets the edge light color. */ public void setColor(@ColorInt int color) { public boolean setColor(@ColorInt int color) { boolean changed = mColor != color; mColor = color; return changed; } /** Returns the edge light length, in units of the total device perimeter. */ Loading
packages/SystemUI/src/com/android/systemui/assist/ui/InvocationLightsView.java +5 −2 Original line number Diff line number Diff line Loading @@ -259,12 +259,15 @@ public class InvocationLightsView extends View if (mUseNavBarColor) { @ColorInt int invocationColor = (int) ArgbEvaluator.getInstance().evaluate( darkIntensity, mLightColor, mDarkColor); boolean changed = true; for (EdgeLight light : mAssistInvocationLights) { light.setColor(invocationColor); changed &= light.setColor(invocationColor); } if (changed) { invalidate(); } } } private void renderLight(EdgeLight light, Canvas canvas) { if (light.getLength() > 0) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ButtonDispatcher.java +10 −4 Original line number Diff line number Diff line Loading @@ -203,10 +203,16 @@ public class ButtonDispatcher { mFadeAnimator.addUpdateListener(mAlphaListener); mFadeAnimator.start(); } else { mAlpha = alpha; // Discretize the alpha updates to prevent too frequent updates when there is a long // alpha animation int prevAlpha = (int) (getAlpha() * 255); int nextAlpha = (int) (alpha * 255); if (prevAlpha != nextAlpha) { mAlpha = nextAlpha / 255f; final int N = mViews.size(); for (int i = 0; i < N; i++) { mViews.get(i).setAlpha(alpha); mViews.get(i).setAlpha(mAlpha); } } } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationHandle.java +19 −6 Original line number Diff line number Diff line Loading @@ -31,13 +31,13 @@ import com.android.settingslib.Utils; import com.android.systemui.R; public class NavigationHandle extends View implements ButtonInterface { private float mDarkIntensity = -1; private final Paint mPaint = new Paint(); private @ColorInt final int mLightColor; private @ColorInt final int mDarkColor; private final int mRadius; private final int mBottom; private boolean mRequiresInvalidate; public NavigationHandle(Context context) { this(context, null); Loading @@ -59,6 +59,15 @@ public class NavigationHandle extends View implements ButtonInterface { setFocusable(false); } @Override public void setAlpha(float alpha) { super.setAlpha(alpha); if (alpha > 0f && mRequiresInvalidate) { mRequiresInvalidate = false; invalidate(); } } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); Loading @@ -85,11 +94,15 @@ public class NavigationHandle extends View implements ButtonInterface { @Override public void setDarkIntensity(float intensity) { if (mDarkIntensity != intensity) { mPaint.setColor((int) ArgbEvaluator.getInstance().evaluate(intensity, mLightColor, mDarkColor)); mDarkIntensity = intensity; int color = (int) ArgbEvaluator.getInstance().evaluate(intensity, mLightColor, mDarkColor); if (mPaint.getColor() != color) { mPaint.setColor(color); if (getVisibility() == VISIBLE && getAlpha() > 0) { invalidate(); } else { // If we are currently invisible, then invalidate when we are next made visible mRequiresInvalidate = true; } } } Loading