Animate room list filters when clearing
They animate cleanly back to their original locations now, and correctly overlap each other when doing so. The only thing that is mildly jarring is the reappearing chips, but there's no way to animate appearance in the current version of jetpack compose, so that'll have to be fixed later. Signed-off-by: Joe Groocock <me@frebib.net>
This commit is contained in:
parent
7aa9d856b8
commit
b852578ffc
1 changed files with 0 additions and 8 deletions
|
|
@ -34,7 +34,6 @@ import androidx.compose.foundation.shape.CircleShape
|
|||
import androidx.compose.material3.FilterChip
|
||||
import androidx.compose.material3.FilterChipDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Alignment
|
||||
|
|
@ -106,13 +105,6 @@ fun RoomListFiltersView(
|
|||
}
|
||||
}
|
||||
}
|
||||
LaunchedEffect(state.filterSelectionStates) {
|
||||
// Checking for canScrollBackward is necessary for the itemPlacementAnimation to work correctly.
|
||||
// We don't want the itemPlacementAnimation to be triggered when clearing the filters.
|
||||
if (!state.hasAnyFilterSelected || lazyListState.canScrollBackward) {
|
||||
lazyListState.animateScrollToItem(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue