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