Skip to content

Commit 41541b8

Browse files
authored
Version 5.0.0
Version 5.0.0
2 parents 3a24b1d + 7b7384d commit 41541b8

File tree

121 files changed

+1348
-104
lines changed

Some content is hidden

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

121 files changed

+1348
-104
lines changed

README.md

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ A compatible FirebaseUI client is also available for [iOS](https://github.com/fi
1616
1. [Installation](#installation)
1717
1. [Upgrading](#upgrading)
1818
1. [Dependencies](#dependencies)
19-
1. [Compatability](#compatibility-with-firebase--google-play-services-libraries)
19+
1. [Compatibility](#compatibility-with-firebase--google-play-services-libraries)
2020
1. [Upgrading dependencies](#upgrading-dependencies)
2121
1. [Sample App](#sample-app)
2222
1. [Snapshot Builds](#snapshot-builds)
2323
1. [Contributing](#contributing)
2424
1. [Installing](#installing-locally)
25-
1. [Deploying](#deployment)
26-
1. [Tagging](#tag-a-release-on-github)
2725
1. [License agreements](#contributor-license-agreements)
2826
1. [Process](#contribution-process)
2927

@@ -50,19 +48,19 @@ libraries.
5048
```groovy
5149
dependencies {
5250
// FirebaseUI for Firebase Realtime Database
53-
implementation 'com.firebaseui:firebase-ui-database:4.3.2'
51+
implementation 'com.firebaseui:firebase-ui-database:5.0.0'
5452
5553
// FirebaseUI for Cloud Firestore
56-
implementation 'com.firebaseui:firebase-ui-firestore:4.3.2'
54+
implementation 'com.firebaseui:firebase-ui-firestore:5.0.0'
5755
5856
// FirebaseUI for Firebase Auth
59-
implementation 'com.firebaseui:firebase-ui-auth:4.3.2'
57+
implementation 'com.firebaseui:firebase-ui-auth:5.0.0'
6058
6159
// FirebaseUI for Firebase Auth (GitHub provider)
62-
implementation 'com.firebaseui:firebase-ui-auth-github:4.3.2'
60+
implementation 'com.firebaseui:firebase-ui-auth-github:5.0.0'
6361
6462
// FirebaseUI for Cloud Storage
65-
implementation 'com.firebaseui:firebase-ui-storage:4.3.2'
63+
implementation 'com.firebaseui:firebase-ui-storage:5.0.0'
6664
}
6765
```
6866

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

77+
* [Upgrade from 4.3.2 to 5.x.x](./docs/upgrade-to-5.0.md)
7978
* [Upgrade from 3.3.1 to 4.x.x](./docs/upgrade-to-4.0.md)
8079
* [Upgrade from 2.3.0 to 3.x.x](./docs/upgrade-to-3.0.md)
8180
* [Upgrade from 1.2.0 to 2.x.x](./docs/upgrade-to-2.0.md)
@@ -149,22 +148,6 @@ implementation "com.android.support:appcompat-v7:$BAR"
149148
implementation "com.android.support:palette-v7:$BAR"
150149
```
151150

152-
#### Note
153-
154-
Starting version 25.4.0, support libraries are now available through
155-
[Google's Maven repository](https://developer.android.com/studio/build/dependencies.html#google-maven),
156-
so ensure that you have that added to your project's repositories.
157-
158-
Open the `build.gradle` file for your project and modify it as following,
159-
160-
```
161-
allprojects {
162-
repositories {
163-
google()
164-
jcenter()
165-
}
166-
}
167-
```
168151

169152
## Sample app
170153

@@ -194,7 +177,7 @@ from external model`.
194177

195178
## Snapshot builds
196179

197-
Like to live on the cutting edge? Want to try the next release of FirebaseUI before anyone else? As of version `3.2.2`
180+
Like to live on the cutting edge? Want to try the next release of FirebaseUI before anyone else?
198181
FirebaseUI hosts "snapshot" builds on oss.jfrog.org.
199182

200183
Just add the following to your `build.gradle`:
@@ -229,21 +212,6 @@ repository and running:
229212
./gradlew :library:prepareArtifacts :library:publishAllToMavenLocal
230213
```
231214

232-
### Deployment
233-
234-
To deploy FirebaseUI to Bintray
235-
236-
1. Set `BINTRAY_USER` and `BINTRAY_KEY` in your environment. You must
237-
be a member of the firebaseui Bintray organization.
238-
1. Run `./gradlew clean :library:prepareArtifacts :library:bintrayUploadAll`
239-
1. Go to the Bintray dashboard and click 'Publish'.
240-
1. In Bintray click the 'Maven Central' tab and publish the release.
241-
242-
### Tag a release on GitHub
243-
244-
* Ensure that all your changes are on master and that your local build is on master
245-
* Ensure that the correct version number is in `common/constants.gradle`
246-
247215
### Contributor License Agreements
248216

249217
We'd love to accept your sample apps and patches! Before we can take them, we

app/src/main/AndroidManifest.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@
5555
<activity
5656
android:name=".database.realtime.RealtimeDbChatActivity"
5757
android:label="@string/title_realtime_database_activity" />
58+
59+
<!-- Realtime database paging demo -->
60+
<activity
61+
android:name=".database.realtime.FirebaseDbPagingActivity"
62+
android:label="@string/title_realtime_database_paging_activity" />
63+
5864
<activity
5965
android:name=".database.realtime.RealtimeDbChatIndexActivity"
6066
android:label="@string/title_realtime_database_activity" />

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import com.firebase.uidemo.auth.AuthUiActivity;
3333
import com.firebase.uidemo.database.firestore.FirestoreChatActivity;
3434
import com.firebase.uidemo.database.firestore.FirestorePagingActivity;
35+
import com.firebase.uidemo.database.realtime.FirebaseDbPagingActivity;
3536
import com.firebase.uidemo.database.realtime.RealtimeDbChatActivity;
3637
import com.firebase.uidemo.storage.ImageActivity;
3738

@@ -71,6 +72,7 @@ private static class ActivityChooserAdapter
7172
FirestoreChatActivity.class,
7273
FirestorePagingActivity.class,
7374
RealtimeDbChatActivity.class,
75+
FirebaseDbPagingActivity.class,
7476
ImageActivity.class,
7577
};
7678

@@ -80,6 +82,7 @@ private static class ActivityChooserAdapter
8082
R.string.title_firestore_activity,
8183
R.string.title_firestore_paging_activity,
8284
R.string.title_realtime_database_activity,
85+
R.string.title_realtime_database_paging_activity,
8386
R.string.title_storage_activity
8487
};
8588

@@ -89,6 +92,7 @@ private static class ActivityChooserAdapter
8992
R.string.desc_firestore,
9093
R.string.desc_firestore_paging,
9194
R.string.desc_realtime_database,
95+
R.string.desc_realtime_database_paging,
9296
R.string.desc_storage
9397
};
9498

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,11 @@ private void handleSignInResponse(int resultCode, @Nullable Intent data) {
351351
startActivity(intent);
352352
}
353353

354+
if (response.getError().getErrorCode() == ErrorCodes.ERROR_USER_DISABLED) {
355+
showSnackbar(R.string.account_disabled);
356+
return;
357+
}
358+
354359
showSnackbar(R.string.unknown_error);
355360
Log.e(TAG, "Sign-in error: ", response.getError());
356361
}

app/src/main/java/com/firebase/uidemo/database/firestore/FirestorePagingActivity.java

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.os.Bundle;
55
import android.support.annotation.NonNull;
66
import android.support.annotation.Nullable;
7+
import android.support.v4.widget.SwipeRefreshLayout;
78
import android.support.v7.app.AppCompatActivity;
89
import android.support.v7.widget.LinearLayoutManager;
910
import android.support.v7.widget.RecyclerView;
@@ -40,8 +41,8 @@ public class FirestorePagingActivity extends AppCompatActivity {
4041
@BindView(R.id.paging_recycler)
4142
RecyclerView mRecycler;
4243

43-
@BindView(R.id.paging_loading)
44-
ProgressBar mProgressBar;
44+
@BindView(R.id.swipe_refresh_layout)
45+
SwipeRefreshLayout mSwipeRefreshLayout;
4546

4647
private FirebaseFirestore mFirestore;
4748
private CollectionReference mItemsCollection;
@@ -72,7 +73,7 @@ private void setUpAdapter() {
7273
.setQuery(baseQuery, config, Item.class)
7374
.build();
7475

75-
FirestorePagingAdapter<Item, ItemViewHolder> adapter =
76+
final FirestorePagingAdapter<Item, ItemViewHolder> adapter =
7677
new FirestorePagingAdapter<Item, ItemViewHolder>(options) {
7778
@NonNull
7879
@Override
@@ -95,13 +96,13 @@ protected void onLoadingStateChanged(@NonNull LoadingState state) {
9596
switch (state) {
9697
case LOADING_INITIAL:
9798
case LOADING_MORE:
98-
mProgressBar.setVisibility(View.VISIBLE);
99+
mSwipeRefreshLayout.setRefreshing(true);
99100
break;
100101
case LOADED:
101-
mProgressBar.setVisibility(View.GONE);
102+
mSwipeRefreshLayout.setRefreshing(false);
102103
break;
103104
case FINISHED:
104-
mProgressBar.setVisibility(View.GONE);
105+
mSwipeRefreshLayout.setRefreshing(false);
105106
showToast("Reached end of data set.");
106107
break;
107108
case ERROR:
@@ -110,15 +111,28 @@ protected void onLoadingStateChanged(@NonNull LoadingState state) {
110111
break;
111112
}
112113
}
114+
115+
@Override
116+
protected void onError(@NonNull Exception e) {
117+
mSwipeRefreshLayout.setRefreshing(false);
118+
Log.e(TAG, e.getMessage(), e);
119+
}
113120
};
114121

115122
mRecycler.setLayoutManager(new LinearLayoutManager(this));
116123
mRecycler.setAdapter(adapter);
124+
125+
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
126+
@Override
127+
public void onRefresh() {
128+
adapter.refresh();
129+
}
130+
});
117131
}
118132

119133
@Override
120134
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
121-
getMenuInflater().inflate(R.menu.menu_firestore_paging, menu);
135+
getMenuInflater().inflate(R.menu.menu_paging, menu);
122136
return true;
123137
}
124138

0 commit comments

Comments
 (0)