Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
f0186c2
FirebaseUI for Firestore
samtstern Jul 13, 2017
f91df6f
Merge branch 'version-2.1.1-dev' into firestore
samtstern Jul 25, 2017
d53875e
Merge branch 'master' into firestore
samtstern Jul 26, 2017
887765d
Ordering, timestamps, and better events
samtstern Aug 4, 2017
bb5e182
Merge branch 'master' into firestore
samtstern Aug 4, 2017
3615c00
Unify some changes, add caching.
samtstern Aug 4, 2017
4ac2819
Cleanup some noise
samtstern Aug 4, 2017
5ddf442
Some more fiddling
samtstern Aug 5, 2017
f9d8aba
Add some comments, switch the order of indexes in events.
samtstern Aug 7, 2017
d8dbf87
Unify change event listeners
samtstern Aug 7, 2017
d2fa47e
Move more into the base class
samtstern Aug 8, 2017
b8db413
Unify listener addition, fix hasDataChanged
samtstern Aug 8, 2017
981f7ef
Add OSA to Firestore
samtstern Aug 8, 2017
43ee4e5
Move errors up to base class
samtstern Aug 8, 2017
443bcbb
Merge branch 'master' into firestore
samtstern Aug 18, 2017
c7ff1ae
Merge branch 'master' into firestore
samtstern Sep 5, 2017
b79c707
Add tests
samtstern Sep 6, 2017
74c954f
Version number
samtstern Sep 6, 2017
c8f0d4a
Add more constructors
samtstern Sep 6, 2017
2ba9de0
Merge branch 'dev' into firestore
samtstern Sep 8, 2017
9f00117
Fix typo
samtstern Sep 8, 2017
e30ca58
Merge pull request #1 from FirebasePrivate/firestore
samtstern Sep 8, 2017
e5fbab8
Lockdown firebase arrays and improve index add performance (#898)
SUPERCILEX Sep 11, 2017
90ea9c2
Merge remote-tracking branch 'CONFIDENTIAL/version-3.0.0-dev' into dev
SUPERCILEX Sep 11, 2017
fea9eb3
Cleanup (#2)
SUPERCILEX Sep 12, 2017
57d0de5
Replace adapter constructors with options (#7)
samtstern Sep 12, 2017
e71ddc4
Make FirebaseRecyclerAdapter use RecyclerView naming scheme and metho…
SUPERCILEX Sep 13, 2017
fbb31a9
Revamp sample (#903)
SUPERCILEX Sep 13, 2017
7d72ddb
Merge from public upstream
SUPERCILEX Sep 13, 2017
eab7d78
Add Firestore docs (#11)
samtstern Sep 13, 2017
4c194a9
Revamp Firestore sample with new public repo changes (#4)
SUPERCILEX Sep 13, 2017
22b0b30
Merge branch 'version-2.3.1-dev' into version-3.0.0-dev
samtstern Sep 13, 2017
663e558
Merge branch 'version-3.0.0-dev' into dev
samtstern Sep 13, 2017
db46162
Fix indentation (#14)
SUPERCILEX Sep 13, 2017
70184f2
Bring improvements from Firestore adapter to Firebase adapters (#15)
SUPERCILEX Sep 13, 2017
74454d8
Add back FirestoreArray constructor without QueryListenOptions
SUPERCILEX Sep 13, 2017
0bea78b
Add back FirestoreArray constructor without QueryListenOptions (#16)
samtstern Sep 13, 2017
9744199
Convert SnapshotArray from List<S> to List<T> (#18)
SUPERCILEX Sep 14, 2017
8b6005c
Use proper List equals/hashCode/toString methods (#19)
SUPERCILEX Sep 14, 2017
dac8567
Update RTDB docs to match Firestore docs (#20)
samtstern Sep 19, 2017
34adac2
Support for Glide 4.0 (#802)
samtstern Sep 20, 2017
2f07666
Merge branch 'version-3.0.0-dev' into dev
samtstern Sep 20, 2017
0dde270
3.0 migration guide (#21)
samtstern Sep 21, 2017
b615c39
Make gradle check pass
samtstern Sep 26, 2017
29145b2
Move to final SDK
samtstern Sep 28, 2017
a0e68e3
Update and fix dependencies (cough cough, Facebook 😁) (#929)
SUPERCILEX Sep 28, 2017
1715e6d
Merge remote-tracking branch 'CONFIDENTIAL/version-3.0.0-dev' into dev
SUPERCILEX Sep 28, 2017
2808fd4
Quickfix: update Firestore demo activity name
SUPERCILEX Sep 28, 2017
32ee88f
Merge branch 'master' into version-3.0.0-dev
samtstern Sep 28, 2017
59dfda3
Merge branch 'version-3.0.0-dev' of github.com:firebase/FirebaseUI-An…
samtstern Sep 28, 2017
7981414
Merge branch 'version-3.0.0-dev' into dev
samtstern Sep 28, 2017
f4b0678
Merge branch 'dev' of github.com:FirebasePrivate/FirebaseUI-Android i…
samtstern Sep 28, 2017
4755d44
Enable multidex
samtstern Oct 3, 2017
c8644c6
Really enable multidex
samtstern Oct 3, 2017
74385dc
Merge pull request #936 from firebase/firestore
samtstern Oct 3, 2017
d1f6f9e
Version 3.0.0
samtstern Oct 3, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 28 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
[![Build Status](https://travis-ci.org/firebase/FirebaseUI-Android.svg?branch=master)](https://travis-ci.org/firebase/FirebaseUI-Android)

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

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

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

## Usage

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

* [firebase-ui-database](database/README.md)
* [firebase-ui-firestore](firestore/README.md)
* [firebase-ui-auth](auth/README.md)
* [firebase-ui-storage](storage/README.md)

Expand All @@ -38,17 +38,17 @@ libraries.

```groovy
dependencies {
// FirebaseUI Database only
compile 'com.firebaseui:firebase-ui-database:2.4.0'
// FirebaseUI for Firebase Realtime Database
compile 'com.firebaseui:firebase-ui-database:3.0.0'

// FirebaseUI for Cloud Firestore
compile 'com.firebaseui:firebase-ui-firestore:3.0.0'

// FirebaseUI Auth only
compile 'com.firebaseui:firebase-ui-auth:2.4.0'
// FirebaseUI for Firebase Auth
compile 'com.firebaseui:firebase-ui-auth:3.0.0'

// FirebaseUI Storage only
compile 'com.firebaseui:firebase-ui-storage:2.4.0'

// Single target that includes all FirebaseUI libraries above
compile 'com.firebaseui:firebase-ui:2.4.0'
// FirebaseUI for Cloud Storage
compile 'com.firebaseui:firebase-ui-storage:3.0.0'
}
```

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

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

## Dependencies
Expand All @@ -78,6 +79,9 @@ firebase-ui-auth
firebase-ui-database
|--- com.google.firebase:firebase-database

firebase-ui-firestore
|--- com.google.firebase:firebase-firestore

firebase-ui-storage
|--- com.google.firebase:firebase-storage
```
Expand All @@ -91,6 +95,7 @@ For convenience, here are some recent examples:

| FirebaseUI Version | Firebase/Play Services Version |
|--------------------|--------------------------------|
| 3.0.0 | 11.4.2 |
| 2.4.0 | 11.4.0 |
| 2.3.0 | 11.0.4 |
| 2.2.0 | 11.0.4 |
Expand Down Expand Up @@ -121,7 +126,7 @@ compile "com.android.support:customtabs:$BAR"
compile "com.android.support:cardview-v7:$BAR"
```

Database:
Realtime Database:

```groovy
compile "com.google.firebase:firebase-database:$FOO"
Expand All @@ -130,6 +135,15 @@ compile "com.android.support:recyclerview-v7:$BAR"
compile "com.android.support:support-v4:$BAR"
```

Firestore:

```groovy
compile "com.google.firebase:firebase-firestore:$FOO"

compile "com.android.support:recyclerview-v7:$BAR"
compile "com.android.support:support-v4:$BAR"
```

Storage:

```groovy
Expand Down
19 changes: 14 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ android {
versionName "1.0"

vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}

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

compile project(path: ':auth')
compile project(path: ':database')
compile project(path: ':firestore')
compile project(path: ':storage')

compile "com.google.android.gms:play-services-auth:$firebaseVersion"
compile "com.google.firebase:firebase-auth:$firebaseVersion"
compile "com.google.firebase:firebase-database:$firebaseVersion"
compile "com.google.firebase:firebase-storage:$firebaseVersion"

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

compile "android.arch.lifecycle:runtime:$architectureVersion"
compile "android.arch.lifecycle:extensions:$architectureVersion"

compile 'com.github.bumptech.glide:glide:4.1.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.1.1'

// 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.3'
compile 'pub.devrel:easypermissions:1.0.1'
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'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.4'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
}

apply plugin: 'com.google.gms.google-services'
31 changes: 19 additions & 12 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,40 @@
<activity android:name=".ChooserActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>

<!-- Chat demo -->
<activity
android:name=".database.ChatActivity"
android:label="@string/name_chat" />
<activity
android:name=".database.ChatIndexActivity"
android:label="@string/name_chat" />

<!-- Auth UI demo -->
<activity
android:name=".auth.AuthUiActivity"
android:label="@string/name_auth_ui" />
android:label="@string/title_auth_activity" />
<activity
android:name=".auth.SignedInActivity"
android:label="@string/name_auth_ui" />
android:label="@string/title_auth_activity" />

<!-- Firestore demo -->
<activity
android:name=".database.firestore.FirestoreChatActivity"
android:label="@string/title_firestore_activity" />

<!-- Realtime database demo -->
<activity
android:name=".database.realtime.RealtimeDbChatActivity"
android:label="@string/title_realtime_database_activity" />
<activity
android:name=".database.realtime.RealtimeDbChatIndexActivity"
android:label="@string/title_realtime_database_activity" />

<!-- Storage UI demo-->
<!-- Storage UI demo -->
<activity
android:name=".storage.ImageActivity"
android:label="@string/name_image" />
android:label="@string/title_storage_activity" />

</application>

Expand Down
24 changes: 14 additions & 10 deletions app/src/main/java/com/firebase/uidemo/ChooserActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
import android.widget.TextView;

import com.firebase.uidemo.auth.AuthUiActivity;
import com.firebase.uidemo.database.ChatActivity;
import com.firebase.uidemo.database.firestore.FirestoreChatActivity;
import com.firebase.uidemo.database.realtime.RealtimeDbChatActivity;
import com.firebase.uidemo.storage.ImageActivity;

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

private static class ActivityChooserAdapter extends RecyclerView.Adapter<ActivityStarterHolder> {
private static final Class[] CLASSES = new Class[]{
ChatActivity.class,
AuthUiActivity.class,
FirestoreChatActivity.class,
RealtimeDbChatActivity.class,
ImageActivity.class,
};

private static final int[] DESCRIPTION_NAMES = new int[]{
R.string.name_chat,
R.string.name_auth_ui,
R.string.name_image
R.string.title_auth_activity,
R.string.title_firestore_activity,
R.string.title_realtime_database_activity,
R.string.title_storage_activity
};

private static final int[] DESCRIPTION_IDS = new int[]{
R.string.desc_chat,
R.string.desc_auth_ui,
R.string.desc_image
R.string.desc_auth,
R.string.desc_firestore,
R.string.desc_realtime_database,
R.string.desc_storage
};

@Override
Expand Down Expand Up @@ -92,8 +96,8 @@ private static class ActivityStarterHolder extends RecyclerView.ViewHolder imple

public ActivityStarterHolder(View itemView) {
super(itemView);
mTitle = (TextView) itemView.findViewById(R.id.text1);
mDescription = (TextView) itemView.findViewById(R.id.text2);
mTitle = itemView.findViewById(R.id.text1);
mDescription = itemView.findViewById(R.id.text2);
}

private void bind(Class aClass, @StringRes int name, @StringRes int description) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.firebase.uidemo.auth;

import android.app.Application;
import android.content.Context;
import android.support.multidex.MultiDexApplication;
import android.support.v7.app.AppCompatDelegate;

import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;

public class FirebaseUIDemo extends Application {
public class FirebaseUIDemo extends MultiDexApplication {
private RefWatcher mRefWatcher;

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.firebase.ui.auth.AuthUI;
import com.firebase.ui.auth.AuthUI.IdpConfig;
import com.firebase.ui.auth.IdpResponse;
import com.firebase.uidemo.R;
import com.firebase.uidemo.storage.GlideApp;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.EmailAuthProvider;
Expand Down Expand Up @@ -69,7 +69,6 @@ public class SignedInActivity extends AppCompatActivity {
@BindView(R.id.user_display_name)
TextView mUserDisplayName;


@BindView(R.id.user_phone_number)
TextView mUserPhoneNumber;

Expand Down Expand Up @@ -165,7 +164,7 @@ public void onComplete(@NonNull Task<Void> task) {
private void populateProfile() {
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
if (user.getPhotoUrl() != null) {
Glide.with(this)
GlideApp.with(this)
.load(user.getPhotoUrl())
.fitCenter()
.into(mUserProfilePicture);
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/java/com/firebase/uidemo/database/AbstractChat.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.firebase.uidemo.database;

/**
* Common interface for chat messages, helps share code between RTDB and Firestore examples.
*/
public abstract class AbstractChat {

public abstract String getName();

public abstract String getMessage();

public abstract String getUid();

}
Loading