Skip to content

Commit

Permalink
update versions
Browse files Browse the repository at this point in the history
  • Loading branch information
avan1235 committed Mar 3, 2024
1 parent e9f2c39 commit 1a5c37b
Show file tree
Hide file tree
Showing 20 changed files with 90 additions and 75 deletions.
2 changes: 0 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask

plugins {
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.compose.multiplatform) apply false
alias(libs.plugins.parcelize.darwin) apply false
alias(libs.plugins.moko.resources) apply false

alias(libs.plugins.gradle.versions) apply true
Expand Down
4 changes: 2 additions & 2 deletions desktopApp/compose-desktop.pro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-keep class com.arkivanov.decompose.extensions.compose.jetbrains.mainthread.SwingMainThreadChecker
-keep class com.arkivanov.decompose.extensions.compose.mainthread.SwingMainThreadChecker
-keep class kotlinx.coroutines.swing.SwingDispatcherFactory
-keep class org.bridj.** { *; }
-keep class io.ktor.serialization.kotlinx.json.KotlinxSerializationJsonExtensionProvider { *; }
Expand Down Expand Up @@ -26,7 +26,7 @@
kotlinx.serialization.KSerializer serializer(...);
}

-dontwarn com.arkivanov.decompose.extensions.compose.jetbrains.pages.**
-dontwarn com.arkivanov.decompose.extensions.compose.pages.**
-dontwarn org.xml.sax.**
-dontwarn javax.xml.**
-dontwarn org.w3c.dom.**
Expand Down
23 changes: 9 additions & 14 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# @keep
android-compileSdk = "34"
# @pin
android-gradle-plugin = "8.1.2"
android-gradle-plugin = "8.2.2"
# @keep
android-minSdk = "26"
# @keep
Expand All @@ -15,11 +15,11 @@ androidx-core-ktx = "1.12.0"
androidx-crypto = "1.1.0-alpha05"
barcodeScanning = "17.2.0"
buffer = "1.3.6"
compose = "1.5.12"
compose-extensions = "1.5.11.0"
decompose = "2.2.2-compose-experimental"
compose = "1.6.0-rc02"
compose-extensions = "1.6.0-rc02.0"
decompose = "3.0.0-alpha08"
encoding = "2.0.0"
essenty = "1.3.0"
essenty = "2.0.0-alpha07"
gradle-versions = "0.51.0"
kermit = "2.0.0-RC5"
koin = "3.5.0"
Expand All @@ -29,21 +29,20 @@ kotlin = "1.9.22"
kotlincrypto-hash = "0.3.0"
kotlincrypto-macs = "0.3.0"
kotlincrypto-secure-random = "0.1.0"
kotlinx-coroutines = "1.7.3"
kotlinx-coroutines = "1.8.0"
kotlinx-datetime = "0.5.0"
kotlinx-serialization = "1.6.2"
ktor = "2.3.7"
ktor = "2.3.8"
moko-resources = "0.23.0"
multiplatform-settings = "1.1.1"
parcelize-darwin = "0.2.3"
uri-kmp = "0.0.15"
uuid = "0.8.2"
version-catalog-update = "0.8.4"
# @keep
versionCode = "19"
webcamCapture = "0.3.12"
webcamCaptureDriverNative = "1.0.0"
zxing-core = "3.5.2"
zxing-core = "3.5.3"

