Skip to content

Commit 23b5600

Browse files
committed
Clarifying comments
Change-Id: Id976c22c8a9a820377940a953265484bf6e1dfae
1 parent f24d3a7 commit 23b5600

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

auth/src/main/java/com/firebase/ui/auth/ui/InvisibleActivityBase.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@
2121
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
2222
public class InvisibleActivityBase extends HelperActivityBase {
2323

24+
// Minimum time that the spinner will stay on screen, once it is shown.
2425
private static final long MIN_SPINNER_MS = 750;
2526

2627
private Handler mHandler = new Handler();
2728
private MaterialProgressBar mProgressBar;
29+
30+
// Last time that the progress bar was actually shown
2831
private long mLastShownTime = 0;
2932

3033
@Override
@@ -80,6 +83,13 @@ public void run() {
8083
});
8184
}
8285

86+
/**
87+
* For certain actions (like finishing or hiding the progress dialog) we want to make sure
88+
* that we have shown the progress state for at least MIN_SPINNER_MS to prevent flickering.
89+
*
90+
* This method performs some action after the window has passed, or immediately if we have
91+
* already waited longer than that.
92+
*/
8393
private void doAfterTimeout(Runnable runnable) {
8494
long currentTime = System.currentTimeMillis();
8595
long diff = currentTime - mLastShownTime;

0 commit comments

Comments
 (0)