Skip to content

Commit 73a696e

Browse files
authored
Merge pull request #938 from firebase/version-3.0.0-dev
Release Version 3.0.0
2 parents e25ff29 + d1f6f9e commit 73a696e

File tree

83 files changed

+6182
-1491
lines changed

Some content is hidden

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

83 files changed

+6182
-1491
lines changed

README.md

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
[![Build Status](https://travis-ci.org/firebase/FirebaseUI-Android.svg?branch=master)](https://travis-ci.org/firebase/FirebaseUI-Android)
44

55
FirebaseUI is an open-source library for Android that allows you to
6-
quickly connect common UI elements to [Firebase](https://firebase.google.com)
7-
APIs like the Realtime Database or Firebase Authentication.
6+
quickly connect common UI elements to [Firebase](https://firebase.google.com) APIs.
87

98
A compatible FirebaseUI client is also available for [iOS](https://github.com/firebase/firebaseui-ios).
109

@@ -19,10 +18,11 @@ A compatible FirebaseUI client is also available for [iOS](https://github.com/fi
1918

2019
## Usage
2120

22-
FirebaseUI has separate modules for using Firebase Database, Auth, and Storage. To
23-
get started, see the individual instructions for each module:
21+
FirebaseUI has separate modules for using Firebase Realtime Database, Cloud Firestore,
22+
Firebase Auth, and Cloud Storage. To get started, see the individual instructions for each module:
2423

2524
* [firebase-ui-database](database/README.md)
25+
* [firebase-ui-firestore](firestore/README.md)
2626
* [firebase-ui-auth](auth/README.md)
2727
* [firebase-ui-storage](storage/README.md)
2828

@@ -38,17 +38,17 @@ libraries.
3838

3939
```groovy
4040
dependencies {
41-
// FirebaseUI Database only
42-
compile 'com.firebaseui:firebase-ui-database:2.4.0'
41+
// FirebaseUI for Firebase Realtime Database
42+
compile 'com.firebaseui:firebase-ui-database:3.0.0'
43+
44+
// FirebaseUI for Cloud Firestore
45+
compile 'com.firebaseui:firebase-ui-firestore:3.0.0'
4346
44-
// FirebaseUI Auth only
45-
compile 'com.firebaseui:firebase-ui-auth:2.4.0'
47+
// FirebaseUI for Firebase Auth
48+
compile 'com.firebaseui:firebase-ui-auth:3.0.0'
4649
47-
// FirebaseUI Storage only
48-
compile 'com.firebaseui:firebase-ui-storage:2.4.0'
49-
50-
// Single target that includes all FirebaseUI libraries above
51-
compile 'com.firebaseui:firebase-ui:2.4.0'
50+
// FirebaseUI for Cloud Storage
51+
compile 'com.firebaseui:firebase-ui-storage:3.0.0'
5252
}
5353
```
5454

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

66+
* [Upgrade from 2.3.0 to 3.x.x](./docs/upgrade-to-3.0.md)
6667
* [Upgrade from 1.2.0 to 2.x.x](./docs/upgrade-to-2.0.md)
6768

6869
## Dependencies
@@ -78,6 +79,9 @@ firebase-ui-auth
7879
firebase-ui-database
7980
|--- com.google.firebase:firebase-database
8081
82+
firebase-ui-firestore
83+
|--- com.google.firebase:firebase-firestore
84+
8185
firebase-ui-storage
8286
|--- com.google.firebase:firebase-storage
8387
```
@@ -91,6 +95,7 @@ For convenience, here are some recent examples:
9195

9296
| FirebaseUI Version | Firebase/Play Services Version |
9397
|--------------------|--------------------------------|
98+
| 3.0.0 | 11.4.2 |
9499
| 2.4.0 | 11.4.0 |
95100
| 2.3.0 | 11.0.4 |
96101
| 2.2.0 | 11.0.4 |
@@ -121,7 +126,7 @@ compile "com.android.support:customtabs:$BAR"
121126
compile "com.android.support:cardview-v7:$BAR"
122127
```
123128

124-
Database:
129+
Realtime Database:
125130

126131
```groovy
127132
compile "com.google.firebase:firebase-database:$FOO"
@@ -130,6 +135,15 @@ compile "com.android.support:recyclerview-v7:$BAR"
130135
compile "com.android.support:support-v4:$BAR"
131136
```
132137

138+
Firestore:
139+
140+
```groovy
141+
compile "com.google.firebase:firebase-firestore:$FOO"
142+
143+
compile "com.android.support:recyclerview-v7:$BAR"
144+
compile "com.android.support:support-v4:$BAR"
145+
```
146+
133147
Storage:
134148

135149
```groovy

app/build.gradle

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ android {
1313
versionName "1.0"
1414

1515
vectorDrawables.useSupportLibrary = true
16+
multiDexEnabled true
1617
}
1718

1819
buildTypes {
@@ -34,28 +35,36 @@ android {
3435
dependencies {
3536
compile fileTree(dir: 'libs', include: ['*.jar'])
3637
compile "com.android.support:design:$supportLibraryVersion"
38+
compile 'com.android.support:multidex:1.0.1'
3739

3840
compile project(path: ':auth')
3941
compile project(path: ':database')
42+
compile project(path: ':firestore')
4043
compile project(path: ':storage')
4144

4245
compile "com.google.android.gms:play-services-auth:$firebaseVersion"
4346
compile "com.google.firebase:firebase-auth:$firebaseVersion"
4447
compile "com.google.firebase:firebase-database:$firebaseVersion"
4548
compile "com.google.firebase:firebase-storage:$firebaseVersion"
4649

47-
compile('com.facebook.android:facebook-android-sdk:4.25.0')
50+
compile('com.facebook.android:facebook-login:4.27.0')
4851
compile("com.twitter.sdk.android:twitter-core:3.0.0@aar") { transitive = true }
4952

53+
compile "android.arch.lifecycle:runtime:$architectureVersion"
54+
compile "android.arch.lifecycle:extensions:$architectureVersion"
55+
56+
compile 'com.github.bumptech.glide:glide:4.1.1'
57+
annotationProcessor 'com.github.bumptech.glide:compiler:4.1.1'
58+
5059
// The following dependencies are not required to use the Firebase UI library.
5160
// They are used to make some aspects of the demo app implementation simpler for
5261
// demonstrative purposes, and you may find them useful in your own apps; YMMV.
53-
compile 'pub.devrel:easypermissions:0.4.3'
62+
compile 'pub.devrel:easypermissions:1.0.1'
5463
compile 'com.jakewharton:butterknife:8.7.0'
5564
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
56-
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
57-
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
58-
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
65+
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.4'
66+
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
67+
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
5968
}
6069

6170
apply plugin: 'com.google.gms.google-services'

app/src/main/AndroidManifest.xml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,40 @@
2121
<activity android:name=".ChooserActivity">
2222
<intent-filter>
2323
<action android:name="android.intent.action.MAIN" />
24+
2425
<category android:name="android.intent.category.LAUNCHER" />
2526
</intent-filter>
27+
2628
<meta-data
2729
android:name="android.app.shortcuts"
2830
android:resource="@xml/shortcuts" />
2931
</activity>
3032

31-
<!-- Chat demo -->
32-
<activity
33-
android:name=".database.ChatActivity"
34-
android:label="@string/name_chat" />
35-
<activity
36-
android:name=".database.ChatIndexActivity"
37-
android:label="@string/name_chat" />
38-
3933
<!-- Auth UI demo -->
4034
<activity
4135
android:name=".auth.AuthUiActivity"
42-
android:label="@string/name_auth_ui" />
36+
android:label="@string/title_auth_activity" />
4337
<activity
4438
android:name=".auth.SignedInActivity"
45-
android:label="@string/name_auth_ui" />
39+
android:label="@string/title_auth_activity" />
40+
41+
<!-- Firestore demo -->
42+
<activity
43+
android:name=".database.firestore.FirestoreChatActivity"
44+
android:label="@string/title_firestore_activity" />
45+
46+
<!-- Realtime database demo -->
47+
<activity
48+
android:name=".database.realtime.RealtimeDbChatActivity"
49+
android:label="@string/title_realtime_database_activity" />
50+
<activity
51+
android:name=".database.realtime.RealtimeDbChatIndexActivity"
52+
android:label="@string/title_realtime_database_activity" />
4653

47-
<!-- Storage UI demo-->
54+
<!-- Storage UI demo -->
4855
<activity
4956
android:name=".storage.ImageActivity"
50-
android:label="@string/name_image" />
57+
android:label="@string/title_storage_activity" />
5158

5259
</application>
5360

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
import android.widget.TextView;
2727

2828
import com.firebase.uidemo.auth.AuthUiActivity;
29-
import com.firebase.uidemo.database.ChatActivity;
29+
import com.firebase.uidemo.database.firestore.FirestoreChatActivity;
30+
import com.firebase.uidemo.database.realtime.RealtimeDbChatActivity;
3031
import com.firebase.uidemo.storage.ImageActivity;
3132

3233
import butterknife.BindView;
@@ -49,21 +50,24 @@ protected void onCreate(Bundle savedInstanceState) {
4950

5051
private static class ActivityChooserAdapter extends RecyclerView.Adapter<ActivityStarterHolder> {
5152
private static final Class[] CLASSES = new Class[]{
52-
ChatActivity.class,
5353
AuthUiActivity.class,
54+
FirestoreChatActivity.class,
55+
RealtimeDbChatActivity.class,
5456
ImageActivity.class,
5557
};
5658

5759
private static final int[] DESCRIPTION_NAMES = new int[]{
58-
R.string.name_chat,
59-
R.string.name_auth_ui,
60-
R.string.name_image
60+
R.string.title_auth_activity,
61+
R.string.title_firestore_activity,
62+
R.string.title_realtime_database_activity,
63+
R.string.title_storage_activity
6164
};
6265

6366
private static final int[] DESCRIPTION_IDS = new int[]{
64-
R.string.desc_chat,
65-
R.string.desc_auth_ui,
66-
R.string.desc_image
67+
R.string.desc_auth,
68+
R.string.desc_firestore,
69+
R.string.desc_realtime_database,
70+
R.string.desc_storage
6771
};
6872

6973
@Override
@@ -92,8 +96,8 @@ private static class ActivityStarterHolder extends RecyclerView.ViewHolder imple
9296

9397
public ActivityStarterHolder(View itemView) {
9498
super(itemView);
95-
mTitle = (TextView) itemView.findViewById(R.id.text1);
96-
mDescription = (TextView) itemView.findViewById(R.id.text2);
99+
mTitle = itemView.findViewById(R.id.text1);
100+
mDescription = itemView.findViewById(R.id.text2);
97101
}
98102

99103
private void bind(Class aClass, @StringRes int name, @StringRes int description) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package com.firebase.uidemo.auth;
22

3-
import android.app.Application;
43
import android.content.Context;
4+
import android.support.multidex.MultiDexApplication;
55
import android.support.v7.app.AppCompatDelegate;
66

77
import com.squareup.leakcanary.LeakCanary;
88
import com.squareup.leakcanary.RefWatcher;
99

10-
public class FirebaseUIDemo extends Application {
10+
public class FirebaseUIDemo extends MultiDexApplication {
1111
private RefWatcher mRefWatcher;
1212

1313
static {

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
import android.widget.ImageView;
3232
import android.widget.TextView;
3333

34-
import com.bumptech.glide.Glide;
3534
import com.firebase.ui.auth.AuthUI;
3635
import com.firebase.ui.auth.AuthUI.IdpConfig;
3736
import com.firebase.ui.auth.IdpResponse;
3837
import com.firebase.uidemo.R;
38+
import com.firebase.uidemo.storage.GlideApp;
3939
import com.google.android.gms.tasks.OnCompleteListener;
4040
import com.google.android.gms.tasks.Task;
4141
import com.google.firebase.auth.EmailAuthProvider;
@@ -69,7 +69,6 @@ public class SignedInActivity extends AppCompatActivity {
6969
@BindView(R.id.user_display_name)
7070
TextView mUserDisplayName;
7171

72-
7372
@BindView(R.id.user_phone_number)
7473
TextView mUserPhoneNumber;
7574

@@ -165,7 +164,7 @@ public void onComplete(@NonNull Task<Void> task) {
165164
private void populateProfile() {
166165
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
167166
if (user.getPhotoUrl() != null) {
168-
Glide.with(this)
167+
GlideApp.with(this)
169168
.load(user.getPhotoUrl())
170169
.fitCenter()
171170
.into(mUserProfilePicture);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.firebase.uidemo.database;
2+
3+
/**
4+
* Common interface for chat messages, helps share code between RTDB and Firestore examples.
5+
*/
6+
public abstract class AbstractChat {
7+
8+
public abstract String getName();
9+
10+
public abstract String getMessage();
11+
12+
public abstract String getUid();
13+
14+
}

0 commit comments

Comments
 (0)