summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/widget
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/widget
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/widget')
-rw-r--r--src/com/android/launcher3/widget/BaseWidgetSheet.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/com/android/launcher3/widget/BaseWidgetSheet.java b/src/com/android/launcher3/widget/BaseWidgetSheet.java
index 48c18f853..673b3cc14 100644
--- a/src/com/android/launcher3/widget/BaseWidgetSheet.java
+++ b/src/com/android/launcher3/widget/BaseWidgetSheet.java
@@ -17,6 +17,7 @@ package com.android.launcher3.widget;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
+import static com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound;
import static com.android.launcher3.logging.LoggerUtils.newContainerTarget;
import android.content.Context;
@@ -42,8 +43,6 @@ import com.android.launcher3.util.Themes;
import com.android.launcher3.views.AbstractSlideInView;
import com.android.launcher3.views.BaseDragLayer;
-import androidx.core.graphics.ColorUtils;
-
/**
* Base class for various widgets popup
*/
@@ -162,11 +161,11 @@ abstract class BaseWidgetSheet extends AbstractSlideInView
private static View createColorScrim(Context context) {
View view = new View(context);
- view.forceHasOverlappingRendering(false);
+ if (Utilities.ATLEAST_NOUGAT) view.forceHasOverlappingRendering(false);
WallpaperColorInfo colors = WallpaperColorInfo.getInstance(context);
int alpha = context.getResources().getInteger(R.integer.extracted_color_gradient_alpha);
- view.setBackgroundColor(ColorUtils.setAlphaComponent(colors.getSecondaryColor(), alpha));
+ view.setBackgroundColor(setColorAlphaBound(colors.getSecondaryColor(), alpha));
BaseDragLayer.LayoutParams lp = new BaseDragLayer.LayoutParams(MATCH_PARENT, MATCH_PARENT);
lp.ignoreInsets = true;