mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 18:06:48 +00:00
Use FlingOnBackAnimationCallback for predictive back
Use FlingOnBackAnimationCallback to get automatically interpolated progress and out-of-the-box support for back gesture flings. Bug: 362938401 Test: Manual, i.e. testing launcher predictive back cases (all apps, widget-picker) Flag: com.android.window.flags.predictive_back_timestamp_api Change-Id: I35806dbf005eb6fce97327d26c1e75bca60c2c77
This commit is contained in:
@@ -52,6 +52,7 @@ import com.android.launcher3.widget.model.WidgetsListBaseEntriesBuilder;
|
||||
import com.android.launcher3.widget.model.WidgetsListBaseEntry;
|
||||
import com.android.launcher3.widget.picker.WidgetsFullSheet;
|
||||
import com.android.launcher3.widget.picker.model.WidgetPickerDataProvider;
|
||||
import com.android.systemui.animation.back.FlingOnBackAnimationCallback;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
@@ -356,12 +357,12 @@ public class WidgetPickerActivity extends BaseActivity {
|
||||
/**
|
||||
* Animation callback for different predictive back animation states for the widget picker.
|
||||
*/
|
||||
private class BackAnimationCallback implements OnBackAnimationCallback {
|
||||
private class BackAnimationCallback extends FlingOnBackAnimationCallback {
|
||||
@Nullable
|
||||
OnBackAnimationCallback mActiveOnBackAnimationCallback;
|
||||
|
||||
@Override
|
||||
public void onBackStarted(@NonNull BackEvent backEvent) {
|
||||
public void onBackStartedCompat(@NonNull BackEvent backEvent) {
|
||||
if (mActiveOnBackAnimationCallback != null) {
|
||||
mActiveOnBackAnimationCallback.onBackCancelled();
|
||||
}
|
||||
@@ -372,7 +373,7 @@ public class WidgetPickerActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackInvoked() {
|
||||
public void onBackInvokedCompat() {
|
||||
if (mActiveOnBackAnimationCallback == null) {
|
||||
return;
|
||||
}
|
||||
@@ -381,7 +382,7 @@ public class WidgetPickerActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackProgressed(@NonNull BackEvent backEvent) {
|
||||
public void onBackProgressedCompat(@NonNull BackEvent backEvent) {
|
||||
if (mActiveOnBackAnimationCallback == null) {
|
||||
return;
|
||||
}
|
||||
@@ -389,7 +390,7 @@ public class WidgetPickerActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackCancelled() {
|
||||
public void onBackCancelledCompat() {
|
||||
if (mActiveOnBackAnimationCallback == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user