mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix(about/license): Use Bundle
This commit is contained in:
parent
6c93deacca
commit
c95c364c0c
2 changed files with 16 additions and 8 deletions
|
@ -1,5 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.ui.more
|
package eu.kanade.tachiyomi.ui.more
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
@ -22,13 +23,13 @@ import yokai.presentation.AppBarType
|
||||||
import yokai.presentation.YokaiScaffold
|
import yokai.presentation.YokaiScaffold
|
||||||
import yokai.presentation.component.ToolTipButton
|
import yokai.presentation.component.ToolTipButton
|
||||||
|
|
||||||
class AboutLibraryLicenseController(
|
class AboutLibraryLicenseController(private val bundle: Bundle) : BaseComposeController(bundle) {
|
||||||
private val name: String,
|
|
||||||
private val website: String?,
|
|
||||||
private val license: String,
|
|
||||||
) : BaseComposeController() {
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun ScreenContent() {
|
override fun ScreenContent() {
|
||||||
|
val name = bundle.getString(LIBRARY_NAME) ?: throw RuntimeException("Missing library name")
|
||||||
|
val website = bundle.getString(LIBRARY_WEBSITE)
|
||||||
|
val license = bundle.getString(LIBRARY_LICENSE) ?: throw RuntimeException("Missing library license")
|
||||||
|
|
||||||
val uriHandler = LocalUriHandler.current
|
val uriHandler = LocalUriHandler.current
|
||||||
|
|
||||||
YokaiScaffold(
|
YokaiScaffold(
|
||||||
|
@ -71,3 +72,7 @@ class AboutLibraryLicenseController(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const val LIBRARY_NAME = "aboutLibraries__LibraryName"
|
||||||
|
const val LIBRARY_WEBSITE = "aboutLibraries__LibraryWebsite"
|
||||||
|
const val LIBRARY_LICENSE = "aboutLibraries__LibraryLicense"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.ui.more
|
package eu.kanade.tachiyomi.ui.more
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.material3.TopAppBarDefaults
|
import androidx.compose.material3.TopAppBarDefaults
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
@ -28,9 +29,11 @@ class AboutLicenseController : BaseComposeController() {
|
||||||
onLibraryClick = {
|
onLibraryClick = {
|
||||||
router.pushController(
|
router.pushController(
|
||||||
AboutLibraryLicenseController(
|
AboutLibraryLicenseController(
|
||||||
it.name,
|
Bundle().apply {
|
||||||
it.website,
|
this.putString(LIBRARY_NAME, it.name)
|
||||||
it.licenses.firstOrNull()?.htmlReadyLicenseContent.orEmpty(),
|
it.website?.let { website -> this.putString(LIBRARY_WEBSITE, website) }
|
||||||
|
this.putString(LIBRARY_LICENSE, it.licenses.firstOrNull()?.htmlReadyLicenseContent.orEmpty())
|
||||||
|
}
|
||||||
).withFadeTransaction(),
|
).withFadeTransaction(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue