diff --git a/quickstep/res/layout/overview_clear_all_button.xml b/quickstep/res/layout/overview_clear_all_button.xml index c61610a438..1ee726e62e 100644 --- a/quickstep/res/layout/overview_clear_all_button.xml +++ b/quickstep/res/layout/overview_clear_all_button.xml @@ -21,5 +21,5 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/recents_clear_all" - android:textColor="?attr/workspaceTextColor" + android:textColor="?android:attr/textColorPrimary" android:textSize="14sp" /> \ No newline at end of file diff --git a/quickstep/res/layout/overview_panel.xml b/quickstep/res/layout/overview_panel.xml index 394e8808c8..d7bcd9e932 100644 --- a/quickstep/res/layout/overview_panel.xml +++ b/quickstep/res/layout/overview_panel.xml @@ -19,8 +19,7 @@ android:id="@+id/split_placeholder" android:layout_width="match_parent" android:layout_height="@dimen/split_placeholder_size" - android:background="@android:color/white" - android:alpha=".8" + android:background="@android:color/darker_gray" android:visibility="gone" /> Your predicted apps - Close + Close Get app suggestions on the bottom row of your Home screen @@ -91,14 +91,6 @@ Predicted app: %1$s - - Search your phone for apps, people, settings and more! - - Tap keyboard search button to launch the first search - result. - - - Got it. Make sure you swipe from the far-left edge. diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java index 085db6d7b6..e9ded8a07c 100644 --- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java @@ -92,6 +92,7 @@ public abstract class BaseQuickstepLauncher extends Launcher private final TaskbarStateHandler mTaskbarStateHandler = new TaskbarStateHandler(this); // Will be updated when dragging from taskbar. private @Nullable DragOptions mNextWorkspaceDragOptions = null; + private SplitPlaceholderView mSplitPlaceholderView; @Override protected void onCreate(Bundle savedInstanceState) { @@ -215,12 +216,12 @@ public abstract class BaseQuickstepLauncher extends Launcher SysUINavigationMode.INSTANCE.get(this).updateMode(); mActionsView = findViewById(R.id.overview_actions_view); - SplitPlaceholderView splitPlaceholderView = findViewById(R.id.split_placeholder); + mSplitPlaceholderView = findViewById(R.id.split_placeholder); RecentsView overviewPanel = (RecentsView) getOverviewPanel(); - splitPlaceholderView.init( + mSplitPlaceholderView.init( new SplitSelectStateController(SystemUiProxy.INSTANCE.get(this)) ); - overviewPanel.init(mActionsView, splitPlaceholderView); + overviewPanel.init(mActionsView, mSplitPlaceholderView); mActionsView.updateVerticalMargin(SysUINavigationMode.getMode(this)); mAppTransitionManager = new QuickstepTransitionManager(this); @@ -256,6 +257,10 @@ public abstract class BaseQuickstepLauncher extends Launcher return (T) mActionsView; } + public SplitPlaceholderView getSplitPlaceholderView() { + return mSplitPlaceholderView; + } + @Override protected void closeOpenViews(boolean animate) { super.closeOpenViews(animate); diff --git a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java index 8e92b59ae1..cc3ccea4d0 100644 --- a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java +++ b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java @@ -237,7 +237,9 @@ public class PredictionRowView extends LinearLayout implements setTranslationY(scroll); } setAlpha(mScrolledOut ? 0 : 1); - AlphaUpdateListener.updateVisibility(this); + if (getVisibility() != GONE) { + AlphaUpdateListener.updateVisibility(this); + } } @Override diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarContainerView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarContainerView.java index 5202d91684..ccf6b41e5d 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarContainerView.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarContainerView.java @@ -27,7 +27,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.launcher3.R; -import com.android.launcher3.anim.AlphaUpdateListener; import com.android.launcher3.util.TouchController; import com.android.launcher3.views.BaseDragLayer; import com.android.systemui.shared.system.ViewTreeObserverWrapper; @@ -83,18 +82,13 @@ public class TaskbarContainerView extends BaseDragLayer private ViewTreeObserverWrapper.OnComputeInsetsListener createTaskbarInsetsComputer() { return insetsInfo -> { - if (getAlpha() < AlphaUpdateListener.ALPHA_CUTOFF_THRESHOLD - || mTaskbarView.getVisibility() != VISIBLE || mTaskbarView.isDraggingItem()) { - // We're invisible or dragging out of taskbar, let touches pass through us. + if (mControllerCallbacks.isTaskbarTouchable()) { + // Accept touches anywhere in our bounds. + insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_FRAME); + } else { + // Let touches pass through us. insetsInfo.touchableRegion.setEmpty(); insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION); - // TODO(b/182234653): Shouldn't need to do this, but for the meantime, reporting - // that visibleInsets is empty allows DragEvents through. Setting them as completely - // empty reverts to default behavior, so set 1 px instead. - insetsInfo.visibleInsets.set(0, 0, 0, 1); - } else { - // We're visible again, accept touches anywhere in our bounds. - insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_FRAME); } // TaskbarContainerView provides insets to other apps based on contentInsets. These diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarController.java index de23ad2efa..559ede1956 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarController.java @@ -42,6 +42,7 @@ import com.android.launcher3.DeviceProfile; import com.android.launcher3.LauncherState; import com.android.launcher3.QuickstepTransitionManager; import com.android.launcher3.R; +import com.android.launcher3.anim.AlphaUpdateListener; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.folder.Folder; import com.android.launcher3.folder.FolderIcon; @@ -88,7 +89,6 @@ public class TaskbarController { private @Nullable Animator mAnimator; private boolean mIsAnimatingToLauncher; - private boolean mIsAnimatingToApp; public TaskbarController(BaseQuickstepLauncher launcher, TaskbarContainerView taskbarContainerView, TaskbarView taskbarViewOnHome) { @@ -141,6 +141,13 @@ public class TaskbarController { setTaskbarWindowFullscreen(false); } } + + @Override + public boolean isTaskbarTouchable() { + return mTaskbarContainerView.getAlpha() > AlphaUpdateListener.ALPHA_CUTOFF_THRESHOLD + && mTaskbarViewInApp.getVisibility() == View.VISIBLE + && !mIsAnimatingToLauncher; + } }; } @@ -250,7 +257,9 @@ public class TaskbarController { mHotseatController.init(); mRecentsController.init(); - updateWhichTaskbarViewIsVisible(); + setWhichTaskbarViewIsVisible(mLauncher.hasBeenResumed() + ? mTaskbarViewOnHome + : mTaskbarViewInApp); } private TaskbarStateHandlerCallbacks createTaskbarStateHandlerCallbacks() { @@ -284,6 +293,8 @@ public class TaskbarController { mTaskbarAnimationController.cleanup(); mHotseatController.cleanup(); mRecentsController.cleanup(); + + setWhichTaskbarViewIsVisible(null); } private void removeFromWindowManager() { @@ -364,7 +375,7 @@ public class TaskbarController { @Override public void onAnimationEnd(Animator animation) { mIsAnimatingToLauncher = false; - updateWhichTaskbarViewIsVisible(); + setWhichTaskbarViewIsVisible(mTaskbarViewOnHome); } }); @@ -377,14 +388,12 @@ public class TaskbarController { anim.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { - mIsAnimatingToApp = true; mTaskbarViewInApp.updateHotseatItemsVisibility(); - updateWhichTaskbarViewIsVisible(); + setWhichTaskbarViewIsVisible(mTaskbarViewInApp); } @Override public void onAnimationEnd(Animator animation) { - mIsAnimatingToApp = false; } }); return anim.buildAnim(); @@ -487,18 +496,12 @@ public class TaskbarController { mTaskbarViewOnHome.getHeight() - hotseatBounds.bottom); } - private void updateWhichTaskbarViewIsVisible() { - boolean isInApp = !mLauncher.hasBeenResumed() || mIsAnimatingToLauncher - || mIsAnimatingToApp; - if (isInApp) { - mTaskbarViewInApp.setVisibility(View.VISIBLE); - mTaskbarViewOnHome.setVisibility(View.INVISIBLE); - mLauncher.getHotseat().setIconsAlpha(0); - } else { - mTaskbarViewInApp.setVisibility(View.INVISIBLE); - mTaskbarViewOnHome.setVisibility(View.VISIBLE); - mLauncher.getHotseat().setIconsAlpha(1); - } + private void setWhichTaskbarViewIsVisible(@Nullable TaskbarView visibleTaskbar) { + mTaskbarViewInApp.setVisibility(visibleTaskbar == mTaskbarViewInApp + ? View.VISIBLE : View.INVISIBLE); + mTaskbarViewOnHome.setVisibility(visibleTaskbar == mTaskbarViewOnHome + ? View.VISIBLE : View.INVISIBLE); + mLauncher.getHotseat().setIconsAlpha(visibleTaskbar != mTaskbarViewInApp ? 1f : 0f); } /** @@ -549,6 +552,7 @@ public class TaskbarController { */ protected interface TaskbarContainerViewCallbacks { void onViewRemoved(); + boolean isTaskbarTouchable(); } /** diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java index d36af09d89..a3a1fef052 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java @@ -116,6 +116,11 @@ public abstract class BaseRecentsViewStateController config.getInterpolator(ANIM_OVERVIEW_SCRIM_FADE, LINEAR)); setter.setFloat(scrim, SCRIM_MULTIPLIER, 1f, config.getInterpolator(ANIM_OVERVIEW_SCRIM_FADE, LINEAR)); + if (toState.areElementsVisible(mLauncher, LauncherState.SPLIT_PLACHOLDER_VIEW)) { + scrim.updateStableScrimmedView(mLauncher.getSplitPlaceholderView()); + } else { + scrim.updateStableScrimmedView(mLauncher.getOverviewPanel()); + } setter.setFloat( mRecentsView, getTaskModalnessProperty(), diff --git a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java index 6929b5dc9c..9097c8b4c2 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java @@ -113,7 +113,7 @@ public final class RecentsViewStateController extends ANIM_OVERVIEW_ACTIONS_FADE, LINEAR)); float splitPlaceholderAlpha = state.areElementsVisible(mLauncher, SPLIT_PLACHOLDER_VIEW) ? - 1 : 0; + 0.7f : 0; propertySetter.setFloat(mRecentsView.getSplitPlaceholder(), ALPHA_FLOAT, splitPlaceholderAlpha, LINEAR); } diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java index 65bbeea52e..464b90a2cb 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java @@ -111,7 +111,7 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch float progressMultiplier = super.initCurrentAnimation(); if (mToState == HINT_STATE) { // Track the drag across the entire height of the screen. - progressMultiplier = -1 / getShiftRange(); + progressMultiplier = -1f / mLauncher.getDeviceProfile().heightPx; } return progressMultiplier; } diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index b7c6743780..2a903eb9fc 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -217,6 +217,8 @@ public abstract class AbsSwipeUpHandler, // Either RectFSpringAnim (if animating home) or ObjectAnimator (from mCurrentShift) otherwise private RunningWindowAnim mRunningWindowAnim; + // Possible second animation running at the same time as mRunningWindowAnim + private Animator mParallelRunningAnim; private boolean mIsMotionPaused; private boolean mHasMotionEverBeenPaused; @@ -317,9 +319,9 @@ public abstract class AbsSwipeUpHandler, mStateCallback.runOnceAtState(STATE_LAUNCHER_PRESENT | STATE_HANDLER_INVALIDATED, this::invalidateHandlerWithLauncher); mStateCallback.runOnceAtState(STATE_HANDLER_INVALIDATED | STATE_RESUME_LAST_TASK, - this::notifyTransitionCancelled); + this::resetStateForAnimationCancel); mStateCallback.runOnceAtState(STATE_HANDLER_INVALIDATED | STATE_FINISH_WITH_NO_END, - this::notifyTransitionCancelled); + this::resetStateForAnimationCancel); if (!LIVE_TILE.get()) { mStateCallback.addChangeListener(STATE_APP_CONTROLLER_RECEIVED | STATE_LAUNCHER_PRESENT @@ -798,6 +800,13 @@ public abstract class AbsSwipeUpHandler, mRunningWindowAnim.end(); } } + if (mParallelRunningAnim != null) { + if (cancel) { + mParallelRunningAnim.cancel(); + } else { + mParallelRunningAnim.end(); + } + } } private void onSettledOnEndTarget() { @@ -1060,7 +1069,11 @@ public abstract class AbsSwipeUpHandler, ActivityManagerWrapper.getInstance().registerTaskStackListener( mActivityRestartListener); - mActivityInterface.onAnimateToLauncher(mGestureState.getEndTarget(), duration); + mParallelRunningAnim = mActivityInterface.getParallelAnimationToLauncher( + mGestureState.getEndTarget(), duration); + if (mParallelRunningAnim != null) { + mParallelRunningAnim.start(); + } } if (mGestureState.getEndTarget() == HOME) { @@ -1370,10 +1383,6 @@ public abstract class AbsSwipeUpHandler, mActivity.getRootView().setOnApplyWindowInsetsListener(null); } - private void notifyTransitionCancelled() { - mAnimationFactory.onTransitionCancelled(); - } - private void resetStateForAnimationCancel() { boolean wasVisible = mWasLauncherAlreadyVisible || mGestureStarted; mActivityInterface.onTransitionCancelled(wasVisible); diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index 3afffc1dad..147297af23 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -347,7 +347,9 @@ public abstract class BaseActivityInterface