Skip to content

Instantly share code, notes, and snippets.

@Pouyaa91
Created October 20, 2023 00:07
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 Pouyaa91/0b75d690a650845a403f69cbe7ad29b0 to your computer and use it in GitHub Desktop.
Save Pouyaa91/0b75d690a650845a403f69cbe7ad29b0 to your computer and use it in GitHub Desktop.
ExpandableSectionTitle
@Composable
fun ExpandableSectionTitle(modifier: Modifier = Modifier, isExpanded: Boolean, title: String) {
val icon = if (isExpanded) Icons.Rounded.KeyboardArrowUp else Icons.Rounded.KeyboardArrowDown
Row(modifier = modifier.padding(8.dp), verticalAlignment = Alignment.CenterVertically) {
Image(
modifier = Modifier.size(32.dp),
imageVector = icon,
colorFilter = ColorFilter.tint(color = MaterialTheme.colorScheme.onPrimaryContainer),
contentDescription = stringResource(id = R.string.expand_or_collapse)
)
Text(text = title, style = MaterialTheme.typography.headlineMedium)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment