Lifted NestedScrollConnection to abstract Compose classes

Since it'll likely be used in every controller.
This commit is contained in:
arkon
2022-04-23 10:57:04 -04:00
parent bf0bb5aa88
commit 2d01933c28
4 changed files with 14 additions and 14 deletions

View File

@@ -32,9 +32,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
@@ -62,13 +60,12 @@ import java.util.Date
@Composable
fun HistoryScreen(
composeView: ComposeView,
nestedScrollInterop: NestedScrollConnection,
presenter: HistoryPresenter,
onClickItem: (HistoryWithRelations) -> Unit,
onClickResume: (HistoryWithRelations) -> Unit,
onClickDelete: (HistoryWithRelations, Boolean) -> Unit,
) {
val nestedScrollInterop = rememberNestedScrollInteropConnection(composeView)
val state by presenter.state.collectAsState()
val history = state.list?.collectAsLazyPagingItems()
when {