Revert "[Overview Actions] UI update for Landscape."
This reverts commit 160ca4b8a23f543c9af9f77a5fe836823c7d04da.
Reason for revert: Got issues like b/158318606 when switch nav modes, also the margin seems not set properly. And this doesn't work for 3 button mode too. Would switch to just use task menu for all.
Change-Id: I645f2a2a9032ae99799c75bcc6c983c1bbfd8df8
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityInterface.java
index 4801d71..62eb235 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityInterface.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityInterface.java
@@ -310,8 +310,8 @@
@Override
protected float getExtraSpace(Context context, DeviceProfile dp,
PagedOrientationHandler orientationHandler) {
- if ((dp.isVerticalBarLayout() && !showOverviewActions(context))
- || hideShelfInTwoButtonLandscape(context, orientationHandler)) {
+ if (dp.isVerticalBarLayout() ||
+ hideShelfInTwoButtonLandscape(context, orientationHandler)) {
return 0;
} else {
Resources res = context.getResources();
@@ -319,14 +319,12 @@
//TODO: this needs to account for the swipe gesture height and accessibility
// UI when shown.
float actionsBottomMargin = 0;
- if (!dp.isVerticalBarLayout()) {
- if (getMode(context) == Mode.THREE_BUTTONS) {
- actionsBottomMargin = res.getDimensionPixelSize(
+ if (getMode(context) == Mode.THREE_BUTTONS) {
+ actionsBottomMargin = res.getDimensionPixelSize(
R.dimen.overview_actions_bottom_margin_three_button);
- } else {
- actionsBottomMargin = res.getDimensionPixelSize(
+ } else {
+ actionsBottomMargin = res.getDimensionPixelSize(
R.dimen.overview_actions_bottom_margin_gesture);
- }
}
float actionsHeight = actionsBottomMargin
+ res.getDimensionPixelSize(R.dimen.overview_actions_height);
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/OverviewActionsView.java
index 08c3dc9..83287c4 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/OverviewActionsView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/OverviewActionsView.java
@@ -21,7 +21,6 @@
import static com.android.quickstep.SysUINavigationMode.removeShelfFromOverview;
import android.content.Context;
-import android.content.res.Configuration;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
@@ -34,7 +33,6 @@
import com.android.launcher3.R;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.launcher3.util.MultiValueAlpha.AlphaProperty;
-import com.android.quickstep.SysUINavigationMode;
import com.android.quickstep.SysUINavigationMode.Mode;
import com.android.quickstep.TaskOverlayFactory.OverlayUICallbacks;
@@ -131,12 +129,6 @@
updateHiddenFlags(HIDDEN_UNSUPPORTED_NAVIGATION, !removeShelfFromOverview(getContext()));
}
- @Override
- protected void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- updateVerticalMargin(SysUINavigationMode.getMode(getContext()));
- }
-
public void updateHiddenFlags(@ActionsHiddenFlags int visibilityFlags, boolean enable) {
if (enable) {
mHiddenFlags |= visibilityFlags;
@@ -160,13 +152,10 @@
return mMultiValueAlpha.getProperty(INDEX_FULLSCREEN_ALPHA);
}
- /** Updates vertical margins for different navigation mode or configuration changes. */
- public void updateVerticalMargin(Mode mode) {
- int bottomMargin;
- int orientation = getResources().getConfiguration().orientation;
- if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
- bottomMargin = 0;
- } else if (mode == Mode.THREE_BUTTONS) {
+ /** Updates vertical margins for different navigation mode. */
+ public void updateVerticalMarginForNavModeChange(Mode mode) {
+ int bottomMargin = 0;
+ if (mode == Mode.THREE_BUTTONS) {
bottomMargin = getResources()
.getDimensionPixelSize(R.dimen.overview_actions_bottom_margin_three_button);
} else {
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
index 64d90cf..f27bedb 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
@@ -1627,10 +1627,8 @@
: View.LAYOUT_DIRECTION_RTL);
mClearAllButton.setRotation(mOrientationHandler.getDegreesRotated());
mActivity.getDragLayer().recreateControllers();
- boolean isInLandscape = touchRotation != 0
- || mOrientationState.getLauncherRotation() != ROTATION_0;
mActionsView.updateHiddenFlags(HIDDEN_NON_ZERO_ROTATION,
- !mOrientationState.canLauncherRotate() && isInLandscape);
+ touchRotation != 0 || mOrientationState.getLauncherRotation() != ROTATION_0);
resetPaddingFromTaskSize();
requestLayout();
}
diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
index 4874307..0968d8e 100644
--- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
@@ -93,7 +93,7 @@
public void onNavigationModeChanged(Mode newMode) {
getDragLayer().recreateControllers();
if (mActionsView != null && isOverviewActionsEnabled()) {
- mActionsView.updateVerticalMargin(newMode);
+ mActionsView.updateVerticalMarginForNavModeChange(newMode);
}
}
@@ -175,7 +175,7 @@
// Overview is above all other launcher elements, including qsb, so move it to the top.
getOverviewPanel().bringToFront();
mActionsView.bringToFront();
- mActionsView.updateVerticalMargin(SysUINavigationMode.getMode(this));
+ mActionsView.updateVerticalMarginForNavModeChange(SysUINavigationMode.getMode(this));
}
}