Skip to content

Instantly share code, notes, and snippets.

@ekeitho
Last active April 26, 2022 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ekeitho/92c7504b3ecfba055436e1d0eb1573fd to your computer and use it in GitHub Desktop.
Save ekeitho/92c7504b3ecfba055436e1d0eb1573fd to your computer and use it in GitHub Desktop.
@Composable
fun ContactListWithScroller(
contacts: List<Contact>,
) {
val mapOfFirstLetterIndex = remember(contacts) { contacts.getFirstUniqueSeenCharIndex() }
Row(
modifier = Modifier.fillMaxSize(),
verticalAlignment = Alignment.CenterVertically,
) {
ContactList(
modifier = Modifier.fillMaxHeight().weight(1F),
contacts = contacts,
mapOfFirstLetterIndex = mapOfFirstLetterIndex
)
AlphabetScroller()
}
}
@ekeitho
Copy link
Author

ekeitho commented Mar 19, 2022

Without the fillMaxHeight() when we have small number of contacts it would look like this:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment