Commit a8232031 authored by Alice Wang's avatar Alice Wang Committed by Commit Bot

[Android][WebSignIn] Adjust UI for sign-in general error screen

This CL adjusts the UI for the sign-in general error screen in the web
sign-in flow and add strings needed for the screen. The order of the
view elements in account_picker_bottom_sheet_view.xml are rearranged to
make sure that the height of sign-in general error screen is the same as
the sign-in in progress screen.

Screenshot: https://crbug.com/1114589#c5
Bug: 1114589
Change-Id: I281c59eb7a64f7121cf1a8dcd989a32c37f6a1a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362588Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Reviewed-by: default avatarTanmoy Mollik <triploblastic@chromium.org>
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799765}
parent 01681247
......@@ -71,6 +71,14 @@
android:layout_marginTop="8dp"
layout="@layout/account_picker_row" />
<ProgressBar
android:id="@+id/account_picker_signin_spinner_view"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="center"
android:layout_marginBottom="54dp"
android:visibility="gone" />
<org.chromium.ui.widget.ButtonCompat
android:id="@+id/account_picker_continue_as_button"
style="@style/FilledButton.Flat"
......@@ -84,15 +92,6 @@
android:singleLine="true"
android:text="@string/signin_promo_continue_as" />
<ProgressBar
android:id="@+id/account_picker_signin_spinner_view"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="center"
android:layout_marginTop="32dp"
android:layout_marginBottom="132dp"
android:visibility="gone" />
<include
android:id="@+id/incognito_interstitial_bottom_sheet_view"
android:layout_width="match_parent"
......
......@@ -124,12 +124,15 @@ class AccountPickerBottomSheetView implements BottomSheetContent {
*/
void setUpSignInInProgressView() {
mAccountPickerTitle.setText(R.string.signin_account_picker_bottom_sheet_signin_title);
mAccountPickerSubtitle.setVisibility(View.GONE);
mContentView.findViewById(R.id.account_picker_horizontal_divider).setVisibility(View.GONE);
mSelectedAccountView.setVisibility(View.GONE);
mContinueAsButton.setVisibility(View.GONE);
mAccountPickerSubtitle.setVisibility(View.INVISIBLE);
// Set the account picker subtitle text in case there's an error.
mAccountPickerSubtitle.setText(R.string.signin_account_picker_general_error_subtitle);
mContentView.findViewById(R.id.account_picker_signin_spinner_view)
.setVisibility(View.VISIBLE);
mContinueAsButton.setVisibility(View.INVISIBLE);
mContentView.findViewById(R.id.account_picker_horizontal_divider).setVisibility(View.GONE);
mSelectedAccountView.setVisibility(View.GONE);
}
void setUpIncognitoInterstitialView() {
......@@ -148,12 +151,15 @@ class AccountPickerBottomSheetView implements BottomSheetContent {
* Sets up the view for sign-in general error.
*/
void setUpSignInGeneralErrorView() {
// TODO(https://crbug.com/1114589): Add subtitle string for sign-in general error
mAccountPickerTitle.setText(R.string.signin_account_picker_bottom_sheet_error_title);
mAccountPickerSubtitle.setVisibility(View.VISIBLE);
mContentView.findViewById(R.id.account_picker_signin_spinner_view)
.setVisibility(View.INVISIBLE);
mContinueAsButton.setVisibility(View.VISIBLE);
mContinueAsButton.setText(R.string.signin_account_picker_general_error_button);
mContentView.findViewById(R.id.account_picker_horizontal_divider).setVisibility(View.GONE);
mSelectedAccountView.setVisibility(View.GONE);
mContentView.findViewById(R.id.account_picker_signin_spinner_view).setVisibility(View.GONE);
}
@Override
......
......@@ -301,7 +301,12 @@ public class AccountPickerBottomSheetTest {
&& bottomSheetView.findViewById(R.id.account_picker_bottom_sheet_subtitle)
.isShown();
});
onView(withId(R.id.account_picker_bottom_sheet_subtitle)).check(matches(isDisplayed()));
onView(withText(R.string.signin_account_picker_bottom_sheet_error_title))
.check(matches(isDisplayed()));
onView(withText(R.string.signin_account_picker_general_error_subtitle))
.check(matches(isDisplayed()));
onView(withText(R.string.signin_account_picker_general_error_button))
.check(matches(isDisplayed()));
onView(withId(R.id.account_picker_horizontal_divider)).check(matches(not(isDisplayed())));
onView(withId(R.id.account_picker_selected_account)).check(matches(not(isDisplayed())));
onView(withId(R.id.account_picker_signin_spinner_view)).check(matches(not(isDisplayed())));
......
......@@ -2428,6 +2428,15 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_SIGNIN_ACCOUNT_PICKER_BOTTOM_SHEET_SIGNIN_TITLE" desc="The title of the account picker bottom sheet tells that the user is in the process of signing in with their Google Account">
Signing in...
</message>
<message name="IDS_SIGNIN_ACCOUNT_PICKER_BOTTOM_SHEET_ERROR_TITLE" desc="The title of the account picker bottom sheet when something went wrong in the sign-in process">
Something went wrong
</message>
<message name="IDS_SIGNIN_ACCOUNT_PICKER_GENERAL_ERROR_SUBTITLE" desc="The subtitle of the account picker bottom sheet when something went wrong in the sign-in process">
Chrome couldn’t verify your information
</message>
<message name="IDS_SIGNIN_ACCOUNT_PICKER_GENERAL_ERROR_BUTTON" desc="Button text of the account picker bottom sheet when something went wrong in the sign-in process. User can try again if they click it.">
Try again
</message>
<!-- Personalized Signin Promos Strings -->
<message name="IDS_SIGNIN_PROMO_CONTINUE_AS" desc="Button that the user can press to login without asking the password and continue using Chrome with this acccount.">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment