Skip to content

Commit

Permalink
Squashed 'libs/login/' changes from f52c56b481..78c5307f7a
Browse files Browse the repository at this point in the history
78c5307f7a Merge pull request #16 from wordpress-mobile/fix_crash_in_login_email_fragment
edd8684ec4 Merge pull request #18 from wordpress-mobile/new-wpandroid-changes
71729e5e76 Merge pull request #17 from wordpress-mobile/issue/glide-4.9
aabdedf672 Merge commit '099b5a011d32283eb6c79b0e599b5272a597e849' into update-login-library
1eb7f4f156 Updated Glide to 4.9.0
a32cc8c09d Add crash fix to SignupEmailFragment
08109fa90f Adds non-null check to onActivityResult
664b67f62d Fix  #9826: make sure we Play Services are available before running the email hint picker
94a0ae2a39 Merge pull request #9743 from wordpress-mobile/feature/manage_insights_readonly
7cad17e264 Fix a few ContentDescription lint errors
9f171b55d0 Merge branch 'feature/manage_insights_readonly' into issue/9464-manage-insights
663a168903 Add the missing drawable resources

git-subtree-dir: libs/login
git-subtree-split: 78c5307f7a8a15cae1a164e4cbb0b7b924a37d37
  • Loading branch information
malinajirka committed Jun 6, 2019
1 parent 099b5a0 commit 258c26d
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 2 deletions.
4 changes: 2 additions & 2 deletions WordPressLoginFlow/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ dependencies {
}
}

implementation 'com.github.bumptech.glide:glide:4.6.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'

// Dagger
implementation 'com.google.dagger:dagger:2.11'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.google.android.gms.auth.api.credentials.CredentialPickerConfig;
import com.google.android.gms.auth.api.credentials.HintRequest;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
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;
Expand Down Expand Up @@ -424,6 +425,12 @@ public void onConnectionSuspended(int i) {
}

public void getEmailHints() {
GoogleApiAvailability googleApiAvailability = GoogleApiAvailability.getInstance();
if (getContext() == null
|| googleApiAvailability.isGooglePlayServicesAvailable(getContext()) != ConnectionResult.SUCCESS) {
AppLog.w(T.NUX, LOG_TAG + ": Couldn't start hint picker - Play Services unavailable");
return;
}
HintRequest hintRequest = new HintRequest.Builder()
.setHintPickerConfig(new CredentialPickerConfig.Builder()
.setShowCancelButton(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.google.android.gms.auth.api.credentials.CredentialPickerConfig;
import com.google.android.gms.auth.api.credentials.HintRequest;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
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;
Expand Down Expand Up @@ -296,6 +297,12 @@ public void onConnectionSuspended(int i) {
}

public void getEmailHints() {
GoogleApiAvailability googleApiAvailability = GoogleApiAvailability.getInstance();
if (getContext() == null
|| googleApiAvailability.isGooglePlayServicesAvailable(getContext()) != ConnectionResult.SUCCESS) {
AppLog.w(T.NUX, LOG_TAG + ": Couldn't start hint picker - Play Services unavailable");
return;
}
HintRequest hintRequest = new HintRequest.Builder()
.setHintPickerConfig(new CredentialPickerConfig.Builder()
.setShowCancelButton(true)
Expand All @@ -317,6 +324,10 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);

if (requestCode == EMAIL_CREDENTIALS_REQUEST_CODE) {
if (mEmailInput == null) {
// Activity result received before the fragments onCreateView(), disregard result.
return;
}
if (resultCode == RESULT_OK) {
Credential credential = data.getParcelableExtra(Credential.EXTRA_KEY);
mEmailInput.getEditText().setText(credential.getId());
Expand Down
4 changes: 4 additions & 0 deletions WordPressLoginFlow/src/main/res/drawable/shape_oval_green.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >
<solid android:color="@color/alert_green" />
</shape>
4 changes: 4 additions & 0 deletions WordPressLoginFlow/src/main/res/drawable/shape_oval_red.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >
<solid android:color="@color/alert_red" />
</shape>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

<ImageView
android:id="@+id/gravatar"
android:importantForAccessibility="no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

<ImageView
android:id="@+id/gravatar"
android:importantForAccessibility="no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

<ImageView
android:id="@+id/login_blavatar"
android:importantForAccessibility="no"
android:layout_width="@dimen/blavatar_sz"
android:layout_height="@dimen/blavatar_sz"
android:background="@android:color/white"
Expand All @@ -36,6 +37,7 @@

<ImageView
android:id="@+id/login_blavatar_static"
android:importantForAccessibility="no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/login_background_color"
Expand Down

0 comments on commit 258c26d

Please sign in to comment.