Add library desugaring

master
Zakhar Timoshenko 2 years ago
parent c905548f37
commit 2746b71575
Signed by: Xtimms
SSH Key Fingerprint: SHA256:wH6spYepK/A5erBh7ZyAnr1ru9H4eaMVBEuiw6DSpxI

@ -8,7 +8,7 @@ No, nothing works.
## Screens ## Screens
| Shelf | Details | History | | Shelf | Details | History |
|:-----------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------:|-----------------------------------------------------------------------------------------| |:-----------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------:|:---------------------------------------------------------------------------------------:|
| ![Shelf](https://git.kotatsu.app/Xtimms/Tokusho/raw/branch/master/images/shelf.png) | ![Details](https://git.kotatsu.app/Xtimms/Tokusho/raw/branch/master/images/details.png) | ![History](https://git.kotatsu.app/Xtimms/Tokusho/raw/branch/master/images/history.png) | | ![Shelf](https://git.kotatsu.app/Xtimms/Tokusho/raw/branch/master/images/shelf.png) | ![Details](https://git.kotatsu.app/Xtimms/Tokusho/raw/branch/master/images/details.png) | ![History](https://git.kotatsu.app/Xtimms/Tokusho/raw/branch/master/images/history.png) |
## Acknowledgements ## Acknowledgements

@ -64,6 +64,7 @@ android {
} }
} }
compileOptions { compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
} }
@ -139,6 +140,7 @@ dependencies {
kaptAndroidTest("com.google.dagger:hilt-android-compiler:2.50") kaptAndroidTest("com.google.dagger:hilt-android-compiler:2.50")
debugImplementation("androidx.compose.ui:ui-tooling") debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest") debugImplementation("androidx.compose.ui:ui-test-manifest")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
} }
// Git is needed in your system PATH for these commands to work. // Git is needed in your system PATH for these commands to work.

@ -83,13 +83,30 @@ class DatabasePrePopulateCallback(private val resources: Resources) : RoomDataba
"https://mangadex.org/title/822c9883-385c-4fd0-9523-16e7789cbeae", "https://mangadex.org/title/822c9883-385c-4fd0-9523-16e7789cbeae",
-1.0, -1.0,
0, 0,
"https://uploads.mangadex.org/covers/822c9883-385c-4fd0-9523-16e7789cbeae/542f379f-adee-4d27-bdd1-ffd81b140851.jpg.256.jpg", "https://mangadex.org/covers/822c9883-385c-4fd0-9523-16e7789cbeae/f886822a-80c3-484c-ad75-9aa32abedc18.jpg.256.jpg",
"https://uploads.mangadex.org/covers/822c9883-385c-4fd0-9523-16e7789cbeae/542f379f-adee-4d27-bdd1-ffd81b140851.jpg", "https://mangadex.org/covers/822c9883-385c-4fd0-9523-16e7789cbeae/f886822a-80c3-484c-ad75-9aa32abedc18.jpg",
"FINISHED", "FINISHED",
"Muchi Maro", "Muchi Maro",
"MANGADEX", "MANGADEX",
) )
) )
db.execSQL(
"INSERT INTO manga (manga_id, title, alt_title, url, public_url, rating, nsfw, cover_url, large_cover_url, state, author, source) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)",
arrayOf(
-5513532524243987690,
"Тотальный гарем",
"Shuumatsu no Harem",
"/manga/api/694",
"https://desu.me/manga/z-shuumatsu-no-harem.694/",
1.0,
1,
"https://desu.me/data/manga/covers/preview/694.jpg",
"https://desu.me/data/manga/covers/original/694.jpg",
"ONGOING",
"",
"DESUME",
)
)
db.execSQL( db.execSQL(
"INSERT INTO favourites (manga_id, category_id, sort_key, created_at, deleted_at) VALUES (?,?,?,?,?)", "INSERT INTO favourites (manga_id, category_id, sort_key, created_at, deleted_at) VALUES (?,?,?,?,?)",
arrayOf( arrayOf(
@ -100,5 +117,28 @@ class DatabasePrePopulateCallback(private val resources: Resources) : RoomDataba
0, 0,
) )
) )
db.execSQL(
"INSERT INTO favourites (manga_id, category_id, sort_key, created_at, deleted_at) VALUES (?,?,?,?,?)",
arrayOf(
-5513532524243987690,
1,
0,
1705944302882,
0,
)
)
db.execSQL(
"INSERT into history (manga_id, created_at, updated_at, chapter_id, page, scroll, percent, deleted_at) VALUES (?,?,?,?,?,?,?,?)",
arrayOf(
-5513532524243987690,
1710617414,
1710617414,
1,
3,
0.3,
0.4,
0
)
)
} }
} }

@ -19,7 +19,6 @@ import kotlinx.serialization.json.Json
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import okhttp3.ResponseBody import okhttp3.ResponseBody
import org.xtimms.tokusho.App
import org.xtimms.tokusho.R import org.xtimms.tokusho.R
import org.xtimms.tokusho.core.prefs.AppSettings.getInt import org.xtimms.tokusho.core.prefs.AppSettings.getInt
import org.xtimms.tokusho.core.prefs.STABLE import org.xtimms.tokusho.core.prefs.STABLE
@ -31,8 +30,8 @@ import java.util.regex.Pattern
object Updater { object Updater {
private const val OWNER = "KotatsuApp" private const val OWNER = "ztimms73"
private const val REPO = "Kotatsu" private const val REPO = "tokusho"
private const val TAG = "Updates" private const val TAG = "Updates"
private val client = OkHttpClient() private val client = OkHttpClient()

@ -5,9 +5,7 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.navigationBars import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Print import androidx.compose.material.icons.outlined.Print
@ -76,9 +74,9 @@ fun AdvancedView(
bottom = WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding() bottom = WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding()
) )
) { ) {
item { /*item {
PreferenceItem(title = "STATS", onClick = { navigateToStats() } ) PreferenceItem(title = "STATS", onClick = { navigateToStats() } )
} }*/
item { item {
PreferenceSwitch( PreferenceSwitch(
title = stringResource(id = R.string.send_crash_reports), title = stringResource(id = R.string.send_crash_reports),

@ -116,7 +116,7 @@ fun CleanDialog(
@Preview @Preview
@Composable @Composable
private fun DirectoryPreferenceDialogPreview() { private fun CleanDialogPreview() {
CleanDialog( CleanDialog(
onDismissRequest = {}, onDismissRequest = {},
isPagesCacheSelected = false, isPagesCacheSelected = false,

@ -1,16 +0,0 @@
package org.xtimms.tokusho.utils.lang
import android.net.Uri
import androidx.activity.result.ActivityResultLauncher
import androidx.core.app.ActivityOptionsCompat
fun <I> ActivityResultLauncher<I>.tryLaunch(
input: I,
options: ActivityOptionsCompat? = null,
): Boolean = runCatching {
launch(input, options)
}.onFailure { e ->
e.printStackTrace()
}.isSuccess
fun String.toUriOrNull() = if (isEmpty()) null else Uri.parse(this)
Loading…
Cancel
Save