Migrate open source licenses screen to Compose

This commit is contained in:
arkon
2022-04-23 10:52:19 -04:00
parent 2b79295240
commit 1b4d9fc4e9
12 changed files with 64 additions and 206 deletions
@@ -7,6 +7,9 @@ import eu.kanade.presentation.theme.TachiyomiTheme
import eu.kanade.tachiyomi.databinding.ComposeControllerBinding
import nucleus.presenter.Presenter
/**
* Compose controller with a Nucleus presenter.
*/
abstract class ComposeController<P : Presenter<*>> : NucleusController<ComposeControllerBinding, P>() {
override fun createBinding(inflater: LayoutInflater): ComposeControllerBinding =
@@ -24,3 +27,24 @@ abstract class ComposeController<P : Presenter<*>> : NucleusController<ComposeCo
@Composable abstract fun ComposeContent()
}
/**
* Basic Compose controller without a presenter.
*/
abstract class BasicComposeController : BaseController<ComposeControllerBinding>() {
override fun createBinding(inflater: LayoutInflater): ComposeControllerBinding =
ComposeControllerBinding.inflate(inflater)
override fun onViewCreated(view: View) {
super.onViewCreated(view)
binding.root.setContent {
TachiyomiTheme {
ComposeContent()
}
}
}
@Composable abstract fun ComposeContent()
}