Use snapshotView references in TaskContainer when possible

- Moved majority of TaskContainer.thumbnailViewDeprecated usage to TaskContainer.snapshotView, so they'll cover the new TaskThumbnailView as well
- There are afew location left that will be handled as a follow-up
- Removed TaskThumbnailView's splitTranslation and use translation directly as it's the only translation we use

Bug: 336612373
Test: Ensure all Task CUJs still work without refacorting
Test: Ensure major Task CUJs work with refactoring
Flag: EXEMPT refactor
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: Ieb52236bc503ce0d0a511249978c1821a82d406e
This commit is contained in:
Alex Chau
2024-05-30 12:28:07 +01:00
parent b76356a202
commit c06bc41ee0
13 changed files with 136 additions and 202 deletions

View File

@@ -33,7 +33,6 @@ import com.android.launcher3.taskbar.TaskbarActivityContext
import com.android.launcher3.util.SplitConfigurationOptions
import com.android.quickstep.views.GroupedTaskView
import com.android.quickstep.views.IconView
import com.android.quickstep.views.TaskThumbnailViewDeprecated
import com.android.quickstep.views.TaskView
import com.android.quickstep.views.TaskView.TaskContainer
import com.android.systemui.shared.recents.model.Task
@@ -59,7 +58,7 @@ class SplitAnimationControllerTest {
private val mockSplitSelectStateController: SplitSelectStateController = mock()
// TaskView
private val mockTaskView: TaskView = mock()
private val mockThumbnailView: TaskThumbnailViewDeprecated = mock()
private val mockSnapshotView: View = mock()
private val mockBitmap: Bitmap = mock()
private val mockIconView: IconView = mock()
private val mockTaskViewDrawable: Drawable = mock()
@@ -87,8 +86,8 @@ class SplitAnimationControllerTest {
@Before
fun setup() {
whenever(mockTaskContainer.thumbnailViewDeprecated).thenReturn(mockThumbnailView)
whenever(mockThumbnailView.thumbnail).thenReturn(mockBitmap)
whenever(mockTaskContainer.snapshotView).thenReturn(mockSnapshotView)
whenever(mockTaskContainer.thumbnail).thenReturn(mockBitmap)
whenever(mockTaskContainer.iconView).thenReturn(mockIconView)
whenever(mockIconView.drawable).thenReturn(mockTaskViewDrawable)
whenever(mockTaskView.taskContainers).thenReturn(List(1) { mockTaskContainer })
@@ -180,7 +179,6 @@ class SplitAnimationControllerTest {
whenever(mockTaskContainer.task).thenReturn(mockTask)
whenever(mockTaskContainer.iconView).thenReturn(mockIconView)
whenever(mockTaskContainer.thumbnailViewDeprecated).thenReturn(mockThumbnailView)
whenever(mockTask.getKey()).thenReturn(mockTaskKey)
whenever(mockTaskKey.getId()).thenReturn(taskId)
whenever(mockSplitSelectStateController.initialTaskId).thenReturn(taskId)