Skip to content

Commit

Permalink
Merge pull request #132 from tom5079/Pupil-130
Browse files Browse the repository at this point in the history
Pupil-130 [Source] Show progress indicator right away when update button is clicked
  • Loading branch information
tom5079 authored May 1, 2022
2 parents ef4c581 + 7bf3f16 commit 8da98c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/main/java/xyz/quaver/pupil/ui/SourceSelector.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class DownloadApkActionState(override val di: DI) : DIAware {
private set

suspend fun download(sourceInfo: RemoteSourceInfo): File {
progress = 0f

val file = File(app.cacheDir, "apks/${sourceInfo.name}-${sourceInfo.version}.apk").also {
it.parentFile?.mkdirs()
}
Expand All @@ -117,7 +119,7 @@ fun DownloadApkAction(
Modifier.padding(12.dp, 0.dp)
) {
when {
progress.isFinite() ->
progress.isFinite() && progress > 0f ->
CircularProgressIndicator(progress, modifier = Modifier.size(24.dp))
else ->
CircularProgressIndicator(modifier = Modifier.size(24.dp))
Expand Down

0 comments on commit 8da98c5

Please sign in to comment.