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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user