Skip to content

Commit f24d3a7

Browse files
committed
Simple review feedback
Change-Id: I7a60cd497bc00b6b9e6f92b44df1527725d96daa
1 parent a97a918 commit f24d3a7

8 files changed

+13
-14
lines changed

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@
1010
import android.view.View;
1111
import android.view.ViewGroup;
1212
import android.widget.FrameLayout;
13-
import android.widget.ProgressBar;
1413

1514
import com.firebase.ui.auth.R;
1615

16+
import me.zhanghai.android.materialprogressbar.MaterialProgressBar;
1717

1818
/**
1919
* Base classes for activities that are just simple overlays.
2020
*/
2121
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
2222
public class InvisibleActivityBase extends HelperActivityBase {
2323

24-
private static final long MIN_SPINNER_MS = 1000;
24+
private static final long MIN_SPINNER_MS = 750;
2525

2626
private Handler mHandler = new Handler();
27-
private ProgressBar mProgressBar;
27+
private MaterialProgressBar mProgressBar;
2828
private long mLastShownTime = 0;
2929

3030
@Override
@@ -33,9 +33,9 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
3333
setContentView(R.layout.fui_activity_invisible);
3434

3535
// Create an indeterminate, circular progress bar in the app's theme
36-
mProgressBar = new ProgressBar(new ContextThemeWrapper(this, getFlowParams().themeId));
36+
mProgressBar = new MaterialProgressBar(new ContextThemeWrapper(this, getFlowParams().themeId));
3737
mProgressBar.setIndeterminate(true);
38-
mProgressBar.setVisibility(View.INVISIBLE);
38+
mProgressBar.setVisibility(View.GONE);
3939

4040
// Set bar to float in the center
4141
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
@@ -64,7 +64,7 @@ public void hideProgress() {
6464
@Override
6565
public void run() {
6666
mLastShownTime = 0;
67-
mProgressBar.setVisibility(View.INVISIBLE);
67+
mProgressBar.setVisibility(View.GONE);
6868
}
6969
});
7070
}
@@ -83,6 +83,10 @@ public void run() {
8383
private void doAfterTimeout(Runnable runnable) {
8484
long currentTime = System.currentTimeMillis();
8585
long diff = currentTime - mLastShownTime;
86+
87+
// 'diff' is how long it's been since we showed the spinner, so in the
88+
// case where diff is greater than our minimum spinner duration then our
89+
// remaining wait time is 0.
8690
long remaining = Math.max(MIN_SPINNER_MS - diff, 0);
8791

8892
mHandler.postDelayed(runnable, remaining);

auth/src/main/res/layout-land/fui_auth_method_picker_layout.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
<me.zhanghai.android.materialprogressbar.MaterialProgressBar
1313
android:id="@+id/top_progress_bar"
1414
style="@style/FirebaseUI.TopProgressBar"
15-
android:visibility="invisible"
1615
app:layout_constraintTop_toTopOf="parent"
17-
tools:visibility="visible"/>
16+
tools:visibility="visible" />
1817

1918
<ImageView
2019
android:id="@+id/logo"

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
<me.zhanghai.android.materialprogressbar.MaterialProgressBar
1313
android:id="@+id/top_progress_bar"
1414
style="@style/FirebaseUI.TopProgressBar"
15-
android:visibility="invisible"
1615
app:layout_constraintTop_toTopOf="parent"
17-
tools:visibility="visible"/>
16+
tools:visibility="visible" />
1817

1918
<ImageView
2019
android:id="@+id/logo"

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<me.zhanghai.android.materialprogressbar.MaterialProgressBar
1515
android:id="@+id/top_progress_bar"
1616
style="@style/FirebaseUI.TopProgressBar"
17-
android:visibility="invisible"
1817
tools:visibility="visible" />
1918

2019
<LinearLayout

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<me.zhanghai.android.materialprogressbar.MaterialProgressBar
1515
android:id="@+id/top_progress_bar"
1616
style="@style/FirebaseUI.TopProgressBar"
17-
android:visibility="invisible"
1817
tools:visibility="visible" />
1918

2019
<LinearLayout

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<me.zhanghai.android.materialprogressbar.MaterialProgressBar
1414
android:id="@+id/top_progress_bar"
1515
style="@style/FirebaseUI.TopProgressBar"
16-
android:visibility="invisible"
1716
tools:visibility="visible" />
1817

1918
<LinearLayout

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<me.zhanghai.android.materialprogressbar.MaterialProgressBar
1515
android:id="@+id/top_progress_bar"
1616
style="@style/FirebaseUI.TopProgressBar"
17-
android:visibility="invisible"
1817
tools:visibility="visible" />
1918

2019
<android.support.constraint.ConstraintLayout

auth/src/main/res/values/styles.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@
234234
<item name="android:layout_width">match_parent</item>
235235
<item name="android:layout_height">4dp</item>
236236
<item name="android:indeterminate">true</item>
237+
<item name="android:visibility">gone</item>
237238
<item name="mpb_progressStyle">horizontal</item>
238239
<item name="mpb_useIntrinsicPadding">false</item>
239240
</style>

0 commit comments

Comments
 (0)