Adds all_apps_blur flag.
This enables blur both for Taskbar and Launcher, but in slightly different ways. For Taskbar All Apps, we apply blur to the overlay window, and for Launcher All Apps, we utilize the existing DepthController to blur the wallpaper window. For similicity, we currently fade out workspace/hotseat to avoid awkward view + window blurs which don't look that good. This is not the POR, but I think it achieves most of the effect and will help us get some blur exposure. Separately I will continue to investigate options such as blurring workspace in a clever way so it feels blended with the wallpaper, reusing the Taskbar window and connecting it to LauncherState, or using a SurfaceView (though I spent quite some time trying this and it seemed the same as the original issue). In both cases, we use a 20-30% opacity scrim with a set color, and a panel that blends 40% opacity of a dark/light color with 10% white. Also updated some incorrect isTablet checks which really should have been checking shouldShowAllAppsOnSheet(), which includes the all_apps_sheet_for_handheld flag. Demo: https://drive.google.com/file/d/1Ov9Dg3R9YHNfisfxNf97ZIhlDeEA1IWj/view?usp=sharing&resourcekey=0-l_SDpqpS4HtOb10a3b_jNg Other upcoming improvements: interpolator tweaks, colors of things inside the app panel (tabs, private space, search results, etc). Bug: 400827727 Bug: 371343636 Test: Manual Flag: com.android.launcher3.all_apps_blur Change-Id: Ic7063cd822f39a5977715b5477f825bf11e57bdf
This commit is contained in:
1 parent
ccbc78735f
commit
ccb3a5c25c
19 files changed
+189
-30
No files matched your search
@@ -181,6 +181,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
private ScrimView mScrimView;
|
||||
private int mHeaderColor;
|
||||
private int mBottomSheetBackgroundColor;
|
||||
private float mBottomSheetBackgroundAlpha = 1f;
|
||||
private int mTabsProtectionAlpha;
|
||||
@Nullable private AllAppsTransitionController mAllAppsTransitionController;
|
||||
|
||||
@@ -311,7 +312,17 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
0,
|
||||
0 // Bottom left
|
||||
};
|
||||
mBottomSheetBackgroundColor = getContext().getColor(R.color.materialColorSurfaceDim);
|
||||
if (Flags.allAppsBlur()) {
|
||||
int resId = Utilities.isDarkTheme(getContext())
|
||||
? android.R.color.system_accent1_800 : android.R.color.system_accent1_100;
|
||||
int layerAbove = ColorUtils.setAlphaComponent(getResources().getColor(resId, null),
|
||||
(int) (0.4f * 255));
|
||||
int layerBelow = ColorUtils.setAlphaComponent(Color.WHITE, (int) (0.1f * 255));
|
||||
mBottomSheetBackgroundColor = ColorUtils.compositeColors(layerAbove, layerBelow);
|
||||
} else {
|
||||
mBottomSheetBackgroundColor = getContext().getColor(R.color.materialColorSurfaceDim);
|
||||
}
|
||||
mBottomSheetBackgroundAlpha = Color.alpha(mBottomSheetBackgroundColor) / 255.0f;
|
||||
updateBackgroundVisibility(mActivityContext.getDeviceProfile());
|
||||
mSearchUiManager.initializeSearch(this);
|
||||
}
|
||||
@@ -1152,7 +1163,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
|
||||
if (!grid.isVerticalBarLayout() || FeatureFlags.enableResponsiveWorkspace()) {
|
||||
int topPadding = grid.allAppsPadding.top;
|
||||
if (isSearchBarFloating() && !grid.isTablet) {
|
||||
if (isSearchBarFloating() && !grid.shouldShowAllAppsOnSheet()) {
|
||||
topPadding += getResources().getDimensionPixelSize(
|
||||
R.dimen.all_apps_additional_top_padding_floating_search);
|
||||
}
|
||||
@@ -1401,7 +1412,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
// Draw full background panel for tablets.
|
||||
if (hasBottomSheet) {
|
||||
mHeaderPaint.setColor(mBottomSheetBackgroundColor);
|
||||
mHeaderPaint.setAlpha(255);
|
||||
mHeaderPaint.setAlpha((int) (mBottomSheetBackgroundAlpha * 255));
|
||||
|
||||
mTmpRectF.set(
|
||||
leftWithScale,
|
||||
@@ -1424,6 +1435,10 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasBottomSheet) {
|
||||
mHeaderPaint.setAlpha((int) (mHeaderPaint.getAlpha() * mBottomSheetBackgroundAlpha));
|
||||
}
|
||||
|
||||
// Draw header on background panel
|
||||
final float headerBottomNoScale =
|
||||
getHeaderBottom() + getVisibleContainerView().getPaddingTop();
|
||||
@@ -1455,7 +1470,11 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
mHeaderPaint.setColor(Color.BLUE);
|
||||
mHeaderPaint.setAlpha(255);
|
||||
} else {
|
||||
mHeaderPaint.setAlpha((int) (getAlpha() * mTabsProtectionAlpha));
|
||||
float tabAlpha = getAlpha() * mTabsProtectionAlpha;
|
||||
if (hasBottomSheet) {
|
||||
tabAlpha *= mBottomSheetBackgroundAlpha;
|
||||
}
|
||||
mHeaderPaint.setAlpha((int) tabAlpha);
|
||||
}
|
||||
float left = 0f;
|
||||
float right = canvas.getWidth();
|
||||
@@ -1507,7 +1526,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
public int getHeaderBottom() {
|
||||
int bottom = (int) getTranslationY() + mHeader.getClipTop();
|
||||
if (isSearchBarFloating()) {
|
||||
if (mActivityContext.getDeviceProfile().isTablet) {
|
||||
if (mActivityContext.getDeviceProfile().shouldShowAllAppsOnSheet()) {
|
||||
return bottom + mBottomSheetBackground.getTop();
|
||||
}
|
||||
return bottom;
|
||||
|
||||
Reference in new issue
Block a user