5
5
import android .os .Handler ;
6
6
import android .support .annotation .Nullable ;
7
7
import android .support .annotation .RestrictTo ;
8
+ import android .view .ContextThemeWrapper ;
9
+ import android .view .Gravity ;
8
10
import android .view .View ;
11
+ import android .view .ViewGroup ;
12
+ import android .widget .FrameLayout ;
9
13
import android .widget .ProgressBar ;
10
14
11
15
import com .firebase .ui .auth .R ;
@@ -26,10 +30,21 @@ public class InvisibleActivityBase extends HelperActivityBase {
26
30
@ Override
27
31
protected void onCreate (@ Nullable Bundle savedInstanceState ) {
28
32
super .onCreate (savedInstanceState );
29
- setContentView (R .layout .fui_activity_kickoff );
33
+ setContentView (R .layout .fui_activity_invisible );
30
34
31
- // TODO: Set the color based on passed in theme
32
- mProgressBar = findViewById (R .id .progress_spinner );
35
+ // Create an indeterminate, circular progress bar in the app's theme
36
+ mProgressBar = new ProgressBar (new ContextThemeWrapper (this , getFlowParams ().themeId ));
37
+ mProgressBar .setIndeterminate (true );
38
+ mProgressBar .setVisibility (View .INVISIBLE );
39
+
40
+ // Set bar to float in the center
41
+ FrameLayout .LayoutParams params = new FrameLayout .LayoutParams (
42
+ ViewGroup .LayoutParams .WRAP_CONTENT , ViewGroup .LayoutParams .WRAP_CONTENT );
43
+ params .gravity = Gravity .CENTER ;
44
+
45
+ // Add to the container
46
+ FrameLayout container = findViewById (R .id .invisible_frame );
47
+ container .addView (mProgressBar , params );
33
48
}
34
49
35
50
@ Override
0 commit comments