π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
ensu android: keep streaming loader top-left and stable
Prateek Sunal42e0220c3f5a
diff --git a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatMessages.kt b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatMessages.ktindex a6940198cd..9d32cb9391 100644--- a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatMessages.kt+++ b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatMessages.kt@@ -49,6 +49,7 @@ import androidx.compose.ui.graphics.Colorimport androidx.compose.ui.hapticfeedback.HapticFeedbackTypeimport androidx.compose.ui.input.pointer.pointerInputimport androidx.compose.ui.platform.LocalClipboardManager+import androidx.compose.ui.platform.LocalContextimport androidx.compose.ui.text.AnnotatedStringimport androidx.compose.ui.text.style.TextAlignimport androidx.compose.ui.unit.IntOffset@@ -683,47 +684,39 @@ private fun StreamingMessageBubble(text: String) {),horizontalAlignment = Alignment.Start) {- if (text.isNotBlank()) {- Column(- modifier = Modifier- .fillMaxWidth()- .padding(horizontal = EnsuSpacing.sm.dp, vertical = EnsuSpacing.md.dp)- ) {- MarkdownView(markdown = text, enableSelection = false, trailingCursor = showCursor)- }- }-- Box(+ GeneratingAnimation(modifier = Modifier- .fillMaxWidth()- .height(42.dp),- contentAlignment = Alignment.BottomStart- ) {- GeneratingAnimation(- modifier = Modifier- .width(92.dp)- .height(42.dp)- )+ .width(92.dp)+ .height(42.dp)+ )++ if (text.isNotBlank()) {+ Spacer(modifier = Modifier.height(EnsuSpacing.xs.dp))+ MarkdownView(markdown = text, enableSelection = false, trailingCursor = showCursor)}}}@Composableprivate fun GeneratingAnimation(modifier: Modifier = Modifier) {+ val context = LocalContext.current+ val riveView = remember {+ Rive.init(context.applicationContext)+ RiveAnimationView(context).apply {+ setRiveResource(+ resId = R.raw.ensu,+ autoplay = true,+ fit = Fit.CONTAIN,+ alignment = RiveAlignment.CENTER,+ loop = Loop.LOOP+ )+ }+ }+AndroidView(modifier = modifier,- factory = { context ->- Rive.init(context)- RiveAnimationView(context).apply {- setRiveResource(- resId = R.raw.ensu,- autoplay = true,- fit = Fit.CONTAIN,- alignment = RiveAlignment.CENTER,- loop = Loop.LOOP- )- }- }+ factory = { riveView },+ update = { })}