From 9957185057d6d53f198903878a3ac95029d29853 Mon Sep 17 00:00:00 2001 From: Maxime Biais Date: Wed, 3 Jul 2019 14:47:18 +0200 Subject: [PATCH 01/11] Updated login and editor libraries to remove right/left attributes when a start/end attribute already exists --- WordPressLoginFlow/build.gradle | 4 ++-- .../res/layout-land/login_magic_link_request_screen.xml | 6 ------ .../main/res/layout-land/login_magic_link_sent_screen.xml | 6 ------ .../src/main/res/layout-land/signup_bottom_sheet_dialog.xml | 2 -- .../src/main/res/layout-land/signup_magic_link.xml | 3 --- .../src/main/res/layout/login_email_password_screen.xml | 1 - .../src/main/res/layout/login_email_screen.xml | 6 ------ .../src/main/res/layout/login_form_screen.xml | 6 ------ WordPressLoginFlow/src/main/res/layout/login_input_row.xml | 4 ---- .../src/main/res/layout/login_magic_link_request_screen.xml | 1 - .../src/main/res/layout/login_username_password_screen.xml | 2 -- 11 files changed, 2 insertions(+), 39 deletions(-) diff --git a/WordPressLoginFlow/build.gradle b/WordPressLoginFlow/build.gradle index 786af0be0fa2..185b24283922 100644 --- a/WordPressLoginFlow/build.gradle +++ b/WordPressLoginFlow/build.gradle @@ -21,8 +21,8 @@ android { buildToolsVersion "28.0.3" defaultConfig { - minSdkVersion 16 - targetSdkVersion 26 + minSdkVersion 17 + targetSdkVersion 28 versionCode 2 versionName "1.1" 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 e8edec571f4e..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 @@ -50,9 +50,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/login_background_color" - android:paddingLeft="@dimen/margin_small_medium" android:paddingStart="@dimen/margin_small_medium" - android:paddingRight="@dimen/margin_medium_large" android:paddingEnd="@dimen/margin_medium_large" android:paddingTop="@dimen/margin_medium_large" android:paddingBottom="@dimen/margin_medium_large" @@ -65,15 +63,12 @@ android:id="@+id/login_enter_password" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentLeft="true" android:layout_alignParentStart="true" - android:layout_toLeftOf="@+id/login_request_magic_link" android:layout_toStartOf="@+id/login_request_magic_link" android:paddingLeft="@dimen/margin_medium_large" android:paddingStart="@dimen/margin_medium_large" android:paddingRight="@dimen/margin_medium_large" android:paddingEnd="@dimen/margin_medium_large" - android:layout_marginRight="@dimen/margin_extra_large" android:layout_marginEnd="@dimen/margin_extra_large" android:gravity="start|center_vertical" android:text="@string/enter_your_password_instead"/> @@ -83,7 +78,6 @@ android:id="@+id/login_request_magic_link" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentRight="true" android:layout_alignParentEnd="true" android:text="@string/send_link" /> 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 619edb69494b..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 @@ -39,9 +39,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/login_background_color" - android:paddingLeft="@dimen/margin_small_medium" android:paddingStart="@dimen/margin_small_medium" - android:paddingRight="@dimen/margin_medium_large" android:paddingEnd="@dimen/margin_medium_large" android:paddingTop="@dimen/margin_medium_large" android:paddingBottom="@dimen/margin_medium_large" @@ -54,15 +52,12 @@ android:id="@+id/login_enter_password" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentLeft="true" android:layout_alignParentStart="true" - android:layout_toLeftOf="@+id/login_open_email_client" android:layout_toStartOf="@+id/login_open_email_client" android:paddingLeft="@dimen/margin_medium_large" android:paddingStart="@dimen/margin_medium_large" android:paddingRight="@dimen/margin_medium_large" android:paddingEnd="@dimen/margin_medium_large" - android:layout_marginRight="@dimen/margin_extra_large" android:layout_marginEnd="@dimen/margin_extra_large" android:gravity="start|center_vertical" android:text="@string/enter_your_password_instead"/> @@ -72,7 +67,6 @@ android:id="@+id/login_open_email_client" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentRight="true" android:layout_alignParentEnd="true" android:text="@string/open_mail" /> 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 ea86976f985c..8d0605260a13 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 @@ -34,7 +34,6 @@ android:id="@+id/signup_email" android:layout_height="match_parent" android:layout_marginEnd="@dimen/margin_medium" - android:layout_marginRight="@dimen/margin_medium" android:layout_weight="1" android:layout_width="wrap_content" android:text="@string/signup_with_email_button" @@ -45,7 +44,6 @@ android:id="@+id/signup_google" android:layout_height="match_parent" android:layout_marginStart="@dimen/margin_medium" - android:layout_marginLeft="@dimen/margin_medium" android:layout_weight="1" android:layout_width="wrap_content" android:text="@string/signup_with_google_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 9a9e425626f0..1917679299a3 100644 --- a/WordPressLoginFlow/src/main/res/layout-land/signup_magic_link.xml +++ b/WordPressLoginFlow/src/main/res/layout-land/signup_magic_link.xml @@ -53,8 +53,6 @@ android:layout_width="match_parent" android:paddingBottom="@dimen/margin_medium_large" android:paddingEnd="@dimen/margin_medium_large" - android:paddingLeft="@dimen/margin_small_medium" - android:paddingRight="@dimen/margin_medium_large" android:paddingStart="@dimen/margin_small_medium" android:paddingTop="@dimen/margin_medium_large" tools:ignore="InconsistentLayout"> @@ -62,7 +60,6 @@ diff --git a/WordPressLoginFlow/src/main/res/layout/login_email_screen.xml b/WordPressLoginFlow/src/main/res/layout/login_email_screen.xml index 61f7d839d1fd..8c5b1fb2767d 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_email_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_email_screen.xml @@ -9,8 +9,6 @@ android:layout_width="match_parent" android:orientation="vertical" android:paddingEnd="@dimen/margin_extra_large" - android:paddingLeft="@dimen/margin_extra_large" - android:paddingRight="@dimen/margin_extra_large" android:paddingStart="@dimen/margin_extra_large" > @@ -66,7 +63,6 @@ android:importantForAccessibility="no" android:layout_height="@dimen/google_button_icon_sz" android:layout_marginEnd="@dimen/margin_medium" - android:layout_marginRight="@dimen/margin_medium" android:layout_width="@dimen/google_button_icon_sz" app:srcCompat="@drawable/ic_google_60dp" > @@ -92,7 +88,6 @@ android:orientation="horizontal" android:paddingBottom="@dimen/margin_medium" android:paddingEnd="@dimen/margin_medium" - android:paddingRight="@dimen/margin_medium" android:paddingTop="@dimen/margin_medium" android:gravity="center_vertical" tools:ignore="RtlSymmetry" > @@ -102,7 +97,6 @@ android:importantForAccessibility="no" android:layout_height="@dimen/google_button_icon_sz" android:layout_marginEnd="@dimen/margin_medium" - android:layout_marginRight="@dimen/margin_medium" android:layout_width="@dimen/google_button_icon_sz" app:srcCompat="@drawable/ic_domains_grey_24dp" > diff --git a/WordPressLoginFlow/src/main/res/layout/login_form_screen.xml b/WordPressLoginFlow/src/main/res/layout/login_form_screen.xml index bbcd96e240e0..c5871581e58b 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_form_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_form_screen.xml @@ -28,9 +28,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/login_background_color" - android:paddingLeft="@dimen/margin_small_medium" android:paddingStart="@dimen/margin_small_medium" - android:paddingRight="@dimen/margin_medium_large" android:paddingEnd="@dimen/margin_medium_large" android:paddingTop="@dimen/margin_medium_large" android:paddingBottom="@dimen/margin_medium_large" @@ -42,15 +40,12 @@ android:id="@+id/secondary_button" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentLeft="true" android:layout_alignParentStart="true" - android:layout_toLeftOf="@+id/primary_button" android:layout_toStartOf="@+id/primary_button" android:paddingLeft="@dimen/margin_medium_large" android:paddingStart="@dimen/margin_medium_large" android:paddingRight="@dimen/margin_medium_large" android:paddingEnd="@dimen/margin_medium_large" - android:layout_marginRight="@dimen/margin_extra_large" android:layout_marginEnd="@dimen/margin_extra_large" android:gravity="start|center_vertical" tools:text="Secondary action"/> @@ -60,7 +55,6 @@ android:id="@+id/primary_button" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentRight="true" android:layout_alignParentEnd="true" android:text="@string/next" /> diff --git a/WordPressLoginFlow/src/main/res/layout/login_input_row.xml b/WordPressLoginFlow/src/main/res/layout/login_input_row.xml index 89f239d696b5..67eceefe3d3c 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_input_row.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_input_row.xml @@ -12,7 +12,6 @@ android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginRight="@dimen/margin_extra_large" android:layout_marginEnd="@dimen/margin_extra_large" android:importantForAccessibility="no" tools:srcCompat="@drawable/ic_user_grey_24dp" @@ -24,7 +23,6 @@ android:id="@+id/input_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_toRightOf="@+id/icon" android:layout_toEndOf="@+id/icon" android:importantForAccessibility="no"> @@ -34,9 +32,7 @@ android:id="@+id/input" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginRight="@dimen/textinputlayout_correction_margin_right" android:layout_marginEnd="@dimen/textinputlayout_correction_margin_right" - android:paddingRight="@dimen/textinputlayout_correction_padding_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 0ca8224e2c86..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 @@ -71,7 +71,6 @@ android:layout_below="@+id/login_request_magic_link" android:layout_centerHorizontal="true" android:layout_marginEnd="@dimen/margin_extra_large" - android:layout_marginRight="@dimen/margin_extra_large" android:gravity="center" android:paddingEnd="@dimen/margin_medium_large" android:paddingLeft="@dimen/margin_medium_large" 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 d3bbe6719645..2cf21940f34c 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_username_password_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_username_password_screen.xml @@ -22,7 +22,6 @@ @@ -49,7 +48,6 @@ From 382614389a0eec5cea5bbe908e27feccd63f38db Mon Sep 17 00:00:00 2001 From: Shiki Date: Thu, 18 Jul 2019 19:43:09 -0600 Subject: [PATCH 02/11] Move LoginSiteAddress validation to a class This time, the _Next_ button is not enabled until the user has entered an invalid site address. --- .../login/LoginSiteAddressFragment.java | 34 +++++++-------- .../login/LoginSiteAddressValidator.java | 43 +++++++++++++++++++ 2 files changed, 58 insertions(+), 19 deletions(-) create mode 100644 WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressFragment.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressFragment.java index 2bcbfff80faa..89b55f7f2033 100644 --- a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressFragment.java +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressFragment.java @@ -5,9 +5,7 @@ import android.content.Intent; import android.os.Bundle; import android.text.Editable; -import android.text.TextUtils; import android.text.TextWatcher; -import android.util.Patterns; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; @@ -18,6 +16,7 @@ import androidx.annotation.LayoutRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.lifecycle.Observer; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; @@ -57,6 +56,8 @@ public class LoginSiteAddressFragment extends LoginBaseFormFragment() { + @Override public void onChanged(Boolean aBoolean) { + getPrimaryButton().setEnabled(aBoolean); + } + }); + } + @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); @@ -153,19 +164,7 @@ protected void discover() { return; } - String cleanedSiteAddress = getCleanedSiteAddress(); - - if (TextUtils.isEmpty(cleanedSiteAddress)) { - showError(R.string.login_empty_site_url); - return; - } - - if (!Patterns.WEB_URL.matcher(cleanedSiteAddress).matches()) { - showError(R.string.login_invalid_site_url); - return; - } - - mRequestedSiteAddress = cleanedSiteAddress; + mRequestedSiteAddress = mLoginSiteAddressValidator.getCleanedSiteAddress(); String cleanedXmlrpcSuffix = UrlUtils.removeXmlrpcSuffix(mRequestedSiteAddress); @@ -182,10 +181,6 @@ protected void discover() { startProgress(); } - private String getCleanedSiteAddress() { - return EditTextUtils.getText(mSiteAddressInput.getEditText()).trim().replaceAll("[\r\n]", ""); - } - @Override public void onEditorCommit() { discover(); @@ -193,6 +188,7 @@ public void onEditorCommit() { @Override public void afterTextChanged(Editable s) { + mLoginSiteAddressValidator.setAddress(EditTextUtils.getText(mSiteAddressInput.getEditText())); } @Override diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java new file mode 100644 index 000000000000..34fcf41c565b --- /dev/null +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java @@ -0,0 +1,43 @@ +package org.wordpress.android.login; + +import android.util.Patterns; + +import androidx.annotation.NonNull; +import androidx.lifecycle.LiveData; +import androidx.lifecycle.MutableLiveData; + +import org.jetbrains.annotations.NotNull; + +/** + * Encapsulates the site address validation, cleaning, and error handling of {@link LoginSiteAddressFragment}. + */ +class LoginSiteAddressValidator { + private MutableLiveData mIsValid = new MutableLiveData<>(); + + @NonNull private String mCleanedSiteAddress = ""; + + LiveData getIsValid() { + return mIsValid; + } + + @NotNull String getCleanedSiteAddress() { + return mCleanedSiteAddress; + } + + LoginSiteAddressValidator() { + mIsValid.postValue(false); + } + + public void setAddress(@NonNull String siteAddress) { + mCleanedSiteAddress = cleanSiteAddress(siteAddress); + mIsValid.postValue(siteAddressIsValid(mCleanedSiteAddress)); + } + + private static String cleanSiteAddress(@NonNull String siteAddress) { + return siteAddress.trim().replaceAll("[\r\n]", ""); + } + + private static boolean siteAddressIsValid(@NonNull String cleanedSiteAddress) { + return Patterns.WEB_URL.matcher(cleanedSiteAddress).matches(); + } +} From 88e9fc1323c4815086cc676ef81d96384fea3fd8 Mon Sep 17 00:00:00 2001 From: Shiki Date: Thu, 18 Jul 2019 21:36:14 -0600 Subject: [PATCH 03/11] Do not react to keyboard enter if site is invalid --- .../wordpress/android/login/LoginSiteAddressFragment.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressFragment.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressFragment.java index 89b55f7f2033..6cf1c3ab5c71 100644 --- a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressFragment.java +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressFragment.java @@ -183,7 +183,9 @@ protected void discover() { @Override public void onEditorCommit() { - discover(); + if (getPrimaryButton().isEnabled()) { + discover(); + } } @Override @@ -355,7 +357,7 @@ public void onDiscoverySucceeded(OnDiscoveryResponse event) { return; } else { AppLog.e(T.API, "onDiscoveryResponse has error: " + event.error.name() - + " - " + event.error.toString()); + + " - " + event.error.toString()); handleDiscoveryError(event.error, event.failedEndpoint); return; } From 5426f44f17cbba2c5f1f32f53ddd1e212b3264b2 Mon Sep 17 00:00:00 2001 From: Shiki Date: Fri, 19 Jul 2019 08:22:44 -0600 Subject: [PATCH 04/11] Site Address: Show an error message after 2 sec The invalid address error message will only be shown 2 seconds after the user stopped typing. --- .../login/LoginSiteAddressFragment.java | 24 +++++++++--- .../login/LoginSiteAddressValidator.java | 39 +++++++++++++++---- 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressFragment.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressFragment.java index 6cf1c3ab5c71..03bdd7739bc3 100644 --- a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressFragment.java +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressFragment.java @@ -56,7 +56,7 @@ public class LoginSiteAddressFragment extends LoginBaseFormFragment() { - @Override public void onChanged(Boolean aBoolean) { - getPrimaryButton().setEnabled(aBoolean); + @Override public void onChanged(Boolean enabled) { + getPrimaryButton().setEnabled(enabled); + } + }); + mLoginSiteAddressValidator.getErrorMessageResId().observe(this, new Observer() { + @Override public void onChanged(Integer resId) { + if (resId != null) { + showError(resId); + } else { + mSiteAddressInput.setError(null); + } } }); } @@ -159,6 +166,11 @@ public void onSaveInstanceState(Bundle outState) { outState.putString(KEY_REQUESTED_SITE_ADDRESS, mRequestedSiteAddress); } + @Override public void onDestroyView() { + super.onDestroyView(); + mLoginSiteAddressValidator.dispose(); + } + protected void discover() { if (!NetworkUtils.checkConnection(getActivity())) { return; diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java index 34fcf41c565b..99b0edaf6a64 100644 --- a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java @@ -6,31 +6,56 @@ import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; -import org.jetbrains.annotations.NotNull; +import org.wordpress.android.util.helpers.Debouncer; + +import java.util.concurrent.TimeUnit; /** * Encapsulates the site address validation, cleaning, and error handling of {@link LoginSiteAddressFragment}. */ class LoginSiteAddressValidator { + private static final int SECONDS_DELAY_BEFORE_SHOWING_ERROR_MESSAGE = 2; + private MutableLiveData mIsValid = new MutableLiveData<>(); + private MutableLiveData mErrorMessageResId = new MutableLiveData<>(); - @NonNull private String mCleanedSiteAddress = ""; + private String mCleanedSiteAddress = ""; + private Debouncer mDebouncer = new Debouncer(); - LiveData getIsValid() { + @NonNull LiveData getIsValid() { return mIsValid; } - @NotNull String getCleanedSiteAddress() { + @NonNull LiveData getErrorMessageResId() { + return mErrorMessageResId; + } + + @NonNull String getCleanedSiteAddress() { return mCleanedSiteAddress; } LoginSiteAddressValidator() { - mIsValid.postValue(false); + mIsValid.setValue(false); } - public void setAddress(@NonNull String siteAddress) { + void dispose() { + mDebouncer.shutdown(); + } + + void setAddress(@NonNull String siteAddress) { mCleanedSiteAddress = cleanSiteAddress(siteAddress); - mIsValid.postValue(siteAddressIsValid(mCleanedSiteAddress)); + final boolean isValid = siteAddressIsValid(mCleanedSiteAddress); + + mIsValid.setValue(isValid); + mErrorMessageResId.setValue(null); + + mDebouncer.debounce(Void.class, new Runnable() { + @Override public void run() { + if (!isValid) { + mErrorMessageResId.postValue(R.string.login_invalid_site_url); + } + } + }, SECONDS_DELAY_BEFORE_SHOWING_ERROR_MESSAGE, TimeUnit.SECONDS); } private static String cleanSiteAddress(@NonNull String siteAddress) { From 28f3b5e0f15ebc138136a30125265b60ac9e154f Mon Sep 17 00:00:00 2001 From: Shiki Date: Fri, 19 Jul 2019 09:28:22 -0600 Subject: [PATCH 05/11] Do not report an error if the text is empty --- .../wordpress/android/login/LoginSiteAddressValidator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java index 99b0edaf6a64..fff34b33313a 100644 --- a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java @@ -11,7 +11,7 @@ import java.util.concurrent.TimeUnit; /** - * Encapsulates the site address validation, cleaning, and error handling of {@link LoginSiteAddressFragment}. + * Encapsulates the site address validation, cleaning, and error reporting of {@link LoginSiteAddressFragment}. */ class LoginSiteAddressValidator { private static final int SECONDS_DELAY_BEFORE_SHOWING_ERROR_MESSAGE = 2; @@ -49,9 +49,10 @@ void setAddress(@NonNull String siteAddress) { mIsValid.setValue(isValid); mErrorMessageResId.setValue(null); + // Call debounce regardless if there was an error so that the previous Runnable will be cancelled. mDebouncer.debounce(Void.class, new Runnable() { @Override public void run() { - if (!isValid) { + if (!isValid && !mCleanedSiteAddress.isEmpty()) { mErrorMessageResId.postValue(R.string.login_invalid_site_url); } } From 7407c9789195ddd42d461df1e9fedd0149ce8bd6 Mon Sep 17 00:00:00 2001 From: Shiki Date: Fri, 19 Jul 2019 09:34:19 -0600 Subject: [PATCH 06/11] Replace login_invalid_site_url This is to match the new iOS error message. --- WordPressLoginFlow/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPressLoginFlow/src/main/res/values/strings.xml b/WordPressLoginFlow/src/main/res/values/strings.xml index 26c045e7c2ab..fc1965e34072 100644 --- a/WordPressLoginFlow/src/main/res/values/strings.xml +++ b/WordPressLoginFlow/src/main/res/values/strings.xml @@ -51,7 +51,7 @@ Log in to WordPress.com to access the post. Log in to WordPress.com to share the content. Please enter a site address - The site address you entered is invalid. Please re-enter it. + Enter a valid URL e.g. example.com. Please enter a username Please enter a password Please enter a verification code From 004ae9984cad5578256fe47de92ca9be29df0983 Mon Sep 17 00:00:00 2001 From: Shiki Date: Fri, 19 Jul 2019 09:37:00 -0600 Subject: [PATCH 07/11] Delete unused R.string.login_empty_site_url --- WordPressLoginFlow/src/main/res/values/strings.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/WordPressLoginFlow/src/main/res/values/strings.xml b/WordPressLoginFlow/src/main/res/values/strings.xml index fc1965e34072..10b4ccfa44fd 100644 --- a/WordPressLoginFlow/src/main/res/values/strings.xml +++ b/WordPressLoginFlow/src/main/res/values/strings.xml @@ -50,7 +50,6 @@ Error while adding site. Error code: %s Log in to WordPress.com to access the post. Log in to WordPress.com to share the content. - Please enter a site address Enter a valid URL e.g. example.com. Please enter a username Please enter a password From b4e7e46907c4093e6c2b34784f8a247c540a4fc3 Mon Sep 17 00:00:00 2001 From: Shiki Date: Fri, 19 Jul 2019 11:24:02 -0600 Subject: [PATCH 08/11] Add tests for LoginSiteAddressValidator --- WordPressLoginFlow/build.gradle | 6 + .../login/LoginSiteAddressValidator.java | 7 +- .../login/LoginSiteAddressValidatorTest.java | 129 ++++++++++++++++++ 3 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 WordPressLoginFlow/src/test/java/org/wordpress/android/login/LoginSiteAddressValidatorTest.java diff --git a/WordPressLoginFlow/build.gradle b/WordPressLoginFlow/build.gradle index 185b24283922..55e2ec70f3ef 100644 --- a/WordPressLoginFlow/build.gradle +++ b/WordPressLoginFlow/build.gradle @@ -68,6 +68,12 @@ dependencies { annotationProcessor 'com.google.dagger:dagger-android-processor:2.22.1' lintChecks 'org.wordpress:lint:1.0.1' + + testImplementation 'junit:junit:4.12' + testImplementation 'org.mockito:mockito-core:2.27.0' + testImplementation 'androidx.arch.core:core-testing:2.0.1' + testImplementation 'org.robolectric:robolectric:3.6.1' + testImplementation 'org.assertj:assertj-core:3.11.1' } // Add properties named "wp.xxx" to our BuildConfig diff --git a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java index fff34b33313a..fd8a430bdca3 100644 --- a/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java +++ b/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressValidator.java @@ -20,7 +20,7 @@ class LoginSiteAddressValidator { private MutableLiveData mErrorMessageResId = new MutableLiveData<>(); private String mCleanedSiteAddress = ""; - private Debouncer mDebouncer = new Debouncer(); + private final Debouncer mDebouncer; @NonNull LiveData getIsValid() { return mIsValid; @@ -35,7 +35,12 @@ class LoginSiteAddressValidator { } LoginSiteAddressValidator() { + this(new Debouncer()); + } + + LoginSiteAddressValidator(@NonNull Debouncer debouncer) { mIsValid.setValue(false); + mDebouncer = debouncer; } void dispose() { diff --git a/WordPressLoginFlow/src/test/java/org/wordpress/android/login/LoginSiteAddressValidatorTest.java b/WordPressLoginFlow/src/test/java/org/wordpress/android/login/LoginSiteAddressValidatorTest.java new file mode 100644 index 000000000000..c31183a770e2 --- /dev/null +++ b/WordPressLoginFlow/src/test/java/org/wordpress/android/login/LoginSiteAddressValidatorTest.java @@ -0,0 +1,129 @@ +package org.wordpress.android.login; + +import androidx.arch.core.executor.testing.InstantTaskExecutorRule; +import androidx.lifecycle.Observer; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; +import org.robolectric.RobolectricTestRunner; +import org.wordpress.android.util.helpers.Debouncer; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.mock; + +@RunWith(RobolectricTestRunner.class) +public class LoginSiteAddressValidatorTest { + @Rule + public InstantTaskExecutorRule instantTaskExecutorRule = new InstantTaskExecutorRule(); + + private Debouncer mDebouncer; + private LoginSiteAddressValidator mValidator; + + @Before + public void setUp() { + mDebouncer = mock(Debouncer.class); + doAnswer(new Answer() { + @Override public Void answer(InvocationOnMock invocation) { + final Runnable runnable = invocation.getArgument(1); + runnable.run(); + return null; + } + }).when(mDebouncer).debounce(any(), any(Runnable.class), anyLong(), any(TimeUnit.class)); + + mValidator = new LoginSiteAddressValidator(mDebouncer); + } + + @After + public void tearDown() { + mValidator = null; + mDebouncer = null; + } + + @Test + public void testAnErrorIsReturnedWhenGivenAnInvalidAddress() { + // Arrange + assertThat(mValidator.getErrorMessageResId().getValue()).isNull(); + + // Act + mValidator.setAddress("invalid"); + + // Assert + assertThat(mValidator.getErrorMessageResId().getValue()).isNotNull(); + assertThat(mValidator.getCleanedSiteAddress()).isEqualTo("invalid"); + assertThat(mValidator.getIsValid().getValue()).isFalse(); + } + + @Test + public void testNoErrorIsReturnedButIsInvalidWhenGivenAnEmptyAddress() { + // Act + mValidator.setAddress(""); + + // Assert + assertThat(mValidator.getErrorMessageResId().getValue()).isNull(); + assertThat(mValidator.getIsValid().getValue()).isFalse(); + assertThat(mValidator.getCleanedSiteAddress()).isEqualTo(""); + } + + @Test + public void testTheErrorIsImmediatelyClearedWhenANewAddressIsGiven() { + // Arrange + final ArrayList> resIdValues = new ArrayList<>(); + mValidator.getErrorMessageResId().observeForever(new Observer() { + @Override public void onChanged(Integer resId) { + resIdValues.add(Optional.ofNullable(resId)); + } + }); + + // Act + mValidator.setAddress("invalid"); + mValidator.setAddress("another-invalid"); + + // Assert + assertThat(resIdValues).hasSize(4); + assertThat(resIdValues.get(0)).isEmpty(); + assertThat(resIdValues.get(1)).isNotEmpty(); + assertThat(resIdValues.get(2)).isEmpty(); + assertThat(resIdValues.get(3)).isNotEmpty(); + } + + @Test + public void testItReturnsValidWhenGivenValidURLs() { + // Arrange + final List validUrls = Arrays.asList( + "http://subdomain.example.com", + "http://example.ca", + "example.ca", + "subdomain.example.com", + " space-with-subdomain.example.net", + "https://subdomain.example.com/folder", + "http://subdomain.example.com/folder/over/there ", + "7.7.7.7", + "http://7.7.13.45", + "http://47.147.43.45/folder "); + + // Act and Assert + assertThat(validUrls).allSatisfy(new Consumer() { + @Override public void accept(String url) { + mValidator.setAddress(url); + + assertThat(mValidator.getErrorMessageResId().getValue()).isNull(); + assertThat(mValidator.getIsValid().getValue()).isTrue(); + } + }); + } +} From 9dd103da804f14694bc7fccee1926852525642e3 Mon Sep 17 00:00:00 2001 From: Shiki Date: Mon, 22 Jul 2019 11:31:03 -0600 Subject: [PATCH 09/11] Update login_invalid_site_url MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is based on Editorial’s advice. --- WordPressLoginFlow/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPressLoginFlow/src/main/res/values/strings.xml b/WordPressLoginFlow/src/main/res/values/strings.xml index 10b4ccfa44fd..81359116268d 100644 --- a/WordPressLoginFlow/src/main/res/values/strings.xml +++ b/WordPressLoginFlow/src/main/res/values/strings.xml @@ -50,7 +50,7 @@ Error while adding site. Error code: %s Log in to WordPress.com to access the post. Log in to WordPress.com to share the content. - Enter a valid URL e.g. example.com. + Please enter a complete website address, like example.com. Please enter a username Please enter a password Please enter a verification code From b918be9871190cbacb6f9994a4ad0db56d43bd5e Mon Sep 17 00:00:00 2001 From: Shiki Date: Mon, 22 Jul 2019 12:06:40 -0600 Subject: [PATCH 10/11] Fix redundancy in R.string.enter_site_address --- WordPressLoginFlow/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPressLoginFlow/src/main/res/values/strings.xml b/WordPressLoginFlow/src/main/res/values/strings.xml index 81359116268d..ae49cceed88c 100644 --- a/WordPressLoginFlow/src/main/res/values/strings.xml +++ b/WordPressLoginFlow/src/main/res/values/strings.xml @@ -39,7 +39,7 @@ Continue Already logged in to WordPress.com \@%s - Enter the address of your WordPress site you\'d like to connect. + Enter the address of the WordPress site you\'d like to connect. Enter the address of your WordPress site you\'d like to share the content to. Site address Need help finding your site address? From a5a8a544e3f6b88d266f23cf7334765b0ab33130 Mon Sep 17 00:00:00 2001 From: Maxime Biais Date: Wed, 3 Jul 2019 14:47:18 +0200 Subject: [PATCH 11/11] Updated login and editor libraries to remove right/left attributes when a start/end attribute already exists --- .../res/layout-land/login_magic_link_request_screen.xml | 6 ------ .../main/res/layout-land/login_magic_link_sent_screen.xml | 6 ------ .../src/main/res/layout-land/signup_bottom_sheet_dialog.xml | 2 -- .../src/main/res/layout-land/signup_magic_link.xml | 3 --- .../src/main/res/layout/login_email_password_screen.xml | 1 - .../src/main/res/layout/login_email_screen.xml | 6 ------ .../src/main/res/layout/login_form_screen.xml | 6 ------ WordPressLoginFlow/src/main/res/layout/login_input_row.xml | 4 ---- .../src/main/res/layout/login_magic_link_request_screen.xml | 1 - .../src/main/res/layout/login_username_password_screen.xml | 2 -- 10 files changed, 37 deletions(-) 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 e8edec571f4e..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 @@ -50,9 +50,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/login_background_color" - android:paddingLeft="@dimen/margin_small_medium" android:paddingStart="@dimen/margin_small_medium" - android:paddingRight="@dimen/margin_medium_large" android:paddingEnd="@dimen/margin_medium_large" android:paddingTop="@dimen/margin_medium_large" android:paddingBottom="@dimen/margin_medium_large" @@ -65,15 +63,12 @@ android:id="@+id/login_enter_password" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentLeft="true" android:layout_alignParentStart="true" - android:layout_toLeftOf="@+id/login_request_magic_link" android:layout_toStartOf="@+id/login_request_magic_link" android:paddingLeft="@dimen/margin_medium_large" android:paddingStart="@dimen/margin_medium_large" android:paddingRight="@dimen/margin_medium_large" android:paddingEnd="@dimen/margin_medium_large" - android:layout_marginRight="@dimen/margin_extra_large" android:layout_marginEnd="@dimen/margin_extra_large" android:gravity="start|center_vertical" android:text="@string/enter_your_password_instead"/> @@ -83,7 +78,6 @@ android:id="@+id/login_request_magic_link" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentRight="true" android:layout_alignParentEnd="true" android:text="@string/send_link" /> 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 619edb69494b..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 @@ -39,9 +39,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/login_background_color" - android:paddingLeft="@dimen/margin_small_medium" android:paddingStart="@dimen/margin_small_medium" - android:paddingRight="@dimen/margin_medium_large" android:paddingEnd="@dimen/margin_medium_large" android:paddingTop="@dimen/margin_medium_large" android:paddingBottom="@dimen/margin_medium_large" @@ -54,15 +52,12 @@ android:id="@+id/login_enter_password" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentLeft="true" android:layout_alignParentStart="true" - android:layout_toLeftOf="@+id/login_open_email_client" android:layout_toStartOf="@+id/login_open_email_client" android:paddingLeft="@dimen/margin_medium_large" android:paddingStart="@dimen/margin_medium_large" android:paddingRight="@dimen/margin_medium_large" android:paddingEnd="@dimen/margin_medium_large" - android:layout_marginRight="@dimen/margin_extra_large" android:layout_marginEnd="@dimen/margin_extra_large" android:gravity="start|center_vertical" android:text="@string/enter_your_password_instead"/> @@ -72,7 +67,6 @@ android:id="@+id/login_open_email_client" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentRight="true" android:layout_alignParentEnd="true" android:text="@string/open_mail" /> 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 ea86976f985c..8d0605260a13 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 @@ -34,7 +34,6 @@ android:id="@+id/signup_email" android:layout_height="match_parent" android:layout_marginEnd="@dimen/margin_medium" - android:layout_marginRight="@dimen/margin_medium" android:layout_weight="1" android:layout_width="wrap_content" android:text="@string/signup_with_email_button" @@ -45,7 +44,6 @@ android:id="@+id/signup_google" android:layout_height="match_parent" android:layout_marginStart="@dimen/margin_medium" - android:layout_marginLeft="@dimen/margin_medium" android:layout_weight="1" android:layout_width="wrap_content" android:text="@string/signup_with_google_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 9a9e425626f0..1917679299a3 100644 --- a/WordPressLoginFlow/src/main/res/layout-land/signup_magic_link.xml +++ b/WordPressLoginFlow/src/main/res/layout-land/signup_magic_link.xml @@ -53,8 +53,6 @@ android:layout_width="match_parent" android:paddingBottom="@dimen/margin_medium_large" android:paddingEnd="@dimen/margin_medium_large" - android:paddingLeft="@dimen/margin_small_medium" - android:paddingRight="@dimen/margin_medium_large" android:paddingStart="@dimen/margin_small_medium" android:paddingTop="@dimen/margin_medium_large" tools:ignore="InconsistentLayout"> @@ -62,7 +60,6 @@ diff --git a/WordPressLoginFlow/src/main/res/layout/login_email_screen.xml b/WordPressLoginFlow/src/main/res/layout/login_email_screen.xml index d75750b2c679..30dbc62535d1 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_email_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_email_screen.xml @@ -9,8 +9,6 @@ android:layout_width="match_parent" android:orientation="vertical" android:paddingEnd="@dimen/margin_extra_large" - android:paddingLeft="@dimen/margin_extra_large" - android:paddingRight="@dimen/margin_extra_large" android:paddingStart="@dimen/margin_extra_large" > @@ -68,7 +65,6 @@ android:importantForAccessibility="no" android:layout_height="@dimen/google_button_icon_sz" android:layout_marginEnd="@dimen/margin_medium" - android:layout_marginRight="@dimen/margin_medium" android:layout_width="@dimen/google_button_icon_sz" app:srcCompat="@drawable/ic_google_60dp" > @@ -94,7 +90,6 @@ android:orientation="horizontal" android:paddingBottom="@dimen/margin_medium" android:paddingEnd="@dimen/margin_medium" - android:paddingRight="@dimen/margin_medium" android:paddingTop="@dimen/margin_medium" android:gravity="center_vertical" tools:ignore="RtlSymmetry" > @@ -104,7 +99,6 @@ android:importantForAccessibility="no" android:layout_height="@dimen/google_button_icon_sz" android:layout_marginEnd="@dimen/margin_medium" - android:layout_marginRight="@dimen/margin_medium" android:layout_width="@dimen/google_button_icon_sz" app:srcCompat="@drawable/ic_domains_grey_24dp" > diff --git a/WordPressLoginFlow/src/main/res/layout/login_form_screen.xml b/WordPressLoginFlow/src/main/res/layout/login_form_screen.xml index b73464ee00ae..4ed2340b3d47 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_form_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_form_screen.xml @@ -28,9 +28,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/login_background_color" - android:paddingLeft="@dimen/margin_small_medium" android:paddingStart="@dimen/margin_small_medium" - android:paddingRight="@dimen/margin_medium_large" android:paddingEnd="@dimen/margin_medium_large" android:paddingTop="@dimen/margin_medium_large" android:paddingBottom="@dimen/margin_medium_large" @@ -42,15 +40,12 @@ android:id="@+id/secondary_button" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentLeft="true" android:layout_alignParentStart="true" - android:layout_toLeftOf="@+id/primary_button" android:layout_toStartOf="@+id/primary_button" android:paddingLeft="@dimen/margin_medium_large" android:paddingStart="@dimen/margin_medium_large" android:paddingRight="@dimen/margin_medium_large" android:paddingEnd="@dimen/margin_medium_large" - android:layout_marginRight="@dimen/margin_extra_large" android:layout_marginEnd="@dimen/margin_extra_large" android:textAlignment="viewStart" android:gravity="start|center_vertical" @@ -61,7 +56,6 @@ android:id="@+id/primary_button" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentRight="true" android:layout_alignParentEnd="true" android:text="@string/next" /> diff --git a/WordPressLoginFlow/src/main/res/layout/login_input_row.xml b/WordPressLoginFlow/src/main/res/layout/login_input_row.xml index 89f239d696b5..67eceefe3d3c 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_input_row.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_input_row.xml @@ -12,7 +12,6 @@ android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginRight="@dimen/margin_extra_large" android:layout_marginEnd="@dimen/margin_extra_large" android:importantForAccessibility="no" tools:srcCompat="@drawable/ic_user_grey_24dp" @@ -24,7 +23,6 @@ android:id="@+id/input_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_toRightOf="@+id/icon" android:layout_toEndOf="@+id/icon" android:importantForAccessibility="no"> @@ -34,9 +32,7 @@ android:id="@+id/input" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginRight="@dimen/textinputlayout_correction_margin_right" android:layout_marginEnd="@dimen/textinputlayout_correction_margin_right" - android:paddingRight="@dimen/textinputlayout_correction_padding_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 0ca8224e2c86..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 @@ -71,7 +71,6 @@ android:layout_below="@+id/login_request_magic_link" android:layout_centerHorizontal="true" android:layout_marginEnd="@dimen/margin_extra_large" - android:layout_marginRight="@dimen/margin_extra_large" android:gravity="center" android:paddingEnd="@dimen/margin_medium_large" android:paddingLeft="@dimen/margin_medium_large" 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 d3bbe6719645..2cf21940f34c 100644 --- a/WordPressLoginFlow/src/main/res/layout/login_username_password_screen.xml +++ b/WordPressLoginFlow/src/main/res/layout/login_username_password_screen.xml @@ -22,7 +22,6 @@ @@ -49,7 +48,6 @@