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") {
|
sourceSets.getByName("full") {
|
||||||
|
manifest.srcFile("src/androidFull/AndroidManifest.xml")
|
||||||
java.srcDir(fullCommonSourceDir)
|
java.srcDir(fullCommonSourceDir)
|
||||||
}
|
}
|
||||||
packaging {
|
packaging {
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,12 @@ object AndroidAppUpdaterPlatform {
|
||||||
fun canRequestPackageInstalls(): Boolean {
|
fun canRequestPackageInstalls(): Boolean {
|
||||||
val context = appContext ?: return false
|
val context = appContext ?: return false
|
||||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
try {
|
||||||
context.packageManager.canRequestPackageInstalls()
|
context.packageManager.canRequestPackageInstalls()
|
||||||
|
} catch (_: SecurityException) {
|
||||||
|
|
||||||
|
true
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -536,25 +536,12 @@ fun AppUpdaterHost(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row(
|
Column(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
horizontalArrangement = Arrangement.spacedBy(10.dp, Alignment.End),
|
verticalArrangement = Arrangement.spacedBy(10.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
) {
|
) {
|
||||||
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(
|
Button(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
onClick = {
|
onClick = {
|
||||||
when {
|
when {
|
||||||
state.showUnknownSourcesDialog -> controller.resumeInstallation()
|
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