yayan před 1 rokem
rodič
revize
b9d0867357

+ 2 - 0
app/src/main/java/io/nexilis/alpha/ui/components/BubleChat.kt

@@ -50,6 +50,7 @@ fun RightBubbleChat(
             modifier = Modifier
                 .align(Alignment.End)
                 .graphicsLayer {
+                    shadowElevation = 1f
                     shape = RoundedCornerShape(12.dp)
                     clip = true
                 }
@@ -110,6 +111,7 @@ fun LeftBubbleChat(
             modifier = Modifier
                 .align(Alignment.Start)
                 .graphicsLayer {
+                    shadowElevation = 1f
                     shape = RoundedCornerShape(12.dp)
                     clip = true
                 }

+ 2 - 1
app/src/main/java/io/nexilis/alpha/ui/components/InputChat.kt

@@ -69,7 +69,7 @@ fun InputChat(
             .fillMaxWidth()
             .padding(start = 6.dp, end = 6.dp, bottom = 6.dp)
             .graphicsLayer {
-                shadowElevation = 3f
+                shadowElevation = 1f
                 shape = RoundedCornerShape(16.dp)
                 clip = true
             },
@@ -214,6 +214,7 @@ private fun addAttachment(
                     .fillMaxWidth()
                     .padding(start = 16.dp, end = 16.dp, bottom = 8.dp)
                     .graphicsLayer {
+                        shadowElevation = 1f
                         shape = RoundedCornerShape(16.dp)
                         clip = true
                     }

+ 12 - 10
app/src/main/java/io/nexilis/alpha/ui/main/Chat.kt

@@ -1,12 +1,11 @@
 package io.nexilis.alpha.ui.main
 
-import androidx.compose.animation.AnimatedVisibility
 import androidx.compose.foundation.layout.*
 import androidx.compose.foundation.lazy.LazyColumn
 import androidx.compose.foundation.lazy.rememberLazyListState
 import androidx.compose.foundation.shape.CircleShape
 import androidx.compose.material.icons.Icons
-import androidx.compose.material.icons.filled.KeyboardDoubleArrowDown
+import androidx.compose.material.icons.filled.KeyboardArrowDown
 import androidx.compose.material3.*
 import androidx.compose.runtime.*
 import androidx.compose.ui.Modifier
@@ -34,7 +33,7 @@ fun Chat(
     me: Buddy
 ) {
     val messageModel: MessageViewModel = hiltViewModel()
-    val flow  = remember { messageModel.getOpposite(pin) }
+    val flow = remember { messageModel.getOpposite(pin) }
     val lazyPagingItems = flow.collectAsLazyPagingItems()
     val listState = rememberLazyListState()
     val scope = rememberCoroutineScope()
@@ -43,7 +42,7 @@ fun Chat(
             .fillMaxSize()
             .consumeWindowInsets(contentPadding)
             .imePadding()
-            .imeNestedScroll()
+//            .imeNestedScroll()
     ) {
         val (lazyColumn, fab, input) = createRefs()
         LazyColumn(
@@ -55,7 +54,9 @@ fun Chat(
             state = listState,
             reverseLayout = true
         ) {
-            items(count = lazyPagingItems.itemCount, key = lazyPagingItems.itemKey { it.message_id }) { index ->
+            items(
+                count = lazyPagingItems.itemCount,
+                key = lazyPagingItems.itemKey { it.message_id }) { index ->
                 lazyPagingItems[index]?.let { message ->
                     ListItem(modifier = Modifier.fillMaxWidth(), headlineContent = {
                         Row(
@@ -95,21 +96,22 @@ fun Chat(
                 listState.firstVisibleItemIndex > 0
             }
         }
-        AnimatedVisibility(visible = showButton, modifier = Modifier.constrainAs(fab) {
-            end.linkTo(parent.end)
-            bottom.linkTo(input.top)
-        }) {
+        if (showButton) {
             Button(
                 onClick = {
                     scope.launch { listState.scrollToItem(0) }
                 },
                 modifier = Modifier
+                    .constrainAs(fab) {
+                        end.linkTo(parent.end)
+                        bottom.linkTo(input.top)
+                    }
                     .padding(end = 6.dp, bottom = 6.dp)
                     .size(32.dp),
                 shape = CircleShape,
                 contentPadding = PaddingValues(0.dp)
             ) {
-                Icon(imageVector = Icons.Default.KeyboardDoubleArrowDown, contentDescription = "")
+                Icon(imageVector = Icons.Default.KeyboardArrowDown, contentDescription = "")
             }
         }
         InputChat(