Target SKD 34 and bump dependencies

This commit is contained in:
Rafał Kobyłko 2023-08-13 12:59:02 +02:00
parent f2f811a232
commit 9e7d0ca751
14 changed files with 78 additions and 30 deletions

View File

@ -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")
}

View File

@ -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(

View File

@ -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

View File

@ -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<NavBackStackEntry>.() -> EnterTransition) =
{ fadeIn(animationSpec = tween(250)) }
val Exit: (AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition) =
{ fadeOut(animationSpec = tween(250)) }
}

View File

@ -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)
}

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="#FF000000"
android:pathData="M248,688q53.57,0 104.28,12.5T452,738v-427q-45,-30 -97.62,-46.5Q301.76,248 248,248q-38,0 -74.5,9.5T100,281v434q31,-14 70.5,-20.5T248,688ZM512,738q50,-25 98,-37.5T712,688q38,0 78.5,6t69.5,16v-429q-34,-18 -71.82,-25.5Q750.35,248 712,248q-54,0 -104.5,16.5T512,311v427ZM484.5,842q-7.64,0 -16.57,-1.5Q459,839 452,834q-46,-29 -97.86,-46Q302.27,771 248,771q-34.15,0 -67.07,9.5Q148,790 115,801q-33.1,17 -65.55,-2.16Q17,779.68 17,741v-462q0,-25 11,-46.3 11,-21.3 33,-32.7 44,-19.5 90.39,-27.75 46.39,-8.25 94.55,-8.25Q310,164 370,181.5T482,236q51,-36 110,-54t122.06,-18q47.81,0 93.88,9T898,200q22,11.4 33.5,32.7Q943,254 943,279v473q0,36.94 -33,52.97Q877,821 844,801q-32,-12 -64.9,-21 -32.9,-9 -67.03,-9 -53.35,0 -102.21,17.5Q561,806 516,834q-6,5 -14.93,6.5 -8.93,1.5 -16.57,1.5ZM276,499Z"/>
</vector>

View File

@ -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)

View File

@ -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") {

View File

@ -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))
}

View File

@ -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"

View File

@ -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

View File

@ -2,17 +2,16 @@
plugins {
alias(libs.plugins.twofasAndroidLibrary)
alias(libs.plugins.kotlinKapt)
alias(libs.plugins.ksp)
}
android {
namespace = "com.twofasapp.persistence"
kapt {
arguments {
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}
}
}
dependencies {
implementation(project(":core:di"))
@ -26,5 +25,5 @@ dependencies {
implementation(libs.bundles.room)
implementation(libs.reLinker)
kapt(libs.roomCompiler)
ksp(libs.roomCompiler)
}

View File

@ -39,7 +39,7 @@
<color name="simpleEntrySubtitle">#61000000</color>
<color name="fabNeutral">#FFF</color>
<color name="fabNeutralIcon">#FF3F3F#F</color>
<color name="fabNeutralIcon">#FFF</color>
<color name="surface">#F9F9F9</color>
<color name="surfaceVariant">#EEEEEE</color>

View File

@ -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) {