Loading src/com/android/launcher3/dragndrop/DragLayer.java +8 −4 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Rect; import android.graphics.Region; import android.support.v4.graphics.ColorUtils; import android.util.AttributeSet; import android.view.KeyEvent; import android.view.LayoutInflater; Loading Loading @@ -54,6 +55,7 @@ import com.android.launcher3.ShortcutAndWidgetContainer; import com.android.launcher3.Utilities; import com.android.launcher3.allapps.AllAppsTransitionController; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.dynamicui.WallpaperColorInfo; import com.android.launcher3.folder.Folder; import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.keyboard.ViewGroupFocusHelper; Loading @@ -73,9 +75,6 @@ public class DragLayer extends InsettableFrameLayout { public static final int ANIMATION_END_DISAPPEAR = 0; public static final int ANIMATION_END_REMAIN_VISIBLE = 2; // Scrim color without any alpha component. private static final int SCRIM_COLOR = Color.BLACK & 0x00FFFFFF; private final int[] mTmpXY = new int[2]; @Thunk DragController mDragController; Loading Loading @@ -108,6 +107,7 @@ public class DragLayer extends InsettableFrameLayout { // Related to adjacent page hints private final Rect mScrollChildPosition = new Rect(); private final ViewGroupFocusHelper mFocusIndicatorHelper; private final WallpaperColorInfo mWallpaperColorInfo; // Related to pinch-to-go-to-overview gesture. private PinchToOverviewListener mPinchListener = null; Loading @@ -131,6 +131,7 @@ public class DragLayer extends InsettableFrameLayout { mIsRtl = Utilities.isRtl(getResources()); mFocusIndicatorHelper = new ViewGroupFocusHelper(this); mWallpaperColorInfo = WallpaperColorInfo.getInstance(getContext()); } public void setup(Launcher launcher, DragController dragController, Loading Loading @@ -878,7 +879,10 @@ public class DragLayer extends InsettableFrameLayout { getDescendantRectRelativeToSelf(currCellLayout, mHighlightRect); canvas.clipRect(mHighlightRect, Region.Op.DIFFERENCE); } canvas.drawColor((alpha << 24) | SCRIM_COLOR); // for super light wallpaper it needs to be darken for contrast to workspace // for dark wallpapers the text is white so darkening works as well int color = ColorUtils.compositeColors(0x66000000, mWallpaperColorInfo.getMainColor()); canvas.drawColor(ColorUtils.setAlphaComponent(color, alpha)); canvas.restore(); } Loading Loading
src/com/android/launcher3/dragndrop/DragLayer.java +8 −4 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Rect; import android.graphics.Region; import android.support.v4.graphics.ColorUtils; import android.util.AttributeSet; import android.view.KeyEvent; import android.view.LayoutInflater; Loading Loading @@ -54,6 +55,7 @@ import com.android.launcher3.ShortcutAndWidgetContainer; import com.android.launcher3.Utilities; import com.android.launcher3.allapps.AllAppsTransitionController; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.dynamicui.WallpaperColorInfo; import com.android.launcher3.folder.Folder; import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.keyboard.ViewGroupFocusHelper; Loading @@ -73,9 +75,6 @@ public class DragLayer extends InsettableFrameLayout { public static final int ANIMATION_END_DISAPPEAR = 0; public static final int ANIMATION_END_REMAIN_VISIBLE = 2; // Scrim color without any alpha component. private static final int SCRIM_COLOR = Color.BLACK & 0x00FFFFFF; private final int[] mTmpXY = new int[2]; @Thunk DragController mDragController; Loading Loading @@ -108,6 +107,7 @@ public class DragLayer extends InsettableFrameLayout { // Related to adjacent page hints private final Rect mScrollChildPosition = new Rect(); private final ViewGroupFocusHelper mFocusIndicatorHelper; private final WallpaperColorInfo mWallpaperColorInfo; // Related to pinch-to-go-to-overview gesture. private PinchToOverviewListener mPinchListener = null; Loading @@ -131,6 +131,7 @@ public class DragLayer extends InsettableFrameLayout { mIsRtl = Utilities.isRtl(getResources()); mFocusIndicatorHelper = new ViewGroupFocusHelper(this); mWallpaperColorInfo = WallpaperColorInfo.getInstance(getContext()); } public void setup(Launcher launcher, DragController dragController, Loading Loading @@ -878,7 +879,10 @@ public class DragLayer extends InsettableFrameLayout { getDescendantRectRelativeToSelf(currCellLayout, mHighlightRect); canvas.clipRect(mHighlightRect, Region.Op.DIFFERENCE); } canvas.drawColor((alpha << 24) | SCRIM_COLOR); // for super light wallpaper it needs to be darken for contrast to workspace // for dark wallpapers the text is white so darkening works as well int color = ColorUtils.compositeColors(0x66000000, mWallpaperColorInfo.getMainColor()); canvas.drawColor(ColorUtils.setAlphaComponent(color, alpha)); canvas.restore(); } Loading