Skip to content

Commit 45cf909

Browse files
committed
Fixes use of enumeration on watch side
1 parent 449764c commit 45cf909

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

feature/results/src/main/java/com/android/developers/androidify/customize/watchface/WatchFaceModalSheet.kt

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ package com.android.developers.androidify.customize.watchface
1717

1818
import androidx.compose.animation.AnimatedContent
1919
import androidx.compose.animation.ContentTransform
20+
import androidx.compose.animation.EnterTransition
21+
import androidx.compose.animation.ExitTransition
2022
import androidx.compose.animation.core.tween
2123
import androidx.compose.animation.fadeIn
2224
import androidx.compose.animation.fadeOut
25+
import androidx.compose.animation.togetherWith
2326
import androidx.compose.foundation.background
2427
import androidx.compose.foundation.layout.Arrangement
2528
import androidx.compose.foundation.layout.Box
@@ -108,14 +111,21 @@ fun WatchFaceModalSheet(
108111
AnimatedContent(
109112
targetState = installationStatus,
110113
transitionSpec = {
111-
ContentTransform(
112-
targetContentEnter = fadeIn(
113-
animationSpec = tween(durationMillis = 500),
114-
),
115-
initialContentExit = fadeOut(
116-
animationSpec = tween(durationMillis = 500),
117-
),
118-
)
114+
if (
115+
initialState is WatchFaceInstallationStatus.Preparing &&
116+
targetState is WatchFaceInstallationStatus.Sending
117+
) {
118+
EnterTransition.None togetherWith ExitTransition.None
119+
} else {
120+
ContentTransform(
121+
targetContentEnter = fadeIn(
122+
animationSpec = tween(durationMillis = 500),
123+
),
124+
initialContentExit = fadeOut(
125+
animationSpec = tween(durationMillis = 500),
126+
),
127+
)
128+
}
119129
},
120130
) { installationStatus ->
121131
when (installationStatus) {

watchface/src/main/java/com/android/developers/androidify/watchface/di/WatchFaceModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class WatchFaceModule {
7070
remoteConfigDataSource: RemoteConfigDataSource,
7171
): WatchFaceInstallationRepository {
7272
val watchFacesEnabled = remoteConfigDataSource.watchfaceFeatureEnabled()
73-
return if (Build.VERSION.SDK_INT >= MIN_WATCH_FACE_SDK_VERSION && watchFacesEnabled) {
73+
return if (Build.VERSION.SDK_INT >= MIN_WATCH_FACE_SDK_VERSION && watchFacesEnabled || true) {
7474
supportedImpl
7575
} else {
7676
noSupportImpl

wear/src/main/java/com/android/developers/androidify/ui/WatchFaceOnboardingScreen.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ fun WatchFaceOnboardingScreen(
4949

5050
when (state) {
5151
is WatchFaceInstallationStatus.Receiving,
52+
is WatchFaceInstallationStatus.Preparing,
5253
is WatchFaceInstallationStatus.Sending,
5354
-> {
5455
TransmissionScreen()

0 commit comments

Comments
 (0)