Your phone, on your command. Gotcha is world's first fully on-device AI copilot for Android that turns natural language into real device actions — safely.
feat: enhance LegalConsentDialog with expandable document sections for improved readability
Durganshu Mishra49192dd81656
diff --git a/app/src/main/java/com/gotcha/LegalConsentDialog.kt b/app/src/main/java/com/gotcha/LegalConsentDialog.ktindex 3116190..7eaeda1 100644--- a/app/src/main/java/com/gotcha/LegalConsentDialog.kt+++ b/app/src/main/java/com/gotcha/LegalConsentDialog.kt@@ -1,6 +1,7 @@package com.gotchaimport android.content.Context+import androidx.compose.foundation.clickableimport androidx.compose.foundation.layout.Arrangementimport androidx.compose.foundation.layout.Columnimport androidx.compose.foundation.layout.Row@@ -10,8 +11,12 @@ import androidx.compose.foundation.rememberScrollStateimport androidx.compose.foundation.selection.toggleableimport androidx.compose.foundation.shape.RoundedCornerShapeimport androidx.compose.foundation.verticalScroll+import androidx.compose.material.icons.Icons+import androidx.compose.material.icons.filled.ExpandLess+import androidx.compose.material.icons.filled.ExpandMoreimport androidx.compose.material3.Checkboximport androidx.compose.material3.HorizontalDivider+import androidx.compose.material3.Iconimport androidx.compose.material3.MaterialThemeimport androidx.compose.material3.Surfaceimport androidx.compose.material3.Text@@ -172,12 +177,16 @@ fun LegalConsentDialog(}/**- * One legal document inline: section title plus its rendered Markdown body.- * Sits in a soft surface card so the eye picks it out from the surrounding- * summary text, which uses the default background.+ * One legal document inline: a tappable header (title + chevron) that+ * expands to reveal the rendered Markdown body. Starts collapsed — these+ * documents are long, and showing all three fully expanded by default would+ * turn the dialog into a wall of text the user has to scroll past rather+ * than one they can selectively dig into.*/@Composableprivate fun DocumentBlock(title: String, body: String?, loadingLabel: String) {+ var expanded by remember { mutableStateOf(false) }+Surface(shape = RoundedCornerShape(8.dp),color = MaterialTheme.colorScheme.surfaceVariant,@@ -189,17 +198,33 @@ private fun DocumentBlock(title: String, body: String?, loadingLabel: String) {.padding(horizontal = 12.dp, vertical = 10.dp),verticalArrangement = Arrangement.spacedBy(6.dp)) {- Text(- text = title,- style = MaterialTheme.typography.titleSmall,- fontWeight = FontWeight.SemiBold,- color = MaterialTheme.colorScheme.onSurfaceVariant- )- Text(- text = renderLegalMarkdown(body ?: loadingLabel),- style = MaterialTheme.typography.bodySmall,- color = MaterialTheme.colorScheme.onSurfaceVariant- )+ Row(+ modifier = Modifier+ .fillMaxWidth()+ .clickable { expanded = !expanded },+ horizontalArrangement = Arrangement.SpaceBetween,+ verticalAlignment = Alignment.CenterVertically+ ) {+ Text(+ text = title,+ style = MaterialTheme.typography.titleSmall,+ fontWeight = FontWeight.SemiBold,+ color = MaterialTheme.colorScheme.onSurfaceVariant,+ modifier = Modifier.weight(1f)+ )+ Icon(+ imageVector = if (expanded) Icons.Default.ExpandLess else Icons.Default.ExpandMore,+ contentDescription = null,+ tint = MaterialTheme.colorScheme.onSurfaceVariant+ )+ }+ if (expanded) {+ Text(+ text = renderLegalMarkdown(body ?: loadingLabel),+ style = MaterialTheme.typography.bodySmall,+ color = MaterialTheme.colorScheme.onSurfaceVariant+ )+ }}}}