Loading res/values/colors.xml +1 −0 Original line number Diff line number Diff line Loading @@ -58,5 +58,6 @@ <color name="text_color_tertiary_dark">#CCFFFFFF</color> <color name="wallpaper_popup_scrim">?android:attr/colorAccent</color> <color name="wallpaper_scrim_color">#0D878787</color> </resources> res/xml/dynamic_resources.xml +2 −2 Original line number Diff line number Diff line Loading @@ -4,6 +4,6 @@ <entry id="@color/delete_target_hover_tint" /> <entry id="@color/delete_target_hover_tint" /> <entry id="@color/delete_target_hover_tint" /> <entry id="@color/wallpaper_scrim_color" /> </DynamicResources> src/com/android/launcher3/config/FeatureFlags.java +4 −0 Original line number Diff line number Diff line Loading @@ -240,6 +240,10 @@ public final class FeatureFlags { public static final BooleanFlag PROTOTYPE_APP_CLOSE = getDebugFlag( "PROTOTYPE_APP_CLOSE", false, "Enables new app close"); public static final BooleanFlag ENABLE_WALLPAPER_SCRIM = getDebugFlag( "ENABLE_WALLPAPER_SCRIM", false, "Enables scrim over wallpaper for text protection."); public static void initialize(Context context) { synchronized (sDebugFlags) { for (DebugFlag flag : sDebugFlags) { Loading src/com/android/launcher3/graphics/SysUiScrim.java +20 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,10 @@ import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.R; import com.android.launcher3.ResourceUtils; import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.util.DynamicResource; import com.android.launcher3.util.Themes; import com.android.systemui.plugins.ResourceProvider; /** * View scrim which draws behind hotseat and workspace Loading Loading @@ -101,8 +104,10 @@ public class SysUiScrim implements View.OnAttachStateChangeListener { private static final int ALPHA_MASK_BITMAP_DP = 200; private static final int ALPHA_MASK_WIDTH_DP = 2; private boolean mDrawTopScrim, mDrawBottomScrim; private boolean mDrawTopScrim, mDrawBottomScrim, mDrawWallpaperScrim; private final RectF mWallpaperScrimRect = new RectF(); private final Paint mWallpaperScrimPaint = new Paint(); private final RectF mFinalMaskRect = new RectF(); private final Paint mBottomMaskPaint = new Paint(Paint.FILTER_BITMAP_FLAG); private final Bitmap mBottomMask; Loading @@ -117,6 +122,7 @@ public class SysUiScrim implements View.OnAttachStateChangeListener { private boolean mAnimateScrimOnNextDraw = false; private float mSysUiAnimMultiplier = 1; private int mWallpaperScrimMaxAlpha; public SysUiScrim(View view) { mRoot = view; Loading @@ -127,6 +133,14 @@ public class SysUiScrim implements View.OnAttachStateChangeListener { mBottomMask = mTopScrim == null ? null : createDitheredAlphaMask(); mHideSysUiScrim = mTopScrim == null; mDrawWallpaperScrim = FeatureFlags.ENABLE_WALLPAPER_SCRIM.get() && !Themes.getAttrBoolean(view.getContext(), R.attr.isMainColorDark) && !Themes.getAttrBoolean(view.getContext(), R.attr.isWorkspaceDarkText); ResourceProvider rp = DynamicResource.provider(view.getContext()); int wallpaperScrimColor = rp.getColor(R.color.wallpaper_scrim_color); mWallpaperScrimMaxAlpha = Color.alpha(wallpaperScrimColor); mWallpaperScrimPaint.setColor(wallpaperScrimColor); view.addOnAttachStateChangeListener(this); } Loading @@ -151,6 +165,9 @@ public class SysUiScrim implements View.OnAttachStateChangeListener { mAnimateScrimOnNextDraw = false; } if (mDrawWallpaperScrim) { canvas.drawRect(mWallpaperScrimRect, mWallpaperScrimPaint); } if (mDrawTopScrim) { mTopScrim.draw(canvas); } Loading Loading @@ -214,6 +231,7 @@ public class SysUiScrim implements View.OnAttachStateChangeListener { mTopScrim.setBounds(0, 0, w, h); mFinalMaskRect.set(0, h - mMaskHeight, w, h); } mWallpaperScrimRect.set(0, 0, w, h); } private void setSysUiProgress(float progress) { Loading @@ -236,6 +254,7 @@ public class SysUiScrim implements View.OnAttachStateChangeListener { if (mTopScrim != null) { mTopScrim.setAlpha(Math.round(255 * factor)); } mWallpaperScrimPaint.setAlpha(Math.round(mWallpaperScrimMaxAlpha * factor)); } private Bitmap createDitheredAlphaMask() { Loading Loading
res/values/colors.xml +1 −0 Original line number Diff line number Diff line Loading @@ -58,5 +58,6 @@ <color name="text_color_tertiary_dark">#CCFFFFFF</color> <color name="wallpaper_popup_scrim">?android:attr/colorAccent</color> <color name="wallpaper_scrim_color">#0D878787</color> </resources>
res/xml/dynamic_resources.xml +2 −2 Original line number Diff line number Diff line Loading @@ -4,6 +4,6 @@ <entry id="@color/delete_target_hover_tint" /> <entry id="@color/delete_target_hover_tint" /> <entry id="@color/delete_target_hover_tint" /> <entry id="@color/wallpaper_scrim_color" /> </DynamicResources>
src/com/android/launcher3/config/FeatureFlags.java +4 −0 Original line number Diff line number Diff line Loading @@ -240,6 +240,10 @@ public final class FeatureFlags { public static final BooleanFlag PROTOTYPE_APP_CLOSE = getDebugFlag( "PROTOTYPE_APP_CLOSE", false, "Enables new app close"); public static final BooleanFlag ENABLE_WALLPAPER_SCRIM = getDebugFlag( "ENABLE_WALLPAPER_SCRIM", false, "Enables scrim over wallpaper for text protection."); public static void initialize(Context context) { synchronized (sDebugFlags) { for (DebugFlag flag : sDebugFlags) { Loading
src/com/android/launcher3/graphics/SysUiScrim.java +20 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,10 @@ import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.R; import com.android.launcher3.ResourceUtils; import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.util.DynamicResource; import com.android.launcher3.util.Themes; import com.android.systemui.plugins.ResourceProvider; /** * View scrim which draws behind hotseat and workspace Loading Loading @@ -101,8 +104,10 @@ public class SysUiScrim implements View.OnAttachStateChangeListener { private static final int ALPHA_MASK_BITMAP_DP = 200; private static final int ALPHA_MASK_WIDTH_DP = 2; private boolean mDrawTopScrim, mDrawBottomScrim; private boolean mDrawTopScrim, mDrawBottomScrim, mDrawWallpaperScrim; private final RectF mWallpaperScrimRect = new RectF(); private final Paint mWallpaperScrimPaint = new Paint(); private final RectF mFinalMaskRect = new RectF(); private final Paint mBottomMaskPaint = new Paint(Paint.FILTER_BITMAP_FLAG); private final Bitmap mBottomMask; Loading @@ -117,6 +122,7 @@ public class SysUiScrim implements View.OnAttachStateChangeListener { private boolean mAnimateScrimOnNextDraw = false; private float mSysUiAnimMultiplier = 1; private int mWallpaperScrimMaxAlpha; public SysUiScrim(View view) { mRoot = view; Loading @@ -127,6 +133,14 @@ public class SysUiScrim implements View.OnAttachStateChangeListener { mBottomMask = mTopScrim == null ? null : createDitheredAlphaMask(); mHideSysUiScrim = mTopScrim == null; mDrawWallpaperScrim = FeatureFlags.ENABLE_WALLPAPER_SCRIM.get() && !Themes.getAttrBoolean(view.getContext(), R.attr.isMainColorDark) && !Themes.getAttrBoolean(view.getContext(), R.attr.isWorkspaceDarkText); ResourceProvider rp = DynamicResource.provider(view.getContext()); int wallpaperScrimColor = rp.getColor(R.color.wallpaper_scrim_color); mWallpaperScrimMaxAlpha = Color.alpha(wallpaperScrimColor); mWallpaperScrimPaint.setColor(wallpaperScrimColor); view.addOnAttachStateChangeListener(this); } Loading @@ -151,6 +165,9 @@ public class SysUiScrim implements View.OnAttachStateChangeListener { mAnimateScrimOnNextDraw = false; } if (mDrawWallpaperScrim) { canvas.drawRect(mWallpaperScrimRect, mWallpaperScrimPaint); } if (mDrawTopScrim) { mTopScrim.draw(canvas); } Loading Loading @@ -214,6 +231,7 @@ public class SysUiScrim implements View.OnAttachStateChangeListener { mTopScrim.setBounds(0, 0, w, h); mFinalMaskRect.set(0, h - mMaskHeight, w, h); } mWallpaperScrimRect.set(0, 0, w, h); } private void setSysUiProgress(float progress) { Loading @@ -236,6 +254,7 @@ public class SysUiScrim implements View.OnAttachStateChangeListener { if (mTopScrim != null) { mTopScrim.setAlpha(Math.round(255 * factor)); } mWallpaperScrimPaint.setAlpha(Math.round(mWallpaperScrimMaxAlpha * factor)); } private Bitmap createDitheredAlphaMask() { Loading