Skip to content

Commit

Permalink
Version 5.0.0
Browse files Browse the repository at this point in the history
Version 5.0.0
  • Loading branch information
samtstern committed May 21, 2019
2 parents 3a24b1d + 7b7384d commit 41541b8
Show file tree
Hide file tree
Showing 121 changed files with 1,348 additions and 104 deletions.
48 changes: 8 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ A compatible FirebaseUI client is also available for [iOS](https://github.com/fi
1. [Installation](#installation)
1. [Upgrading](#upgrading)
1. [Dependencies](#dependencies)
1. [Compatability](#compatibility-with-firebase--google-play-services-libraries)
1. [Compatibility](#compatibility-with-firebase--google-play-services-libraries)
1. [Upgrading dependencies](#upgrading-dependencies)
1. [Sample App](#sample-app)
1. [Snapshot Builds](#snapshot-builds)
1. [Contributing](#contributing)
1. [Installing](#installing-locally)
1. [Deploying](#deployment)
1. [Tagging](#tag-a-release-on-github)
1. [License agreements](#contributor-license-agreements)
1. [Process](#contribution-process)

Expand All @@ -50,19 +48,19 @@ libraries.
```groovy
dependencies {
// FirebaseUI for Firebase Realtime Database
implementation 'com.firebaseui:firebase-ui-database:4.3.2'
implementation 'com.firebaseui:firebase-ui-database:5.0.0'
// FirebaseUI for Cloud Firestore
implementation 'com.firebaseui:firebase-ui-firestore:4.3.2'
implementation 'com.firebaseui:firebase-ui-firestore:5.0.0'
// FirebaseUI for Firebase Auth
implementation 'com.firebaseui:firebase-ui-auth:4.3.2'
implementation 'com.firebaseui:firebase-ui-auth:5.0.0'
// FirebaseUI for Firebase Auth (GitHub provider)
implementation 'com.firebaseui:firebase-ui-auth-github:4.3.2'
implementation 'com.firebaseui:firebase-ui-auth-github:5.0.0'
// FirebaseUI for Cloud Storage
implementation 'com.firebaseui:firebase-ui-storage:4.3.2'
implementation 'com.firebaseui:firebase-ui-storage:5.0.0'
}
```

Expand All @@ -76,6 +74,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 4.3.2 to 5.x.x](./docs/upgrade-to-5.0.md)
* [Upgrade from 3.3.1 to 4.x.x](./docs/upgrade-to-4.0.md)
* [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)
Expand Down Expand Up @@ -149,22 +148,6 @@ implementation "com.android.support:appcompat-v7:$BAR"
implementation "com.android.support:palette-v7:$BAR"
```

#### Note

Starting version 25.4.0, support libraries are now available through
[Google's Maven repository](https://developer.android.com/studio/build/dependencies.html#google-maven),
so ensure that you have that added to your project's repositories.

Open the `build.gradle` file for your project and modify it as following,

```
allprojects {
repositories {
google()
jcenter()
}
}
```

## Sample app

Expand Down Expand Up @@ -194,7 +177,7 @@ from external model`.

## Snapshot builds

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

Just add the following to your `build.gradle`:
Expand Down Expand Up @@ -229,21 +212,6 @@ repository and running:
./gradlew :library:prepareArtifacts :library:publishAllToMavenLocal
```

### Deployment

To deploy FirebaseUI to Bintray

1. Set `BINTRAY_USER` and `BINTRAY_KEY` in your environment. You must
be a member of the firebaseui Bintray organization.
1. Run `./gradlew clean :library:prepareArtifacts :library:bintrayUploadAll`
1. Go to the Bintray dashboard and click 'Publish'.
1. In Bintray click the 'Maven Central' tab and publish the release.

### Tag a release on GitHub

* Ensure that all your changes are on master and that your local build is on master
* Ensure that the correct version number is in `common/constants.gradle`

### Contributor License Agreements

We'd love to accept your sample apps and patches! Before we can take them, we
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
<activity
android:name=".database.realtime.RealtimeDbChatActivity"
android:label="@string/title_realtime_database_activity" />

<!-- Realtime database paging demo -->
<activity
android:name=".database.realtime.FirebaseDbPagingActivity"
android:label="@string/title_realtime_database_paging_activity" />

<activity
android:name=".database.realtime.RealtimeDbChatIndexActivity"
android:label="@string/title_realtime_database_activity" />
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/com/firebase/uidemo/ChooserActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.firebase.uidemo.auth.AuthUiActivity;
import com.firebase.uidemo.database.firestore.FirestoreChatActivity;
import com.firebase.uidemo.database.firestore.FirestorePagingActivity;
import com.firebase.uidemo.database.realtime.FirebaseDbPagingActivity;
import com.firebase.uidemo.database.realtime.RealtimeDbChatActivity;
import com.firebase.uidemo.storage.ImageActivity;

Expand Down Expand Up @@ -71,6 +72,7 @@ private static class ActivityChooserAdapter
FirestoreChatActivity.class,
FirestorePagingActivity.class,
RealtimeDbChatActivity.class,
FirebaseDbPagingActivity.class,
ImageActivity.class,
};

Expand All @@ -80,6 +82,7 @@ private static class ActivityChooserAdapter
R.string.title_firestore_activity,
R.string.title_firestore_paging_activity,
R.string.title_realtime_database_activity,
R.string.title_realtime_database_paging_activity,
R.string.title_storage_activity
};

Expand All @@ -89,6 +92,7 @@ private static class ActivityChooserAdapter
R.string.desc_firestore,
R.string.desc_firestore_paging,
R.string.desc_realtime_database,
R.string.desc_realtime_database_paging,
R.string.desc_storage
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,11 @@ private void handleSignInResponse(int resultCode, @Nullable Intent data) {
startActivity(intent);
}

if (response.getError().getErrorCode() == ErrorCodes.ERROR_USER_DISABLED) {
showSnackbar(R.string.account_disabled);
return;
}

showSnackbar(R.string.unknown_error);
Log.e(TAG, "Sign-in error: ", response.getError());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
Expand Down Expand Up @@ -40,8 +41,8 @@ public class FirestorePagingActivity extends AppCompatActivity {
@BindView(R.id.paging_recycler)
RecyclerView mRecycler;

@BindView(R.id.paging_loading)
ProgressBar mProgressBar;
@BindView(R.id.swipe_refresh_layout)
SwipeRefreshLayout mSwipeRefreshLayout;

private FirebaseFirestore mFirestore;
private CollectionReference mItemsCollection;
Expand Down Expand Up @@ -72,7 +73,7 @@ private void setUpAdapter() {
.setQuery(baseQuery, config, Item.class)
.build();

FirestorePagingAdapter<Item, ItemViewHolder> adapter =
final FirestorePagingAdapter<Item, ItemViewHolder> adapter =
new FirestorePagingAdapter<Item, ItemViewHolder>(options) {
@NonNull
@Override
Expand All @@ -95,13 +96,13 @@ protected void onLoadingStateChanged(@NonNull LoadingState state) {
switch (state) {
case LOADING_INITIAL:
case LOADING_MORE:
mProgressBar.setVisibility(View.VISIBLE);
mSwipeRefreshLayout.setRefreshing(true);
break;
case LOADED:
mProgressBar.setVisibility(View.GONE);
mSwipeRefreshLayout.setRefreshing(false);
break;
case FINISHED:
mProgressBar.setVisibility(View.GONE);
mSwipeRefreshLayout.setRefreshing(false);
showToast("Reached end of data set.");
break;
case ERROR:
Expand All @@ -110,15 +111,28 @@ protected void onLoadingStateChanged(@NonNull LoadingState state) {
break;
}
}

@Override
protected void onError(@NonNull Exception e) {
mSwipeRefreshLayout.setRefreshing(false);
Log.e(TAG, e.getMessage(), e);
}
};

mRecycler.setLayoutManager(new LinearLayoutManager(this));
mRecycler.setAdapter(adapter);

mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
adapter.refresh();
}
});
}

@Override
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
getMenuInflater().inflate(R.menu.menu_firestore_paging, menu);
getMenuInflater().inflate(R.menu.menu_paging, menu);
return true;
}

Expand Down
Loading

0 comments on commit 41541b8

Please sign in to comment.