diff --git a/app/build.gradle.kts b/app/build.gradle.kts index cc64bc36..32b901b5 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -5,6 +5,7 @@ plugins { alias(libs.plugins.kotlinSerialization) alias(libs.plugins.kotlinParcelize) alias(libs.plugins.kotlinKapt) + alias(libs.plugins.ksp) id("com.google.gms.google-services") id("com.google.firebase.crashlytics") } diff --git a/app/src/main/java/com/twofasapp/ui/main/MainNavHost.kt b/app/src/main/java/com/twofasapp/ui/main/MainNavHost.kt index 1d2e7208..dbd98765 100644 --- a/app/src/main/java/com/twofasapp/ui/main/MainNavHost.kt +++ b/app/src/main/java/com/twofasapp/ui/main/MainNavHost.kt @@ -17,6 +17,7 @@ import androidx.navigation.compose.NavHost import com.google.accompanist.navigation.material.BottomSheetNavigator import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi import com.google.accompanist.navigation.material.bottomSheet +import com.twofasapp.android.navigation.NavAnimation import com.twofasapp.android.navigation.clearGraphBackStack import com.twofasapp.android.navigation.intentFor import com.twofasapp.android.navigation.withArg @@ -84,7 +85,9 @@ internal fun MainNavHost( NavHost( navController = navController, - startDestination = startDestination + startDestination = startDestination, + enterTransition = NavAnimation.Enter, + exitTransition = NavAnimation.Exit, ) { startupNavigation( diff --git a/buildlogic/src/main/java/com/twofasapp/buildlogic/version/AppConfig.kt b/buildlogic/src/main/java/com/twofasapp/buildlogic/version/AppConfig.kt index 65b61eca..3471dfa8 100644 --- a/buildlogic/src/main/java/com/twofasapp/buildlogic/version/AppConfig.kt +++ b/buildlogic/src/main/java/com/twofasapp/buildlogic/version/AppConfig.kt @@ -2,8 +2,8 @@ package com.twofasapp.buildlogic.version object AppConfig { const val minSdk = 23 - const val targetSdk = 33 - const val compileSdk = 33 + const val targetSdk = 34 + const val compileSdk = 34 private const val verMajor = 4 private const val verMinor = 6 diff --git a/core/android/src/main/java/com/twofasapp/android/navigation/NavAnimation.kt b/core/android/src/main/java/com/twofasapp/android/navigation/NavAnimation.kt new file mode 100644 index 00000000..8f845732 --- /dev/null +++ b/core/android/src/main/java/com/twofasapp/android/navigation/NavAnimation.kt @@ -0,0 +1,18 @@ +package com.twofasapp.android.navigation + +import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.EnterTransition +import androidx.compose.animation.ExitTransition +import androidx.compose.animation.core.tween +import androidx.compose.animation.fadeIn +import androidx.compose.animation.fadeOut +import androidx.navigation.NavBackStackEntry + +object NavAnimation { + + val Enter: (AnimatedContentTransitionScope.() -> EnterTransition) = + { fadeIn(animationSpec = tween(250)) } + + val Exit: (AnimatedContentTransitionScope.() -> ExitTransition) = + { fadeOut(animationSpec = tween(250)) } +} \ No newline at end of file diff --git a/core/designsystem/src/main/java/com/twofasapp/designsystem/TwIcons.kt b/core/designsystem/src/main/java/com/twofasapp/designsystem/TwIcons.kt index c55dfd18..4e352190 100644 --- a/core/designsystem/src/main/java/com/twofasapp/designsystem/TwIcons.kt +++ b/core/designsystem/src/main/java/com/twofasapp/designsystem/TwIcons.kt @@ -64,4 +64,5 @@ object TwIcons { val Screenshot @Composable get() = painterResource(R.drawable.ic_screenshot) val Keyboard @Composable get() = painterResource(R.drawable.ic_keyboard) val Panorama @Composable get() = painterResource(R.drawable.ic_panorama) + val Guide @Composable get() = painterResource(R.drawable.ic_guide) } \ No newline at end of file diff --git a/core/designsystem/src/main/res/drawable/ic_guide.xml b/core/designsystem/src/main/res/drawable/ic_guide.xml new file mode 100644 index 00000000..22928ab3 --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_guide.xml @@ -0,0 +1,9 @@ + + + diff --git a/core/locale/src/main/java/com/twofasapp/locale/Strings.kt b/core/locale/src/main/java/com/twofasapp/locale/Strings.kt index 7cccf394..dcc7011e 100644 --- a/core/locale/src/main/java/com/twofasapp/locale/Strings.kt +++ b/core/locale/src/main/java/com/twofasapp/locale/Strings.kt @@ -167,6 +167,7 @@ class Strings(c: Context) { val addDescription = c.getString(R.string.tokens__add_description) val addOtherMethods = c.getString(R.string.tokens__add_other_methods) val addEnterManual = c.getString(R.string.tokens__add_enter_manual) + val addWithGuide = c.getString(R.string.tokens__add_with_guide) val addFromGallery = c.getString(R.string.tokens__add_from_gallery) val addSuccessTitle = c.getString(R.string.tokens__add_success_title) val addSuccessDescription = c.getString(R.string.tokens__add_success_description) diff --git a/feature/home/src/main/java/com/twofasapp/feature/home/ui/services/add/AddServiceModal.kt b/feature/home/src/main/java/com/twofasapp/feature/home/ui/services/add/AddServiceModal.kt index 94227aa9..8993142a 100644 --- a/feature/home/src/main/java/com/twofasapp/feature/home/ui/services/add/AddServiceModal.kt +++ b/feature/home/src/main/java/com/twofasapp/feature/home/ui/services/add/AddServiceModal.kt @@ -6,6 +6,7 @@ import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable import androidx.navigation.compose.rememberNavController import androidx.navigation.navArgument +import com.twofasapp.android.navigation.NavAnimation import com.twofasapp.data.services.domain.RecentlyAddedService import com.twofasapp.designsystem.common.Modal import com.twofasapp.feature.home.ui.services.add.manual.AddServiceManualScreen @@ -25,7 +26,9 @@ fun AddServiceModal( Modal { NavHost( navController = navController, - startDestination = "main" + startDestination = "main", + enterTransition = NavAnimation.Enter, + exitTransition = NavAnimation.Exit, ) { composable(route = "main") { diff --git a/feature/home/src/main/java/com/twofasapp/feature/home/ui/services/add/scan/AddServiceScanScreen.kt b/feature/home/src/main/java/com/twofasapp/feature/home/ui/services/add/scan/AddServiceScanScreen.kt index c0bbdeb2..1c0a7457 100644 --- a/feature/home/src/main/java/com/twofasapp/feature/home/ui/services/add/scan/AddServiceScanScreen.kt +++ b/feature/home/src/main/java/com/twofasapp/feature/home/ui/services/add/scan/AddServiceScanScreen.kt @@ -41,6 +41,7 @@ import com.twofasapp.designsystem.common.TwCenterTopAppBar import com.twofasapp.designsystem.common.TwTextButton import com.twofasapp.designsystem.dialog.ConfirmDialog import com.twofasapp.designsystem.dialog.InfoDialog +import com.twofasapp.designsystem.ktx.LocalBackDispatcher import com.twofasapp.designsystem.ktx.settingsIntent import com.twofasapp.designsystem.settings.SettingsLink import com.twofasapp.feature.qrscan.QrScan @@ -56,6 +57,7 @@ internal fun AddServiceScanScreen( ) { val uiState by viewModel.uiState.collectAsStateWithLifecycle() val context = LocalContext.current + val backHandler = LocalBackDispatcher val singlePhotoPickerLauncher = rememberLauncherForActivityResult( contract = ActivityResultContracts.PickVisualMedia(), onResult = { uri -> uri?.let { viewModel.onLoadFromGallery(it) } } @@ -154,6 +156,11 @@ internal fun AddServiceScanScreen( ) } + SettingsLink( + title = TwLocale.strings.addWithGuide, + icon = TwIcons.Guide + ) { backHandler.onBackPressed() } + Spacer(modifier = Modifier.height(16.dp)) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7fd53694..e60ebb09 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,22 +1,22 @@ [versions] -accompanist = "0.31.3-beta" -agp = "8.1.0-rc01" -coil = "2.3.0" -compose = "1.5.0-beta01" +accompanist = "0.31.6-rc" +agp = "8.2.0-alpha15" +coil = "2.4.0" +compose = "1.5.0" composeActivity = "1.7.2" -composeCompiler = "1.4.7" +composeCompiler = "1.5.1" core = "1.10.1" espresso = "3.5.1" -koin = "3.4.1" -koinAndroid = "3.4.5" -kotest = "5.5.5" -kotlin = "1.8.21" -kotlinCoroutines = "1.6.4" -kotlinKsp = "1.8.21-1.0.11" +koin = "3.4.3" +koinAndroid = "3.4.6" +kotest = "5.6.2" +kotlin = "1.9.0" +kotlinCoroutines = "1.7.3" +kotlinKsp = "1.9.0-1.0.13" ktlint = "3.12.0" -ktor = "2.3.0" -material3 = "1.2.0-alpha02" -room = "2.5.1" +ktor = "2.3.3" +material3 = "1.2.0-alpha04" +room = "2.5.2" viewModel = "2.6.1" junit = "4.13.2" androidx-test-ext-junit = "1.1.5" @@ -56,7 +56,7 @@ koinTestJunit = { module = "io.insert-koin:koin-test-junit4", version.ref = "koi kotest = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" } kotlinCoroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinCoroutines" } kotlinCoroutinesTest = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinCoroutines" } -kotlinSerialization = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1" +kotlinSerialization = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1" kotlinTestJunit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" } ktorAuth = { module = "io.ktor:ktor-client-auth", version.ref = "ktor" } ktorContentNegotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } @@ -68,12 +68,12 @@ material = "com.google.android.material:material:1.9.0" material3 = { module = "androidx.compose.material3:material3", version.ref = "material3" } material3Window = { module = "androidx.compose.material3:material3-window-size-class", version.ref = "material3" } mockk = "io.mockk:mockk:1.13.2" -navigationCompose = "androidx.navigation:navigation-compose:2.6.0-rc02" +navigationCompose = "androidx.navigation:navigation-compose:2.7.0" robolectric = "org.robolectric:robolectric:4.9" roomCompiler = { module = "androidx.room:room-compiler", version.ref = "room" } roomKtx = { module = "androidx.room:room-ktx", version.ref = "room" } roomRuntime = { module = "androidx.room:room-runtime", version.ref = "room" } -sharedPrefs = "androidx.preference:preference-ktx:1.2.0" +sharedPrefs = "androidx.preference:preference-ktx:1.2.1" socketIo = "io.socket:socket.io-client:2.1.0" testCore = "androidx.test:core:1.5.0" timber = "com.jakewharton.timber:timber:5.0.1" @@ -110,7 +110,7 @@ lottie = "com.airbnb.android:lottie-compose:5.0.3" protobuf = "com.google.protobuf:protobuf-kotlin-lite:3.19.1" biometric = "androidx.biometric:biometric:1.1.0" coroutinesToRx = "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:1.6.4" -barcodeScanning = "com.google.mlkit:barcode-scanning:17.1.0" +barcodeScanning = "com.google.mlkit:barcode-scanning:17.2.0" camera2 = "androidx.camera:camera-camera2:1.2.3" camera2Lifecycle = "androidx.camera:camera-lifecycle:1.2.3" camera2View = "androidx.camera:camera-view:1.2.3" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0b1eaeec..39174e7f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip \ No newline at end of file diff --git a/persistence/build.gradle.kts b/persistence/build.gradle.kts index fc5250ce..87f4da20 100644 --- a/persistence/build.gradle.kts +++ b/persistence/build.gradle.kts @@ -2,15 +2,14 @@ plugins { alias(libs.plugins.twofasAndroidLibrary) alias(libs.plugins.kotlinKapt) + alias(libs.plugins.ksp) } android { namespace = "com.twofasapp.persistence" - kapt { - arguments { - arg("room.schemaLocation", "$projectDir/schemas") - } + ksp { + arg("room.schemaLocation", "$projectDir/schemas") } } @@ -26,5 +25,5 @@ dependencies { implementation(libs.bundles.room) implementation(libs.reLinker) - kapt(libs.roomCompiler) + ksp(libs.roomCompiler) } \ No newline at end of file diff --git a/resources/src/main/res/values/colors.xml b/resources/src/main/res/values/colors.xml index b5b0a89d..c3c62101 100644 --- a/resources/src/main/res/values/colors.xml +++ b/resources/src/main/res/values/colors.xml @@ -39,7 +39,7 @@ #61000000 #FFF - #FF3F3F#F + #FFF #F9F9F9 #EEEEEE diff --git a/services/src/main/java/com/twofasapp/services/ui/EditServiceScreenRoute.kt b/services/src/main/java/com/twofasapp/services/ui/EditServiceScreenRoute.kt index e56fe0b4..6e3e9da1 100644 --- a/services/src/main/java/com/twofasapp/services/ui/EditServiceScreenRoute.kt +++ b/services/src/main/java/com/twofasapp/services/ui/EditServiceScreenRoute.kt @@ -6,6 +6,7 @@ import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable import androidx.navigation.compose.navigation import androidx.navigation.compose.rememberNavController +import com.twofasapp.android.navigation.NavAnimation import com.twofasapp.services.ui.advancedsettings.AdvancedSettingsScreen import com.twofasapp.services.ui.changebrand.ChangeBrandScreen import com.twofasapp.services.ui.changelabel.ChangeLabelScreen @@ -40,7 +41,12 @@ internal fun EditServiceScreenRoute( ) { val navHostController = rememberNavController() - NavHost(navHostController, startDestination = ServiceInternalGraph.route) { + NavHost( + navHostController, + startDestination = ServiceInternalGraph.route, + enterTransition = NavAnimation.Enter, + exitTransition = NavAnimation.Exit, + ) { navigation(route = ServiceInternalGraph.route, startDestination = Node.Main.route) { composable(Node.Main.route) {