Add search suggestion item placement animation
This commit is contained in:
1 parent
29e33d6e69
commit
053832681f
1 file changed
+6
-3
@@ -314,8 +314,11 @@ fun SearchBarScreen(
|
||||
}
|
||||
},
|
||||
) {
|
||||
LazyColumn(contentPadding = WindowInsets.navigationBars.union(WindowInsets.ime).asPaddingValues()) {
|
||||
items(mSuggestionList) {
|
||||
LazyColumn(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
contentPadding = WindowInsets.navigationBars.union(WindowInsets.ime).asPaddingValues(),
|
||||
) {
|
||||
items(mSuggestionList, key = { it.keyword }) {
|
||||
ListItem(
|
||||
headlineContent = { Text(text = it.keyword) },
|
||||
supportingContent = it.hint.ifNotNullThen { Text(text = it.hint!!) },
|
||||
@@ -334,7 +337,7 @@ fun SearchBarScreen(
|
||||
}
|
||||
},
|
||||
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
|
||||
modifier = Modifier.clickable { it.onClick() },
|
||||
modifier = Modifier.clickable { it.onClick() }.animateItemPlacement(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user