mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-16 23:12:12 +00:00
fix: android file pickup fix and modal button alignement fix
This commit is contained in:
parent
aa3e3058b9
commit
56997df8e2
3 changed files with 41 additions and 17 deletions
|
|
@ -316,6 +316,7 @@ android {
|
|||
}
|
||||
}
|
||||
sourceSets.getByName("full") {
|
||||
manifest.srcFile("src/androidFull/AndroidManifest.xml")
|
||||
java.srcDir(fullCommonSourceDir)
|
||||
}
|
||||
packaging {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue