Hide hotseat in landscape overview
Bug: 70179916
Change-Id: Ib277a054cf16233ab9156a4448c41952e3295fae
diff --git a/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
index 3458a3f..267c4d0 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
@@ -57,6 +57,11 @@
}
@Override
+ public float getHoseatAlpha(Launcher launcher) {
+ return launcher.getDeviceProfile().isVerticalBarLayout() ? 0 : 1;
+ }
+
+ @Override
public void onStateEnabled(Launcher launcher) {
RecentsView rv = launcher.getOverviewPanel();
rv.setOverviewStateEnabled(true);
diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java
index dfb935f..01ab563 100644
--- a/src/com/android/launcher3/LauncherState.java
+++ b/src/com/android/launcher3/LauncherState.java
@@ -131,6 +131,10 @@
return new float[] {1, 0};
}
+ public float getHoseatAlpha(Launcher launcher) {
+ return 1f;
+ }
+
public void onStateEnabled(Launcher launcher) {
dispatchWindowStateChanged(launcher);
}
diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
index 9f76b6f..2392c9b 100644
--- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
+++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
@@ -18,6 +18,7 @@
import static com.android.launcher3.LauncherAnimUtils.DRAWABLE_ALPHA;
import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
+import static com.android.launcher3.Partner.TAG;
import static com.android.launcher3.compat.AccessibilityManagerCompat.isAccessibilityEnabled;
import android.animation.Animator;
@@ -25,6 +26,7 @@
import android.animation.ObjectAnimator;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
+import android.util.Log;
import android.util.Property;
import android.view.View;
@@ -138,6 +140,10 @@
propertySetter.setFloat(mWorkspace, View.TRANSLATION_Y,
finalWorkspaceTranslationY, Interpolators.ZOOM_IN);
+ float hotseatAlpha = state.getHoseatAlpha(mLauncher);
+ propertySetter.setViewAlpha(mWorkspace.createHotseatAlphaAnimator(hotseatAlpha),
+ mLauncher.getHotseat(), hotseatAlpha);
+
// Set scrim
propertySetter.setInt(mLauncher.getDragLayer().getScrim(), DRAWABLE_ALPHA,
state.hasScrim ? mWorkspaceScrimAlpha : 0, Interpolators.DEACCEL_1_5);
@@ -159,6 +165,7 @@
public static class PropertySetter {
public void setViewAlpha(Animator anim, View view, float alpha) {
+ Log.d(TAG, "setViewAlpha: " + anim + " " + alpha);
if (anim != null) {
anim.end();
return;
diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/OverviewPanel.java b/src_ui_overrides/com/android/launcher3/uioverrides/OverviewPanel.java
index b23927b..26dd68f 100644
--- a/src_ui_overrides/com/android/launcher3/uioverrides/OverviewPanel.java
+++ b/src_ui_overrides/com/android/launcher3/uioverrides/OverviewPanel.java
@@ -173,13 +173,8 @@
}
private void setState(LauncherState state, PropertySetter setter) {
- boolean isOverview = state == LauncherState.OVERVIEW;
- float finalHotseatAlpha = isOverview ? 0 : 1;
-
- setter.setViewAlpha(null, this, isOverview ? 1 : 0);
- setter.setViewAlpha(
- mLauncher.getWorkspace().createHotseatAlphaAnimator(finalHotseatAlpha),
- mLauncher.getHotseat(), finalHotseatAlpha);
+ float hotseatAlpha = state.getHoseatAlpha(mLauncher);
+ setter.setViewAlpha(null, this, 1f - hotseatAlpha);
}
public static int getButtonBarHeight(Launcher launcher) {
diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/OverviewState.java b/src_ui_overrides/com/android/launcher3/uioverrides/OverviewState.java
index bcbe61c..73f208e 100644
--- a/src_ui_overrides/com/android/launcher3/uioverrides/OverviewState.java
+++ b/src_ui_overrides/com/android/launcher3/uioverrides/OverviewState.java
@@ -63,6 +63,11 @@
}
@Override
+ public float getHoseatAlpha(Launcher launcher) {
+ return 0;
+ }
+
+ @Override
public void onStateEnabled(Launcher launcher) {
launcher.getWorkspace().setPageRearrangeEnabled(true);