Loading quickstep/src/com/android/quickstep/util/RecentsViewUtils.kt +10 −0 Original line number Diff line number Diff line Loading @@ -17,9 +17,11 @@ package com.android.quickstep.util import com.android.launcher3.Flags.enableLargeDesktopWindowingTile import com.android.quickstep.RecentsAnimationController import com.android.quickstep.views.DesktopTaskView import com.android.quickstep.views.TaskView import com.android.quickstep.views.TaskViewType import com.android.systemui.shared.recents.model.ThumbnailData /** * Helper class for [com.android.quickstep.views.RecentsView]. This util class contains refactored Loading Loading @@ -68,4 +70,12 @@ class RecentsViewUtils { if (taskView?.isLargeTile == true) taskView else null } } fun screenshotTasks( taskView: TaskView, recentsAnimationController: RecentsAnimationController ): Map<Int, ThumbnailData> = taskView.taskContainers.associate { it.task.key.id to recentsAnimationController.screenshotTask(it.task.key.id) } } quickstep/src/com/android/quickstep/views/RecentsView.java +11 −19 Original line number Diff line number Diff line Loading @@ -3058,14 +3058,15 @@ public abstract class RecentsView< } private void setRunningTaskViewShowScreenshot(boolean showScreenshot) { setRunningTaskViewShowScreenshot(showScreenshot, /*updatedThumbnails=*/null); } private void setRunningTaskViewShowScreenshot(boolean showScreenshot, @Nullable Map<Integer, ThumbnailData> updatedThumbnails) { mRunningTaskShowScreenshot = showScreenshot; TaskView runningTaskView = getRunningTaskView(); if (runningTaskView != null) { runningTaskView.setShouldShowScreenshot(mRunningTaskShowScreenshot); if (!enableRefactorTaskThumbnail()) { runningTaskView.getTaskContainers().forEach( taskContainer -> taskContainer.getThumbnailViewDeprecated().refresh()); } runningTaskView.setShouldShowScreenshot(mRunningTaskShowScreenshot, updatedThumbnails); } if (enableRefactorTaskThumbnail()) { mRecentsViewModel.setRunningTaskShowScreenshot(showScreenshot); Loading Loading @@ -6154,20 +6155,12 @@ public abstract class RecentsView< return; } Map<Integer, ThumbnailData> updatedThumbnails = mRecentsViewUtils.screenshotTasks(taskView, mRecentsAnimationController); if (enableRefactorTaskThumbnail()) { mHelper.switchToScreenshot(taskView, mRecentsAnimationController, onFinishRunnable); mHelper.switchToScreenshot(taskView, updatedThumbnails, onFinishRunnable); } else { setRunningTaskViewShowScreenshot(true); for (TaskContainer container : taskView.getTaskContainers()) { ThumbnailData thumbnailData = mRecentsAnimationController.screenshotTask(container.getTask().key.id); TaskThumbnailViewDeprecated thumbnailView = container.getThumbnailViewDeprecated(); if (thumbnailData != null) { thumbnailView.setThumbnail(container.getTask(), thumbnailData); } else { thumbnailView.refresh(); } } setRunningTaskViewShowScreenshot(true, updatedThumbnails); ViewUtils.postFrameDrawn(taskView, onFinishRunnable); } } Loading @@ -6186,8 +6179,7 @@ public abstract class RecentsView< if (enableRefactorTaskThumbnail()) { mHelper.switchToScreenshot(taskView, thumbnailDatas, onFinishRunnable); } else { taskView.setShouldShowScreenshot(true); taskView.refreshThumbnails(thumbnailDatas); taskView.setShouldShowScreenshot(true, thumbnailDatas); ViewUtils.postFrameDrawn(taskView, onFinishRunnable); } } else { Loading quickstep/src/com/android/quickstep/views/RecentsViewModelHelper.kt +0 −13 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.quickstep.views import com.android.quickstep.RecentsAnimationController import com.android.quickstep.ViewUtils import com.android.quickstep.recents.viewmodel.RecentsViewModel import com.android.systemui.shared.recents.model.ThumbnailData Loading @@ -40,18 +39,6 @@ class RecentsViewModelHelper(private val recentsViewModel: RecentsViewModel) { viewAttachedScope.cancel("RecentsView detaching from window") } fun switchToScreenshot( taskView: TaskView, recentsAnimationController: RecentsAnimationController, onFinishRunnable: Runnable, ) { val updatedThumbnails = taskView.taskContainers.associate { it.task.key.id to recentsAnimationController.screenshotTask(it.task.key.id) } switchToScreenshot(taskView, updatedThumbnails, onFinishRunnable) } fun switchToScreenshot( taskView: TaskView, updatedThumbnails: Map<Int, ThumbnailData>?, Loading quickstep/src/com/android/quickstep/views/TaskView.kt +8 −2 Original line number Diff line number Diff line Loading @@ -79,7 +79,6 @@ import com.android.launcher3.util.rects.set import com.android.launcher3.views.ActivityContext import com.android.quickstep.RecentsModel import com.android.quickstep.RemoteAnimationTargets import com.android.quickstep.TaskAnimationManager import com.android.quickstep.TaskOverlayFactory import com.android.quickstep.TaskViewUtils import com.android.quickstep.orientation.RecentsPagedOrientationHandler Loading Loading @@ -408,6 +407,7 @@ constructor( protected var shouldShowScreenshot = false get() = !isRunningTask || field private set /** Enable or disable showing border on hover and focus change */ @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED) Loading Loading @@ -974,7 +974,13 @@ constructor( iconView.setText(text) } open fun refreshThumbnails(thumbnailDatas: Map<Int, ThumbnailData?>?) { @JvmOverloads open fun setShouldShowScreenshot( shouldShowScreenshot: Boolean, thumbnailDatas: Map<Int, ThumbnailData?>? = null ) { if (this.shouldShowScreenshot == shouldShowScreenshot) return this.shouldShowScreenshot = shouldShowScreenshot if (enableRefactorTaskThumbnail()) { return } Loading Loading
quickstep/src/com/android/quickstep/util/RecentsViewUtils.kt +10 −0 Original line number Diff line number Diff line Loading @@ -17,9 +17,11 @@ package com.android.quickstep.util import com.android.launcher3.Flags.enableLargeDesktopWindowingTile import com.android.quickstep.RecentsAnimationController import com.android.quickstep.views.DesktopTaskView import com.android.quickstep.views.TaskView import com.android.quickstep.views.TaskViewType import com.android.systemui.shared.recents.model.ThumbnailData /** * Helper class for [com.android.quickstep.views.RecentsView]. This util class contains refactored Loading Loading @@ -68,4 +70,12 @@ class RecentsViewUtils { if (taskView?.isLargeTile == true) taskView else null } } fun screenshotTasks( taskView: TaskView, recentsAnimationController: RecentsAnimationController ): Map<Int, ThumbnailData> = taskView.taskContainers.associate { it.task.key.id to recentsAnimationController.screenshotTask(it.task.key.id) } }
quickstep/src/com/android/quickstep/views/RecentsView.java +11 −19 Original line number Diff line number Diff line Loading @@ -3058,14 +3058,15 @@ public abstract class RecentsView< } private void setRunningTaskViewShowScreenshot(boolean showScreenshot) { setRunningTaskViewShowScreenshot(showScreenshot, /*updatedThumbnails=*/null); } private void setRunningTaskViewShowScreenshot(boolean showScreenshot, @Nullable Map<Integer, ThumbnailData> updatedThumbnails) { mRunningTaskShowScreenshot = showScreenshot; TaskView runningTaskView = getRunningTaskView(); if (runningTaskView != null) { runningTaskView.setShouldShowScreenshot(mRunningTaskShowScreenshot); if (!enableRefactorTaskThumbnail()) { runningTaskView.getTaskContainers().forEach( taskContainer -> taskContainer.getThumbnailViewDeprecated().refresh()); } runningTaskView.setShouldShowScreenshot(mRunningTaskShowScreenshot, updatedThumbnails); } if (enableRefactorTaskThumbnail()) { mRecentsViewModel.setRunningTaskShowScreenshot(showScreenshot); Loading Loading @@ -6154,20 +6155,12 @@ public abstract class RecentsView< return; } Map<Integer, ThumbnailData> updatedThumbnails = mRecentsViewUtils.screenshotTasks(taskView, mRecentsAnimationController); if (enableRefactorTaskThumbnail()) { mHelper.switchToScreenshot(taskView, mRecentsAnimationController, onFinishRunnable); mHelper.switchToScreenshot(taskView, updatedThumbnails, onFinishRunnable); } else { setRunningTaskViewShowScreenshot(true); for (TaskContainer container : taskView.getTaskContainers()) { ThumbnailData thumbnailData = mRecentsAnimationController.screenshotTask(container.getTask().key.id); TaskThumbnailViewDeprecated thumbnailView = container.getThumbnailViewDeprecated(); if (thumbnailData != null) { thumbnailView.setThumbnail(container.getTask(), thumbnailData); } else { thumbnailView.refresh(); } } setRunningTaskViewShowScreenshot(true, updatedThumbnails); ViewUtils.postFrameDrawn(taskView, onFinishRunnable); } } Loading @@ -6186,8 +6179,7 @@ public abstract class RecentsView< if (enableRefactorTaskThumbnail()) { mHelper.switchToScreenshot(taskView, thumbnailDatas, onFinishRunnable); } else { taskView.setShouldShowScreenshot(true); taskView.refreshThumbnails(thumbnailDatas); taskView.setShouldShowScreenshot(true, thumbnailDatas); ViewUtils.postFrameDrawn(taskView, onFinishRunnable); } } else { Loading
quickstep/src/com/android/quickstep/views/RecentsViewModelHelper.kt +0 −13 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.quickstep.views import com.android.quickstep.RecentsAnimationController import com.android.quickstep.ViewUtils import com.android.quickstep.recents.viewmodel.RecentsViewModel import com.android.systemui.shared.recents.model.ThumbnailData Loading @@ -40,18 +39,6 @@ class RecentsViewModelHelper(private val recentsViewModel: RecentsViewModel) { viewAttachedScope.cancel("RecentsView detaching from window") } fun switchToScreenshot( taskView: TaskView, recentsAnimationController: RecentsAnimationController, onFinishRunnable: Runnable, ) { val updatedThumbnails = taskView.taskContainers.associate { it.task.key.id to recentsAnimationController.screenshotTask(it.task.key.id) } switchToScreenshot(taskView, updatedThumbnails, onFinishRunnable) } fun switchToScreenshot( taskView: TaskView, updatedThumbnails: Map<Int, ThumbnailData>?, Loading
quickstep/src/com/android/quickstep/views/TaskView.kt +8 −2 Original line number Diff line number Diff line Loading @@ -79,7 +79,6 @@ import com.android.launcher3.util.rects.set import com.android.launcher3.views.ActivityContext import com.android.quickstep.RecentsModel import com.android.quickstep.RemoteAnimationTargets import com.android.quickstep.TaskAnimationManager import com.android.quickstep.TaskOverlayFactory import com.android.quickstep.TaskViewUtils import com.android.quickstep.orientation.RecentsPagedOrientationHandler Loading Loading @@ -408,6 +407,7 @@ constructor( protected var shouldShowScreenshot = false get() = !isRunningTask || field private set /** Enable or disable showing border on hover and focus change */ @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED) Loading Loading @@ -974,7 +974,13 @@ constructor( iconView.setText(text) } open fun refreshThumbnails(thumbnailDatas: Map<Int, ThumbnailData?>?) { @JvmOverloads open fun setShouldShowScreenshot( shouldShowScreenshot: Boolean, thumbnailDatas: Map<Int, ThumbnailData?>? = null ) { if (this.shouldShowScreenshot == shouldShowScreenshot) return this.shouldShowScreenshot = shouldShowScreenshot if (enableRefactorTaskThumbnail()) { return } Loading