Skip to content

Commit

Permalink
Version 6.2.1
Browse files Browse the repository at this point in the history
Version 6.2.1
  • Loading branch information
samtstern authored Mar 25, 2020
2 parents 2f95eb9 + 485453f commit e9df5b5
Show file tree
Hide file tree
Showing 38 changed files with 310 additions and 181 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Android CI

on:
- pull_request
- push

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./scripts/build.sh
- name: Print Logs
if: failure()
run: ./scripts/print_build_logs.sh
21 changes: 21 additions & 0 deletions .github/workflows/artifactory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Artifactory

on:
push:
branches:
- 'version-*-dev'

jobs:
artifactory:
runs-on: ubuntu-latest
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Publish to Artifactory
run: ./scripts/artifactory.sh
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![FirebaseOpensource.com](https://img.shields.io/badge/Docs-firebaseopensource.com-orange.svg)](
https://firebaseopensource.com/projects/firebase/firebaseui-android
)
[![Build Status](https://travis-ci.org/firebase/FirebaseUI-Android.svg?branch=master)](https://travis-ci.org/firebase/FirebaseUI-Android)
[![Actions Status][gh-actions-badge]][gh-actions]

FirebaseUI is an open-source library for Android that allows you to
quickly connect common UI elements to [Firebase](https://firebase.google.com) APIs.
Expand Down Expand Up @@ -48,16 +48,16 @@ libraries.
```groovy
dependencies {
// FirebaseUI for Firebase Realtime Database
implementation 'com.firebaseui:firebase-ui-database:6.2.0'
implementation 'com.firebaseui:firebase-ui-database:6.2.1'
// FirebaseUI for Cloud Firestore
implementation 'com.firebaseui:firebase-ui-firestore:6.2.0'
implementation 'com.firebaseui:firebase-ui-firestore:6.2.1'
// FirebaseUI for Firebase Auth
implementation 'com.firebaseui:firebase-ui-auth:6.2.0'
implementation 'com.firebaseui:firebase-ui-auth:6.2.1'
// FirebaseUI for Cloud Storage
implementation 'com.firebaseui:firebase-ui-storage:6.2.0'
implementation 'com.firebaseui:firebase-ui-storage:6.2.1'
}
```

Expand Down Expand Up @@ -241,3 +241,6 @@ accept your pull requests.
you are contributing.
1. Ensure that your code has an appropriate set of unit tests which all pass.
1. Submit a pull request targeting the latest dev branch.

[gh-actions]: https://github.com/firebase/FirebaseUI-Android/actions
[gh-actions-badge]: https://github.com/firebase/FirebaseUI-Android/workflows/Android%20CI/badge.svg
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ android {
}

dependencies {
implementation(Config.Libs.Firebase.core)
implementation(Config.Libs.Androidx.design)
implementation(Config.Libs.Androidx.multidex)

Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/com/firebase/uidemo/FirebaseUIDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

import com.squareup.leakcanary.LeakCanary;

import androidx.appcompat.app.AppCompatDelegate;
import androidx.multidex.MultiDexApplication;

public class FirebaseUIDemo extends MultiDexApplication {
static {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY);
}

@Override
public void onCreate() {
super.onCreate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ private void startSignedInActivity(@Nullable IdpResponse response) {
@OnClick({R.id.default_theme, R.id.purple_theme, R.id.green_theme, R.id.dark_theme})
public void toggleDarkTheme() {
int mode = mDarkTheme.isChecked() ?
AppCompatDelegate.MODE_NIGHT_YES : AppCompatDelegate.MODE_NIGHT_NO;
AppCompatDelegate.MODE_NIGHT_YES : AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
AppCompatDelegate.setDefaultNightMode(mode);
getDelegate().setLocalNightMode(mode);
}
Expand Down
2 changes: 1 addition & 1 deletion auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Gradle, add the dependency:
```groovy
dependencies {
// ...
implementation 'com.firebaseui:firebase-ui-auth:6.2.0'
implementation 'com.firebaseui:firebase-ui-auth:6.2.1'
// Required only if Facebook login support is required
// Find the latest Facebook SDK releases here: https://goo.gl/Ce5L94
Expand Down
1 change: 1 addition & 0 deletions auth/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies {
implementation(Config.Libs.Androidx.lifecycleExtensions)
annotationProcessor(Config.Libs.Androidx.lifecycleCompiler)

implementation(platform(Config.Libs.Firebase.bom))
api(Config.Libs.Firebase.auth)
api(Config.Libs.PlayServices.auth)

Expand Down
4 changes: 2 additions & 2 deletions auth/src/main/java/com/firebase/ui/auth/AuthUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ public SignInIntentBuilder createSignInIntentBuilder() {
ANONYMOUS_PROVIDER,
EmailAuthProvider.EMAIL_LINK_SIGN_IN_METHOD
})

@Retention(RetentionPolicy.SOURCE)
public @interface SupportedProvider {
}
Expand Down Expand Up @@ -996,7 +995,8 @@ public GoogleBuilder() {
@NonNull
public GoogleBuilder setScopes(@NonNull List<String> scopes) {
GoogleSignInOptions.Builder builder =
new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN);
new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail();
for (String scope : scopes) {
builder.requestScopes(new Scope(scope));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.firebase.ui.auth.IdpResponse;
import com.firebase.ui.auth.data.model.Resource;
import com.firebase.ui.auth.data.model.User;
import com.firebase.ui.auth.data.model.UserCancellationException;
import com.firebase.ui.auth.ui.HelperActivityBase;
import com.firebase.ui.auth.util.ExtraConstants;
import com.firebase.ui.auth.viewmodel.ProviderSignInBase;
Expand Down Expand Up @@ -111,7 +112,7 @@ public void onSuccess(LoginResult result) {

@Override
public void onCancel() {
onError(new FacebookException());
setResult(Resource.<IdpResponse>forFailure(new UserCancellationException()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.firebase.ui.auth.data.model.UserCancellationException;
import com.firebase.ui.auth.ui.HelperActivityBase;
import com.firebase.ui.auth.util.ExtraConstants;
import com.firebase.ui.auth.util.FirebaseAuthError;
import com.firebase.ui.auth.util.data.AuthOperationManager;
import com.firebase.ui.auth.util.data.ProviderUtils;
import com.firebase.ui.auth.viewmodel.ProviderSignInBase;
Expand All @@ -32,6 +33,7 @@
import com.google.firebase.auth.AuthCredential;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseAuthException;
import com.google.firebase.auth.FirebaseAuthUserCollisionException;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.auth.OAuthCredential;
Expand Down Expand Up @@ -91,17 +93,27 @@ public void onSuccess(@NonNull AuthResult authResult) {
new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
if (e instanceof FirebaseAuthUserCollisionException) {
FirebaseAuthUserCollisionException collisionException =
(FirebaseAuthUserCollisionException) e;

setResult(Resource.<IdpResponse>forFailure(
new FirebaseUiUserCollisionException(
ErrorCodes.ERROR_GENERIC_IDP_RECOVERABLE_ERROR,
"Recoverable error.",
provider.getProviderId(),
collisionException.getEmail(),
collisionException.getUpdatedCredential())));
if (e instanceof FirebaseAuthException) {
FirebaseAuthError error =
FirebaseAuthError.fromException((FirebaseAuthException) e);

if (e instanceof FirebaseAuthUserCollisionException) {
FirebaseAuthUserCollisionException collisionException =
(FirebaseAuthUserCollisionException) e;

setResult(Resource.<IdpResponse>forFailure(
new FirebaseUiUserCollisionException(
ErrorCodes.ERROR_GENERIC_IDP_RECOVERABLE_ERROR,
"Recoverable error.",
provider.getProviderId(),
collisionException.getEmail(),
collisionException.getUpdatedCredential())));
} else if (error == FirebaseAuthError.ERROR_WEB_CONTEXT_CANCELED) {
setResult(Resource.<IdpResponse>forFailure(
new UserCancellationException()));
} else {
setResult(Resource.<IdpResponse>forFailure(e));
}
} else {
setResult(Resource.<IdpResponse>forFailure(e));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public void onClick(DialogInterface dialog, int id) {

@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RequestCodes.EMAIL_LINK_PROMPT_FOR_EMAIL_FLOW
|| requestCode == RequestCodes.EMAIL_LINK_CROSS_DEVICE_LINKING_FLOW) {
IdpResponse response = IdpResponse.fromResultIntent(data);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.firebase.ui.auth.ui.email;

import android.annotation.SuppressLint;
import android.os.Build;
import android.os.Bundle;
import android.text.SpannableStringBuilder;
Expand All @@ -22,8 +23,6 @@
import androidx.annotation.RestrictTo;
import androidx.fragment.app.FragmentActivity;

import static android.text.Layout.JUSTIFICATION_MODE_INTER_WORD;

/**
* Fragment that tells the user that a linking flow cannot be completed as they have opened the
* email link on a different device.
Expand Down Expand Up @@ -52,6 +51,7 @@ public View onCreateView(@NonNull LayoutInflater inflater,

@SuppressWarnings("WrongConstant")
@Override
@SuppressLint("WrongConstant")
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
mProgressBar = view.findViewById(R.id.top_progress_bar);
mContinueButton = view.findViewById(R.id.button_continue);
Expand All @@ -73,7 +73,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat

// Justifies the text
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
body.setJustificationMode(JUSTIFICATION_MODE_INTER_WORD);
body.setJustificationMode(android.text.Layout.JUSTIFICATION_MODE_INTER_WORD);
}

TextView footerText = view.findViewById(R.id.email_footer_tos_and_pp_text);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.firebase.ui.auth.ui.email;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
Expand All @@ -22,8 +23,6 @@
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;

import static android.text.Layout.JUSTIFICATION_MODE_INTER_WORD;

@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class WelcomeBackEmailLinkPrompt extends AppCompatBase implements View.OnClickListener {

Expand Down Expand Up @@ -85,7 +84,7 @@ private void setBodyText() {
body.setText(spannableStringBuilder);
// Justifies the text
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
body.setJustificationMode(JUSTIFICATION_MODE_INTER_WORD);
body.setJustificationMode(android.text.Layout.JUSTIFICATION_MODE_INTER_WORD);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@

import com.firebase.ui.auth.ErrorCodes;
import com.firebase.ui.auth.FirebaseAuthAnonymousUpgradeException;
import com.firebase.ui.auth.FirebaseUiException;
import com.firebase.ui.auth.IdpResponse;
import com.firebase.ui.auth.R;
import com.firebase.ui.auth.data.model.FlowParameters;
import com.firebase.ui.auth.ui.AppCompatBase;
import com.firebase.ui.auth.util.ExtraConstants;
import com.firebase.ui.auth.util.FirebaseAuthError;
import com.firebase.ui.auth.util.data.PrivacyDisclosureUtils;
import com.firebase.ui.auth.util.data.ProviderUtils;
import com.firebase.ui.auth.util.ui.ImeHelper;
Expand All @@ -41,7 +43,10 @@
import com.firebase.ui.auth.viewmodel.email.WelcomeBackPasswordHandler;
import com.google.android.material.textfield.TextInputLayout;
import com.google.firebase.auth.AuthCredential;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseAuthException;
import com.google.firebase.auth.FirebaseAuthInvalidCredentialsException;
import com.google.firebase.auth.FirebaseAuthInvalidUserException;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -120,9 +125,21 @@ protected void onFailure(@NonNull Exception e) {
if (e instanceof FirebaseAuthAnonymousUpgradeException) {
IdpResponse response = ((FirebaseAuthAnonymousUpgradeException) e).getResponse();
finish(ErrorCodes.ANONYMOUS_UPGRADE_MERGE_CONFLICT, response.toIntent());
} else {
mPasswordLayout.setError(getString(getErrorMessage(e)));
return;
}

if (e instanceof FirebaseAuthException) {
FirebaseAuthException authEx = (FirebaseAuthException) e;
FirebaseAuthError error = FirebaseAuthError.fromException(authEx);
if (error == FirebaseAuthError.ERROR_USER_DISABLED) {
IdpResponse resp = IdpResponse.from(
new FirebaseUiException(ErrorCodes.ERROR_USER_DISABLED));
finish(RESULT_CANCELED, resp.toIntent());
return;
}
}

mPasswordLayout.setError(getString(getErrorMessage(e)));
}
});

Expand Down
Loading

0 comments on commit e9df5b5

Please sign in to comment.