mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Prevent progress bar from flickering
This commit is contained in:
@@ -181,8 +181,10 @@ public class ListHabitsRootView extends BaseRootView
|
|||||||
private void updateProgressBar()
|
private void updateProgressBar()
|
||||||
{
|
{
|
||||||
postDelayed(() -> {
|
postDelayed(() -> {
|
||||||
progressBar.setVisibility(
|
int activeTaskCount = runner.getActiveTaskCount();
|
||||||
runner.getActiveTaskCount() > 0 ? VISIBLE : GONE);
|
int newVisibility = activeTaskCount > 0 ? VISIBLE : GONE;
|
||||||
|
if (progressBar.getVisibility() != newVisibility)
|
||||||
|
progressBar.setVisibility(newVisibility);
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user