Update aboutLibraries to v15 (#3553)
This commit is contained in:
-80
@@ -1,80 +0,0 @@
|
|||||||
package eu.kanade.presentation.more.settings.screen.about
|
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Column
|
|
||||||
import androidx.compose.foundation.layout.padding
|
|
||||||
import androidx.compose.foundation.rememberScrollState
|
|
||||||
import androidx.compose.foundation.verticalScroll
|
|
||||||
import androidx.compose.material.icons.Icons
|
|
||||||
import androidx.compose.material.icons.filled.Public
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.platform.LocalUriHandler
|
|
||||||
import androidx.compose.ui.unit.dp
|
|
||||||
import androidx.compose.ui.viewinterop.AndroidView
|
|
||||||
import androidx.core.text.HtmlCompat
|
|
||||||
import cafe.adriel.voyager.navigator.LocalNavigator
|
|
||||||
import cafe.adriel.voyager.navigator.currentOrThrow
|
|
||||||
import com.google.android.material.textview.MaterialTextView
|
|
||||||
import eu.kanade.presentation.components.AppBar
|
|
||||||
import eu.kanade.presentation.components.AppBarActions
|
|
||||||
import eu.kanade.presentation.util.Screen
|
|
||||||
import tachiyomi.i18n.MR
|
|
||||||
import tachiyomi.presentation.core.components.material.Scaffold
|
|
||||||
import tachiyomi.presentation.core.i18n.stringResource
|
|
||||||
|
|
||||||
class OpenSourceLibraryLicenseScreen(
|
|
||||||
private val name: String,
|
|
||||||
private val website: String?,
|
|
||||||
private val license: String,
|
|
||||||
) : Screen() {
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
override fun Content() {
|
|
||||||
val navigator = LocalNavigator.currentOrThrow
|
|
||||||
val uriHandler = LocalUriHandler.current
|
|
||||||
|
|
||||||
Scaffold(
|
|
||||||
topBar = {
|
|
||||||
AppBar(
|
|
||||||
title = name,
|
|
||||||
navigateUp = navigator::pop,
|
|
||||||
actions = {
|
|
||||||
if (!website.isNullOrEmpty()) {
|
|
||||||
AppBarActions(
|
|
||||||
listOf(
|
|
||||||
AppBar.Action(
|
|
||||||
title = stringResource(MR.strings.website),
|
|
||||||
icon = Icons.Default.Public,
|
|
||||||
onClick = { uriHandler.openUri(website) },
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
scrollBehavior = it,
|
|
||||||
)
|
|
||||||
},
|
|
||||||
) { contentPadding ->
|
|
||||||
Column(
|
|
||||||
modifier = Modifier
|
|
||||||
.verticalScroll(rememberScrollState())
|
|
||||||
.padding(contentPadding)
|
|
||||||
.padding(16.dp),
|
|
||||||
) {
|
|
||||||
HtmlLicenseText(html = license)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun HtmlLicenseText(html: String) {
|
|
||||||
AndroidView(
|
|
||||||
factory = {
|
|
||||||
MaterialTextView(it)
|
|
||||||
},
|
|
||||||
update = {
|
|
||||||
it.text = HtmlCompat.fromHtml(html, HtmlCompat.FROM_HTML_MODE_COMPACT)
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+2
-10
@@ -8,7 +8,7 @@ import cafe.adriel.voyager.navigator.LocalNavigator
|
|||||||
import cafe.adriel.voyager.navigator.currentOrThrow
|
import cafe.adriel.voyager.navigator.currentOrThrow
|
||||||
import com.mikepenz.aboutlibraries.ui.compose.android.produceLibraries
|
import com.mikepenz.aboutlibraries.ui.compose.android.produceLibraries
|
||||||
import com.mikepenz.aboutlibraries.ui.compose.m3.LibrariesContainer
|
import com.mikepenz.aboutlibraries.ui.compose.m3.LibrariesContainer
|
||||||
import com.mikepenz.aboutlibraries.ui.compose.util.htmlReadyLicenseContent
|
import com.mikepenz.aboutlibraries.ui.compose.variant.LibraryDetailMode
|
||||||
import eu.kanade.presentation.components.AppBar
|
import eu.kanade.presentation.components.AppBar
|
||||||
import eu.kanade.presentation.util.Screen
|
import eu.kanade.presentation.util.Screen
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
@@ -36,15 +36,7 @@ class OpenSourceLicensesScreen : Screen() {
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize(),
|
.fillMaxSize(),
|
||||||
contentPadding = contentPadding,
|
contentPadding = contentPadding,
|
||||||
onLibraryClick = {
|
detailMode = LibraryDetailMode.Sheet,
|
||||||
navigator.push(
|
|
||||||
OpenSourceLibraryLicenseScreen(
|
|
||||||
name = it.name,
|
|
||||||
website = it.website,
|
|
||||||
license = it.licenses.firstOrNull()?.htmlReadyLicenseContent.orEmpty(),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[versions]
|
[versions]
|
||||||
aboutLibraries = "14.2.1"
|
aboutLibraries = "15.0.3"
|
||||||
android-desugar = "2.1.5"
|
android-desugar = "2.1.5"
|
||||||
android-gradle = "9.2.1"
|
android-gradle = "9.2.1"
|
||||||
androidx-activity-compose = "1.13.0"
|
androidx-activity-compose = "1.13.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user