Trigger onTaskAppeared when a task started from recents becomes ready.
Launcher can now receive onTaskAppeared callback from
RecentsAnimationController to get remote animation target when in quick
switch mode.
Note: This CL just demonstrates how to receive callback and then
calling removeTask & finish recents animation,
in order to really improve quick switch flicking, launcher side needs
to implement the rest of logic to animate task's remote animation target
to make task switching more smoothly.
Bug: 152480470
Test: WIP
Change-Id: Id0371db7339cfe84942cc905a89b0a2c1fab62ec
(cherry picked from commit bec41bc5b9)
This commit is contained in:
@@ -28,12 +28,14 @@ import android.view.InputEvent;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.UiThread;
|
||||
|
||||
import com.android.launcher3.util.Preconditions;
|
||||
import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||
import com.android.systemui.shared.system.InputConsumerController;
|
||||
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;
|
||||
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
@@ -107,6 +109,15 @@ public class RecentsAnimationController {
|
||||
UI_HELPER_EXECUTOR.execute(() -> mController.cleanupScreenshot());
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove task remote animation target from
|
||||
* {@link RecentsAnimationCallbacks#onTaskAppeared(RemoteAnimationTargetCompat)}}.
|
||||
*/
|
||||
@UiThread
|
||||
public boolean removeTaskTarget(@NonNull RemoteAnimationTargetCompat target) {
|
||||
return mController.removeTask(target.taskId);
|
||||
}
|
||||
|
||||
@UiThread
|
||||
public void finishAnimationToHome() {
|
||||
finishAndClear(true /* toRecents */, null, false /* sendUserLeaveHint */);
|
||||
|
||||
Reference in New Issue
Block a user