Revert "Revert "Exposing AnimatorListeners in StateManager to receive both success and failure callback""

This reverts commit d7f11d5fb9.

Reason for revert: Fixed initial error
Bug: 185554764

Change-Id: I32cc49f9b3820166736ceb347f33577939aa6efa
This commit is contained in:
Sunny Goyal
2021-05-13 17:14:10 +00:00
parent e2522016ae
commit 01b32466c3
17 changed files with 184 additions and 135 deletions

View File

@@ -25,6 +25,7 @@ import static com.android.launcher3.LauncherState.FLAG_WORKSPACE_INACCESSIBLE;
import static com.android.launcher3.LauncherState.HINT_STATE;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.SPRING_LOADED;
import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback;
import static com.android.launcher3.config.FeatureFlags.ADAPTIVE_ICON_WINDOW_ANIM;
import static com.android.launcher3.dragndrop.DragLayer.ALPHA_INDEX_OVERLAY;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME;
@@ -1946,8 +1947,8 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
}
parent.onDropChild(cell);
mLauncher.getStateManager().goToState(
NORMAL, SPRING_LOADED_EXIT_DELAY, onCompleteRunnable);
mLauncher.getStateManager().goToState(NORMAL, SPRING_LOADED_EXIT_DELAY,
onCompleteRunnable == null ? null : forSuccessCallback(onCompleteRunnable));
mStatsLogManager.logger().withItemInfo(d.dragInfo).withInstanceId(d.logInstanceId)
.log(LauncherEvent.LAUNCHER_ITEM_DROP_COMPLETED);
}