Polish native shell navigation

This commit is contained in:
2026-07-05 20:27:48 +02:00
parent 6bcfc534a0
commit 8ae8a1ccee
8 changed files with 123 additions and 73 deletions

View File

@@ -1,7 +1,6 @@
package com.vnidrop.app.ui.navigation
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
@@ -40,23 +39,34 @@ fun AppSidebarNavigation(
modifier: Modifier = Modifier,
) {
val colors = LocalVniDropColors.current
Column(
Box(
modifier = modifier
.width(88.dp)
.fillMaxHeight()
.background(colors.backgroundSurface200)
.border(width = 1.dp, color = colors.borderDefault)
.padding(vertical = 10.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(2.dp),
.background(colors.backgroundSurface200),
) {
primaryNavigationItems.forEach { item ->
SidebarNavigationItem(
item = item,
selected = item.destination == selected,
onClick = { onDestinationSelected(item.destination) },
)
Column(
modifier = Modifier
.fillMaxHeight()
.padding(vertical = 10.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(2.dp),
) {
primaryNavigationItems.forEach { item ->
SidebarNavigationItem(
item = item,
selected = item.destination == selected,
onClick = { onDestinationSelected(item.destination) },
)
}
}
Box(
modifier = Modifier
.align(Alignment.CenterEnd)
.width(1.dp)
.fillMaxHeight()
.background(colors.borderDefault),
)
}
}
@@ -70,10 +80,8 @@ fun AppBottomNavigation(
Column(
modifier = modifier
.fillMaxWidth()
.background(colors.backgroundSurface200)
.border(width = 1.dp, color = colors.borderDefault),
.background(colors.backgroundSurface200),
) {
ActiveBottomIndicator(selected = selected)
Row(
modifier = Modifier
.fillMaxWidth()
@@ -107,18 +115,8 @@ private fun SidebarNavigationItem(
modifier = Modifier
.fillMaxWidth()
.selectable(selected = selected, onClick = onClick)
.background(if (selected) colors.backgroundSurface300 else Color.Transparent)
.padding(vertical = 13.dp),
) {
if (selected) {
Box(
modifier = Modifier
.align(Alignment.CenterStart)
.size(width = 4.dp, height = 46.dp)
.clip(RoundedCornerShape(topEnd = 4.dp, bottomEnd = 4.dp))
.background(colors.brandLink),
)
}
Column(
modifier = Modifier.align(Alignment.Center),
horizontalAlignment = Alignment.CenterHorizontally,
@@ -168,19 +166,3 @@ private fun BottomNavigationItem(
)
}
}
@Composable
private fun ActiveBottomIndicator(selected: AppDestination) {
val colors = LocalVniDropColors.current
val index = primaryNavigationItems.indexOfFirst { it.destination == selected }.coerceAtLeast(0)
Row(modifier = Modifier.fillMaxWidth()) {
repeat(primaryNavigationItems.size) { itemIndex ->
Box(
modifier = Modifier
.weight(1f)
.size(height = 3.dp, width = 1.dp)
.background(if (itemIndex == index) colors.brandLink else Color.Transparent),
)
}
}
}

View File

@@ -41,17 +41,13 @@ object VniDropIcons {
strokeLineJoin = StrokeJoin.Round,
pathFillType = PathFillType.NonZero,
) {
moveTo(12f, 3f)
lineTo(12f, 15f)
moveTo(7f, 10f)
lineTo(12f, 15f)
lineTo(17f, 10f)
moveTo(5f, 21f)
lineTo(19f, 21f)
moveTo(5f, 17f)
moveTo(12f, 17f)
lineTo(12f, 3f)
moveTo(6f, 11f)
lineTo(12f, 17f)
lineTo(18f, 11f)
moveTo(19f, 21f)
lineTo(5f, 21f)
moveTo(19f, 17f)
lineTo(19f, 21f)
}
}.build()
}
@@ -66,25 +62,22 @@ object VniDropIcons {
strokeLineJoin = StrokeJoin.Round,
pathFillType = PathFillType.NonZero,
) {
moveTo(9.671f, 4.136f)
arcToRelative(2.34f, 2.34f, 0f, false, true, 4.659f, 0f)
arcToRelative(2.34f, 2.34f, 0f, false, false, 3.319f, 1.915f)
arcToRelative(2.34f, 2.34f, 0f, false, true, 2.33f, 4.033f)
arcToRelative(2.34f, 2.34f, 0f, false, false, 0f, 3.831f)
arcToRelative(2.34f, 2.34f, 0f, false, true, -2.33f, 4.033f)
arcToRelative(2.34f, 2.34f, 0f, false, false, -3.319f, 1.915f)
arcToRelative(2.34f, 2.34f, 0f, false, true, -4.659f, 0f)
arcToRelative(2.34f, 2.34f, 0f, false, false, -3.32f, -1.915f)
arcToRelative(2.34f, 2.34f, 0f, false, true, -2.33f, -4.033f)
arcToRelative(2.34f, 2.34f, 0f, false, false, 0f, -3.831f)
arcTo(2.34f, 2.34f, 0f, false, true, 6.35f, 6.051f)
arcToRelative(2.34f, 2.34f, 0f, false, false, 3.319f, -1.915f)
moveTo(12f, 15f)
arcTo(3f, 3f, 0f, false, false, 12f, 9f)
arcTo(3f, 3f, 0f, false, false, 12f, 15f)
moveTo(19.4f, 15f)
lineTo(20.8f, 17.4f)
lineTo(18.4f, 21f)
lineTo(15.8f, 20f)
moveTo(8.2f, 4f)
lineTo(5.6f, 3f)
lineTo(3.2f, 6.6f)
lineTo(4.6f, 9f)
moveTo(15.8f, 4f)
lineTo(18.4f, 3f)
lineTo(20.8f, 6.6f)
lineTo(19.4f, 9f)
moveTo(4.6f, 15f)
lineTo(3.2f, 17.4f)
lineTo(5.6f, 21f)
lineTo(8.2f, 20f)
arcTo(3f, 3f, 0f, false, true, 12f, 9f)
arcTo(3f, 3f, 0f, false, true, 12f, 15f)
}
}.build()
}