From 199d0e800102604e0d4a926ccb56983d2cc84dc5 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Wed, 5 Jun 2024 21:28:49 +0100 Subject: [PATCH] fix: possible delay start for `WorkRequest` causing UI inconsistency --- .../ooniprobe/activity/MainActivity.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/openobservatory/ooniprobe/activity/MainActivity.java b/app/src/main/java/org/openobservatory/ooniprobe/activity/MainActivity.java index 321702f0a..2cd31860e 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/activity/MainActivity.java +++ b/app/src/main/java/org/openobservatory/ooniprobe/activity/MainActivity.java @@ -237,6 +237,13 @@ private void onManualUpdatesFetchComplete(WorkInfo workInfo) { if (workInfo != null) { if (workInfo.getProgress().getInt(PROGRESS, -1) >= 0) { binding.reviewUpdateNotificationFragment.setVisibility(View.VISIBLE); + getSupportFragmentManager() + .beginTransaction() + .add( + R.id.review_update_notification_fragment, + OONIRunDynamicProgressBar.newInstance(ProgressType.UPDATE_LINK, null), + OONIRunDynamicProgressBar.getTAG() + "_review_update_enqueued_notification" + ).commit(); } switch (workInfo.getState()) { case SUCCEEDED -> { @@ -274,14 +281,6 @@ public void onCloseButtonClicked() { ).commit(); } - case ENQUEUED -> getSupportFragmentManager() - .beginTransaction() - .add( - R.id.review_update_notification_fragment, - OONIRunDynamicProgressBar.newInstance(ProgressType.UPDATE_LINK, null), - OONIRunDynamicProgressBar.getTAG() + "_review_update_enqueued_notification" - ).commit(); - case FAILED -> Snackbar.make( binding.getRoot(), R.string.Modal_Error,