File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
auth/src/main/java/com/firebase/ui/auth/ui Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 21
21
@ RestrictTo (RestrictTo .Scope .LIBRARY_GROUP )
22
22
public class InvisibleActivityBase extends HelperActivityBase {
23
23
24
+ // Minimum time that the spinner will stay on screen, once it is shown.
24
25
private static final long MIN_SPINNER_MS = 750 ;
25
26
26
27
private Handler mHandler = new Handler ();
27
28
private MaterialProgressBar mProgressBar ;
29
+
30
+ // Last time that the progress bar was actually shown
28
31
private long mLastShownTime = 0 ;
29
32
30
33
@ Override
@@ -80,6 +83,13 @@ public void run() {
80
83
});
81
84
}
82
85
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
+ */
83
93
private void doAfterTimeout (Runnable runnable ) {
84
94
long currentTime = System .currentTimeMillis ();
85
95
long diff = currentTime - mLastShownTime ;
You can’t perform that action at this time.
0 commit comments