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: integrate compose-richtext to enable markdown rendering in message bubbles
Rishabh Bajpaiaf96777a6c2a
diff --git a/app/build.gradle.kts b/app/build.gradle.ktsindex 561912e..17b3e13 100644--- a/app/build.gradle.kts+++ b/app/build.gradle.kts@@ -89,6 +89,10 @@ dependencies {// HTML parsing for webfetch toolimplementation("org.jsoup:jsoup:1.17.2")+ // Markdown rendering+ implementation("com.halilibo.compose-richtext:richtext-ui-material3:0.17.0")+ implementation("com.halilibo.compose-richtext:richtext-commonmark:0.17.0")+// DebugdebugImplementation("androidx.compose.ui:ui-tooling")debugImplementation("androidx.compose.ui:ui-test-manifest")diff --git a/app/src/main/java/com/gotcha/ui/MessageBubble.kt b/app/src/main/java/com/gotcha/ui/MessageBubble.ktindex 1329492..2d28404 100644--- a/app/src/main/java/com/gotcha/ui/MessageBubble.kt+++ b/app/src/main/java/com/gotcha/ui/MessageBubble.kt@@ -14,6 +14,8 @@ import androidx.compose.foundation.layout.sizeimport androidx.compose.foundation.layout.widthimport androidx.compose.foundation.layout.widthInimport androidx.compose.foundation.shape.RoundedCornerShape+import com.halilibo.richtext.markdown.Markdown+import com.halilibo.richtext.ui.material3.Material3RichTextimport androidx.compose.material.icons.Iconsimport androidx.compose.material.icons.automirrored.rounded.VolumeUpimport androidx.compose.material3.Icon@@ -113,13 +115,16 @@ fun MessageBubble()}} else {- Text(- text = displayText,- style = when (message.kind) {- MessageKind.TOOL -> MaterialTheme.typography.bodySmall- else -> MaterialTheme.typography.bodyMedium+ if (message.kind == MessageKind.TOOL) {+ Text(+ text = displayText,+ style = MaterialTheme.typography.bodySmall+ )+ } else {+ Material3RichText {+ Markdown(displayText)}- )+ }}}if (isAssistant && message.text.isNotEmpty()) {diff --git a/app/test_dep.gradle b/app/test_dep.gradlenew file mode 100644index 0000000..38db41e--- /dev/null+++ b/app/test_dep.gradle@@ -0,0 +1,3 @@+apply plugin: 'com.android.application'+repositories { mavenCentral(); google() }+dependencies { implementation "com.halilibo.compose-richtext:richtext-commonmark:0.17.0" }