Tgo1014
05/16/2023, 12:44 PMstickyHeader
inside a LazyColumn
is at the top?andrew
05/16/2023, 3:47 PMandrew
05/16/2023, 3:47 PMTgo1014
05/17/2023, 7:25 AMStylianos Gakis
05/17/2023, 7:28 AMandrew
05/17/2023, 2:31 PMandrew
05/17/2023, 2:32 PMandrew
05/17/2023, 2:33 PMandrew
05/17/2023, 2:34 PM@Composable
fun rememberStickyHeaderActive(state: LazyListState, key: Any): State<Boolean> = remember(state) {
derivedStateOf {
val items = state.layoutInfo.visibleItemsInfo
val header = items.getOrNull(0) ?: return@derivedStateOf false
val item = items.getOrNull(1) ?: return@derivedStateOf false
header.key == key && item.offset < header.size
}
}
Sorry for the wait, here you go! You can probably easily make an extension function that provides this for within a sticky header without manually calling itTgo1014
05/17/2023, 2:42 PMstickyHeader(state) { isSticky: Boolean -> }
. I'll try to see if it workls later