mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 23:36:47 +00:00
Convert TaksView to Kotlin
- PS1: Android Studio conversion (unformatted, cannot compile)
- PS2: Fix compilation issues and formatting
- PS3: First pass ready for review
- PS4: Minor changes (Remove Consumer, remove unnecessary null-checks)
- PS5: Removed check() around taskContainers, which is now lateinit and should always be initiailzed. Also ensure TaskView is bound before adding to parent.
- PS6: Move a bunch of getters to use .property style
- PS8: Refacoted RecentsView.applyLoadPlan bind logic, to avoid inflating TaksView, bind, add then immediatley remove
- PS10: Turned more functions to express functions; added an extension function
- PS11: Re-order functions, no code changes
- PS12: Reverted unit express function back to {} style
Bug: 339787593
Test: Manual
Flag: NONE
Change-Id: I75c06cf29718d8f258a4124997bcb054f5eb056f
This commit is contained in:
@@ -30,7 +30,9 @@ import com.android.launcher3.model.data.WorkspaceItemInfo
|
||||
import com.android.launcher3.uioverrides.QuickstepLauncher
|
||||
import com.android.launcher3.util.SplitConfigurationOptions
|
||||
import com.android.quickstep.views.LauncherRecentsView
|
||||
import com.android.quickstep.views.TaskThumbnailViewDeprecated
|
||||
import com.android.quickstep.views.TaskView
|
||||
import com.android.quickstep.views.TaskViewIcon
|
||||
import com.android.systemui.shared.recents.model.Task
|
||||
import com.android.systemui.shared.recents.model.Task.TaskKey
|
||||
import com.android.window.flags.Flags
|
||||
@@ -58,6 +60,8 @@ class DesktopSystemShortcutTest {
|
||||
private val taskView: TaskView = mock()
|
||||
private val workspaceItemInfo: WorkspaceItemInfo = mock()
|
||||
private val abstractFloatingViewHelper: AbstractFloatingViewHelper = mock()
|
||||
private val thumbnailView: TaskThumbnailViewDeprecated = mock()
|
||||
private val iconView: TaskViewIcon = mock()
|
||||
private val factory: TaskShortcutFactory =
|
||||
DesktopSystemShortcut.createFactory(abstractFloatingViewHelper)
|
||||
|
||||
@@ -90,8 +94,8 @@ class DesktopSystemShortcutTest {
|
||||
val taskContainer =
|
||||
taskView.TaskContainer(
|
||||
task,
|
||||
null,
|
||||
null,
|
||||
thumbnailView,
|
||||
iconView,
|
||||
SplitConfigurationOptions.STAGE_POSITION_UNDEFINED,
|
||||
null
|
||||
)
|
||||
@@ -112,8 +116,8 @@ class DesktopSystemShortcutTest {
|
||||
val taskContainer =
|
||||
taskView.TaskContainer(
|
||||
task,
|
||||
null,
|
||||
null,
|
||||
thumbnailView,
|
||||
iconView,
|
||||
SplitConfigurationOptions.STAGE_POSITION_UNDEFINED,
|
||||
null
|
||||
)
|
||||
@@ -135,8 +139,8 @@ class DesktopSystemShortcutTest {
|
||||
val taskContainer =
|
||||
taskView.TaskContainer(
|
||||
task,
|
||||
null,
|
||||
null,
|
||||
thumbnailView,
|
||||
iconView,
|
||||
SplitConfigurationOptions.STAGE_POSITION_UNDEFINED,
|
||||
null
|
||||
)
|
||||
@@ -156,8 +160,8 @@ class DesktopSystemShortcutTest {
|
||||
val taskContainer =
|
||||
taskView.TaskContainer(
|
||||
task,
|
||||
null,
|
||||
null,
|
||||
thumbnailView,
|
||||
iconView,
|
||||
SplitConfigurationOptions.STAGE_POSITION_UNDEFINED,
|
||||
null
|
||||
)
|
||||
@@ -177,8 +181,8 @@ class DesktopSystemShortcutTest {
|
||||
val taskContainer =
|
||||
taskView.TaskContainer(
|
||||
task,
|
||||
null,
|
||||
null,
|
||||
thumbnailView,
|
||||
iconView,
|
||||
SplitConfigurationOptions.STAGE_POSITION_UNDEFINED,
|
||||
null
|
||||
)
|
||||
|
||||
@@ -53,7 +53,7 @@ class FullscreenDrawParamsTest : FakeInvariantDeviceProfileTest() {
|
||||
)
|
||||
|
||||
val expectedRadius = TaskCornerRadius.get(context)
|
||||
assertThat(params.mCurrentDrawnCornerRadius).isEqualTo(expectedRadius)
|
||||
assertThat(params.currentDrawnCornerRadius).isEqualTo(expectedRadius)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -67,7 +67,7 @@ class FullscreenDrawParamsTest : FakeInvariantDeviceProfileTest() {
|
||||
)
|
||||
|
||||
val expectedRadius = QuickStepContract.getWindowCornerRadius(context)
|
||||
assertThat(params.mCurrentDrawnCornerRadius).isEqualTo(expectedRadius)
|
||||
assertThat(params.currentDrawnCornerRadius).isEqualTo(expectedRadius)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -81,7 +81,7 @@ class FullscreenDrawParamsTest : FakeInvariantDeviceProfileTest() {
|
||||
)
|
||||
|
||||
val expectedRadius = TaskCornerRadius.get(context)
|
||||
assertThat(params.mCurrentDrawnCornerRadius).isEqualTo(expectedRadius)
|
||||
assertThat(params.currentDrawnCornerRadius).isEqualTo(expectedRadius)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -95,7 +95,7 @@ class FullscreenDrawParamsTest : FakeInvariantDeviceProfileTest() {
|
||||
)
|
||||
|
||||
val expectedRadius = QuickStepContract.getWindowCornerRadius(context)
|
||||
assertThat(params.mCurrentDrawnCornerRadius).isEqualTo(expectedRadius)
|
||||
assertThat(params.currentDrawnCornerRadius).isEqualTo(expectedRadius)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -117,7 +117,7 @@ class FullscreenDrawParamsTest : FakeInvariantDeviceProfileTest() {
|
||||
/* parentScale= */ 1.0f,
|
||||
/* taskViewScale= */ 1.0f
|
||||
)
|
||||
assertThat(spyParams.mCurrentDrawnCornerRadius).isEqualTo(display1TaskRadius)
|
||||
assertThat(spyParams.currentDrawnCornerRadius).isEqualTo(display1TaskRadius)
|
||||
|
||||
spyParams.updateCornerRadius(display2Context)
|
||||
spyParams.setProgress(
|
||||
@@ -125,7 +125,7 @@ class FullscreenDrawParamsTest : FakeInvariantDeviceProfileTest() {
|
||||
/* parentScale= */ 1.0f,
|
||||
/* taskViewScale= */ 1.0f
|
||||
)
|
||||
assertThat(spyParams.mCurrentDrawnCornerRadius).isEqualTo(display2TaskRadius)
|
||||
assertThat(spyParams.currentDrawnCornerRadius).isEqualTo(display2TaskRadius)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -147,7 +147,7 @@ class FullscreenDrawParamsTest : FakeInvariantDeviceProfileTest() {
|
||||
/* parentScale= */ 1.0f,
|
||||
/* taskViewScale= */ 1.0f
|
||||
)
|
||||
assertThat(spyParams.mCurrentDrawnCornerRadius).isEqualTo(display1WindowRadius)
|
||||
assertThat(spyParams.currentDrawnCornerRadius).isEqualTo(display1WindowRadius)
|
||||
|
||||
spyParams.updateCornerRadius(display2Context)
|
||||
spyParams.setProgress(
|
||||
@@ -155,6 +155,6 @@ class FullscreenDrawParamsTest : FakeInvariantDeviceProfileTest() {
|
||||
/* parentScale= */ 1.0f,
|
||||
/* taskViewScale= */ 1.0f,
|
||||
)
|
||||
assertThat(spyParams.mCurrentDrawnCornerRadius).isEqualTo(display2WindowRadius)
|
||||
assertThat(spyParams.currentDrawnCornerRadius).isEqualTo(display2WindowRadius)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user