[libraries]
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity-compose" }
Expand All @@ -56,11 +55,10 @@ compose-extensions-camera-permission = { module = "in.procyk.compose:camera-perm
compose-extensions-camera-qr = { module = "in.procyk.compose:camera-qr", version.ref = "compose-extensions" }
compose-extensions-util = { module = "in.procyk.compose:util", version.ref = "compose-extensions" }
decompose = { module = "com.arkivanov.decompose:decompose", version.ref = "decompose" }
decompose-extensionsComposeJetbrains = { module = "com.arkivanov.decompose:extensions-compose-jetbrains", version.ref = "decompose" }
decompose-extensionsCompose = { module = "com.arkivanov.decompose:extensions-compose", version.ref = "decompose" }
encoding-base32 = { module = "io.matthewnelson.encoding:base32", version.ref = "encoding" }
essenty-instanceKeeper = { module = "com.arkivanov.essenty:instance-keeper", version.ref = "essenty" }
essenty-lifecycle = { module = "com.arkivanov.essenty:lifecycle", version.ref = "essenty" }
essenty-parcelable = { module = "com.arkivanov.essenty:parcelable", version.ref = "essenty" }
essenty-stateKeeper = { module = "com.arkivanov.essenty:state-keeper", version.ref = "essenty" }
kermit = { module = "co.touchlab:kermit", version.ref = "kermit" }
koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koin-compose" }
Expand All @@ -84,7 +82,6 @@ moko-resoures = { module = "dev.icerock.moko:resources", version.ref = "moko-res
moko-resoures-compose = { module = "dev.icerock.moko:resources-compose", version.ref = "moko-resources" }
multiplatform-settings = { module = "com.russhwolf:multiplatform-settings", version.ref = "multiplatform-settings" }
multiplatform-settings-coroutines = { module = "com.russhwolf:multiplatform-settings-coroutines", version.ref = "multiplatform-settings" }
parcelize-darwinRuntime = { module = "com.arkivanov.parcelize.darwin:runtime", version.ref = "parcelize-darwin" }
uriKmp = { module = "com.eygraber:uri-kmp", version.ref = "uri-kmp" }
uuid = { module = "com.benasher44:uuid", version.ref = "uuid" }
webcam-capture = { module = "com.github.sarxos:webcam-capture", version.ref = "webcamCapture" }
Expand All @@ -98,8 +95,6 @@ android-library = { id = "com.android.library", version.ref = "android-gradle-pl
compose-multiplatform = { id = "org.jetbrains.compose", version.ref = "compose" }
gradle-versions = { id = "com.github.ben-manes.versions", version.ref = "gradle-versions" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
moko-resources = { id = "dev.icerock.mobile.multiplatform-resources", version.ref = "moko-resources" }
parcelize-darwin = { id = "com.arkivanov.parcelize.darwin", version.ref = "parcelize-darwin" }
version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "version-catalog-update" }
4 changes: 2 additions & 2 deletions iosApp/iosApp/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ struct ContentView: View {
var body: some View {
let backgroundColor = Color(
colorScheme == .dark
? SwiftHelpersKt.MD_THEME_DARK_BACKGROUND
: SwiftHelpersKt.MD_THEME_LIGHT_BACKGROUND
? ThemeHelpersKt.MD_THEME_DARK_BACKGROUND
: ThemeHelpersKt.MD_THEME_LIGHT_BACKGROUND
)
ZStack {
backgroundColor
Expand Down
19 changes: 6 additions & 13 deletions iosApp/iosApp/iOSApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import shared
struct iOSApp: App {

init() {
SwiftHelpersKt.doInitIOSKoin()
KoinHelpersKt.doInitIOSKoin()
}

@UIApplicationDelegateAdaptor(AppDelegate.self)
Expand Down Expand Up @@ -33,26 +33,19 @@ struct iOSApp: App {
}
}

private let STATE_KEY: String = "open-otp-saved-state"

class AppDelegate: NSObject, UIApplicationDelegate {

private var rootHolder: RootHolder?

func application(_ application: UIApplication, shouldSaveSecureApplicationState coder: NSCoder) -> Bool {
let savedState = rootHolder!.stateKeeper.save()
CodingKt.encodeParcelable(coder, value: savedState, key: STATE_KEY)
StateKeeperUtilsKt.save(coder: coder, state: rootHolder!.stateKeeper.save())
return true
}

func application(_ application: UIApplication, shouldRestoreSecureApplicationState coder: NSCoder) -> Bool {
do {
let savedState = try CodingKt.decodeParcelable(coder, key: STATE_KEY) as! ParcelableParcelableContainer
rootHolder = RootHolder(savedState: savedState)
return true
} catch {
return false
}
let savedState = StateKeeperUtilsKt.restore(coder: coder)
rootHolder = RootHolder(savedState: savedState)
return true
}

fileprivate func getRootHolder() -> RootHolder {
Expand All @@ -68,7 +61,7 @@ private class RootHolder {
let stateKeeper: StateKeeperDispatcher
let root: OpenOtpAppComponent

init(savedState: ParcelableParcelableContainer?) {
init(savedState: SerializableContainer?) {
lifecycle = LifecycleRegistryKt.LifecycleRegistry()
stateKeeper = StateKeeperDispatcherKt.StateKeeperDispatcher(savedState: savedState)

Expand Down
8 changes: 1 addition & 7 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.compose.multiplatform)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.parcelize.darwin)
alias(libs.plugins.moko.resources)
}

Expand All @@ -28,7 +26,6 @@ kotlin {
export(libs.decompose)
export(libs.essenty.lifecycle)
export(libs.essenty.stateKeeper)
export(libs.parcelize.darwinRuntime)
}
}

Expand Down Expand Up @@ -84,14 +81,13 @@ kotlin {
implementation(libs.multiplatform.settings.coroutines)

api(libs.decompose)
api(libs.decompose.extensionsComposeJetbrains)
api(libs.decompose.extensionsCompose)

implementation(libs.kotlinx.serialization.json)
implementation(libs.kotlinx.serialization.cbor)

api(libs.essenty.lifecycle)
api(libs.essenty.stateKeeper)
api(libs.essenty.parcelable)
api(libs.essenty.instanceKeeper)

api(libs.moko.resoures)
Expand Down Expand Up @@ -137,8 +133,6 @@ kotlin {

dependencies {
implementation(libs.ktor.client.darwin)

api(libs.parcelize.darwinRuntime)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import com.arkivanov.decompose.extensions.compose.jetbrains.stack.Children
import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.slide
import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.stackAnimation
import com.arkivanov.decompose.extensions.compose.jetbrains.subscribeAsState
import com.arkivanov.decompose.extensions.compose.stack.Children
import com.arkivanov.decompose.extensions.compose.stack.animation.slide
import com.arkivanov.decompose.extensions.compose.stack.animation.stackAnimation
import com.arkivanov.decompose.extensions.compose.subscribeAsState
import `in`.procyk.compose.util.OnceLaunchedEffect
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.serialization.builtins.ListSerializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.Search
import androidx.compose.material.icons.filled.Settings
Expand Down Expand Up @@ -88,7 +88,7 @@ internal fun FilteredOtpCodeItems(
},
) {
Icon(
imageVector = Icons.Default.ArrowBack,
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = stringResource(OpenOtpResources.strings.back_icon_name)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ import androidx.compose.animation.core.*
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.DismissDirection.EndToStart
import androidx.compose.material.DismissDirection.StartToEnd
import androidx.compose.material.DismissState
import androidx.compose.material.DismissValue.*
import androidx.compose.material.SwipeToDismiss
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Cached
import androidx.compose.material.icons.filled.ContentCopy
import androidx.compose.material.icons.filled.Delete
import androidx.compose.material.rememberDismissState
import androidx.compose.material3.*
import androidx.compose.material3.DismissDirection.EndToStart
import androidx.compose.material3.DismissDirection.StartToEnd
import androidx.compose.material3.DismissValue.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -71,7 +74,7 @@ internal fun OtpCodeItems(
val currentItem by rememberUpdatedState(item)
val localClipboardManager = LocalClipboardManager.current
val dismissState = rememberDismissState(
confirmValueChange = {
confirmStateChange = {
when (it) {
DismissedToEnd -> localClipboardManager.copyOtpCode(currentItem, currentTimestamp).letTrue()
DismissedToStart -> when (confirmCodeDismiss) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import kotlinx.coroutines.delay
import ml.dev.kotlin.openotp.ui.component.SearchBarDefaults.InputFieldHeight
import kotlin.math.max
import kotlin.math.min
import androidx.compose.foundation.layout.MutableWindowInsets as UnconsumedInsets


@Composable
Expand Down Expand Up @@ -86,7 +87,7 @@ internal fun SearchBar(
else -> shape
}
}
val unconsumedInsets = remember { MutableWindowInsets() }
val unconsumedInsets = remember { UnconsumedInsets() }
val topPadding = remember(density) {
derivedStateOf {
SearchBarVerticalPadding + unconsumedInsets.asPaddingValues(density).calculateTopPadding()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.arkivanov.decompose.extensions.compose.jetbrains.subscribeAsState
import com.arkivanov.decompose.extensions.compose.subscribeAsState
import dev.icerock.moko.resources.compose.stringResource
import ml.dev.kotlin.openotp.component.AddHotpProviderComponent
import ml.dev.kotlin.openotp.component.AddOtpProviderComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.unit.dp
import com.arkivanov.decompose.extensions.compose.jetbrains.subscribeAsState
import com.arkivanov.decompose.extensions.compose.subscribeAsState
import dev.icerock.moko.resources.compose.stringResource
import ml.dev.kotlin.openotp.component.LinkAccountComponent
import ml.dev.kotlin.openotp.shared.OpenOtpResources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.ClipboardManager
import androidx.compose.ui.unit.dp
import com.arkivanov.decompose.extensions.compose.jetbrains.subscribeAsState
import com.arkivanov.decompose.extensions.compose.subscribeAsState
import dev.icerock.moko.resources.compose.stringResource
import `in`.procyk.compose.camera.permission.CameraPermission.Denied
import `in`.procyk.compose.camera.permission.CameraPermission.Granted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.arkivanov.decompose.extensions.compose.jetbrains.subscribeAsState
import com.arkivanov.decompose.extensions.compose.subscribeAsState
import dev.icerock.moko.resources.compose.stringResource
import ml.dev.kotlin.openotp.component.OpenOtpAppTheme
import ml.dev.kotlin.openotp.component.SettingsComponent
Expand Down Expand Up @@ -123,7 +123,7 @@ private fun CodesManagementSettingsGroup(component: SettingsComponent) {
checked = confirmOtpDataDelete,
onCheckedChange = component::onConfirmOtpDataDeleteChange,
)
Divider()
HorizontalDivider()

val sortOtpDataBy by component.sortOtpDataBy.subscribeAsState()
NamedDropdownMenu(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ml.dev.kotlin.openotp.ui.theme
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import com.arkivanov.decompose.extensions.compose.jetbrains.subscribeAsState
import com.arkivanov.decompose.extensions.compose.subscribeAsState
import ml.dev.kotlin.openotp.component.OpenOtpAppComponent

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ package ml.dev.kotlin.openotp.util

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
Expand Down Expand Up @@ -57,7 +55,7 @@ internal fun TopBarClickableIconScreen(
) {
ClickableIconButton(onClick = onIconClick) {
Icon(
imageVector = Icons.Default.ArrowBack,
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = stringResource(OpenOtpResources.strings.back_icon_name),
tint = contentColorFor(accent),
)
Expand Down
2 changes: 1 addition & 1 deletion shared/src/desktopMain/kotlin/main.desktop.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import androidx.compose.ui.window.rememberWindowState
import com.arkivanov.decompose.DefaultComponentContext
import com.arkivanov.decompose.extensions.compose.jetbrains.lifecycle.LifecycleController
import com.arkivanov.decompose.extensions.compose.lifecycle.LifecycleController
import com.arkivanov.essenty.lifecycle.LifecycleRegistry
import ml.dev.kotlin.openotp.OpenOtpApp
import ml.dev.kotlin.openotp.component.OpenOtpAppComponentContext
Expand Down
14 changes: 14 additions & 0 deletions shared/src/iosMain/kotlin/KoinHelpers.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import ml.dev.kotlin.openotp.component.OpenOtpAppComponentContext
import ml.dev.kotlin.openotp.initOpenOtpKoin
import ml.dev.kotlin.openotp.util.BiometryAuthenticator
import org.koin.dsl.module

@Suppress("UNUSED")
fun initIOSKoin() {
initOpenOtpKoin {
modules(module {
single { OpenOtpAppComponentContext() }
single { BiometryAuthenticator() }
})
}
}
Loading

0 comments on commit 1a5c37b

Please sign in to comment.