Skip to content

Commit 97c7155

Browse files
committed
style(ui): improve UI expressiveness and consistency across components
This commit enhances the visual consistency and interactivity of several UI components by adopting a more "expressive" design language. It introduces a reusable `ExpressiveCard` component, updates shapes to use larger corner radii, and implements specialized Material3 shapes for icon buttons. - **feat(dev-profile)**: Added `ExpressiveCard` component using `ElevatedCard` with a 32.dp corner radius and consistent surface coloring. - **refactor(dev-profile)**: Migrated `StatsRow`, `DeveloperRepoItem`, and `ProfileInfoCard` to use `ExpressiveCard` for a unified look. - **style(dev-profile)**: Applied unique `MaterialShapes` (Cookie9Sided and Cookie6Sided) to sort and favorite buttons. - **style(apps)**: Updated repository cards in `AppsRoot` with 32.dp rounded corners and improved click handling with proper clipping. - **style(details)**: Updated the `Owner` section card to use a `RoundedCornerShape(32.dp)` to match the new design language. - **style(dev-profile)**: Added `DropdownMenu` rounding and additional padding to sort menu items.
1 parent 34018e0 commit 97c7155

7 files changed

Lines changed: 47 additions & 10 deletions

File tree

feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsRoot.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,9 @@ fun AppItemCard(
377377
ExpressiveCard {
378378
Column(
379379
modifier = modifier
380-
.padding(16.dp)
380+
.clip(RoundedCornerShape(32.dp))
381381
.clickable { onRepoClick() }
382+
.padding(16.dp)
382383
) {
383384
Row(
384385
modifier = Modifier.fillMaxWidth(),

feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/components/sections/Owner.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import androidx.compose.foundation.layout.padding
1212
import androidx.compose.foundation.layout.size
1313
import androidx.compose.foundation.lazy.LazyListScope
1414
import androidx.compose.foundation.shape.CircleShape
15+
import androidx.compose.foundation.shape.RoundedCornerShape
1516
import androidx.compose.material.icons.Icons
1617
import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight
1718
import androidx.compose.material3.CardDefaults
@@ -74,6 +75,7 @@ fun LazyListScope.author(
7475
colors = CardDefaults.outlinedCardColors(
7576
containerColor = MaterialTheme.colorScheme.surfaceContainerLowest
7677
),
78+
shape = RoundedCornerShape(32.dp)
7779
) {
7880
Row(
7981
modifier = Modifier.padding(12.dp),

feature/dev-profile/presentation/src/commonMain/kotlin/zed/rainxch/devprofile/presentation/components/DeveloperRepoItem.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
package zed.rainxch.devprofile.presentation.components
44

5+
import androidx.compose.foundation.clickable
56
import androidx.compose.foundation.horizontalScroll
67
import androidx.compose.foundation.layout.Arrangement
78
import androidx.compose.foundation.layout.Column
@@ -25,9 +26,11 @@ import androidx.compose.material3.Card
2526
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
2627
import androidx.compose.material3.FilledIconToggleButton
2728
import androidx.compose.material3.Icon
29+
import androidx.compose.material3.MaterialShapes
2830
import androidx.compose.material3.MaterialTheme
2931
import androidx.compose.material3.SuggestionChip
3032
import androidx.compose.material3.Text
33+
import androidx.compose.material3.toShape
3134
import androidx.compose.runtime.Composable
3235
import androidx.compose.ui.Alignment
3336
import androidx.compose.ui.Modifier
@@ -53,13 +56,13 @@ fun DeveloperRepoItem(
5356
onToggleFavorite: () -> Unit,
5457
modifier: Modifier = Modifier
5558
) {
56-
Card(
59+
ExpressiveCard(
5760
modifier = modifier.fillMaxWidth(),
58-
onClick = onItemClick
5961
) {
6062
Column(
6163
modifier = Modifier
6264
.fillMaxWidth()
65+
.clickable(onClick = onItemClick)
6366
.padding(16.dp)
6467
) {
6568
Row(
@@ -93,7 +96,8 @@ fun DeveloperRepoItem(
9396
FilledIconToggleButton(
9497
checked = repository.isFavorite,
9598
onCheckedChange = { onToggleFavorite() },
96-
modifier = Modifier.size(40.dp)
99+
modifier = Modifier.size(40.dp),
100+
shape = MaterialShapes.Cookie6Sided.toShape(),
97101
) {
98102
Icon(
99103
imageVector = if (repository.isFavorite) {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package zed.rainxch.devprofile.presentation.components
2+
3+
import androidx.compose.foundation.layout.fillMaxWidth
4+
import androidx.compose.foundation.shape.RoundedCornerShape
5+
import androidx.compose.material3.CardDefaults
6+
import androidx.compose.material3.ElevatedCard
7+
import androidx.compose.material3.MaterialTheme
8+
import androidx.compose.runtime.Composable
9+
import androidx.compose.ui.Modifier
10+
import androidx.compose.ui.unit.dp
11+
12+
@Composable
13+
fun ExpressiveCard(
14+
modifier: Modifier = Modifier,
15+
content: @Composable () -> Unit
16+
) {
17+
ElevatedCard(
18+
modifier = modifier.fillMaxWidth(),
19+
colors = CardDefaults.elevatedCardColors(
20+
containerColor = MaterialTheme.colorScheme.surfaceContainer
21+
),
22+
shape = RoundedCornerShape(32.dp),
23+
content = { content() }
24+
)
25+
}

feature/dev-profile/presentation/src/commonMain/kotlin/zed/rainxch/devprofile/presentation/components/FilterSortControls.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.Row
77
import androidx.compose.foundation.layout.Spacer
88
import androidx.compose.foundation.layout.fillMaxWidth
99
import androidx.compose.foundation.layout.height
10+
import androidx.compose.foundation.layout.padding
1011
import androidx.compose.foundation.layout.size
1112
import androidx.compose.foundation.shape.RoundedCornerShape
1213
import androidx.compose.material.icons.Icons
@@ -20,11 +21,13 @@ import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
2021
import androidx.compose.material3.FilledIconButton
2122
import androidx.compose.material3.Icon
2223
import androidx.compose.material3.IconButton
24+
import androidx.compose.material3.MaterialShapes
2325
import androidx.compose.material3.MaterialTheme
2426
import androidx.compose.material3.OutlinedTextField
2527
import androidx.compose.material3.SecondaryScrollableTabRow
2628
import androidx.compose.material3.Tab
2729
import androidx.compose.material3.Text
30+
import androidx.compose.material3.toShape
2831
import androidx.compose.runtime.Composable
2932
import androidx.compose.runtime.getValue
3033
import androidx.compose.runtime.mutableStateOf
@@ -165,6 +168,7 @@ private fun FilterChipTab(
165168
}
166169
}
167170

171+
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
168172
@Composable
169173
private fun SortMenu(
170174
currentSort: RepoSortType,
@@ -175,7 +179,8 @@ private fun SortMenu(
175179
Box {
176180
FilledIconButton(
177181
onClick = { expanded = true },
178-
modifier = Modifier.size(40.dp)
182+
modifier = Modifier.size(40.dp),
183+
shape = MaterialShapes.Cookie9Sided.toShape()
179184
) {
180185
Icon(
181186
imageVector = Icons.AutoMirrored.Filled.Sort,
@@ -186,12 +191,14 @@ private fun SortMenu(
186191

187192
DropdownMenu(
188193
expanded = expanded,
189-
onDismissRequest = { expanded = false }
194+
onDismissRequest = { expanded = false },
195+
shape = RoundedCornerShape(32.dp)
190196
) {
191197
RepoSortType.entries.forEach { sort ->
192198
DropdownMenuItem(
193199
text = {
194200
Row(
201+
modifier = Modifier.padding(4.dp),
195202
horizontalArrangement = Arrangement.spacedBy(8.dp),
196203
verticalAlignment = Alignment.CenterVertically
197204
) {

feature/dev-profile/presentation/src/commonMain/kotlin/zed/rainxch/devprofile/presentation/components/ProfileInfoCard.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ fun ProfileInfoCard(
4141
profile: DeveloperProfile,
4242
onAction: (DeveloperProfileAction) -> Unit
4343
) {
44-
Card(
45-
modifier = Modifier.fillMaxWidth()
46-
) {
44+
ExpressiveCard {
4745
Column(
4846
modifier = Modifier
4947
.fillMaxWidth()

feature/dev-profile/presentation/src/commonMain/kotlin/zed/rainxch/devprofile/presentation/components/StatsRow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private fun StatCard(
5252
value: String,
5353
modifier: Modifier = Modifier
5454
) {
55-
Card(modifier = modifier) {
55+
ExpressiveCard(modifier = modifier) {
5656
Column(
5757
modifier = Modifier
5858
.fillMaxWidth()

0 commit comments

Comments
 (0)