Skip to content

Commit

Permalink
Version 8.0
Browse files Browse the repository at this point in the history
Version 8.0
  • Loading branch information
samtstern authored Jul 30, 2021
2 parents 11dd3e7 + d005f35 commit 5ac863c
Show file tree
Hide file tree
Showing 248 changed files with 2,471 additions and 4,295 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Build with Gradle
run: ./scripts/build.sh
- name: Print Logs
Expand Down
3 changes: 2 additions & 1 deletion .opensource/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"docs/upgrade-to-4.0.md": "Upgrade to v4.0",
"docs/upgrade-to-5.0.md": "Upgrade to v5.0",
"docs/upgrade-to-6.0.md": "Upgrade to v6.0",
"docs/upgrade-to-7.0.md": "Upgrade to v7.0"
"docs/upgrade-to-7.0.md": "Upgrade to v7.0",
"docs/upgrade-to-8.0.md": "Upgrade to v8.0"
},

"related": [
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ libraries.
```groovy
dependencies {
// FirebaseUI for Firebase Realtime Database
implementation 'com.firebaseui:firebase-ui-database:7.2.0'
implementation 'com.firebaseui:firebase-ui-database:8.0.0'
// FirebaseUI for Cloud Firestore
implementation 'com.firebaseui:firebase-ui-firestore:7.2.0'
implementation 'com.firebaseui:firebase-ui-firestore:8.0.0'
// FirebaseUI for Firebase Auth
implementation 'com.firebaseui:firebase-ui-auth:7.2.0'
implementation 'com.firebaseui:firebase-ui-auth:8.0.0'
// FirebaseUI for Cloud Storage
implementation 'com.firebaseui:firebase-ui-storage:7.2.0'
implementation 'com.firebaseui:firebase-ui-storage:8.0.0'
}
```

Expand All @@ -71,6 +71,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 7.2.0 to 8.x.x](./docs/upgrade-to-8.0.md)
* [Upgrade from 6.4.0 to 7.x.x](./docs/upgrade-to-7.0.md)
* [Upgrade from 5.1.0 to 6.x.x](./docs/upgrade-to-6.0.md)
* [Upgrade from 4.3.2 to 5.x.x](./docs/upgrade-to-5.0.md)
Expand Down
14 changes: 8 additions & 6 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ plugins {
}

android {
compileSdkVersion(Config.SdkVersions.compile)
compileSdk = Config.SdkVersions.compile

defaultConfig {
minSdkVersion(Config.SdkVersions.min)
targetSdkVersion(Config.SdkVersions.target)
minSdk = Config.SdkVersions.min
targetSdk = Config.SdkVersions.target

versionName = Config.version
versionCode = 1
Expand Down Expand Up @@ -37,13 +37,15 @@ android {
}
}

lintOptions {
lint {
// Common lint options across all modules
disable(
"IconExpectedSize",
"InvalidPackage", // Firestore uses GRPC which makes lint mad
"NewerVersionAvailable", "GradleDependency", // For reproducible builds
"SelectableText", "SyntheticAccessor" // We almost never care about this
"SelectableText", "SyntheticAccessor", // We almost never care about this
"UnusedIds", "MediaCapabilities" // TODO(rosariopfernandes): remove this once we confirm
// it builds successfully
)

// Module-specific
Expand All @@ -67,7 +69,7 @@ android {
}

dependencies {
implementation(Config.Libs.Androidx.design)
implementation(Config.Libs.Androidx.materialDesign)
implementation(Config.Libs.Androidx.multidex)

implementation(project(":auth"))
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute"
android:usesCleartextTraffic="true">

<activity android:name=".ChooserActivity">
<activity android:name=".ChooserActivity"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,48 +57,22 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
handleSignInResult(ErrorCodes.ANONYMOUS_UPGRADE_MERGE_CONFLICT, response);
}

mBinding.anonSignIn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
signInAnonymously();
}
});

mBinding.beginFlow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startAuthUI();
}
});

mBinding.resolveMerge.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
resolveMerge();
}
});

mBinding.signOut.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
signOut();
}
});
mBinding.anonSignIn.setOnClickListener(view -> signInAnonymously());
mBinding.beginFlow.setOnClickListener(view -> startAuthUI());
mBinding.resolveMerge.setOnClickListener(view -> resolveMerge());
mBinding.signOut.setOnClickListener(view -> signOut());
}

public void signInAnonymously() {
FirebaseAuth.getInstance().signInAnonymously()
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
updateUI();

if (task.isSuccessful()) {
setStatus("Signed in anonymously as user "
+ getUserIdentifier(task.getResult().getUser()));
} else {
setStatus("Anonymous sign in failed.");
}
.addOnCompleteListener(this, task -> {
updateUI();

if (task.isSuccessful()) {
setStatus("Signed in anonymously as user "
+ getUserIdentifier(task.getResult().getUser()));
} else {
setStatus("Anonymous sign in failed.");
}
});
}
Expand All @@ -122,31 +96,25 @@ public void resolveMerge() {
// TODO: Show how to do good data moving

FirebaseAuth.getInstance().signInWithCredential(mPendingCredential)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
mPendingCredential = null;
updateUI();

if (task.isSuccessful()) {
setStatus("Signed in as " + getUserIdentifier(task.getResult()
.getUser()));
} else {
Log.w(TAG, "Merge failed", task.getException());
setStatus("Failed to resolve merge conflict, see logs.");
}
.addOnCompleteListener(this, task -> {
mPendingCredential = null;
updateUI();

if (task.isSuccessful()) {
setStatus("Signed in as " + getUserIdentifier(task.getResult()
.getUser()));
} else {
Log.w(TAG, "Merge failed", task.getException());
setStatus("Failed to resolve merge conflict, see logs.");
}
});
}

public void signOut() {
AuthUI.getInstance().signOut(this)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
setStatus(null);
updateUI();
}
.addOnCompleteListener(task -> {
setStatus(null);
updateUI();
});
}

Expand Down
Loading

0 comments on commit 5ac863c

Please sign in to comment.