Эх сурвалжийг харах

Make text clickable when removing item from tracker

arkon 1 жил өмнө
parent
commit
8626a55fe4

+ 5 - 4
app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriApi.kt

@@ -1,5 +1,6 @@
 package eu.kanade.tachiyomi.data.track.shikimori
 
+import android.net.Uri
 import androidx.core.net.toUri
 import eu.kanade.tachiyomi.data.database.models.Track
 import eu.kanade.tachiyomi.data.track.model.TrackSearch
@@ -37,12 +38,12 @@ class ShikimoriApi(
 
     private val authClient = client.newBuilder().addInterceptor(interceptor).build()
 
-    suspend fun addLibManga(track: Track, user_id: String): Track {
+    suspend fun addLibManga(track: Track, userId: String): Track {
         return withIOContext {
             with(json) {
                 val payload = buildJsonObject {
                     putJsonObject("user_rate") {
-                        put("user_id", user_id)
+                        put("user_id", userId)
                         put("target_id", track.media_id)
                         put("target_type", "Manga")
                         put("chapters", track.last_chapter_read.toInt())
@@ -65,7 +66,7 @@ class ShikimoriApi(
         }
     }
 
-    suspend fun updateLibManga(track: Track, user_id: String): Track = addLibManga(track, user_id)
+    suspend fun updateLibManga(track: Track, userId: String): Track = addLibManga(track, userId)
 
     suspend fun deleteLibManga(track: Track): Track {
         return withIOContext {
@@ -201,7 +202,7 @@ class ShikimoriApi(
 
         private const val redirectUrl = "tachiyomi://shikimori-auth"
 
-        fun authUrl() = loginUrl.toUri().buildUpon()
+        fun authUrl(): Uri = loginUrl.toUri().buildUpon()
             .appendQueryParameter("client_id", clientId)
             .appendQueryParameter("redirect_uri", redirectUrl)
             .appendQueryParameter("response_type", "code")

+ 9 - 2
app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackInfoDialog.kt

@@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.ui.manga.track
 
 import android.app.Application
 import android.content.Context
+import androidx.compose.foundation.clickable
 import androidx.compose.foundation.layout.Arrangement
 import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.Row
@@ -759,8 +760,14 @@ private data class TrackerRemoveScreen(
                         text = stringResource(R.string.track_delete_text, serviceName),
                     )
                     if (sm.isDeletable()) {
-                        Row(verticalAlignment = Alignment.CenterVertically) {
-                            Checkbox(checked = removeRemoteTrack, onCheckedChange = { removeRemoteTrack = it })
+                        val onChange = { removeRemoteTrack = !removeRemoteTrack }
+                        Row(
+                            modifier = Modifier
+                                .fillMaxWidth()
+                                .clickable(onClick = onChange),
+                            verticalAlignment = Alignment.CenterVertically,
+                        ) {
+                            Checkbox(checked = removeRemoteTrack, onCheckedChange = { onChange() })
                             Text(text = stringResource(R.string.track_delete_remote_text, serviceName))
                         }
                     }