Convert Source tab to use Compose (#6987)

* Use Compose in Source tab

* Replace hashCode with key function

* Add ability to turn off pins moving on top of source list

* Changes from review comments
This commit is contained in:
Andreas
2022-04-24 20:35:59 +02:00
committed by GitHub
parent 558b18899c
commit 29a0989f28
30 changed files with 705 additions and 538 deletions
@@ -7,6 +7,7 @@ import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
import eu.kanade.presentation.theme.TachiyomiTheme
import eu.kanade.tachiyomi.databinding.ComposeControllerBinding
import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter
import nucleus.presenter.Presenter
/**
@@ -52,3 +53,22 @@ abstract class BasicComposeController : BaseController<ComposeControllerBinding>
@Composable abstract fun ComposeContent(nestedScrollInterop: NestedScrollConnection)
}
abstract class SearchableComposeController<P : BasePresenter<*>> : SearchableNucleusController<ComposeControllerBinding, P>() {
override fun createBinding(inflater: LayoutInflater): ComposeControllerBinding =
ComposeControllerBinding.inflate(inflater)
override fun onViewCreated(view: View) {
super.onViewCreated(view)
binding.root.setContent {
val nestedScrollInterop = rememberNestedScrollInteropConnection(binding.root)
TachiyomiTheme {
ComposeContent(nestedScrollInterop)
}
}
}
@Composable abstract fun ComposeContent(nestedScrollInterop: NestedScrollConnection)
}