Prevent all apps transition NPE
b/29643291
b/29642263
> Also do not change status bar when landscape mode
Change-Id: I1e44af8e031856a50a7413ad297c437245e8b2aa
diff --git a/src/com/android/launcher3/BaseContainerView.java b/src/com/android/launcher3/BaseContainerView.java
index 84bd88d..45d0b52 100644
--- a/src/com/android/launcher3/BaseContainerView.java
+++ b/src/com/android/launcher3/BaseContainerView.java
@@ -53,7 +53,8 @@
Launcher launcher = Launcher.getLauncher(context);
int width = launcher.getDeviceProfile().availableWidthPx;
if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP &&
- this instanceof AllAppsContainerView && !launcher.getDeviceProfile().isLandscape) {
+ this instanceof AllAppsContainerView &&
+ !launcher.getDeviceProfile().isVerticalBarLayout()) {
mHorizontalPadding = 0;
} else {
mHorizontalPadding = DeviceProfile.getContainerPadding(context, width);
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index 5245509..b2f24be 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -227,4 +227,8 @@
setBackground(mBackground);
}
}
+
+ public int getBackgroundDrawableAlpha() {
+ return Color.alpha(mBackgroundColor);
+ }
}
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index ba4d38c..2c5a342 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -239,7 +239,7 @@
if (!mLauncher.isAllAppsVisible()) {
mLauncher.tryAndUpdatePredictedApps();
- mHotseatBackgroundAlpha = mHotseat.getBackground().getAlpha() / 255f;
+ mHotseatBackgroundAlpha = mHotseat.getBackgroundDrawableAlpha() / 255f;
mHotseat.setBackgroundTransparent(true /* transparent */);
mAppsView.setVisibility(View.VISIBLE);
mAppsView.getContentView().setVisibility(View.VISIBLE);
@@ -270,6 +270,10 @@
private void updateLightStatusBar(float progress) {
boolean enable = (progress < mStatusBarHeight / 2);
+ // Do not modify status bar on landscape as all apps is not full bleed.
+ if (mLauncher.getDeviceProfile().isVerticalBarLayout()) {
+ return;
+ }
// Already set correctly
if (mLightStatusBar == enable) {
return;