|
@@ -52,6 +52,7 @@ fun Chat(navController: NavHostController, pin: String, mainViewModel: MainViewM
|
|
|
Column(
|
|
|
modifier = Modifier
|
|
|
.fillMaxSize()
|
|
|
+ .background(color = MaterialTheme.colorScheme.surfaceContainer)
|
|
|
.padding(start = 8.dp, end = 8.dp, bottom = 8.dp)
|
|
|
) {
|
|
|
LazyColumn(
|
|
@@ -71,97 +72,93 @@ fun Chat(navController: NavHostController, pin: String, mainViewModel: MainViewM
|
|
|
) {
|
|
|
if (message?.f_pin == me?.f_pin) {
|
|
|
Spacer(modifier = Modifier.weight(0.2f))
|
|
|
- Row(
|
|
|
+ Column(
|
|
|
modifier = Modifier
|
|
|
- .graphicsLayer {
|
|
|
- shadowElevation = 2.dp.toPx()
|
|
|
- shape = RoundedCornerShape(16.dp)
|
|
|
- clip = true
|
|
|
- }
|
|
|
.weight(weight = 0.8f, fill = false)
|
|
|
- .background(color = MaterialTheme.colorScheme.primaryContainer)
|
|
|
- .padding(8.dp)
|
|
|
) {
|
|
|
Text(
|
|
|
- modifier = Modifier.padding(
|
|
|
- PaddingValues(
|
|
|
- start = 6.dp,
|
|
|
- top = 6.dp,
|
|
|
- end = 12.dp,
|
|
|
- bottom = 6.dp
|
|
|
- )
|
|
|
- ),
|
|
|
+ modifier = Modifier
|
|
|
+ .align(Alignment.End)
|
|
|
+ .graphicsLayer {
|
|
|
+// shadowElevation = 2.dp.toPx()
|
|
|
+ shape = RoundedCornerShape(16.dp)
|
|
|
+ clip = true
|
|
|
+ }
|
|
|
+ .background(color = MaterialTheme.colorScheme.primaryContainer)
|
|
|
+ .padding(8.dp),
|
|
|
text = list?.get(it)?.message_text ?: "",
|
|
|
- color = MaterialTheme.colorScheme.onPrimaryContainer,
|
|
|
style = MaterialTheme.typography.bodyMedium,
|
|
|
)
|
|
|
- Text(
|
|
|
- modifier = Modifier.align(Alignment.Bottom),
|
|
|
- text = DateUtils.formatDateTime(
|
|
|
- LocalContext.current,
|
|
|
- list?.get(it)?.server_date ?: 0,
|
|
|
- DateUtils.FORMAT_SHOW_TIME
|
|
|
- ),
|
|
|
- color = MaterialTheme.colorScheme.onPrimaryContainer,
|
|
|
- style = MaterialTheme.typography.bodySmall,
|
|
|
- )
|
|
|
- Spacer(modifier = Modifier.width(6.dp))
|
|
|
- Icon(
|
|
|
- imageVector = Icons.Default.DoneAll,
|
|
|
- contentDescription = "",
|
|
|
+ Row(
|
|
|
modifier = Modifier
|
|
|
- .align(Alignment.Bottom)
|
|
|
- .size(16.dp),
|
|
|
- tint = Color(0xFF0075F1)
|
|
|
- )
|
|
|
+ .padding(3.dp)
|
|
|
+ .align(Alignment.End)
|
|
|
+ ) {
|
|
|
+ Text(
|
|
|
+ text = DateUtils.formatDateTime(
|
|
|
+ LocalContext.current,
|
|
|
+ list?.get(it)?.server_date ?: 0,
|
|
|
+ DateUtils.FORMAT_SHOW_TIME
|
|
|
+ ),
|
|
|
+ color = MaterialTheme.colorScheme.onPrimaryContainer,
|
|
|
+ style = MaterialTheme.typography.bodySmall,
|
|
|
+ )
|
|
|
+ Spacer(modifier = Modifier.width(6.dp))
|
|
|
+ Icon(
|
|
|
+ imageVector = Icons.Default.DoneAll,
|
|
|
+ contentDescription = "",
|
|
|
+ modifier = Modifier
|
|
|
+ .align(Alignment.Bottom)
|
|
|
+ .size(16.dp),
|
|
|
+ tint = Color(0xFF0075F1)
|
|
|
+ )
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
- Row(
|
|
|
+ Column(
|
|
|
modifier = Modifier
|
|
|
- .graphicsLayer {
|
|
|
- shadowElevation = 2.dp.toPx()
|
|
|
- shape = RoundedCornerShape(16.dp)
|
|
|
- clip = true
|
|
|
- }
|
|
|
.weight(weight = 0.8f, fill = false)
|
|
|
- .background(color = MaterialTheme.colorScheme.surface)
|
|
|
- .padding(8.dp)
|
|
|
) {
|
|
|
Text(
|
|
|
- modifier = Modifier.padding(
|
|
|
- PaddingValues(
|
|
|
- start = 6.dp,
|
|
|
- top = 6.dp,
|
|
|
- end = 12.dp,
|
|
|
- bottom = 6.dp
|
|
|
- )
|
|
|
- ),
|
|
|
+ modifier = Modifier
|
|
|
+ .align(Alignment.Start)
|
|
|
+ .graphicsLayer {
|
|
|
+// shadowElevation = 2.dp.toPx()
|
|
|
+ shape = RoundedCornerShape(16.dp)
|
|
|
+ clip = true
|
|
|
+ }
|
|
|
+ .background(color = MaterialTheme.colorScheme.surface)
|
|
|
+ .padding(8.dp),
|
|
|
text = list?.get(it)?.message_text ?: "",
|
|
|
- color = MaterialTheme.colorScheme.onSurface,
|
|
|
style = MaterialTheme.typography.bodyMedium,
|
|
|
)
|
|
|
- Text(
|
|
|
- modifier = Modifier.align(Alignment.Bottom),
|
|
|
- text = DateUtils.formatDateTime(
|
|
|
- LocalContext.current,
|
|
|
- list?.get(it)?.server_date ?: 0,
|
|
|
- DateUtils.FORMAT_SHOW_TIME
|
|
|
- ),
|
|
|
- color = MaterialTheme.colorScheme.onSurface,
|
|
|
- style = MaterialTheme.typography.bodySmall,
|
|
|
- )
|
|
|
+ Row(
|
|
|
+ modifier = Modifier
|
|
|
+ .padding(3.dp)
|
|
|
+ .align(Alignment.Start)
|
|
|
+ ) {
|
|
|
+ Text(
|
|
|
+ text = DateUtils.formatDateTime(
|
|
|
+ LocalContext.current,
|
|
|
+ list?.get(it)?.server_date ?: 0,
|
|
|
+ DateUtils.FORMAT_SHOW_TIME
|
|
|
+ ),
|
|
|
+ color = MaterialTheme.colorScheme.onSurface,
|
|
|
+ style = MaterialTheme.typography.bodySmall,
|
|
|
+ )
|
|
|
+ }
|
|
|
}
|
|
|
Spacer(modifier = Modifier.weight(0.2f))
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
+ }, colors = ListItemDefaults.colors(containerColor = Color.Transparent))
|
|
|
}
|
|
|
}
|
|
|
TextField(
|
|
|
modifier = Modifier
|
|
|
.fillMaxWidth()
|
|
|
.graphicsLayer {
|
|
|
- shadowElevation = 2.dp.toPx()
|
|
|
+// shadowElevation = 2.dp.toPx()
|
|
|
shape = CircleShape
|
|
|
clip = true
|
|
|
}
|
|
@@ -170,7 +167,7 @@ fun Chat(navController: NavHostController, pin: String, mainViewModel: MainViewM
|
|
|
onValueChange = { textInput = it },
|
|
|
label = null,
|
|
|
placeholder = {
|
|
|
- Text(text = "Typing here...", color = MaterialTheme.colorScheme.onPrimary)
|
|
|
+ Text(text = "Typing here...", color = MaterialTheme.colorScheme.onSurface)
|
|
|
},
|
|
|
leadingIcon = {
|
|
|
IconButton(onClick = { }
|
|
@@ -178,7 +175,7 @@ fun Chat(navController: NavHostController, pin: String, mainViewModel: MainViewM
|
|
|
Icon(
|
|
|
imageVector = Icons.Default.Add,
|
|
|
contentDescription = "",
|
|
|
- tint = MaterialTheme.colorScheme.onPrimary
|
|
|
+ tint = MaterialTheme.colorScheme.primary
|
|
|
)
|
|
|
}
|
|
|
},
|
|
@@ -213,15 +210,15 @@ fun Chat(navController: NavHostController, pin: String, mainViewModel: MainViewM
|
|
|
Icon(
|
|
|
imageVector = Icons.AutoMirrored.Filled.Send,
|
|
|
contentDescription = "",
|
|
|
- tint = MaterialTheme.colorScheme.onPrimary
|
|
|
+ tint = MaterialTheme.colorScheme.primary
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
colors = TextFieldDefaults.colors(
|
|
|
- focusedContainerColor = MaterialTheme.colorScheme.primary,
|
|
|
- unfocusedContainerColor = MaterialTheme.colorScheme.primary,
|
|
|
- disabledContainerColor = MaterialTheme.colorScheme.primary,
|
|
|
+ focusedContainerColor = MaterialTheme.colorScheme.surface,
|
|
|
+ unfocusedContainerColor = MaterialTheme.colorScheme.surface,
|
|
|
+ disabledContainerColor = MaterialTheme.colorScheme.surface,
|
|
|
focusedIndicatorColor = Color.Transparent,
|
|
|
unfocusedIndicatorColor = Color.Transparent,
|
|
|
disabledIndicatorColor = Color.Transparent,
|