Created
October 20, 2023 00:07
-
-
Save Pouyaa91/0b75d690a650845a403f69cbe7ad29b0 to your computer and use it in GitHub Desktop.
ExpandableSectionTitle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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