diff options
| author | 2024-10-22 18:10:11 +0100 | |
|---|---|---|
| committer | 2024-10-22 18:12:23 +0100 | |
| commit | 5dde51f0a8e37ab8edac5c5e324adfbf06fd02ee (patch) | |
| tree | 601921b84f5ad3bfd716a264a6bae53e7d9551c0 | |
| parent | 2c5c7d9bff7266528c5e183b90da37d989c36d52 (diff) | |
Passing animation markers between model layers
Also renaming progressStartMark to progressStartMarker, same for end*.
Bug: 369817369
Test: manual, everything works as before
Flag: com.android.systemui.shared.new_touchpad_gestures_tutorial
Change-Id: I5c530e47def6a8089792900b37c762fc8049511f
4 files changed, 17 insertions, 13 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/BackGestureTutorialScreen.kt b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/BackGestureTutorialScreen.kt index 2337ec1801d7..d752f54cb6f7 100644 --- a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/BackGestureTutorialScreen.kt +++ b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/BackGestureTutorialScreen.kt @@ -51,8 +51,8 @@ fun BackGestureTutorialScreen(onDoneButtonClicked: () -> Unit, onBack: () -> Uni remember(recognizer) { GestureFlowAdapter(recognizer).gestureStateAsFlow.map { it.toGestureUiState( - progressStartMark = "", - progressEndMark = "", + progressStartMarker = "", + progressEndMarker = "", successAnimation = R.raw.trackpad_back_success, ) } diff --git a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/GestureTutorialScreen.kt b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/GestureTutorialScreen.kt index e058527ffdbe..2332c0051c69 100644 --- a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/GestureTutorialScreen.kt +++ b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/GestureTutorialScreen.kt @@ -51,20 +51,20 @@ sealed interface GestureUiState { data class InProgress( val progress: Float = 0f, - val progressStartMark: String = "", - val progressEndMark: String = "", + val progressStartMarker: String, + val progressEndMarker: String, ) : GestureUiState } fun GestureState.toGestureUiState( - progressStartMark: String, - progressEndMark: String, + progressStartMarker: String, + progressEndMarker: String, successAnimation: Int, ): GestureUiState { return when (this) { GestureState.NotStarted -> NotStarted is GestureState.InProgress -> - GestureUiState.InProgress(this.progress, progressStartMark, progressEndMark) + GestureUiState.InProgress(this.progress, progressStartMarker, progressEndMarker) is GestureState.Finished -> GestureUiState.Finished(successAnimation) } } @@ -72,8 +72,12 @@ fun GestureState.toGestureUiState( fun GestureUiState.toTutorialActionState(): TutorialActionState { return when (this) { NotStarted -> TutorialActionState.NotStarted - // progress is disabled for now as views are not ready to handle varying progress - is GestureUiState.InProgress -> TutorialActionState.InProgress(progress = 0f) + is GestureUiState.InProgress -> + TutorialActionState.InProgress( + progress = progress, + startMarker = progressStartMarker, + endMarker = progressEndMarker, + ) is Finished -> TutorialActionState.Finished(successAnimation) } } diff --git a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/HomeGestureTutorialScreen.kt b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/HomeGestureTutorialScreen.kt index 55749b2f3656..7c4f33c46211 100644 --- a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/HomeGestureTutorialScreen.kt +++ b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/HomeGestureTutorialScreen.kt @@ -50,8 +50,8 @@ fun HomeGestureTutorialScreen(onDoneButtonClicked: () -> Unit, onBack: () -> Uni remember(recognizer) { GestureFlowAdapter(recognizer).gestureStateAsFlow.map { it.toGestureUiState( - progressStartMark = "", - progressEndMark = "", + progressStartMarker = "", + progressEndMarker = "", successAnimation = R.raw.trackpad_home_success, ) } diff --git a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/RecentAppsGestureTutorialScreen.kt b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/RecentAppsGestureTutorialScreen.kt index d928535f721f..83d9bd1a262a 100644 --- a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/RecentAppsGestureTutorialScreen.kt +++ b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/RecentAppsGestureTutorialScreen.kt @@ -51,8 +51,8 @@ fun RecentAppsGestureTutorialScreen(onDoneButtonClicked: () -> Unit, onBack: () remember(recognizer) { GestureFlowAdapter(recognizer).gestureStateAsFlow.map { it.toGestureUiState( - progressStartMark = "", - progressEndMark = "", + progressStartMarker = "", + progressEndMarker = "", successAnimation = R.raw.trackpad_recent_apps_success, ) } |