Skip to content
This repository was archived by the owner on Jul 2, 2025. It is now read-only.

Commit aa21ca3

Browse files
intergate auth
1 parent 7066c93 commit aa21ca3

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

android/canonical/app/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
22
apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-android-extensions'
44
apply plugin: 'kotlin-kapt'
5+
apply plugin: 'com.google.gms.google-services'
56

67
android {
78
compileSdkVersion 29
@@ -19,6 +20,7 @@ android {
1920
versionName "1.0"
2021

2122
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
23+
multiDexEnabled true
2224
}
2325

2426
buildTypes {
@@ -42,9 +44,11 @@ dependencies {
4244
implementation 'com.google.android.libraries.places:places:2.3.0'
4345
implementation "android.arch.lifecycle:extensions:1.1.1"
4446
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
47+
implementation 'com.google.firebase:firebase-analytics:17.4.4'
48+
implementation 'com.google.firebase:firebase-auth:19.3.2'
4549
kapt 'com.android.databinding:compiler:3.1.4'
4650
testImplementation 'junit:junit:4.12'
4751
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
4852
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
4953

50-
}
54+
}

android/canonical/app/src/main/java/com/google/samples/quickstart/canonical/MeFragment.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import androidx.fragment.app.Fragment
55
import android.view.LayoutInflater
66
import android.view.View
77
import android.view.ViewGroup
8+
import com.google.android.gms.auth.api.signin.GoogleSignInOptions
89

910
// TODO: Rename parameter arguments, choose names that match
1011
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
@@ -27,6 +28,13 @@ class MeFragment : Fragment() {
2728
param1 = it.getString(ARG_PARAM1)
2829
param2 = it.getString(ARG_PARAM2)
2930
}
31+
32+
// // Configure Google Sign In
33+
// val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
34+
// .requestIdToken(getString(R.string.default_web_client_id))
35+
// .requestEmail()
36+
// .build()
37+
3038
}
3139

3240
override fun onCreateView(

android/canonical/app/src/main/res/layout/fragment_me.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
<!-- TODO: Update blank fragment layout -->
1010
<TextView
11+
android:id="@+id/textView"
1112
android:layout_width="match_parent"
1213
android:layout_height="wrap_content"
1314
android:gravity="center"
@@ -16,4 +17,13 @@
1617
app:layout_constraintBottom_toBottomOf="parent"
1718
app:layout_constraintTop_toTopOf="parent" />
1819

20+
<com.google.android.gms.common.SignInButton
21+
android:id="@+id/sign_in_button"
22+
android:layout_width="wrap_content"
23+
android:layout_height="wrap_content"
24+
android:layout_marginBottom="40dp"
25+
app:layout_constraintBottom_toBottomOf="parent"
26+
app:layout_constraintEnd_toEndOf="parent"
27+
app:layout_constraintStart_toStartOf="parent" />
28+
1929
</androidx.constraintlayout.widget.ConstraintLayout>

android/canonical/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ buildscript {
66
}
77
dependencies {
88
classpath "com.android.tools.build:gradle:4.0.0"
9+
classpath 'com.google.gms:google-services:4.3.3'
910
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1011

1112
// NOTE: Do not place your application dependencies here; they belong

0 commit comments

Comments
 (0)