Skip to content

Commit

Permalink
Fix percent string on loading
Browse files Browse the repository at this point in the history
  • Loading branch information
cortinico committed Oct 17, 2024
1 parent c6eff3c commit 3e79aa8
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package it.bitprepared.prbm.mobile.activity

import android.Manifest
import android.app.AlertDialog
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.text.util.Linkify
import android.util.Log
import androidx.activity.result.contract.ActivityResultContracts
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
Expand Down Expand Up @@ -45,7 +43,12 @@ class MainActivity : AppCompatActivity() {
if (error != null) {
binding.progressStatus.text = "Error: $error"
} else {
binding.progressStatus.text = "Caricamento in corso: ${(progress * 100).toInt()}%"
val progressPercent = (progress * 100).toInt()
if (progressPercent < 100) {
binding.progressStatus.text = "Caricamento in corso: ${progressPercent}%"
} else {
binding.progressStatus.text = "Caricamento completato!"
}
}
}
}
Expand Down

0 comments on commit 3e79aa8

Please sign in to comment.