Prevent progress bar from flickering

This commit is contained in:
2016-09-02 21:03:09 -04:00
parent b5cd4584b2
commit e0df69beb6

View File

@@ -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);
} }
} }