Skip to content

Commit

Permalink
Merge pull request #872 from firebase/version-2.3.0-release
Browse files Browse the repository at this point in the history
Version 2.3.0
  • Loading branch information
samtstern authored Aug 18, 2017
2 parents 49ca5e1 + 9d4efee commit f4494c4
Show file tree
Hide file tree
Showing 99 changed files with 667 additions and 383 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ libraries.
```groovy
dependencies {
// FirebaseUI Database only
compile 'com.firebaseui:firebase-ui-database:2.2.0'
compile 'com.firebaseui:firebase-ui-database:2.3.0'
// FirebaseUI Auth only
compile 'com.firebaseui:firebase-ui-auth:2.2.0'
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
// FirebaseUI Storage only
compile 'com.firebaseui:firebase-ui-storage:2.2.0'
compile 'com.firebaseui:firebase-ui-storage:2.3.0'
// Single target that includes all FirebaseUI libraries above
compile 'com.firebaseui:firebase-ui:2.2.0'
compile 'com.firebaseui:firebase-ui:2.3.0'
}
```

Expand Down Expand Up @@ -91,6 +91,7 @@ For convenience, here are some recent examples:

| FirebaseUI Version | Firebase/Play Services Version |
|--------------------|--------------------------------|
| 2.3.0 | 11.2.0 |
| 2.2.0 | 11.0.4 |
| 2.1.1 | 11.0.2 |
| 2.0.1 | 11.0.1 |
Expand Down
10 changes: 6 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ android {
targetSdkVersion targetSdk
versionCode 1
versionName "1.0"

vectorDrawables.useSupportLibrary = true
}

