Skip to content

Commit 7d7a1fc

Browse files
authored
Merge pull request #1311 from firebase/version-4.0
Version 4.0
2 parents 48c625b + 2d7f098 commit 7d7a1fc

File tree

179 files changed

+6615
-1277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+6615
-1277
lines changed

.opensource/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"storage/README.md",
2121
"firestore/README.md",
2222
"docs/upgrade-to-2.0.md",
23-
"docs/upgrade-to-3.0.md"
23+
"docs/upgrade-to-3.0.md",
24+
"docs/upgrade-to-4.0.md"
2425
],
2526

2627
// Related projects on Github, in the format $owner/$repo[/$subproject]

README.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ libraries.
4747
```groovy
4848
dependencies {
4949
// FirebaseUI for Firebase Realtime Database
50-
implementation 'com.firebaseui:firebase-ui-database:3.3.1'
50+
implementation 'com.firebaseui:firebase-ui-database:4.0.0'
5151
5252
// FirebaseUI for Cloud Firestore
53-
implementation 'com.firebaseui:firebase-ui-firestore:3.3.1'
53+
implementation 'com.firebaseui:firebase-ui-firestore:4.0.0'
5454
5555
// FirebaseUI for Firebase Auth
56-
implementation 'com.firebaseui:firebase-ui-auth:3.3.1'
56+
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'
5757
5858
// FirebaseUI for Cloud Storage
59-
implementation 'com.firebaseui:firebase-ui-storage:3.3.1'
59+
implementation 'com.firebaseui:firebase-ui-storage:4.0.0'
6060
}
6161
```
6262

@@ -70,6 +70,7 @@ After the project is synchronized, we're ready to start using Firebase functiona
7070
If you are using an old version of FirebaseUI and upgrading, please see the appropriate
7171
migration guide:
7272

73+
* [Upgrade from 3.3.1 to 4.x.x](./docs/upgrade-to-4.0.md)
7374
* [Upgrade from 2.3.0 to 3.x.x](./docs/upgrade-to-3.0.md)
7475
* [Upgrade from 1.2.0 to 2.x.x](./docs/upgrade-to-2.0.md)
7576

