Skip to content

Commit 863746e

Browse files
committed
Theme the spinner
Change-Id: I85f2cc7aa3a0e33234f7819e15fc955633175fb1
1 parent 4b363d4 commit 863746e

File tree

3 files changed

+28
-24
lines changed

3 files changed

+28
-24
lines changed

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
import android.os.Handler;
66
import android.support.annotation.Nullable;
77
import android.support.annotation.RestrictTo;
8+
import android.view.ContextThemeWrapper;
9+
import android.view.Gravity;
810
import android.view.View;
11+
import android.view.ViewGroup;
12+
import android.widget.FrameLayout;
913
import android.widget.ProgressBar;
1014

1115
import com.firebase.ui.auth.R;
@@ -26,10 +30,21 @@ public class InvisibleActivityBase extends HelperActivityBase {
2630
@Override
2731
protected void onCreate(@Nullable Bundle savedInstanceState) {
2832
super.onCreate(savedInstanceState);
29-
setContentView(R.layout.fui_activity_kickoff);
33+
setContentView(R.layout.fui_activity_invisible);
3034

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);
3348
}
3449

3550
@Override
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<FrameLayout
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:id="@+id/invisible_frame"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent">
7+
8+
<!-- See InvisibleActivityBase -->
9+
10+
</FrameLayout>

auth/src/main/res/layout/fui_activity_kickoff.xml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)