buildTypes {
Expand Down Expand Up @@ -42,15 +44,15 @@ dependencies {
compile "com.google.firebase:firebase-database:$firebaseVersion"
compile "com.google.firebase:firebase-storage:$firebaseVersion"

compile('com.facebook.android:facebook-android-sdk:4.23.0')
compile('com.facebook.android:facebook-android-sdk:4.25.0')
compile("com.twitter.sdk.android:twitter-core:3.0.0@aar") { transitive = true }

// The following dependencies are not required to use the Firebase UI library.
// They are used to make some aspects of the demo app implementation simpler for
// demonstrative purposes, and you may find them useful in your own apps; YMMV.
compile 'pub.devrel:easypermissions:0.4.2'
compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
compile 'pub.devrel:easypermissions:0.4.3'
compile 'com.jakewharton:butterknife:8.7.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
Expand Down
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
Expand Down
10 changes: 4 additions & 6 deletions app/src/main/java/com/firebase/uidemo/auth/AuthUiActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import com.firebase.ui.auth.AuthUI.IdpConfig;
import com.firebase.ui.auth.ErrorCodes;
import com.firebase.ui.auth.IdpResponse;
import com.firebase.ui.auth.ResultCodes;
import com.firebase.uidemo.R;
import com.google.android.gms.common.Scopes;
import com.google.firebase.auth.FirebaseAuth;
Expand All @@ -54,6 +53,7 @@ public class AuthUiActivity extends AppCompatActivity {
private static final String FIREBASE_TOS_URL = "https://firebase.google.com/terms/";
private static final String GOOGLE_PRIVACY_POLICY_URL = "https://www.google.com/policies/privacy/";
private static final String FIREBASE_PRIVACY_POLICY_URL = "https://firebase.google.com/terms/analytics/#7_privacy";

private static final int RC_SIGN_IN = 100;

@BindView(R.id.default_theme)
Expand Down Expand Up @@ -138,9 +138,7 @@ public class AuthUiActivity extends AppCompatActivity {
CheckBox mGoogleScopeYoutubeData;

public static Intent createIntent(Context context) {
Intent in = new Intent();
in.setClass(context, AuthUiActivity.class);
return in;
return new Intent(context, AuthUiActivity.class);
}

@Override
Expand Down Expand Up @@ -229,7 +227,7 @@ private void handleSignInResponse(int resultCode, Intent data) {
IdpResponse response = IdpResponse.fromResultIntent(data);

// Successfully signed in
if (resultCode == ResultCodes.OK) {
if (resultCode == RESULT_OK) {
startSignedInActivity(response);
finish();
return;
Expand Down Expand Up @@ -307,7 +305,7 @@ private int getSelectedLogo() {
if (mFirebaseLogo.isChecked()) {
return R.drawable.firebase_auth_120dp;
} else if (mGoogleLogo.isChecked()) {
return R.drawable.logo_googleg_color_144dp;
return R.drawable.ic_googleg_color_144dp;
}
return AuthUI.NO_LOGO;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ public void onComplete(@NonNull Task<Void> task) {

@OnClick(R.id.delete_account)
public void deleteAccountClicked() {

AlertDialog dialog = new AlertDialog.Builder(this)
new AlertDialog.Builder(this)
.setMessage("Are you sure you want to delete this account?")
.setPositiveButton("Yes, nuke it!", new DialogInterface.OnClickListener() {
@Override
Expand All @@ -143,9 +142,7 @@ public void onClick(DialogInterface dialogInterface, int i) {
}
})
.setNegativeButton("No", null)
.create();

dialog.show();
.show();
}

private void deleteAccount() {
Expand Down
Binary file removed app/src/main/res/drawable-hdpi/anon_user_48dp.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/anon_user_48dp.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/drawable-xhdpi/anon_user_48dp.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/drawable-xxhdpi/anon_user_48dp.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/drawable-xxxhdpi/anon_user_48dp.png
Binary file not shown.
Binary file not shown.
31 changes: 31 additions & 0 deletions app/src/main/res/drawable/ic_anon_user_48dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
xmlns:tools="http://schemas.android.com/tools">
<item>
<shape android:shape="oval">
<solid android:color="@color/material_gray_300" />
<size
android:width="48dp"
android:height="48dp" />
</shape>
</item>
<item
android:bottom="4dp"
android:left="4dp"
android:right="4dp"
android:top="4dp">
<aapt:attr name="android:drawable">
<vector
android:width="44dp"
android:height="44dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
tools:targetApi="lollipop">
<path
android:fillColor="@color/material_gray_500"
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z" />
</vector>
</aapt:attr>
</item>
</layer-list>
19 changes: 19 additions & 0 deletions app/src/main/res/drawable/ic_googleg_color_144dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="144dp"
android:height="144dp"
android:viewportHeight="512.0"
android:viewportWidth="512.0">
<path
android:fillColor="#4285f4"
android:pathData="M482.6,261.4c0,-16.7 -1.5,-32.8 -4.3,-48.3H256v91.3h127c-5.5,29.5 -22.1,54.5 -47.1,71.2v59.2h76.3c44.6,-41.1 70.4,-101.6 70.4,-173.5z" />
<path
android:fillColor="#34a853"
android:pathData="M256,492c63.7,0 117.1,-21.1 156.2,-57.2l-76.3,-59.2c-21.1,14.2 -48.2,22.5 -79.9,22.5 -61.5,0 -113.5,-41.5 -132.1,-97.3H45.1v61.2c38.8,77.1 118.6,130 210.9,130z" />
<path
android:fillColor="#fbbc05"
android:pathData="M123.9,300.8c-4.7,-14.2 -7.4,-29.3 -7.4,-44.8s2.7,-30.7 7.4,-44.8V150H45.1C29.1,181.9 20,217.9 20,256c0,38.1 9.1,74.1 25.1,106l78.8,-61.2z" />
<path
android:fillColor="#ea4335"
android:pathData="M256,113.9c34.7,0 65.8,11.9 90.2,35.3l67.7,-67.7C373,43.4 319.6,20 256,20c-92.3,0 -172.1,52.9 -210.9,130l78.8,61.2c18.6,-55.8 70.6,-97.3 132.1,-97.3z" />
</vector>
6 changes: 3 additions & 3 deletions app/src/main/res/layout/message.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
android:layout_height="50dp"
android:layout_marginStart="2dp"
android:layout_marginLeft="2dp"
android:background="@drawable/chat_message_arrow"
android:background="@drawable/ic_chat_message_arrow"
android:rotation="180" />


Expand All @@ -24,7 +24,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="26dp"
android:layout_marginRight="26dp"
android:background="@drawable/chat_message_background"
android:background="@drawable/ic_chat_message_background"
android:orientation="vertical"
android:padding="10dp">

Expand Down Expand Up @@ -56,7 +56,7 @@
android:layout_alignRight="@+id/message"
android:layout_marginRight="25dp"
android:layout_alignParentTop="true"
android:background="@drawable/chat_message_arrow"
android:background="@drawable/ic_chat_message_arrow"
android:rotation="180" />

</RelativeLayout>
3 changes: 2 additions & 1 deletion app/src/main/res/layout/signed_in_layout.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down Expand Up @@ -71,7 +72,7 @@
android:layout_gravity="center_horizontal"
android:layout_margin="16dp"
android:contentDescription="@string/profile_picture_content_desc"
android:src="@drawable/anon_user_48dp" />
app:srcCompat="@drawable/ic_anon_user_48dp" />

<LinearLayout
android:layout_width="wrap_content"
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@android:color/white"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
5 changes: 5 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@android:color/white"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<color name="material_green_300">#AED581</color>

<color name="material_gray_300">#E0E0E0</color>
<color name="material_gray_500">#9e9e9e</color>
<color name="material_gray_850">#ff303030</color>
<color name="material_gray_900">#ff212121</color>

Expand Down
12 changes: 6 additions & 6 deletions auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Gradle, add the dependency:
```groovy
dependencies {
// ...
compile 'com.firebaseui:firebase-ui-auth:2.2.0'
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
// Required only if Facebook login support is required
compile('com.facebook.android:facebook-android-sdk:4.22.1')
Expand Down Expand Up @@ -261,9 +261,9 @@ startActivityForResult(
##### Response codes

The authentication flow provides several response codes of which the most common are as follows:
`ResultCodes.OK` if a user is signed in, `ResultCodes.CANCELLED` if the user manually canceled the sign in,
`ResultCodes.NO_NETWORK` if sign in failed due to a lack of network connectivity,
and `ResultCodes.UNKNOWN_ERROR` for all other errors.
`Activity.RESULT_OK` if a user is signed in, `Activity.RESULT_CANCELED` if the user manually canceled the sign in,
`ErrorCodes.NO_NETWORK` if sign in failed due to a lack of network connectivity,
and `ErrorCodes.UNKNOWN_ERROR` for all other errors.
Typically, the only recourse for most apps if sign in fails is to ask
the user to sign in again later, or proceed with anonymous sign-in if supported.

Expand All @@ -275,7 +275,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
IdpResponse response = IdpResponse.fromResultIntent(data);

// Successfully signed in
if (resultCode == ResultCodes.OK) {
if (resultCode == RESULT_OK) {
startActivity(SignedInActivity.createIntent(this, response));
finish();
return;
Expand Down Expand Up @@ -315,7 +315,7 @@ Intent.
```java
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == ResultCodes.OK) {
if (resultCode == RESULT_OK) {
IdpResponse idpResponse = IdpResponse.fromResultIntent(data);
startActivity(new Intent(this, WelcomeBackActivity.class)
.putExtra("my_token", idpResponse.getIdpToken()));
Expand Down
14 changes: 13 additions & 1 deletion auth/auth-proguard.pro
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
# Twitter and Facebook are optional
-dontwarn com.twitter.**
-dontwarn com.facebook.**
-dontwarn com.facebook.**

# Recommended flags for Firebase Auth
-keepattributes Signature
-keepattributes *Annotation*

# Don't warn about retrofit or okio classes
-dontwarn okio.**
-dontwarn retrofit2.Call
-dontnote retrofit2.Platform
-dontnote retrofit2.Platform$IOS$MainThreadExecutor
-dontwarn retrofit2.Platform$Java8
7 changes: 4 additions & 3 deletions auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ android {
versionCode 1
versionName "1.0"

vectorDrawables.useSupportLibrary = true
resourcePrefix "fui_"
}

Expand All @@ -19,7 +20,7 @@ android {
manifestPlaceholders = [enableFbLogging: true]

minifyEnabled false
consumerProguardFiles getDefaultProguardFile('proguard-android.txt'), 'auth-proguard.pro'
consumerProguardFiles 'auth-proguard.pro'
}

debug {
Expand Down Expand Up @@ -50,7 +51,7 @@ dependencies {
compile "com.google.firebase:firebase-auth:$firebaseVersion"
compile "com.google.android.gms:play-services-auth:$firebaseVersion"

provided 'com.facebook.android:facebook-android-sdk:4.23.0'
provided 'com.facebook.android:facebook-android-sdk:4.25.0'
provided("com.twitter.sdk.android:twitter-core:3.0.0@aar") { transitive = true }

// The following libraries are needed to prevent incompatibilities with the facebook
Expand All @@ -61,7 +62,7 @@ dependencies {
//noinspection GradleDynamicVersion
testCompile 'org.mockito:mockito-core:2.8.+'
testCompile 'org.robolectric:robolectric:3.4'
testCompile 'com.facebook.android:facebook-android-sdk:4.23.0'
testCompile 'com.facebook.android:facebook-android-sdk:4.25.0'
}

javadoc.exclude([
Expand Down
3 changes: 3 additions & 0 deletions auth/src/main/java/com/firebase/ui/auth/AuthUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
import com.google.firebase.auth.PhoneAuthProvider;
import com.google.firebase.auth.TwitterAuthProvider;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand All @@ -73,6 +75,7 @@ public class AuthUI {
FacebookAuthProvider.PROVIDER_ID, FACEBOOK_PROVIDER,
TwitterAuthProvider.PROVIDER_ID, TWITTER_PROVIDER
})
@Retention(RetentionPolicy.SOURCE)
public @interface SupportedProvider {}

/**
Expand Down
Loading

0 comments on commit f4494c4

Please sign in to comment.