Skip to content

Commit 56fd43a

Browse files
Lyokonethatfiredev
authored andcommitted
feat: move from SmartLock to CredentialManager
update versions update version fix more tests fixes sdk bump fix gradle save the response Sign In working chore: upgrade Gradle, AGP and Kotlin chore: move namespace to build.gradle chore: upgrade Lint API add new lines at EOF for checkstyle ci: temporarily stop building proguard-test test: update robolectric and use Looper ignore test clean update ci remove comments Bad code fix? unused imports more more fix fixes fix more fixes
1 parent 5b6c9f0 commit 56fd43a

File tree

55 files changed

+922
-898
lines changed

Some content is hidden

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

55 files changed

+922
-898
lines changed

.github/workflows/android.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
12-
- name: set up JDK 11
13-
uses: actions/setup-java@v1
14-
with:
15-
java-version: 11
16-
- name: Build with Gradle
17-
run: ./scripts/build.sh
18-
- name: Print Logs
19-
if: failure()
20-
run: ./scripts/print_build_logs.sh
11+
- uses: actions/checkout@v2
12+
- name: set up JDK 17
13+
uses: actions/setup-java@v1
14+
with:
15+
java-version: 17
16+
- name: Build with Gradle
17+
run: ./scripts/build.sh
18+
- name: Print Logs
19+
if: failure()
20+
run: ./scripts/print_build_logs.sh

