Skip to content

Commit fb2f686

Browse files
committed
feat(ui): simplify and refine the send experience
- separate the Material 3 Expressive button group from send content - simplify file selection around large, responsive previews - scale file thumbnails for phone, tablet, and desktop widths - overlay filenames directly on previews while preserving extensions - add compact remove actions to individual file previews - keep selected files inside a horizontally scrollable row - simplify file-picker actions and selected-file information - remove the obsolete FileItemCard component - refine nearby-device card shapes, layering, and spacing - align reload controls with the established surface hierarchy - align the floating navigation bar with the scaffold background - allow Sync360Surface callers to provide an appropriate corner shape - preserve existing send state, device selection, picker, and transfer flows
1 parent 93fd0d8 commit fb2f686

7 files changed

Lines changed: 175 additions & 273 deletions

File tree

shared/src/commonMain/kotlin/com/liftley/sync360/Sync360Root.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ fun Sync360Root() {
108108
.padding(horizontal = 32.dp, vertical = 16.dp)
109109
// 3. Clip the corners after padding to create the floating card shape
110110
.clip(MaterialTheme.shapes.extraExtraLarge),
111-
containerColor = MaterialTheme.colorScheme.surfaceContainer,
111+
containerColor = MaterialTheme.colorScheme.surface,
112112
// 4. Disable internal inset consumption so our custom modifiers control the shape
113113
windowInsets = WindowInsets(0, 0, 0, 0)
114114
) {

shared/src/commonMain/kotlin/com/liftley/sync360/presentation/app/components/Sync360Surface.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
package com.liftley.sync360.presentation.app.components
22

3+
import androidx.compose.foundation.shape.CornerBasedShape
34
import androidx.compose.material3.MaterialTheme
45
import androidx.compose.material3.Surface
56
import androidx.compose.runtime.Composable
67
import androidx.compose.ui.Modifier
78
import androidx.compose.ui.graphics.Color
89

10+
911
@Composable
1012
fun Sync360Surface(
1113
modifier: Modifier = Modifier,
1214
containerColor: Color = MaterialTheme.colorScheme.surface,
15+
shape: CornerBasedShape = MaterialTheme.shapes.large,
1316
content: @Composable (() -> Unit)
1417
) {
1518
Surface(
1619
modifier = modifier,
1720
color = containerColor,
18-
shape = MaterialTheme.shapes.large
21+
shape = shape
1922
) {
2023
content()
2124
}

shared/src/commonMain/kotlin/com/liftley/sync360/presentation/send/SendScreen.kt

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,34 @@ fun SendScreen(
4848
horizontalAlignment = Alignment.CenterHorizontally,
4949
verticalArrangement = Arrangement.spacedBy(16.dp)
5050
) {
51+
Sync360Surface(
52+
containerColor = MaterialTheme.colorScheme.surface
53+
) {
54+
ButtonGroup(
55+
overflowIndicator = { menuState ->
56+
ButtonGroupDefaults.OverflowIndicator(menuState)
57+
},
58+
modifier = Modifier.fillMaxWidth().padding(8.dp)
59+
) {
60+
toggleableItem(
61+
checked = screenState.selectedTab == SendTab.Text,
62+
label = "Text",
63+
onCheckedChange = { checked ->
64+
if (checked) sendScreenViewModel.onTabSelected(SendTab.Text)
65+
},
66+
weight = 1f
67+
)
68+
69+
toggleableItem(
70+
checked = screenState.selectedTab == SendTab.Files,
71+
label = "Files",
72+
onCheckedChange = { checked ->
73+
if (checked) sendScreenViewModel.onTabSelected(SendTab.Files)
74+
},
75+
weight = 1f
76+
)
77+
}
78+
}
5179
Sync360Surface(
5280
containerColor = MaterialTheme.colorScheme.surface
5381
) {
@@ -57,31 +85,6 @@ fun SendScreen(
5785
.padding(16.dp),
5886
verticalArrangement = Arrangement.spacedBy(16.dp)
5987
) {
60-
ButtonGroup(
61-
overflowIndicator = { menuState ->
62-
ButtonGroupDefaults.OverflowIndicator(menuState)
63-
},
64-
modifier = Modifier.fillMaxWidth()
65-
) {
66-
toggleableItem(
67-
checked = screenState.selectedTab == SendTab.Text,
68-
label = "Text",
69-
onCheckedChange = { checked ->
70-
if (checked) sendScreenViewModel.onTabSelected(SendTab.Text)
71-
},
72-
weight = 1f
73-
)
74-
75-
toggleableItem(
76-
checked = screenState.selectedTab == SendTab.Files,
77-
label = "Files",
78-
onCheckedChange = { checked ->
79-
if (checked) sendScreenViewModel.onTabSelected(SendTab.Files)
80-
},
81-
weight = 1f
82-
)
83-
}
84-
8588
when (screenState.selectedTab) {
8689
SendTab.Text -> {
8790
TextSendContent(

shared/src/commonMain/kotlin/com/liftley/sync360/presentation/send/components/FileItemCard.kt

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)