Skip to content

Commit 7bf5939

Browse files
fix(authenticator): Update to Compose 1.5.4 (#80)
Co-authored-by: Tyler Roach <[email protected]>
1 parent 1291292 commit 7bf5939

File tree

7 files changed

+20
-22
lines changed

7 files changed

+20
-22
lines changed

authenticator/src/main/java/com/amplifyframework/ui/authenticator/ui/Authenticator.kt

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@
1616
package com.amplifyframework.ui.authenticator.ui
1717

1818
import androidx.compose.animation.AnimatedContent
19-
import androidx.compose.animation.AnimatedContentScope
19+
import androidx.compose.animation.AnimatedContentTransitionScope
2020
import androidx.compose.animation.ContentTransform
21-
import androidx.compose.animation.ExperimentalAnimationApi
2221
import androidx.compose.animation.core.tween
2322
import androidx.compose.animation.fadeIn
2423
import androidx.compose.animation.fadeOut
2524
import androidx.compose.animation.scaleIn
2625
import androidx.compose.animation.scaleOut
27-
import androidx.compose.animation.with
26+
import androidx.compose.animation.togetherWith
2827
import androidx.compose.foundation.layout.Box
2928
import androidx.compose.foundation.layout.Column
3029
import androidx.compose.foundation.rememberScrollState
@@ -76,7 +75,6 @@ import com.amplifyframework.ui.authenticator.util.AuthenticatorMessage
7675
* @param onDisplayMessage Override the default handling for displaying an [AuthenticatorMessage].
7776
* @param content The content shown when the Authenticator reaches the [SignedInState].
7877
*/
79-
@OptIn(ExperimentalAnimationApi::class)
8078
@Composable
8179
fun Authenticator(
8280
modifier: Modifier = Modifier,
@@ -111,7 +109,8 @@ fun Authenticator(
111109
Box(modifier = modifier) {
112110
AnimatedContent(
113111
targetState = stepState,
114-
transitionSpec = { defaultTransition() }
112+
transitionSpec = { defaultTransition() },
113+
label = "AuthenticatorContentTransition"
115114
) { targetState ->
116115
Column(
117116
modifier = Modifier.verticalScroll(rememberScrollState())
@@ -152,16 +151,14 @@ fun Authenticator(
152151
}
153152
}
154153

155-
@OptIn(ExperimentalAnimationApi::class)
156-
internal fun AnimatedContentScope<AuthenticatorStepState>.defaultTransition(): ContentTransform {
154+
internal fun AnimatedContentTransitionScope<AuthenticatorStepState>.defaultTransition(): ContentTransform {
157155
// Show reverse transition when going back to signIn
158156
if (targetState is SignInState && initialState != LoadingState) {
159-
return fadeIn(animationSpec = tween(220, delayMillis = 90)) with
160-
scaleOut(targetScale = 0.92f, animationSpec = tween(90)) +
161-
fadeOut(animationSpec = tween(90))
157+
return fadeIn(animationSpec = tween(220, delayMillis = 90)) togetherWith
158+
scaleOut(targetScale = 0.92f, animationSpec = tween(90)) + fadeOut(animationSpec = tween(90))
162159
}
163160
// Show forward transition for all others
164161
return fadeIn(animationSpec = tween(220, delayMillis = 90)) +
165-
scaleIn(initialScale = 0.92f, animationSpec = tween(220, delayMillis = 90)) with
162+
scaleIn(initialScale = 0.92f, animationSpec = tween(220, delayMillis = 90)) togetherWith
166163
fadeOut(animationSpec = tween(90))
167164
}

build-logic/plugins/src/main/kotlin/AndroidLibraryConventionPlugin.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
7676
}
7777

7878
extension.apply {
79-
compileSdk = 33
79+
compileSdk = 34
8080

8181
buildFeatures {
8282
buildConfig = true
@@ -102,6 +102,7 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
102102
warningsAsErrors = true
103103
abortOnError = true
104104
enable += listOf("UnusedResources", "NewerVersionAvailable")
105+
disable += listOf("GradleDependency")
105106
}
106107

107108
compileOptions {

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[versions]
2-
agp = "8.0.0"
2+
agp = "8.1.3"
33
amplify = "2.14.5"
44
cameraX = "1.2.0"
5-
compose = "1.3.2"
5+
compose = "1.5.4"
66
coroutines = "1.7.3"
77
lifecycle = "2.4.0"
88
kotlin = "1.8.10"
99
ktlint = "11.0.0"
1010
kover = "0.7.2"
1111
kotest = "5.7.1"
12-
material3 = "1.1.0"
12+
material3 = "1.1.2"
1313
paparazzi = "1.2.0"
1414
turbine = "1.0.0"
1515

samples/authenticator/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ plugins {
55

66
android {
77
namespace 'com.amplifyframework.ui.sample.authenticator'
8-
compileSdk 33
8+
compileSdk 34
99

1010
defaultConfig {
1111
applicationId "com.amplifyframework.ui.sample.authenticator"
1212
minSdk 24
13-
targetSdk 33
13+
targetSdk 34
1414
versionCode 1
1515
versionName "1"
1616

samples/authenticator/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
}
99
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
1010
plugins {
11-
id 'com.android.application' version '8.0.0' apply false
12-
id 'com.android.library' version '8.0.0' apply false
11+
id 'com.android.application' version '8.1.2' apply false
12+
id 'com.android.library' version '8.1.2' apply false
1313
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
1414
}

samples/liveness/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66

77
android {
88
namespace 'com.amplifyframework.ui.sample.liveness'
9-
compileSdk 33
9+
compileSdk 34
1010

1111
buildFeatures {
1212
buildConfig true

samples/liveness/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ buildscript {
99
}
1010
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
1111
plugins {
12-
id 'com.android.application' version '8.0.0' apply false
13-
id 'com.android.library' version '8.0.0' apply false
12+
id 'com.android.application' version '8.1.3' apply false
13+
id 'com.android.library' version '8.1.3' apply false
1414
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
1515
id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.10' apply false
1616
}

0 commit comments

Comments
 (0)