Skip to content

Commit

Permalink
feat: Use more appropriate progress values
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Mar 4, 2024
1 parent 1200360 commit 2d7026a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ class MainActivity : FlutterActivity() {
)

if (cancel(patcher::close)) return@Thread
updateProgress(0.1, "Loading patches...", "Loading patches")
updateProgress(0.02, "Loading patches...", "Loading patches")

val patches = patches.filter { patch ->
val isCompatible = patch.compatiblePackages?.any {
Expand All @@ -303,7 +303,7 @@ class MainActivity : FlutterActivity() {
}.toSet()

if (cancel(patcher::close)) return@Thread
updateProgress(0.15, "Executing...", "")
updateProgress(0.05, "Executing...", "")

val patcherResult = patcher.use {
patcher.apply {
Expand All @@ -315,7 +315,7 @@ class MainActivity : FlutterActivity() {
// Update the progress bar every time a patch is executed from 0.15 to 0.7
val totalPatchesCount = patches.size
val progressStep = 0.55 / totalPatchesCount
var progress = 0.15
var progress = 0.05

patcher.apply(false).collect(FlowCollector { patchResult: PatchResult ->
if (cancel(patcher::close)) return@FlowCollector
Expand Down

0 comments on commit 2d7026a

Please sign in to comment.