app/build.gradle.kts

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ plugins {
77
android {
88
compileSdk = Config.SdkVersions.compile
99

10+
namespace = "com.firebase.uidemo"
11+
1012
defaultConfig {
1113
minSdk = Config.SdkVersions.min
1214
targetSdk = Config.SdkVersions.target
@@ -60,8 +62,8 @@ android {
6062
}
6163

6264
compileOptions {
63-
sourceCompatibility = JavaVersion.VERSION_1_8
64-
targetCompatibility = JavaVersion.VERSION_1_8
65+
sourceCompatibility = JavaVersion.VERSION_17
66+
targetCompatibility = JavaVersion.VERSION_17
6567
}
6668

6769
buildFeatures {
@@ -95,9 +97,6 @@ dependencies {
9597
implementation(Config.Libs.Misc.permissions)
9698
implementation(Config.Libs.Androidx.constraint)
9799
debugImplementation(Config.Libs.Misc.leakCanary)
98-
debugImplementation(Config.Libs.Misc.leakCanaryFragments)
99-
releaseImplementation(Config.Libs.Misc.leakCanaryNoop)
100-
testImplementation(Config.Libs.Misc.leakCanaryNoop)
101100
}
102101

103102
apply(plugin = "com.google.gms.google-services")

app/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<manifest
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
xmlns:tools="http://schemas.android.com/tools"
5-
package="com.firebase.uidemo">
5+
>
66

77
<uses-permission android:name="android.permission.INTERNET" />
88
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
11
package com.firebase.uidemo;
22

3-
import com.squareup.leakcanary.LeakCanary;
4-
53
import androidx.appcompat.app.AppCompatDelegate;
64
import androidx.multidex.MultiDexApplication;
75

86
public class FirebaseUIDemo extends MultiDexApplication {
97
static {
108
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY);
119
}
12-
13-
@Override
14-
public void onCreate() {
15-
super.onCreate();
16-
if (LeakCanary.isInAnalyzerProcess(this)) {
17-
// This process is dedicated to LeakCanary for heap analysis.
18-
// You should not init your app in this process.
19-
return;
20-
}
21-
LeakCanary.install(this);
22-
}
2310
}

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

+2-13
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
141141

142142
mBinding.signIn.setOnClickListener(view -> signIn());
143143

144-
mBinding.signInSilent.setOnClickListener(view -> silentSignIn());
145-
146144
if (ConfigurationUtils.isGoogleMisconfigured(this)
147145
|| ConfigurationUtils.isFacebookMisconfigured(this)) {
148146
showSnackbar(R.string.configuration_required);
@@ -226,18 +224,9 @@ private Intent getSignInIntent(@Nullable String link) {
226224
if (auth.getCurrentUser() != null && auth.getCurrentUser().isAnonymous()) {
227225
builder.enableAnonymousUsersAutoUpgrade();
228226
}
229-
return builder.build();
230-
}
231227

232-
public void silentSignIn() {
233-
getAuthUI().silentSignIn(this, getSelectedProviders())
234-
.addOnCompleteListener(this, task -> {
235-
if (task.isSuccessful()) {
236-
startSignedInActivity(null);
237-
} else {
238-
showSnackbar(R.string.sign_in_failed);
239-
}
240-
});
228+
builder.setAlwaysShowSignInMethodScreen(true);
229+
return builder.build();
241230
}
242231

243232
@Override

app/src/main/res/layout/auth_ui_layout.xml

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<androidx.coordinatorlayout.widget.CoordinatorLayout
3+
xmlns:android="http://schemas.android.com/apk/res/android"
34
xmlns:tools="http://schemas.android.com/tools"
45
xmlns:app="http://schemas.android.com/apk/res-auto"
56
android:id="@+id/root"
@@ -27,7 +28,7 @@
2728
android:layout_height="wrap_content"
2829
android:layout_gravity="center_horizontal"
2930
android:text="@string/launch_title"
30-
app:drawableTopCompat="@drawable/firebase_auth_120dp"/>
31+
app:drawableTopCompat="@drawable/firebase_auth_120dp" />
3132

3233
<Button
3334
android:id="@+id/sign_in"
@@ -38,15 +39,6 @@
3839
android:layout_marginTop="16dp"
3940
android:text="@string/sign_in_start" />
4041

41-
<Button
42-
android:id="@+id/sign_in_silent"
43-
style="@style/Widget.MaterialComponents.Button"
44-
android:layout_width="wrap_content"
45-
android:layout_height="wrap_content"
46-
android:layout_gravity="center"
47-
android:layout_marginBottom="16dp"
48-
android:text="@string/sign_in_silent" />
49-
5042
<TextView
5143
style="@style/TextAppearance.MaterialComponents.Subtitle1"
5244
android:layout_width="wrap_content"
@@ -352,4 +344,4 @@
352344

353345
</ScrollView>
354346

355-
</androidx.coordinatorlayout.widget.CoordinatorLayout>
347+
</androidx.coordinatorlayout.widget.CoordinatorLayout>

auth/build.gradle.kts

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import com.android.build.gradle.internal.dsl.TestOptions
22

33
plugins {
4-
id("com.android.library")
5-
id("com.vanniktech.maven.publish")
4+
id("com.android.library")
5+
id("com.vanniktech.maven.publish")
6+
id("org.jetbrains.kotlin.android")
67
}
78

89
android {
910
compileSdk = Config.SdkVersions.compile
11+
namespace = "com.firebase.ui.auth"
1012

1113
defaultConfig {
1214
minSdk = Config.SdkVersions.min
@@ -26,8 +28,8 @@ android {
2628
}
2729

2830
compileOptions {
29-
sourceCompatibility = JavaVersion.VERSION_1_8
30-
targetCompatibility = JavaVersion.VERSION_1_8
31+
sourceCompatibility = JavaVersion.VERSION_17
32+
targetCompatibility = JavaVersion.VERSION_17
3133
}
3234

3335
lint {
@@ -62,6 +64,9 @@ android {
6264
isIncludeAndroidResources = true
6365
}
6466
}
67+
kotlinOptions {
68+
jvmTarget = "17"
69+
}
6570
}
6671

6772
dependencies {
@@ -72,8 +77,11 @@ dependencies {
7277
implementation(Config.Libs.Androidx.fragment)
7378
implementation(Config.Libs.Androidx.customTabs)
7479
implementation(Config.Libs.Androidx.constraint)
80+
implementation("androidx.credentials:credentials:1.3.0")
7581

7682
implementation(Config.Libs.Androidx.lifecycleExtensions)
83+
implementation("androidx.core:core-ktx:1.13.1")
84+
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0")
7785
annotationProcessor(Config.Libs.Androidx.lifecycleCompiler)
7886

7987
implementation(platform(Config.Libs.Firebase.bom))

auth/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<manifest
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
xmlns:tools="http://schemas.android.com/tools"
5-
package="com.firebase.ui.auth">
5+
>
66

77
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
88
<uses-permission android:name="android.permission.INTERNET" />

0 commit comments

Comments
 (0)