mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
[Predictive Back] Swipe back within taskbar all apps should only scale down content view, rather than whole all apps sheet
Bug: 335467443 Test: manual - took a video Flag: aconfig com.android.launcher3.enable_predictive_back_gesture TRUNKFOOD Change-Id: I45980329f70ac1a8a8fc0e84be007f3385e40f58
This commit is contained in:
@@ -206,13 +206,6 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
|
||||
super.dispatchDraw(canvas);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onUserSwipeToDismissProgressChanged() {
|
||||
super.onUserSwipeToDismissProgressChanged();
|
||||
mAppsView.setClipChildren(!mIsDismissInProgress);
|
||||
mAppsView.getAppsRecyclerViewContainer().setClipChildren(!mIsDismissInProgress);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||
super.onLayout(changed, l, t, r, b);
|
||||
@@ -259,12 +252,28 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
|
||||
return getPopupContainer().isEventOverView(mAppsView.getVisibleContainerView(), ev);
|
||||
}
|
||||
|
||||
/**
|
||||
* In taskbar all apps search mode, we should scale down content inside all apps, rather
|
||||
* than the whole all apps bottom sheet, to indicate we will navigate back within the all apps.
|
||||
*/
|
||||
@Override
|
||||
public boolean shouldAnimateContentViewInBackSwipe() {
|
||||
return mAllAppsCallbacks.canHandleSearchBackInvoked();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onUserSwipeToDismissProgressChanged() {
|
||||
super.onUserSwipeToDismissProgressChanged();
|
||||
mAppsView.setClipChildren(!mIsDismissInProgress);
|
||||
mAppsView.getAppsRecyclerViewContainer().setClipChildren(!mIsDismissInProgress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackInvoked() {
|
||||
if (mAllAppsCallbacks.handleSearchBackInvoked()) {
|
||||
// We need to scale back taskbar all apps if we navigate back within search inside all
|
||||
// apps
|
||||
animateSwipeToDismissProgressToStart();
|
||||
post(this::animateSwipeToDismissProgressToStart);
|
||||
} else {
|
||||
super.onBackInvoked();
|
||||
}
|
||||
|
||||
@@ -143,6 +143,11 @@ final class TaskbarAllAppsViewController {
|
||||
}
|
||||
}
|
||||
|
||||
/** Check if search session can handle back. This check doesn't perform any action. */
|
||||
boolean canHandleSearchBackInvoked() {
|
||||
return mSearchSessionController.canHandleBackInvoked();
|
||||
}
|
||||
|
||||
/** Invoked on back press, returning {@code true} if the search session handled it. */
|
||||
boolean handleSearchBackInvoked() {
|
||||
return mSearchSessionController.handleBackInvoked();
|
||||
|
||||
@@ -49,6 +49,8 @@ open class TaskbarSearchSessionController : ResourceBasedOverride, AllAppsTransi
|
||||
/** Creates a [PreDragCondition] for [view], if it is a search result that requires one. */
|
||||
open fun createPreDragConditionForSearch(view: View): PreDragCondition? = null
|
||||
|
||||
open fun canHandleBackInvoked(): Boolean = false
|
||||
|
||||
open fun handleBackInvoked(): Boolean = false
|
||||
|
||||
open fun onAllAppsAnimationPending(
|
||||
|
||||
Reference in New Issue
Block a user