summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/graphics
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2018-11-05 11:08:31 -0800
committerSunny Goyal <sunnygoyal@google.com>2018-11-06 09:59:03 -0800
commit066ace1b8897229445c0fb3515156ef70bdb05e2 (patch)
tree62dd45b95ed2bd2357368c1fd2c82a31da328ffd /src/com/android/launcher3/graphics
parent5bd44153fdc76a4ea96ede8aa6646f7f067bb0d5 (diff)
downloadandroid_packages_apps_Trebuchet-066ace1b8897229445c0fb3515156ef70bdb05e2.tar.gz
android_packages_apps_Trebuchet-066ace1b8897229445c0fb3515156ef70bdb05e2.tar.bz2
android_packages_apps_Trebuchet-066ace1b8897229445c0fb3515156ef70bdb05e2.zip
Replacing setAlphaComponent with setAlphaComponentBound for better animation interpolation
setAlphaComponent throws expetion for invalid range, which can cause brashes in overshoot interpolation Bug: 118390004 Change-Id: Ic9c5ff3d660eba353b982c4c47ccfaf329b3e296
Diffstat (limited to 'src/com/android/launcher3/graphics')
-rw-r--r--src/com/android/launcher3/graphics/IconPalette.java4
-rw-r--r--src/com/android/launcher3/graphics/WorkspaceAndHotseatScrim.java6
2 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/launcher3/graphics/IconPalette.java b/src/com/android/launcher3/graphics/IconPalette.java
index cda07c31a..3d4a1001a 100644
--- a/src/com/android/launcher3/graphics/IconPalette.java
+++ b/src/com/android/launcher3/graphics/IconPalette.java
@@ -16,6 +16,8 @@
package com.android.launcher3.graphics;
+import static com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound;
+
import android.app.Notification;
import android.content.Context;
import android.graphics.Color;
@@ -147,7 +149,7 @@ public class IconPalette {
}
public static int getMutedColor(int color, float whiteScrimAlpha) {
- int whiteScrim = ColorUtils.setAlphaComponent(Color.WHITE, (int) (255 * whiteScrimAlpha));
+ int whiteScrim = setColorAlphaBound(Color.WHITE, (int) (255 * whiteScrimAlpha));
return ColorUtils.compositeColors(whiteScrim, color);
}
}
diff --git a/src/com/android/launcher3/graphics/WorkspaceAndHotseatScrim.java b/src/com/android/launcher3/graphics/WorkspaceAndHotseatScrim.java
index 23d647b44..66f9dbfcd 100644
--- a/src/com/android/launcher3/graphics/WorkspaceAndHotseatScrim.java
+++ b/src/com/android/launcher3/graphics/WorkspaceAndHotseatScrim.java
@@ -19,6 +19,8 @@ package com.android.launcher3.graphics;
import static android.content.Intent.ACTION_SCREEN_OFF;
import static android.content.Intent.ACTION_USER_PRESENT;
+import static com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound;
+
import android.animation.ObjectAnimator;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -174,7 +176,7 @@ public class WorkspaceAndHotseatScrim implements
canvas.clipRect(mHighlightRect, Region.Op.DIFFERENCE);
}
- canvas.drawColor(ColorUtils.setAlphaComponent(mFullScrimColor, mScrimAlpha));
+ canvas.drawColor(setColorAlphaBound(mFullScrimColor, mScrimAlpha));
canvas.restore();
}
@@ -303,7 +305,7 @@ public class WorkspaceAndHotseatScrim implements
LinearGradient lg = new LinearGradient(0, 0, 0, gradientHeight,
new int[]{
0x00FFFFFF,
- ColorUtils.setAlphaComponent(Color.WHITE, (int) (0xFF * 0.95)),
+ setColorAlphaBound(Color.WHITE, (int) (0xFF * 0.95)),
0xFFFFFFFF},
new float[]{0f, 0.8f, 1f},
Shader.TileMode.CLAMP);