Show update button in Explore menu when installed version is not the latest
This commit is contained in:
@@ -260,24 +260,35 @@ fun Explore() {
|
|||||||
sourceInfo.version
|
sourceInfo.version
|
||||||
) {
|
) {
|
||||||
DownloadApkAction(actionState) {
|
DownloadApkAction(actionState) {
|
||||||
IconButton(onClick = {
|
if (localSources[sourceInfo.name]?.version != sourceInfo.version) {
|
||||||
if (sourceInfo.name in localSources) {
|
TextButton(onClick = {
|
||||||
context.startActivity(
|
coroutineScope.launch {
|
||||||
Intent(
|
val file = actionState.download(sourceInfo)
|
||||||
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
|
context.launchApkInstaller(file)
|
||||||
Uri.fromParts("package", localSources[sourceInfo.name]!!.packagePath, null)
|
}
|
||||||
)
|
}) {
|
||||||
)
|
Text("UPDATE")
|
||||||
} else coroutineScope.launch {
|
}
|
||||||
val file = actionState.download(sourceInfo)
|
} else {
|
||||||
context.launchApkInstaller(file)
|
IconButton(onClick = {
|
||||||
|
if (sourceInfo.name in localSources) {
|
||||||
|
context.startActivity(
|
||||||
|
Intent(
|
||||||
|
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
|
||||||
|
Uri.fromParts("package", localSources[sourceInfo.name]!!.packagePath, null)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
} else coroutineScope.launch {
|
||||||
|
val file = actionState.download(sourceInfo)
|
||||||
|
context.launchApkInstaller(file)
|
||||||
|
}
|
||||||
|
}) {
|
||||||
|
Icon(
|
||||||
|
if (sourceInfo.name !in localSources) Icons.Default.Download
|
||||||
|
else Icons.Outlined.Info,
|
||||||
|
contentDescription = "download"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}) {
|
|
||||||
Icon(
|
|
||||||
if (sourceInfo.name !in localSources) Icons.Default.Download
|
|
||||||
else Icons.Outlined.Info,
|
|
||||||
contentDescription = "download"
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user