-
Notifications
You must be signed in to change notification settings - Fork 7.4k
refactor(auth): remove RelativeLayout usage #1237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(auth): remove RelativeLayout usage #1237
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with some small questions about changes to button groups.
binding.passwordlessButtons.visibility = View.GONE | ||
binding.signedInButtons.visibility = View.VISIBLE | ||
binding.signOutButton.visibility = View.VISIBLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the right change? We used to hide a group of buttons now you're just hiding one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the change is correct. That group was a LinearLayout containing only a single button, so I removed it and kept the button only.
quickstart-android/auth/app/src/main/res/layout/activity_passwordless.xml
Lines 110 to 130 in 368ff73
<LinearLayout | |
android:id="@+id/signedInButtons" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_centerInParent="true" | |
android:orientation="horizontal" | |
android:paddingLeft="16dp" | |
android:paddingRight="16dp" | |
android:visibility="gone"> | |
<Button | |
android:id="@+id/signOutButton" | |
android:layout_marginStart="@dimen/button_horizontal_margin" | |
android:layout_marginEnd="@dimen/button_horizontal_margin" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_weight="1.0" | |
android:text="@string/sign_out" | |
android:theme="@style/ThemeOverlay.MyDarkButton" /> | |
</LinearLayout> |
auth/app/src/main/java/com/google/firebase/quickstart/auth/kotlin/PasswordlessActivity.kt
Show resolved
Hide resolved
@@ -287,13 +287,13 @@ class PhoneAuthActivity : AppCompatActivity(), View.OnClickListener { | |||
if (user == null) { | |||
// Signed out | |||
binding.phoneAuthFields.visibility = View.VISIBLE | |||
binding.signedInButtons.visibility = View.GONE | |||
binding.signOutButton.visibility = View.GONE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed above, but I double checked:
quickstart-android/auth/app/src/main/res/layout/activity_phone_auth.xml
Lines 121 to 140 in 368ff73
<LinearLayout | |
android:id="@+id/signedInButtons" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_centerInParent="true" | |
android:orientation="horizontal" | |
android:paddingLeft="16dp" | |
android:paddingRight="16dp" | |
android:visibility="gone" | |
android:weightSum="1.0"> | |
<com.google.android.material.button.MaterialButton | |
android:id="@+id/signOutButton" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_weight="1.0" | |
android:text="@string/sign_out" | |
android:theme="@style/ThemeOverlay.MyDarkButton" /> | |
</LinearLayout> |
@rosariopfernandes makes sense, thank you! Also this PR taught me a lot about Guidelines and Groups in ConstraintLayout :-) |
@samtstern I'm glad :) I noticed in your RTDB PR that we could've used a guideline (in activity_sign_in.xml) to center the textfields and replace their fixed width with |
See discussion in #1217
This is a Work-In-Progress:Anonymous Auth
Email Password
Facebook
Firebase UI
Generic IDP
Google
Multi Factor Auth
I changed this one to give it a better look because the buttons were all squeezed in there.
Passwordless
Phone Auth