[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:
Fengjiang Li committed 2024-04-17 16:09:21 -07:00
1 parent da1a7162e3
commit 1529052dcf
5 files changed
+53 -18

No files matched your search

@@ -46,7 +46,6 @@ import android.view.animation.Interpolator;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.window.BackEvent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -903,22 +902,23 @@ public class WidgetsFullSheet extends BaseWidgetSheet
return isFoldUnFold || useDifferentLayoutOnOrientationChange;
}
/**
* In widget search mode, we should scale down content inside widget bottom sheet, rather
* than the whole bottom sheet, to indicate we will navigate back within the widget
* bottom sheet.
*/
@Override
public void onBackStarted(BackEvent backEvent) {
super.onBackStarted(backEvent);
// In widget search mode, we should scale down content inside widget bottom sheet, rather
// than the whole bottom sheet, to indicate we will navigate back within the widget
// bottom sheet.
if (mIsInSearchMode) {
mViewToAnimateInSwipeToDismiss = mContent;
}
public boolean shouldAnimateContentViewInBackSwipe() {
return mIsInSearchMode;
}
@Override
public void onBackInvoked() {
if (mIsInSearchMode) {
mSearchBar.reset();
animateSwipeToDismissProgressToStart();
// Posting animation to next frame will let widget sheet finish updating UI first, and
// make animation smoother.
post(this::animateSwipeToDismissProgressToStart);
} else {
super.onBackInvoked();
}