|
|
|
|
@ -14,6 +14,7 @@ import androidx.compose.foundation.layout.*
|
|
|
|
|
import androidx.compose.foundation.lazy.LazyColumn |
|
|
|
|
import androidx.compose.foundation.lazy.items |
|
|
|
|
import androidx.compose.foundation.shape.CircleShape |
|
|
|
|
import com.utun.chat.ui.components.UserAvatar |
|
|
|
|
import androidx.compose.foundation.shape.RoundedCornerShape |
|
|
|
|
import androidx.compose.material.icons.Icons |
|
|
|
|
import androidx.compose.material.icons.automirrored.filled.ArrowBack |
|
|
|
|
@ -91,6 +92,7 @@ fun MemberListScreen(
|
|
|
|
|
val m = members[idx] |
|
|
|
|
MemberListItem( |
|
|
|
|
member = m, |
|
|
|
|
group = channel.id, |
|
|
|
|
isSelected = selectedMember?.nodeId == m.nodeId, |
|
|
|
|
onClick = { viewModel.showMemberDetail(channel.id, m.nodeId) }, |
|
|
|
|
onCall = { viewModel.startCall(channel.id, m.nodeId, m.name) }, |
|
|
|
|
@ -152,6 +154,7 @@ fun MemberListScreen(
|
|
|
|
|
@Composable |
|
|
|
|
private fun MemberListItem( |
|
|
|
|
member: ChatMember, |
|
|
|
|
group: String, |
|
|
|
|
isSelected: Boolean = false, |
|
|
|
|
onClick: () -> Unit, |
|
|
|
|
onCall: () -> Unit, |
|
|
|
|
@ -176,15 +179,11 @@ private fun MemberListItem(
|
|
|
|
|
modifier = Modifier.padding(horizontal = 16.dp, vertical = 4.dp), |
|
|
|
|
verticalAlignment = Alignment.CenterVertically |
|
|
|
|
) { |
|
|
|
|
if (member.isSelf) { |
|
|
|
|
Text("✓", fontSize = 12.sp, color = Color(0xFF81C784)) |
|
|
|
|
} else { |
|
|
|
|
Box( |
|
|
|
|
modifier = Modifier |
|
|
|
|
.size(10.dp) |
|
|
|
|
.clip(CircleShape) |
|
|
|
|
.background(onlineColor) |
|
|
|
|
) |
|
|
|
|
Box { |
|
|
|
|
UserAvatar(group, member.nodeId, member.name) |
|
|
|
|
if (member.isSelf) Text("✓", modifier = Modifier.align(Alignment.BottomEnd), |
|
|
|
|
fontSize = 12.sp, color = Color(0xFF81C784)) |
|
|
|
|
else Box(Modifier.align(Alignment.BottomEnd).size(10.dp).clip(CircleShape).background(onlineColor)) |
|
|
|
|
} |
|
|
|
|
Spacer(Modifier.width(10.dp)) |
|
|
|
|
|
|
|
|
|
@ -280,6 +279,8 @@ private fun MemberDetailCard(
|
|
|
|
|
) { |
|
|
|
|
Column(modifier = Modifier.padding(12.dp).verticalScroll(rememberScrollState())) { |
|
|
|
|
Row(verticalAlignment = Alignment.CenterVertically) { |
|
|
|
|
UserAvatar(detail.channelId, detail.nodeId, detail.name) |
|
|
|
|
Spacer(Modifier.width(8.dp)) |
|
|
|
|
Column(modifier = Modifier.weight(1f)) { |
|
|
|
|
Row(verticalAlignment = Alignment.CenterVertically) { |
|
|
|
|
val dotColor = if (detail.online) Color(0xFF81C784) else Color(0xFFAEBCC8) |
|
|
|
|
|