mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
feat: Use more appropriate progress values
This commit is contained in:
parent
1200360588
commit
2d7026ac7a
@ -285,7 +285,7 @@ class MainActivity : FlutterActivity() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (cancel(patcher::close)) return@Thread
|
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 patches = patches.filter { patch ->
|
||||||
val isCompatible = patch.compatiblePackages?.any {
|
val isCompatible = patch.compatiblePackages?.any {
|
||||||
@ -303,7 +303,7 @@ class MainActivity : FlutterActivity() {
|
|||||||
}.toSet()
|
}.toSet()
|
||||||
|
|
||||||
if (cancel(patcher::close)) return@Thread
|
if (cancel(patcher::close)) return@Thread
|
||||||
updateProgress(0.15, "Executing...", "")
|
updateProgress(0.05, "Executing...", "")
|
||||||
|
|
||||||
val patcherResult = patcher.use {
|
val patcherResult = patcher.use {
|
||||||
patcher.apply {
|
patcher.apply {
|
||||||
@ -315,7 +315,7 @@ class MainActivity : FlutterActivity() {
|
|||||||
// Update the progress bar every time a patch is executed from 0.15 to 0.7
|
// Update the progress bar every time a patch is executed from 0.15 to 0.7
|
||||||
val totalPatchesCount = patches.size
|
val totalPatchesCount = patches.size
|
||||||
val progressStep = 0.55 / totalPatchesCount
|
val progressStep = 0.55 / totalPatchesCount
|
||||||
var progress = 0.15
|
var progress = 0.05
|
||||||
|
|
||||||
patcher.apply(false).collect(FlowCollector { patchResult: PatchResult ->
|
patcher.apply(false).collect(FlowCollector { patchResult: PatchResult ->
|
||||||
if (cancel(patcher::close)) return@FlowCollector
|
if (cancel(patcher::close)) return@FlowCollector
|
||||||
|
Loading…
Reference in New Issue
Block a user