From 7244b9ef8244f91d39b5ff13b530e68153c70db5 Mon Sep 17 00:00:00 2001 From: Klymentiy Haykov Date: Fri, 20 Mar 2020 13:04:38 -0700 Subject: [PATCH] Revert "Feature/material theme and Dark Theme support (#11469)" (#11486) --- WordPressLoginFlow/build.gradle | 2 +- .../android/login/Login2FaFragment.java | 9 +- .../android/login/LoginEmailFragment.java | 4 +- .../login/LoginHttpAuthDialogFragment.java | 5 +- .../login/LoginMagicLinkRequestFragment.java | 5 + .../LoginSiteAddressHelpDialogFragment.java | 5 +- .../android/login/SignupEmailFragment.java | 4 +- .../login/SignupMagicLinkFragment.java | 5 +- .../widgets/WPBottomSheetDialogFragment.java | 5 + .../login/widgets/WPLoginInputRow.java | 43 ++++++- .../login_magic_link_request_screen.xml | 88 +++++++------- .../login_magic_link_sent_screen.xml | 90 +++++++-------- .../signup_bottom_sheet_dialog.xml | 47 ++++---- .../res/layout-land/signup_magic_link.xml | 85 +++++++------- .../src/main/res/layout/login_2fa_screen.xml | 2 +- .../main/res/layout/login_alert_http_auth.xml | 18 +-- .../layout/login_alert_site_address_help.xml | 14 +-- .../layout/login_email_password_screen.xml | 43 +++---- .../main/res/layout/login_email_screen.xml | 108 ++++++++++-------- .../src/main/res/layout/login_form_screen.xml | 76 ++++++------ .../src/main/res/layout/login_input_row.xml | 28 ++++- .../login_magic_link_request_screen.xml | 46 ++++---- .../layout/login_magic_link_sent_screen.xml | 37 +++--- .../res/layout/login_site_address_screen.xml | 22 ++-- .../layout/login_username_password_screen.xml | 71 ++++++------ .../res/layout/signup_bottom_sheet_dialog.xml | 43 ++++--- .../main/res/layout/signup_email_fragment.xml | 30 ++--- .../src/main/res/layout/signup_magic_link.xml | 58 ++++++---- .../src/main/res/layout/toolbar_login.xml | 39 ++++--- .../src/main/res/values/attrs.xml | 3 + .../src/main/res/values/styles.xml | 57 +++------ 31 files changed, 588 insertions(+), 504 deletions(-) diff --git a/WordPressLoginFlow/build.gradle b/WordPressLoginFlow/build.gradle index 2023cec713d6..41ddc07efb74 100644 --- a/WordPressLoginFlow/build.gradle +++ b/WordPressLoginFlow/build.gradle @@ -40,7 +40,7 @@ dependencies { implementation 'androidx.media:media:1.0.1' implementation 'androidx.legacy:legacy-support-v13:1.0.0' implementation 'androidx.gridlayout:gridlayout:1.0.0' - implementation 'com.google.android.material:material:1.1.0' + implementation 'com.google.android.material:material:1.0.0' api 'com.google.android.gms:play-services-auth:15.0.1' diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/Login2FaFragment.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/Login2FaFragment.java index 96b2baab5a15..d68880dfae2a 100644 --- a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/Login2FaFragment.java +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/Login2FaFragment.java @@ -7,6 +7,7 @@ import android.text.TextUtils; import android.text.TextWatcher; import android.text.method.DigitsKeyListener; +import android.view.ContextThemeWrapper; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; @@ -20,8 +21,6 @@ import androidx.annotation.StringRes; import androidx.appcompat.app.AlertDialog; -import com.google.android.material.dialog.MaterialAlertDialogBuilder; - import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import org.wordpress.android.fluxc.generated.AccountActionBuilder; @@ -45,10 +44,10 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import static android.content.Context.CLIPBOARD_SERVICE; - import dagger.android.support.AndroidSupportInjection; +import static android.content.Context.CLIPBOARD_SERVICE; + public class Login2FaFragment extends LoginBaseFormFragment implements TextWatcher, OnEditorCommitListener { private static final String KEY_2FA_TYPE = "KEY_2FA_TYPE"; @@ -397,7 +396,7 @@ private void handleAuthError(AuthenticationErrorType error, String errorMessage) } private void showErrorDialog(String message) { - AlertDialog dialog = new MaterialAlertDialogBuilder(getActivity()) + AlertDialog dialog = new AlertDialog.Builder(new ContextThemeWrapper(getActivity(), R.style.LoginTheme)) .setMessage(message) .setPositiveButton(R.string.login_error_button, null) .create(); diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginEmailFragment.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginEmailFragment.java index 8a74bbb3059a..400c5fb1d15a 100644 --- a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginEmailFragment.java +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginEmailFragment.java @@ -10,6 +10,7 @@ import android.text.Html; import android.text.TextWatcher; import android.util.Patterns; +import android.view.ContextThemeWrapper; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; @@ -32,7 +33,6 @@ import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; -import com.google.android.material.dialog.MaterialAlertDialogBuilder; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; @@ -383,7 +383,7 @@ private void showEmailError(int messageId) { } private void showErrorDialog(String message) { - AlertDialog dialog = new MaterialAlertDialogBuilder(getActivity()) + AlertDialog dialog = new AlertDialog.Builder(new ContextThemeWrapper(getActivity(), R.style.LoginTheme)) .setMessage(message) .setPositiveButton(R.string.login_error_button, null) .create(); diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginHttpAuthDialogFragment.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginHttpAuthDialogFragment.java index b006931af0cd..66b1151b9ddf 100644 --- a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginHttpAuthDialogFragment.java +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginHttpAuthDialogFragment.java @@ -7,6 +7,7 @@ import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; +import android.view.ContextThemeWrapper; import android.view.KeyEvent; import android.view.View; import android.widget.EditText; @@ -17,8 +18,6 @@ import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; -import com.google.android.material.dialog.MaterialAlertDialogBuilder; - import org.wordpress.android.util.EditTextUtils; public class LoginHttpAuthDialogFragment extends DialogFragment { @@ -50,7 +49,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) { @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { - AlertDialog.Builder alert = new MaterialAlertDialogBuilder(getActivity()); + AlertDialog.Builder alert = new AlertDialog.Builder(new ContextThemeWrapper(getActivity(), R.style.LoginTheme)); alert.setTitle(R.string.http_authorization_required); //noinspection InflateParams diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginMagicLinkRequestFragment.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginMagicLinkRequestFragment.java index fd554f055455..7d56878202e1 100644 --- a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginMagicLinkRequestFragment.java +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginMagicLinkRequestFragment.java @@ -54,6 +54,7 @@ public class LoginMagicLinkRequestFragment extends Fragment { public static final String TAG = "login_magic_link_request_fragment_tag"; private static final String KEY_IN_PROGRESS = "KEY_IN_PROGRESS"; + private static final String KEY_GRAVATAR_IN_PROGRESS = "KEY_GRAVATAR_IN_PROGRESS"; private static final String ARG_EMAIL_ADDRESS = "ARG_EMAIL_ADDRESS"; private static final String ARG_MAGIC_LINK_SCHEME = "ARG_MAGIC_LINK_SCHEME"; private static final String ARG_IS_JETPACK_CONNECT = "ARG_IS_JETPACK_CONNECT"; @@ -223,6 +224,9 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) { if (mInProgress) { showMagicLinkRequestProgressDialog(); } + + boolean gravatarInProgress = savedInstanceState.getBoolean(KEY_GRAVATAR_IN_PROGRESS); + mAvatarProgressBar.setVisibility(gravatarInProgress ? View.VISIBLE : View.GONE); } // important for accessibility - talkback getActivity().setTitle(R.string.magic_link_login_title); @@ -239,6 +243,7 @@ public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putBoolean(KEY_IN_PROGRESS, mInProgress); + outState.putBoolean(KEY_GRAVATAR_IN_PROGRESS, mAvatarProgressBar.getVisibility() == View.VISIBLE); } @Override diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressHelpDialogFragment.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressHelpDialogFragment.java index c9a36a95d887..98722cbaf0a2 100644 --- a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressHelpDialogFragment.java +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressHelpDialogFragment.java @@ -4,13 +4,12 @@ import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; +import android.view.ContextThemeWrapper; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; -import com.google.android.material.dialog.MaterialAlertDialogBuilder; - import org.wordpress.android.fluxc.store.AccountStore; import org.wordpress.android.fluxc.store.SiteStore; @@ -47,7 +46,7 @@ public void onAttach(Context context) { @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { - AlertDialog.Builder alert = new MaterialAlertDialogBuilder(getActivity()); + AlertDialog.Builder alert = new AlertDialog.Builder(new ContextThemeWrapper(getActivity(), R.style.LoginTheme)); alert.setTitle(R.string.login_site_address_help_title); //noinspection InflateParams diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/SignupEmailFragment.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/SignupEmailFragment.java index a492701f015b..ce49fd618c13 100644 --- a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/SignupEmailFragment.java +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/SignupEmailFragment.java @@ -8,6 +8,7 @@ import android.text.Editable; import android.text.TextWatcher; import android.util.Patterns; +import android.view.ContextThemeWrapper; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; @@ -28,7 +29,6 @@ import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; -import com.google.android.material.dialog.MaterialAlertDialogBuilder; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; @@ -232,7 +232,7 @@ public void onTextChanged(CharSequence s, int start, int before, int count) { } protected void showErrorDialog(String message) { - AlertDialog dialog = new MaterialAlertDialogBuilder(getActivity()) + AlertDialog dialog = new AlertDialog.Builder(new ContextThemeWrapper(getActivity(), R.style.LoginTheme)) .setMessage(message) .setPositiveButton(R.string.login_error_button, null) .create(); diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/SignupMagicLinkFragment.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/SignupMagicLinkFragment.java index 910cd28db95c..b8305d18db50 100644 --- a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/SignupMagicLinkFragment.java +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/SignupMagicLinkFragment.java @@ -4,6 +4,7 @@ import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; +import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -19,8 +20,6 @@ import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; -import com.google.android.material.dialog.MaterialAlertDialogBuilder; - import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import org.wordpress.android.fluxc.Dispatcher; @@ -232,7 +231,7 @@ public void onClick(DialogInterface dialog, int which) { } }; - AlertDialog dialog = new MaterialAlertDialogBuilder(getActivity()) + AlertDialog dialog = new AlertDialog.Builder(new ContextThemeWrapper(getActivity(), R.style.LoginTheme)) .setMessage(message) .setNegativeButton(R.string.signup_magic_link_error_button_negative, dialogListener) .setPositiveButton(R.string.signup_magic_link_error_button_positive, dialogListener) diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/widgets/WPBottomSheetDialogFragment.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/widgets/WPBottomSheetDialogFragment.java index bf25fcf95bb7..7bab90d22348 100644 --- a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/widgets/WPBottomSheetDialogFragment.java +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/widgets/WPBottomSheetDialogFragment.java @@ -16,6 +16,11 @@ import org.wordpress.android.login.R; public class WPBottomSheetDialogFragment extends BottomSheetDialogFragment { + @Override + public int getTheme() { + return R.style.LoginTheme_BottomSheetDialogStyle; + } + @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/widgets/WPLoginInputRow.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/widgets/WPLoginInputRow.java index c17d99bb5280..1cb90f8b2f83 100644 --- a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/widgets/WPLoginInputRow.java +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/widgets/WPLoginInputRow.java @@ -1,7 +1,10 @@ package org.wordpress.android.login.widgets; import android.content.Context; +import android.content.res.ColorStateList; import android.content.res.TypedArray; +import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; import android.os.Parcel; @@ -10,12 +13,16 @@ import android.util.AttributeSet; import android.util.SparseArray; import android.view.KeyEvent; +import android.view.View; import android.view.inputmethod.EditorInfo; import android.widget.EditText; +import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; +import androidx.core.graphics.drawable.DrawableCompat; import com.google.android.material.textfield.TextInputLayout; @@ -31,9 +38,14 @@ public interface OnEditorCommitListener { void onEditorCommit(); } + private ImageView mIcon; private TextInputLayout mTextInputLayout; private EditText mEditText; + public ImageView getIcon() { + return mIcon; + } + public EditText getEditText() { return mEditText; } @@ -56,6 +68,7 @@ public WPLoginInputRow(Context context, AttributeSet attrs, int defStyle) { private void init(Context context, AttributeSet attrs) { inflate(context, R.layout.login_input_row, this); + mIcon = findViewById(R.id.icon); mTextInputLayout = findViewById(R.id.input_layout); mEditText = findViewById(R.id.input); @@ -63,6 +76,27 @@ private void init(Context context, AttributeSet attrs) { TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.wpLoginInputRow, 0, 0); try { + if (a.hasValue(R.styleable.wpLoginInputRow_wpIconDrawable)) { + int iconResId = a.getResourceId(R.styleable.wpLoginInputRow_wpIconDrawable, + R.drawable.ic_user_grey_24dp); + int tintResId = a.getResourceId(R.styleable.wpLoginInputRow_wpIconDrawableTint, + R.color.login_input_icon_color); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + mIcon.setImageTintList(ColorStateList.valueOf(ContextCompat.getColor(context, tintResId))); + mIcon.setImageResource(iconResId); + } else { + Drawable drawable = context.getResources().getDrawable(iconResId); + DrawableCompat.setTint(drawable, context.getResources().getColor(tintResId)); + DrawableCompat.setTintMode(drawable, PorterDuff.Mode.SRC_IN); + mIcon.setImageDrawable(drawable); + } + + mIcon.setVisibility(View.VISIBLE); + } else { + mIcon.setVisibility(View.GONE); + } + if (a.hasValue(R.styleable.wpLoginInputRow_android_inputType)) { mEditText.setInputType(a.getInteger(R.styleable.wpLoginInputRow_android_inputType, 0)); } @@ -78,11 +112,16 @@ private void init(Context context, AttributeSet attrs) { // Makes the hint transparent, so the TalkBack can read it, when the field is prefilled mEditText.setHintTextColor(getResources().getColor(android.R.color.transparent)); } + if (a.hasValue(R.styleable.wpLoginInputRow_passwordToggleEnabled)) { mTextInputLayout.setPasswordVisibilityToggleEnabled( a.getBoolean(R.styleable.wpLoginInputRow_passwordToggleEnabled, false)); } + if (a.hasValue(R.styleable.wpLoginInputRow_passwordToggleTint)) { + mTextInputLayout.setPasswordVisibilityToggleTintList( + a.getColorStateList(R.styleable.wpLoginInputRow_passwordToggleTint)); + } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { if (a.hasValue(R.styleable.wpLoginInputRow_android_textAlignment)) { mEditText.setTextAlignment( @@ -145,8 +184,8 @@ public void setOnEditorCommitListener(final OnEditorCommitListener listener) { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_DONE - || actionId == EditorInfo.IME_ACTION_NEXT - || (event != null + || actionId == EditorInfo.IME_ACTION_NEXT + || (event != null && event.getAction() == KeyEvent.ACTION_UP && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) { listener.onEditorCommit(); diff --git a/WordPressLoginFlow/src/main/res/layout-land/login_magic_link_request_screen.xml b/WordPressLoginFlow/src/main/res/layout-land/login_magic_link_request_screen.xml index 29877bd2aff7..060cdce64517 100644 --- a/WordPressLoginFlow/src/main/res/layout-land/login_magic_link_request_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout-land/login_magic_link_request_screen.xml @@ -1,9 +1,11 @@ + android:layout_height="match_parent" + xmlns:tools="http://schemas.android.com/tools"> - + + android:layout_height="wrap_content"/> + android:indeterminate="true"/> - + android:text="@string/login_magic_links_label"/> - + android:background="@color/login_background_color" + android:paddingStart="@dimen/margin_small_medium" + android:paddingEnd="@dimen/margin_medium_large" + android:paddingTop="@dimen/margin_medium_large" + android:paddingBottom="@dimen/margin_medium_large" + android:layout_alignParentBottom="true" + android:clipToPadding="false" + tools:ignore="InconsistentLayout"> - - - + android:layout_marginEnd="@dimen/margin_extra_large" + android:gravity="start|center_vertical" + android:text="@string/enter_your_password_instead"/> - - - + + diff --git a/WordPressLoginFlow/src/main/res/layout-land/login_magic_link_sent_screen.xml b/WordPressLoginFlow/src/main/res/layout-land/login_magic_link_sent_screen.xml index 1933c757144f..7cf5f68af62b 100644 --- a/WordPressLoginFlow/src/main/res/layout-land/login_magic_link_sent_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout-land/login_magic_link_sent_screen.xml @@ -1,77 +1,73 @@ + android:layout_height="match_parent" + xmlns:tools="http://schemas.android.com/tools"> - + + android:layout_centerInParent="true" + android:orientation="vertical" + android:gravity="center_horizontal"> + android:contentDescription="@null" + app:srcCompat="@drawable/login_email_alert"/> - + android:text="@string/login_magic_links_sent_label"/> - + android:background="@color/login_background_color" + android:paddingStart="@dimen/margin_small_medium" + android:paddingEnd="@dimen/margin_medium_large" + android:paddingTop="@dimen/margin_medium_large" + android:paddingBottom="@dimen/margin_medium_large" + android:layout_alignParentBottom="true" + android:clipToPadding="false" + tools:ignore="InconsistentLayout"> - - - + android:layout_marginEnd="@dimen/margin_extra_large" + android:gravity="start|center_vertical" + android:text="@string/enter_your_password_instead"/> - - - - + + diff --git a/WordPressLoginFlow/src/main/res/layout-land/signup_bottom_sheet_dialog.xml b/WordPressLoginFlow/src/main/res/layout-land/signup_bottom_sheet_dialog.xml index a05807f5a9f8..0f5a6453734b 100644 --- a/WordPressLoginFlow/src/main/res/layout-land/signup_bottom_sheet_dialog.xml +++ b/WordPressLoginFlow/src/main/res/layout-land/signup_bottom_sheet_dialog.xml @@ -1,50 +1,55 @@ - + android:paddingTop="@dimen/margin_medium" > - + android:text="@string/signup_terms_of_service_text" + style="@style/LoginTheme.Button.Secondary" > + + android:layout_marginTop="@dimen/margin_extra_small" + android:layout_width="match_parent" + android:orientation="horizontal" > - + android:layout_width="wrap_content" + android:text="@string/signup_with_email_button" + android:theme="@style/LoginTheme.Button" > + - + android:layout_width="wrap_content" + android:text="@string/signup_with_google_button" + android:theme="@style/LoginTheme.Button" > + diff --git a/WordPressLoginFlow/src/main/res/layout-land/signup_magic_link.xml b/WordPressLoginFlow/src/main/res/layout-land/signup_magic_link.xml index 290d3e3f0262..1917679299a3 100644 --- a/WordPressLoginFlow/src/main/res/layout-land/signup_magic_link.xml +++ b/WordPressLoginFlow/src/main/res/layout-land/signup_magic_link.xml @@ -1,68 +1,71 @@ - + android:layout_height="match_parent" + xmlns:tools="http://schemas.android.com/tools"> - + + + android:layout_width="match_parent" + android:orientation="vertical" > + app:srcCompat="@drawable/login_email_alert" > + + android:paddingStart="@dimen/margin_extra_extra_large" + android:paddingTop="@dimen/margin_extra_large" + android:text="@string/signup_magic_link_message" + style="@style/Base.TextAppearance.AppCompat.Body1" > + - + android:layout_width="match_parent" + android:paddingBottom="@dimen/margin_medium_large" + android:paddingEnd="@dimen/margin_medium_large" + android:paddingStart="@dimen/margin_small_medium" + android:paddingTop="@dimen/margin_medium_large" + tools:ignore="InconsistentLayout"> - + android:layout_width="wrap_content" + android:text="@string/open_mail" + style="@style/LoginTheme.Button.Primary" > + - + - - diff --git a/WordPressLoginFlow/src/main/res/layout/login_2fa_screen.xml b/WordPressLoginFlow/src/main/res/layout/login_2fa_screen.xml index de326ff78418..9d32b8352b43 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_2fa_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_2fa_screen.xml @@ -9,7 +9,7 @@ android:paddingEnd="@dimen/margin_extra_large" android:layout_marginBottom="@dimen/margin_extra_large"> - + android:layout_height="wrap_content"> + android:singleLine="true" + android:hint="@string/httpuser"/> + app:passwordToggleTint="@color/login_input_password_icon_color"> + android:inputType="textPassword" + android:hint="@string/httppassword"/> diff --git a/WordPressLoginFlow/src/main/res/layout/login_alert_site_address_help.xml b/WordPressLoginFlow/src/main/res/layout/login_alert_site_address_help.xml index 2ab69b3277c3..933c2ea8f74e 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_alert_site_address_help.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_alert_site_address_help.xml @@ -3,24 +3,24 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:gravity="top" android:orientation="vertical" + android:gravity="top" android:padding="?attr/dialogPreferredPadding"> - + android:text="@string/login_site_address_help_content"/> + android:contentDescription="@null"/> diff --git a/WordPressLoginFlow/src/main/res/layout/login_email_password_screen.xml b/WordPressLoginFlow/src/main/res/layout/login_email_password_screen.xml index 8053752cf6e6..ad8b4987b601 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_email_password_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_email_password_screen.xml @@ -1,25 +1,25 @@ + android:layout_marginBottom="@dimen/margin_extra_large"> - + android:tint="@color/login_input_icon_color" + app:srcCompat="@drawable/ic_user_grey_24dp"/> + android:focusable="true"> - + android:text="@string/email_address"/> - + android:gravity="start" + tools:text="s@b.com"/> @@ -69,12 +69,15 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/margin_extra_large" android:layout_marginBottom="@dimen/margin_extra_extra_large" - android:gravity="start" android:hint="@string/password" android:importantForAutofill="noExcludeDescendants" android:inputType="textPassword" android:textAlignment="viewStart" + android:gravity="start" app:passwordToggleEnabled="true" - tools:ignore="UnusedAttribute" /> + app:passwordToggleTint="@color/login_input_password_icon_color" + app:wpIconDrawable="@drawable/ic_lock_grey_24dp" + tools:ignore="UnusedAttribute" > + diff --git a/WordPressLoginFlow/src/main/res/layout/login_email_screen.xml b/WordPressLoginFlow/src/main/res/layout/login_email_screen.xml index 53e8e3050019..30dbc62535d1 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_email_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_email_screen.xml @@ -1,108 +1,116 @@ - + android:paddingEnd="@dimen/margin_extra_large" + android:paddingStart="@dimen/margin_extra_large" > - + android:gravity="start" + tools:text="@string/enter_email_wordpress_com" + style="@style/LoginTheme.TextLabel" > + + android:gravity="start" + tools:ignore="UnusedAttribute" > + - + android:layout_marginTop="@dimen/margin_extra_large" + android:layout_width="wrap_content" + android:text="@string/alternatively" + style="@style/LoginTheme.TextLabel" > + + android:paddingEnd="@dimen/margin_medium" + android:paddingTop="@dimen/margin_medium" + android:gravity="center_vertical" + tools:ignore="RtlSymmetry" > + android:layout_width="@dimen/google_button_icon_sz" + app:srcCompat="@drawable/ic_google_60dp" > + - + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/login_google_button_suffix" + style="@style/LoginTheme.Button.Google" > + + android:paddingEnd="@dimen/margin_medium" + android:paddingTop="@dimen/margin_medium" + android:gravity="center_vertical" + tools:ignore="RtlSymmetry" > + android:layout_width="@dimen/google_button_icon_sz" + app:srcCompat="@drawable/ic_domains_grey_24dp" > + - + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="@string/enter_site_address_instead" + style="@style/LoginTheme.Button.Google" > + diff --git a/WordPressLoginFlow/src/main/res/layout/login_form_screen.xml b/WordPressLoginFlow/src/main/res/layout/login_form_screen.xml index 0621b1cc49cb..4ed2340b3d47 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_form_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_form_screen.xml @@ -5,64 +5,58 @@ android:layout_height="match_parent"> + android:layout_below="@+id/toolbar" + android:layout_above="@+id/bottom_buttons"> + android:layout_marginBottom="@dimen/margin_extra_large"/> - - - - + + - - - - - - + android:layout_marginEnd="@dimen/margin_extra_large" + android:textAlignment="viewStart" + android:gravity="start|center_vertical" + tools:text="Secondary action"/> + + + diff --git a/WordPressLoginFlow/src/main/res/layout/login_input_row.xml b/WordPressLoginFlow/src/main/res/layout/login_input_row.xml index d39dcbb868ea..eb238712df35 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_input_row.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_input_row.xml @@ -1,24 +1,40 @@ - + + - + android:layout_marginEnd="@dimen/textinputlayout_correction_margin_right" + android:paddingEnd="@dimen/textinputlayout_correction_padding_right" + tools:hint="@string/email_address"/> + diff --git a/WordPressLoginFlow/src/main/res/layout/login_magic_link_request_screen.xml b/WordPressLoginFlow/src/main/res/layout/login_magic_link_request_screen.xml index ce7ae44a4c24..5b87de6b8936 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_magic_link_request_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_magic_link_request_screen.xml @@ -1,13 +1,16 @@ - + android:layout_height="match_parent"> - + + android:layout_marginBottom="@dimen/margin_extra_large" + android:layout_marginTop="@dimen/margin_extra_extra_large"> + android:layout_height="wrap_content"/> + android:padding="@dimen/margin_large"/> - + android:text="@string/login_magic_links_label"/> - + android:theme="@style/LoginTheme.Button"/> - + android:paddingStart="@dimen/margin_medium_large" + android:text="@string/enter_your_password_instead"/> - + diff --git a/WordPressLoginFlow/src/main/res/layout/login_magic_link_sent_screen.xml b/WordPressLoginFlow/src/main/res/layout/login_magic_link_sent_screen.xml index 53f833f75bb3..4b97edaf36e0 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_magic_link_sent_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_magic_link_sent_screen.xml @@ -1,44 +1,53 @@ - + android:layout_height="match_parent"> - + + app:srcCompat="@drawable/login_email_alert"/> - + android:text="@string/login_magic_links_sent_label"/> - - - + diff --git a/WordPressLoginFlow/src/main/res/layout/login_site_address_screen.xml b/WordPressLoginFlow/src/main/res/layout/login_site_address_screen.xml index 596cd8e6f07c..305760d03a13 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_site_address_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_site_address_screen.xml @@ -1,33 +1,35 @@ + android:layout_marginBottom="@dimen/margin_extra_large"> - + android:imeOptions="actionNext" + android:textAlignment="viewStart" + android:gravity="start" + app:wpIconDrawable="@drawable/ic_globe_grey_24dp"/> diff --git a/WordPressLoginFlow/src/main/res/layout/login_username_password_screen.xml b/WordPressLoginFlow/src/main/res/layout/login_username_password_screen.xml index f2b142305cca..d1829689dfb1 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_username_password_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_username_password_screen.xml @@ -1,34 +1,34 @@ + android:layout_marginBottom="@dimen/margin_extra_large"> - @@ -61,40 +61,40 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="@dimen/margin_extra_large" - android:focusable="true" - android:orientation="vertical"> + android:orientation="vertical" + android:focusable="true"> - + tools:visibility="visible" + android:textAlignment="viewStart" + android:gravity="start"/> - + android:gravity="start" + tools:text="Arround the World with Pam"/> - + android:gravity="start" + tools:text="pamelanguyyen.wordpress.com"/> @@ -102,11 +102,12 @@ android:id="@+id/login_username_row" android:layout_width="match_parent" android:layout_height="wrap_content" - android:gravity="start" android:hint="@string/username" - android:imeOptions="actionNext" android:inputType="textPersonName" - android:textAlignment="viewStart" /> + android:imeOptions="actionNext" + android:textAlignment="viewStart" + android:gravity="start" + app:wpIconDrawable="@drawable/ic_user_grey_24dp"/> + app:passwordToggleTint="@color/login_input_password_icon_color" + android:textAlignment="viewStart" + android:gravity="start" + android:accessibilityLiveRegion="assertive" + app:wpIconDrawable="@drawable/ic_lock_grey_24dp" + tools:ignore="UnusedAttribute"/> diff --git a/WordPressLoginFlow/src/main/res/layout/signup_bottom_sheet_dialog.xml b/WordPressLoginFlow/src/main/res/layout/signup_bottom_sheet_dialog.xml index 87605487db46..f0408261cdd7 100644 --- a/WordPressLoginFlow/src/main/res/layout/signup_bottom_sheet_dialog.xml +++ b/WordPressLoginFlow/src/main/res/layout/signup_bottom_sheet_dialog.xml @@ -1,41 +1,46 @@ - + android:paddingTop="@dimen/margin_medium" > - + android:text="@string/signup_terms_of_service_text" + style="@style/LoginTheme.Button.Secondary" > + - + android:layout_marginTop="@dimen/margin_extra_small" + android:layout_width="match_parent" + android:text="@string/signup_with_email_button" + android:theme="@style/LoginTheme.Button" > + - + android:layout_width="match_parent" + android:text="@string/signup_with_google_button" + android:theme="@style/LoginTheme.Button" > + diff --git a/WordPressLoginFlow/src/main/res/layout/signup_email_fragment.xml b/WordPressLoginFlow/src/main/res/layout/signup_email_fragment.xml index 50061cf17ecd..6a5d3110628f 100644 --- a/WordPressLoginFlow/src/main/res/layout/signup_email_fragment.xml +++ b/WordPressLoginFlow/src/main/res/layout/signup_email_fragment.xml @@ -1,34 +1,38 @@ - + android:paddingLeft="@dimen/margin_extra_large" + android:paddingRight="@dimen/margin_extra_large" + android:paddingStart="@dimen/margin_extra_large" > - + android:layout_marginTop="@dimen/margin_extra_large" + android:layout_width="match_parent" + tools:text="@string/signup_email_header" + style="@style/LoginTheme.TextLabel" > + + android:layout_height="wrap_content" + android:layout_width="match_parent" + app:wpIconDrawable="@drawable/ic_user_grey_24dp" + tools:ignore="UnusedAttribute" > + diff --git a/WordPressLoginFlow/src/main/res/layout/signup_magic_link.xml b/WordPressLoginFlow/src/main/res/layout/signup_magic_link.xml index 92e11f33799a..e4c2e65c448e 100644 --- a/WordPressLoginFlow/src/main/res/layout/signup_magic_link.xml +++ b/WordPressLoginFlow/src/main/res/layout/signup_magic_link.xml @@ -1,50 +1,58 @@ - + android:layout_width="match_parent" > - + + + android:layout_width="match_parent" > + app:srcCompat="@drawable/login_email_alert" > + + android:paddingStart="@dimen/margin_extra_extra_large" + android:paddingTop="@dimen/margin_extra_large" + android:text="@string/signup_magic_link_message" + style="@style/Base.TextAppearance.AppCompat.Body1" > + - + android:layout_width="wrap_content" + android:text="@string/open_mail" + android:theme="@style/LoginTheme.Button" + style="@style/Widget.AppCompat.Button.Colored" > + - + diff --git a/WordPressLoginFlow/src/main/res/layout/toolbar_login.xml b/WordPressLoginFlow/src/main/res/layout/toolbar_login.xml index 695c90671df0..bac5435ba1ba 100644 --- a/WordPressLoginFlow/src/main/res/layout/toolbar_login.xml +++ b/WordPressLoginFlow/src/main/res/layout/toolbar_login.xml @@ -1,23 +1,24 @@ - + android:layout_height="?attr/actionBarSize" + android:background="@color/login_toolbar_color" + android:elevation="@dimen/appbar_elevation" + app:contentInsetLeft="@dimen/toolbar_content_offset" + app:contentInsetStart="@dimen/toolbar_content_offset" + app:contentInsetRight="@dimen/toolbar_content_offset_end" + app:contentInsetEnd="@dimen/toolbar_content_offset_end" + app:theme="@style/LoginTheme.Toolbar" + tools:targetApi="LOLLIPOP"> - - - - - - - + + diff --git a/WordPressLoginFlow/src/main/res/values/attrs.xml b/WordPressLoginFlow/src/main/res/values/attrs.xml index 3f5b74b856cd..3914e5cd5ec7 100644 --- a/WordPressLoginFlow/src/main/res/values/attrs.xml +++ b/WordPressLoginFlow/src/main/res/values/attrs.xml @@ -5,10 +5,13 @@ WPLoginInputRow --> + + + diff --git a/WordPressLoginFlow/src/main/res/values/styles.xml b/WordPressLoginFlow/src/main/res/values/styles.xml index 31b6b44225c5..c35b06ba84aa 100644 --- a/WordPressLoginFlow/src/main/res/values/styles.xml +++ b/WordPressLoginFlow/src/main/res/values/styles.xml @@ -1,65 +1,47 @@ - - - - - - - - - - - - - - - - - - - -