mirror of
https://github.com/owenlejeune/TVTime.git
synced 2025-11-08 04:32:43 -05:00
expand person bio card when tapping anywhere
This commit is contained in:
@@ -79,12 +79,20 @@ fun ExpandableContentCard(
|
||||
collapsedText: String = stringResource(id = R.string.expandable_see_more),
|
||||
expandedText: String = stringResource(id = R.string.expandable_see_less),
|
||||
toggleTextColor: Color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
content: @Composable (Boolean) -> Unit = {}
|
||||
expandOnTouchAnywhere: Boolean = false,
|
||||
content: @Composable (Boolean) -> Unit
|
||||
) {
|
||||
var expandedState by remember { mutableStateOf(false) }
|
||||
|
||||
Card(
|
||||
modifier = modifier,
|
||||
modifier = modifier.then(
|
||||
Modifier.clickable(
|
||||
enabled = expandOnTouchAnywhere,
|
||||
onClick = {
|
||||
expandedState = true
|
||||
}
|
||||
)
|
||||
),
|
||||
shape = RoundedCornerShape(10.dp),
|
||||
elevation = CardDefaults.cardElevation(defaultElevation = 8.dp),
|
||||
colors = CardDefaults.cardColors(containerColor = backgroundColor)
|
||||
|
||||
@@ -138,7 +138,9 @@ fun PersonDetailScreen(
|
||||
@Composable
|
||||
private fun BiographyCard(person: DetailPerson?) {
|
||||
if (person != null && person.biography.isNotEmpty()) {
|
||||
ExpandableContentCard { isExpanded ->
|
||||
ExpandableContentCard(
|
||||
expandOnTouchAnywhere = true
|
||||
) { isExpanded ->
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
|
||||
Reference in New Issue
Block a user