android: add floating bottom nav shell to chat list
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
Codex
2026-03-09 14:29:35 +03:00
parent ce585f62d2
commit 1d37f8eb0b
4 changed files with 55 additions and 4 deletions

View File

@@ -25,6 +25,7 @@ import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Surface
import androidx.compose.material3.Tab
import androidx.compose.material3.TabRow
import androidx.compose.material3.Text
@@ -192,10 +193,27 @@ fun ChatListScreen(
onClick = {},
modifier = Modifier
.align(Alignment.BottomEnd)
.padding(16.dp),
.padding(end = 16.dp, bottom = 88.dp),
) {
Text("+")
}
Surface(
modifier = Modifier
.align(Alignment.BottomCenter)
.padding(horizontal = 16.dp, vertical = 14.dp),
shape = CircleShape,
color = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.92f),
) {
Row(
modifier = Modifier.padding(horizontal = 12.dp, vertical = 8.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp),
) {
BottomNavPill(label = "Chats", selected = true, onClick = {})
BottomNavPill(label = "Contacts", selected = false, onClick = {})
BottomNavPill(label = "Settings", selected = false, onClick = {})
BottomNavPill(label = "Profile", selected = false, onClick = {})
}
}
}
}
}
@@ -363,6 +381,34 @@ private fun ArchiveRow(
}
}
@Composable
private fun BottomNavPill(
label: String,
selected: Boolean,
onClick: () -> Unit,
) {
Surface(
shape = CircleShape,
color = if (selected) {
MaterialTheme.colorScheme.primaryContainer
} else {
MaterialTheme.colorScheme.surface
},
modifier = Modifier.clickable(onClick = onClick),
) {
Text(
text = label,
modifier = Modifier.padding(horizontal = 10.dp, vertical = 6.dp),
style = MaterialTheme.typography.labelMedium,
color = if (selected) {
MaterialTheme.colorScheme.onPrimaryContainer
} else {
MaterialTheme.colorScheme.onSurface
},
)
}
}
@Composable
private fun CenterState(
text: String?,