Skip to content

Commit 059b400

Browse files
committed
Implement credential manager
1 parent 6341b52 commit 059b400

10 files changed

Lines changed: 250 additions & 118 deletions

File tree

.idea/codeStyles/Project.xml

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,18 @@ dependencies {
4848
implementation 'com.google.firebase:firebase-analytics'
4949
implementation 'com.google.firebase:firebase-messaging'
5050
implementation 'com.google.firebase:firebase-auth'
51-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
5251
implementation 'com.firebaseui:firebase-ui-auth:9.1.1'
53-
// Pinned: play-services-auth 22.0.0 removed GoogleSignIn/GoogleSignInClient.
54-
// Unpin once LoginActivity/SettingsActivity move to Credential Manager.
55-
implementation 'com.google.android.gms:play-services-auth:21.3.0'
52+
implementation 'com.google.android.gms:play-services-auth:22.0.0'
53+
implementation 'androidx.credentials:credentials:1.6.0'
54+
implementation 'androidx.credentials:credentials-play-services-auth:1.6.0'
55+
implementation 'com.google.android.libraries.identity.googleid:googleid:1.2.0'
5656
implementation 'com.squareup.okhttp3:okhttp:5.5.0'
5757
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.11.0'
5858
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.11.0'
5959
implementation 'com.google.code.gson:gson:2.14.0'
6060
implementation 'androidx.appcompat:appcompat:1.8.0'
6161
implementation 'androidx.core:core-ktx:1.19.0'
62+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.11.0'
6263
implementation 'androidx.constraintlayout:constraintlayout:2.2.2'
6364
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.2.0'
6465
testImplementation 'junit:junit:4.13.2'

app/src/main/java/com/cornellappdev/coursegrab/CourseDetailsActivity.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import android.widget.ImageView
1010
import android.widget.TextView
1111
import android.widget.Toast
1212
import androidx.appcompat.app.AppCompatActivity
13+
import androidx.lifecycle.lifecycleScope
1314
import androidx.recyclerview.widget.LinearLayoutManager
1415
import androidx.recyclerview.widget.RecyclerView
1516
import com.cornellappdev.coursegrab.databinding.ActivityCourseDetailsBinding
@@ -21,7 +22,6 @@ import com.cornellappdev.coursegrab.networking.Request
2122
import com.cornellappdev.coursegrab.networking.addTracking
2223
import com.cornellappdev.coursegrab.networking.removeTracking
2324
import com.google.gson.reflect.TypeToken
24-
import kotlinx.coroutines.CoroutineScope
2525
import kotlinx.coroutines.Dispatchers
2626
import kotlinx.coroutines.launch
2727
import kotlinx.coroutines.withContext
@@ -65,7 +65,7 @@ class CourseDetailsActivity : AppCompatActivity() {
6565
fun addCourse(courseId: Int, context: Context) {
6666
val addTracking = Endpoint.addTracking(preferencesHelper.sessionToken.toString(), courseId)
6767

68-
CoroutineScope(Dispatchers.Main).launch {
68+
lifecycleScope.launch {
6969
val typeToken = object : TypeToken<ApiResponse<Course>>() {}.type
7070
val response = withContext(Dispatchers.IO) {
7171
Request.makeRequest<ApiResponse<Course>>(
@@ -87,7 +87,7 @@ class CourseDetailsActivity : AppCompatActivity() {
8787
val removeTracking =
8888
Endpoint.removeTracking(preferencesHelper.sessionToken.toString(), courseId)
8989

90-
CoroutineScope(Dispatchers.Main).launch {
90+
lifecycleScope.launch {
9191
val typeToken = object : TypeToken<ApiResponse<Course>>() {}.type
9292
val response = withContext(Dispatchers.IO) {
9393
Request.makeRequest<ApiResponse<Course>>(

0 commit comments

Comments
 (0)