@@ -93,24 +94,20 @@ firebase-ui-storage
9394
|--- com.google.firebase:firebase-storage
9495
```
9596

96-
Each version of FirebaseUI has dependency on a fixed version of these libraries, defined as the variable `firebase_version`
97-
in `common/constants.gradle`. If you are using any dependencies in your app of the form
98-
`implementation 'com.google.firebase:firebase-*:x.y.z'` or
99-
`implementation 'com.google.android.gms:play-services-*:x.y.z'`
100-
you need to make sure that you use the same version that your chosen version of FirebaseUI requires.
97+
As of version `15.0.0`, Firebase and Google Play services libraries have independent, semantic
98+
versions. This means that FirebaseUI has independent dependencies on each of the libraries above.
99+
For best results, your app should depend on a version of each dependency with the same major
100+
version number as the version used by FirebaseUI.
101101

102-
For convenience, here are some recent examples:
103-
104-
| FirebaseUI Version | Firebase/Play Services Version |
105-
|--------------------|--------------------------------|
106-
| 3.3.1 | 15.0.0 |
107-
| 3.3.0 | 12.0.1 |
108-
| 3.2.2 | 11.8.0 |
109-
| 3.1.3 | 11.8.0 |
110-
| 3.0.0 | 11.4.2 |
111-
| 2.4.0 | 11.4.0 |
112-
| 1.1.1 | 10.0.0 or 10.0.1 |
102+
As of version `4.0.0`, FirebaseUI has the following dependency versions:
113103

104+
| Library | Version |
105+
|----------------------|--------------------------------|
106+
| `firebase-auth` | 15.1.0 |
107+
| `play-services-auth` | 15.0.1 |
108+
| `firebase-database` | 15.0.1 |
109+
| `firebase-firestore` | 16.0.0 |
110+
| `firebase-storage` | 15.0.2 |
114111

115112
### Upgrading dependencies
116113

app/build.gradle

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ android {
3636
}
3737

3838
dependencies {
39-
implementation "com.google.firebase:firebase-core:$firebaseVersion"
39+
implementation "com.google.firebase:firebase-core:$coreVersion"
4040
implementation "com.android.support:design:$supportLibraryVersion"
4141
implementation 'com.android.support:multidex:1.0.3'
4242

@@ -45,14 +45,17 @@ dependencies {
4545
implementation project(path: ':database')
4646
implementation project(path: ':storage')
4747

48-
implementation 'com.facebook.android:facebook-login:4.31.0'
48+
implementation 'com.facebook.android:facebook-login:4.32.0'
4949
// Needed to override Facebook
5050
implementation "com.android.support:cardview-v7:$supportLibraryVersion"
5151
implementation "com.android.support:customtabs:$supportLibraryVersion"
5252
implementation("com.twitter.sdk.android:twitter-core:3.1.1@aar") { transitive = true }
5353

54-
implementation 'com.github.bumptech.glide:glide:4.6.1'
55-
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
54+
implementation 'com.github.bumptech.glide:glide:4.7.1'
55+
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
56+
57+
// Used for FirestorePagingActivity
58+
implementation "android.arch.paging:runtime:$pagingVersion"
5659

5760
// The following dependencies are not required to use the Firebase UI library.
5861
// They are used to make some aspects of the demo app implementation simpler for

app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
android:name=".database.firestore.FirestoreChatActivity"
4444
android:label="@string/title_firestore_activity" />
4545

46+
<!-- Firestore paging demo -->
47+
<activity
48+
android:name=".database.firestore.FirestorePagingActivity"
49+
android:label="@string/title_firestore_paging_activity" />
50+
4651
<!-- Realtime database demo -->
4752
<activity
4853
android:name=".database.realtime.RealtimeDbChatActivity"

app/src/main/java/com/firebase/uidemo/ChooserActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
import com.firebase.uidemo.auth.AuthUiActivity;
3030
import com.firebase.uidemo.database.firestore.FirestoreChatActivity;
31+
import com.firebase.uidemo.database.firestore.FirestorePagingActivity;
3132
import com.firebase.uidemo.database.realtime.RealtimeDbChatActivity;
3233
import com.firebase.uidemo.storage.ImageActivity;
3334

@@ -53,20 +54,23 @@ private static class ActivityChooserAdapter extends RecyclerView.Adapter<Activit
5354
private static final Class[] CLASSES = new Class[]{
5455
AuthUiActivity.class,
5556
FirestoreChatActivity.class,
57+
FirestorePagingActivity.class,
5658
RealtimeDbChatActivity.class,
5759
ImageActivity.class,
5860
};
5961

6062
private static final int[] DESCRIPTION_NAMES = new int[]{
6163
R.string.title_auth_activity,
6264
R.string.title_firestore_activity,
65+
R.string.title_firestore_paging_activity,
6366
R.string.title_realtime_database_activity,
6467
R.string.title_storage_activity
6568
};
6669

6770
private static final int[] DESCRIPTION_IDS = new int[]{
6871
R.string.desc_auth,
6972
R.string.desc_firestore,
73+
R.string.desc_firestore_paging,
7074
R.string.desc_realtime_database,
7175
R.string.desc_storage
7276
};

app/src/main/java/com/firebase/uidemo/auth/AuthUiActivity.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import android.content.Intent;
1919
import android.os.Bundle;
2020
import android.support.annotation.DrawableRes;
21+
import android.support.annotation.NonNull;
2122
import android.support.annotation.Nullable;
2223
import android.support.annotation.StringRes;
2324
import android.support.annotation.StyleRes;
@@ -26,7 +27,6 @@
2627
import android.support.v7.app.AppCompatDelegate;
2728
import android.util.Log;
2829
import android.view.View;
29-
import android.widget.Button;
3030
import android.widget.CheckBox;
3131
import android.widget.CompoundButton;
3232
import android.widget.CompoundButton.OnCheckedChangeListener;
@@ -39,6 +39,9 @@
3939
import com.firebase.ui.auth.IdpResponse;
4040
import com.firebase.uidemo.R;
4141
import com.google.android.gms.common.Scopes;
42+
import com.google.android.gms.tasks.OnCompleteListener;
43+
import com.google.android.gms.tasks.Task;
44+
import com.google.firebase.auth.AuthResult;
4245
import com.google.firebase.auth.FirebaseAuth;
4346

4447
import java.util.ArrayList;
@@ -60,7 +63,6 @@ public class AuthUiActivity extends AppCompatActivity {
6063
private static final int RC_SIGN_IN = 100;
6164

6265
@BindView(R.id.root) View mRootView;
63-
@BindView(R.id.sign_in) Button mSignIn;
6466

6567
@BindView(R.id.google_provider) CheckBox mUseGoogleProvider;
6668
@BindView(R.id.facebook_provider) CheckBox mUseFacebookProvider;
@@ -166,6 +168,21 @@ public void signIn(View view) {
166168
RC_SIGN_IN);
167169
}
168170

171+
@OnClick(R.id.sign_in_silent)
172+
public void silentSignIn(View view) {
173+
AuthUI.getInstance().silentSignIn(this, getSelectedProviders())
174+
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
175+
@Override
176+
public void onComplete(@NonNull Task<AuthResult> task) {
177+
if (task.isSuccessful()) {
178+
startSignedInActivity(null);
179+
} else {
180+
showSnackbar(R.string.sign_in_failed);
181+
}
182+
}
183+
});
184+
}
185+
169186
@Override
170187
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
171188
super.onActivityResult(requestCode, resultCode, data);

0 commit comments

Comments
 (0)