diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 6cec144..aa3f31a 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -126,6 +126,7 @@ kotlin { api(libs.kodein.kodein.di.framework.compose) api(libs.androidx.lifecycle.common) api(libs.androidx.lifecycle.runtime) + api(libs.androidx.lifecycle.runtime.compose) api(libs.ktor.ktor.client.core) api(libs.ktor.ktor.client.logging) api(libs.ktor.ktor.client.content.negotiation) diff --git a/common/src/androidMain/kotlin/com/artemchep/keyguard/android/clipboard/KeyguardClipboardService.kt b/common/src/androidMain/kotlin/com/artemchep/keyguard/android/clipboard/KeyguardClipboardService.kt index 84625d8..5b66246 100644 --- a/common/src/androidMain/kotlin/com/artemchep/keyguard/android/clipboard/KeyguardClipboardService.kt +++ b/common/src/androidMain/kotlin/com/artemchep/keyguard/android/clipboard/KeyguardClipboardService.kt @@ -114,7 +114,7 @@ class KeyguardClipboardService : Service(), DIAware { ) : Args @Parcelize - object Cancel : Args + data object Cancel : Args } private data class CopyValueEvent( diff --git a/common/src/androidMain/kotlin/com/artemchep/keyguard/copy/SubscriptionServiceAndroid.kt b/common/src/androidMain/kotlin/com/artemchep/keyguard/copy/SubscriptionServiceAndroid.kt index cd38d53..ca65839 100644 --- a/common/src/androidMain/kotlin/com/artemchep/keyguard/copy/SubscriptionServiceAndroid.kt +++ b/common/src/androidMain/kotlin/com/artemchep/keyguard/copy/SubscriptionServiceAndroid.kt @@ -44,12 +44,12 @@ class SubscriptionServiceAndroid( private val billingManager: BillingManager, ) : SubscriptionService { companion object { - private val SkuListSubscription = listOf( + private val SkuListSubscription = setOf( "premium", "premium_3m", ) - private val SkuListProduct = listOf( + private val SkuListProduct = setOf( "premium_lifetime", ) } @@ -144,7 +144,7 @@ class SubscriptionServiceAndroid( .run { val existingPurchase = receipts ?.firstOrNull { - SkuListSubscription.intersect(it.products) + it.products.intersect(SkuListSubscription) .isNotEmpty() } if (existingPurchase != null && it.productId !in existingPurchase.products) { diff --git a/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/apppicker/AppPickerScreen.kt b/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/apppicker/AppPickerScreen.kt index 06f2a03..3d12b3c 100644 --- a/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/apppicker/AppPickerScreen.kt +++ b/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/apppicker/AppPickerScreen.kt @@ -232,7 +232,7 @@ fun ChangePasswordScreen( ) { item -> AppItem( modifier = Modifier - .animateItemPlacement(), + .animateItem(), item = item, ) } diff --git a/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/apppicker/AppPickerStateProducer.kt b/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/apppicker/AppPickerStateProducer.kt index 328b034..ab60dd9 100644 --- a/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/apppicker/AppPickerStateProducer.kt +++ b/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/apppicker/AppPickerStateProducer.kt @@ -409,7 +409,7 @@ private fun getApps( ApplicationInfo.FLAG_SYSTEM or ApplicationInfo.FLAG_UPDATED_SYSTEM_APP applicationInfo.flags.and(mask) != 0 } - val label = info.loadLabel(pm)?.toString().orEmpty() + val label = info.loadLabel(pm).toString() val installTime = packageInfo.firstInstallTime AppInfo( packageName = info.activityInfo.packageName, diff --git a/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/biometric/BiometricPromptEffect.kt b/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/biometric/BiometricPromptEffect.kt index ae57fba..4338c50 100644 --- a/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/biometric/BiometricPromptEffect.kt +++ b/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/biometric/BiometricPromptEffect.kt @@ -5,8 +5,8 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.rememberUpdatedState import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.platform.LocalLifecycleOwner import androidx.fragment.app.FragmentActivity +import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.whenResumed import arrow.core.left import arrow.core.right diff --git a/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingPermissionOther.kt b/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingPermissionOther.kt index e0e0f3d..64cb781 100644 --- a/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingPermissionOther.kt +++ b/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingPermissionOther.kt @@ -114,6 +114,7 @@ private fun getPermissionItems(context: Context) = kotlin.run { val result = info .requestedPermissions + .orEmpty() .mapNotNull { permission -> kotlin.runCatching { val permissionInfo = pm.getPermissionInfo(permission, 0) diff --git a/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/qr/ScanQrScreen.kt b/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/qr/ScanQrScreen.kt index 95c1961..4aa7cee 100644 --- a/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/qr/ScanQrScreen.kt +++ b/common/src/androidMain/kotlin/com/artemchep/keyguard/feature/qr/ScanQrScreen.kt @@ -21,10 +21,10 @@ import androidx.compose.runtime.* import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.input.nestedscroll.nestedScroll -import androidx.compose.ui.platform.LocalLifecycleOwner import androidx.compose.ui.unit.dp import androidx.compose.ui.viewinterop.AndroidView import androidx.core.content.ContextCompat +import androidx.lifecycle.compose.LocalLifecycleOwner import com.artemchep.keyguard.feature.navigation.NavigationIcon import com.artemchep.keyguard.feature.navigation.RouteResultTransmitter import com.artemchep.keyguard.res.Res @@ -172,7 +172,7 @@ private fun ScanQrCamera( val preview = Preview.Builder() .build() .also { - it.setSurfaceProvider(previewView.surfaceProvider) + it.surfaceProvider = previewView.surfaceProvider } val imageAnalysis = ImageAnalysis.Builder() .setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST) diff --git a/common/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml b/common/src/androidMain/res/mipmap-anydpi/ic_launcher.xml similarity index 100% rename from common/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml rename to common/src/androidMain/res/mipmap-anydpi/ic_launcher.xml diff --git a/common/src/androidMain/res/xml/network_configuration.xml b/common/src/androidMain/res/xml/network_configuration.xml index 03fd745..932d7a4 100644 --- a/common/src/androidMain/res/xml/network_configuration.xml +++ b/common/src/androidMain/res/xml/network_configuration.xml @@ -1,13 +1,17 @@ - + - + - +