From 56997df8e20f6c1321e30f54b6af9ef70ebd8a14 Mon Sep 17 00:00:00 2001 From: tapframe <85391825+tapframe@users.noreply.github.com> Date: Sun, 19 Apr 2026 01:43:12 +0530 Subject: [PATCH] fix: android file pickup fix and modal button alignement fix --- composeApp/build.gradle.kts | 1 + .../updater/AndroidAppUpdaterPlatform.kt | 7 ++- .../nuvio/app/features/updater/AppUpdater.kt | 50 +++++++++++++------ 3 files changed, 41 insertions(+), 17 deletions(-) diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index e30777a8..54a4483c 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -316,6 +316,7 @@ android { } } sourceSets.getByName("full") { + manifest.srcFile("src/androidFull/AndroidManifest.xml") java.srcDir(fullCommonSourceDir) } packaging { diff --git a/composeApp/src/androidFull/kotlin/com/nuvio/app/features/updater/AndroidAppUpdaterPlatform.kt b/composeApp/src/androidFull/kotlin/com/nuvio/app/features/updater/AndroidAppUpdaterPlatform.kt index 0f37aa02..72c2e50e 100644 --- a/composeApp/src/androidFull/kotlin/com/nuvio/app/features/updater/AndroidAppUpdaterPlatform.kt +++ b/composeApp/src/androidFull/kotlin/com/nuvio/app/features/updater/AndroidAppUpdaterPlatform.kt @@ -91,7 +91,12 @@ object AndroidAppUpdaterPlatform { fun canRequestPackageInstalls(): Boolean { val context = appContext ?: return false return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - context.packageManager.canRequestPackageInstalls() + try { + context.packageManager.canRequestPackageInstalls() + } catch (_: SecurityException) { + + true + } } else { true } diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/updater/AppUpdater.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/updater/AppUpdater.kt index 575c6a0c..7711facb 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/updater/AppUpdater.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/updater/AppUpdater.kt @@ -536,25 +536,12 @@ fun AppUpdaterHost( } } - Row( + Column( modifier = Modifier.fillMaxWidth(), - horizontalArrangement = Arrangement.spacedBy(10.dp, Alignment.End), - verticalAlignment = Alignment.CenterVertically, + verticalArrangement = Arrangement.spacedBy(10.dp), ) { - if (state.isUpdateAvailable && !state.isDownloading && !state.showUnknownSourcesDialog) { - OutlinedButton(onClick = controller::ignoreThisVersion) { - Text("Ignore") - } - } - - OutlinedButton( - onClick = controller::dismissDialog, - enabled = !state.isDownloading, - ) { - Text(if (state.isDownloading) "Downloading" else "Later") - } - Button( + modifier = Modifier.fillMaxWidth(), onClick = { when { state.showUnknownSourcesDialog -> controller.resumeInstallation() @@ -577,6 +564,37 @@ fun AppUpdaterHost( }, ) } + + if (state.isUpdateAvailable && !state.isDownloading && !state.showUnknownSourcesDialog) { + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.spacedBy(10.dp), + verticalAlignment = Alignment.CenterVertically, + ) { + OutlinedButton( + modifier = Modifier.weight(1f), + onClick = controller::ignoreThisVersion, + ) { + Text("Ignore") + } + + OutlinedButton( + modifier = Modifier.weight(1f), + onClick = controller::dismissDialog, + enabled = !state.isDownloading, + ) { + Text(if (state.isDownloading) "Downloading" else "Later") + } + } + } else { + OutlinedButton( + modifier = Modifier.fillMaxWidth(), + onClick = controller::dismissDialog, + enabled = !state.isDownloading, + ) { + Text(if (state.isDownloading) "Downloading" else "Later") + } + } } } }