From 1dae67b49d307e8c295aa2625195f87e180bd53f Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 27 Jun 2019 23:16:42 -0700 Subject: [PATCH] Fixing accessibility arrow > Hiding arrow in background state and during quick switch > Preventing arrow overlapping with search box in overview state Bug: 135885458 Change-Id: Iadefba044717351d69480cde7d784cd04289d086 --- .../states/BackgroundAppState.java | 3 ++- .../quickstep/views/ShelfScrimView.java | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java index d14de70c50..5ee08c12d2 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java @@ -81,7 +81,8 @@ public class BackgroundAppState extends OverviewState { @Override public int getVisibleElements(Launcher launcher) { - return super.getVisibleElements(launcher) & ~RECENTS_CLEAR_ALL_BUTTON; + return super.getVisibleElements(launcher) + & ~RECENTS_CLEAR_ALL_BUTTON & ~VERTICAL_SWIPE_INDICATOR; } @Override diff --git a/quickstep/src/com/android/quickstep/views/ShelfScrimView.java b/quickstep/src/com/android/quickstep/views/ShelfScrimView.java index b6ddb5fd1d..63c8023f6d 100644 --- a/quickstep/src/com/android/quickstep/views/ShelfScrimView.java +++ b/quickstep/src/com/android/quickstep/views/ShelfScrimView.java @@ -15,6 +15,7 @@ */ package com.android.quickstep.views; +import static com.android.launcher3.LauncherState.ALL_APPS_HEADER_EXTRA; import static com.android.launcher3.LauncherState.BACKGROUND_APP; import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.anim.Interpolators.ACCEL; @@ -29,6 +30,7 @@ import android.graphics.Paint; import android.graphics.Path; import android.graphics.Path.Direction; import android.graphics.Path.Op; +import android.graphics.Rect; import android.util.AttributeSet; import android.view.animation.Interpolator; @@ -36,6 +38,7 @@ import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.Interpolators; +import com.android.launcher3.uioverrides.states.OverviewState; import com.android.launcher3.util.Themes; import com.android.launcher3.views.ScrimView; import com.android.quickstep.SysUINavigationMode; @@ -145,14 +148,22 @@ public class ShelfScrimView extends ScrimView implements NavigationModeChangeLis mRemainingScreenPathValid = false; mShiftRange = mLauncher.getAllAppsController().getShiftRange(); - mMidProgress = OVERVIEW.getVerticalProgress(mLauncher); - mMidAlpha = mMidProgress >= 1 ? 0 - : Themes.getAttrInteger(getContext(), R.attr.allAppsInterimScrimAlpha); + if ((OVERVIEW.getVisibleElements(mLauncher) & ALL_APPS_HEADER_EXTRA) == 0) { + mMidProgress = 1; + mMidAlpha = 0; + } else { + mMidAlpha = Themes.getAttrInteger(getContext(), R.attr.allAppsInterimScrimAlpha); + Rect hotseatPadding = dp.getHotseatLayoutPadding(); + int hotseatSize = dp.hotseatBarSizePx + dp.getInsets().bottom + - hotseatPadding.bottom - hotseatPadding.top; + float arrowTop = Math.min(hotseatSize, OverviewState.getDefaultSwipeHeight(dp)); + mMidProgress = 1 - (arrowTop / mShiftRange); + } mTopOffset = dp.getInsets().top - mShelfOffset; mShelfTopAtThreshold = mShiftRange * SCRIM_CATCHUP_THRESHOLD + mTopOffset; - updateColors(); } + updateColors(); updateDragHandleAlpha(); invalidate(); }