[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:
1 parent
da1a7162e3
commit
1529052dcf
5 files changed
+53
-18
No files matched your search
@@ -287,6 +287,13 @@ public abstract class AbstractSlideInView<T extends Context & ActivityContext>
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
|
||||
public void onBackStarted(BackEvent backEvent) {
|
||||
super.onBackStarted(backEvent);
|
||||
mViewToAnimateInSwipeToDismiss = shouldAnimateContentViewInBackSwipe() ? mContent : this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
|
||||
public void onBackProgressed(BackEvent backEvent) {
|
||||
@@ -295,6 +302,18 @@ public abstract class AbstractSlideInView<T extends Context & ActivityContext>
|
||||
mSwipeToDismissProgress.updateValue(deceleratedProgress);
|
||||
}
|
||||
|
||||
/**
|
||||
* During predictive back swipe, the default behavior is to scale {@link AbstractSlideInView}
|
||||
* during back swipe. This method allow subclass to scale {@link #mContent}, typically to exit
|
||||
* search mode.
|
||||
*
|
||||
* <p>Note that this method can be expensive, and should only be called from
|
||||
* {@link #onBackStarted(BackEvent)}, not from {@link #onBackProgressed(BackEvent)}.
|
||||
*/
|
||||
protected boolean shouldAnimateContentViewInBackSwipe() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void onUserSwipeToDismissProgressChanged() {
|
||||
float progress = mSwipeToDismissProgress.value;
|
||||
mIsDismissInProgress = progress > 0f;
|
||||
|
||||
Reference in new issue
Block a user