Skip to content

Commit 6cb440f

Browse files
Refine sidebar and rating screen layout
- Increase sidebar icon spacing and simplify tab badges - Restyle rating screen with tighter card, dial, and button styling
1 parent e15d2c6 commit 6cb440f

2 files changed

Lines changed: 65 additions & 75 deletions

File tree

app/src/main/java/com/spotifyhub/ui/main/MainScreen.kt

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ private fun SidebarRail(
342342
/* Center: tab icons */
343343
Column(
344344
horizontalAlignment = Alignment.CenterHorizontally,
345-
verticalArrangement = Arrangement.spacedBy(4.dp),
345+
verticalArrangement = Arrangement.spacedBy(12.dp),
346346
) {
347347
TabIcon(
348348
icon = if (selectedTab == MainTab.Home) AppIcons.homeSelected else AppIcons.home,
@@ -398,28 +398,19 @@ private fun TabIcon(
398398
else -> Color.White.copy(alpha = 0.45f)
399399
}
400400

401-
Column(
401+
Box(
402402
modifier = Modifier
403403
.clip(SquircleShape(12.dp))
404404
.clickable(onClick = onClick)
405-
.padding(horizontal = 4.dp, vertical = 6.dp),
406-
horizontalAlignment = Alignment.CenterHorizontally,
407-
verticalArrangement = Arrangement.spacedBy(2.dp),
405+
.padding(horizontal = 10.dp, vertical = 10.dp),
406+
contentAlignment = Alignment.Center,
408407
) {
409408
Icon(
410409
imageVector = icon,
411410
contentDescription = label,
412-
modifier = Modifier.size(22.dp),
411+
modifier = Modifier.size(26.dp),
413412
tint = tint,
414413
)
415-
Text(
416-
text = label,
417-
color = tint,
418-
style = MaterialTheme.typography.labelSmall.copy(
419-
fontSize = 8.sp,
420-
fontWeight = if (isSelected) FontWeight.Bold else FontWeight.Medium,
421-
),
422-
)
423414
}
424415
}
425416

app/src/main/java/com/spotifyhub/ui/rating/RatingScreen.kt

Lines changed: 60 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
2020
import androidx.compose.foundation.layout.height
2121
import androidx.compose.foundation.layout.padding
2222
import androidx.compose.foundation.layout.size
23+
import androidx.compose.foundation.layout.width
2324
import androidx.compose.foundation.shape.CircleShape
2425
import sv.lib.squircleshape.SquircleShape
2526
import androidx.compose.material.icons.Icons
@@ -66,14 +67,15 @@ import kotlin.math.sin
6667

6768
/* ── Design tokens ───────────────────────────────────────────────── */
6869

69-
private val ArtworkShape = SquircleShape(18.dp)
70-
private val CardSurface = Color(0x2415181D)
71-
private val CardBorder = Color.White.copy(alpha = 0.08f)
72-
private val SurfaceShadow = Color.Black.copy(alpha = 0.20f)
70+
private val ArtworkShape = SquircleShape(12.dp)
71+
private val CardShape = SquircleShape(16.dp)
7372
private val SpotifyGreen = Color(0xFF1ED760)
7473
private val LockedGold = Color(0xFFD4A843)
74+
private val BrowseBackground = Color(0xFF171A1F)
7575

76-
private val TrackColorInactive = Color.White.copy(alpha = 0.10f)
76+
private val CardBackground = Color.White.copy(alpha = 0.06f)
77+
private val CardBorder = Color.White.copy(alpha = 0.08f)
78+
private val TrackColorInactive = Color.White.copy(alpha = 0.08f)
7779

7880
/* ── Public entry-point ──────────────────────────────────────────── */
7981

@@ -86,15 +88,7 @@ fun RatingScreen(
8688
Box(
8789
modifier = Modifier
8890
.fillMaxSize()
89-
.background(
90-
Brush.linearGradient(
91-
colors = listOf(
92-
Color(0xFF132433),
93-
Color(0xFF161A22),
94-
Color(0xFF101318),
95-
),
96-
),
97-
),
91+
.background(BrowseBackground),
9892
contentAlignment = Alignment.Center,
9993
) {
10094
if (uiState.currentItem == null) {
@@ -168,80 +162,85 @@ private fun RatingContent(
168162
Row(
169163
modifier = Modifier
170164
.fillMaxSize()
171-
.padding(horizontal = 24.dp, vertical = 12.dp),
172-
horizontalArrangement = Arrangement.spacedBy(24.dp),
165+
.padding(horizontal = 20.dp, vertical = 16.dp),
166+
horizontalArrangement = Arrangement.spacedBy(16.dp),
173167
verticalAlignment = Alignment.CenterVertically,
174168
) {
175-
/* Left column: album art + metadata + submit button */
169+
/* Left column: album info card */
176170
Column(
177171
modifier = Modifier
178172
.weight(1f)
179173
.fillMaxHeight(),
180174
verticalArrangement = Arrangement.Center,
181175
horizontalAlignment = Alignment.CenterHorizontally,
182176
) {
177+
/* Album info card */
183178
Row(
184-
modifier = Modifier.fillMaxWidth(),
185-
horizontalArrangement = Arrangement.spacedBy(14.dp),
179+
modifier = Modifier
180+
.fillMaxWidth()
181+
.clip(CardShape)
182+
.background(CardBackground)
183+
.border(1.dp, CardBorder, CardShape)
184+
.padding(12.dp),
185+
horizontalArrangement = Arrangement.spacedBy(12.dp),
186186
verticalAlignment = Alignment.CenterVertically,
187187
) {
188-
/* Small album art */
188+
/* Album art */
189189
AlbumArtwork(
190190
artworkUrl = item.artworkUrl,
191191
title = item.album,
192-
modifier = Modifier.size(110.dp),
192+
modifier = Modifier.size(88.dp),
193193
)
194194

195-
/* Metadata beside art */
195+
/* Metadata */
196196
Column(
197197
modifier = Modifier.weight(1f),
198198
verticalArrangement = Arrangement.Center,
199199
) {
200200
Text(
201201
text = item.artist,
202-
color = Color.White.copy(alpha = 0.85f),
202+
color = Color.White.copy(alpha = 0.55f),
203203
maxLines = 1,
204204
overflow = TextOverflow.Ellipsis,
205-
style = MaterialTheme.typography.titleMedium.copy(
206-
fontSize = 17.sp,
205+
style = MaterialTheme.typography.bodyMedium.copy(
207206
fontWeight = FontWeight.Medium,
208207
),
209208
)
210209

211-
Spacer(modifier = Modifier.height(3.dp))
210+
Spacer(modifier = Modifier.height(2.dp))
212211

213212
Text(
214213
text = item.album,
215214
color = Color.White,
216215
maxLines = 2,
217216
overflow = TextOverflow.Ellipsis,
218-
style = MaterialTheme.typography.titleLarge.copy(
219-
fontSize = 22.sp,
217+
style = MaterialTheme.typography.titleMedium.copy(
218+
fontSize = 18.sp,
220219
fontWeight = FontWeight.Bold,
221220
),
222221
)
223222

224223
item.releaseDate?.takeIf { it.isNotBlank() }?.let { date ->
225-
Spacer(modifier = Modifier.height(3.dp))
224+
Spacer(modifier = Modifier.height(4.dp))
226225
Text(
227226
text = date,
228-
color = Color.White.copy(alpha = 0.45f),
227+
color = Color.White.copy(alpha = 0.35f),
229228
style = MaterialTheme.typography.bodySmall.copy(
230229
letterSpacing = 0.5.sp,
231230
),
232231
)
233232
}
234233

235234
if (isLocked) {
236-
Spacer(modifier = Modifier.height(8.dp))
235+
Spacer(modifier = Modifier.height(6.dp))
237236
Row(
238237
verticalAlignment = Alignment.CenterVertically,
239-
horizontalArrangement = Arrangement.spacedBy(5.dp),
238+
horizontalArrangement = Arrangement.spacedBy(4.dp),
240239
) {
241240
Icon(
242241
imageVector = Icons.Rounded.Lock,
243242
contentDescription = "Already rated",
244-
modifier = Modifier.size(12.dp),
243+
modifier = Modifier.size(11.dp),
245244
tint = LockedGold,
246245
)
247246
Text(
@@ -256,7 +255,7 @@ private fun RatingContent(
256255
}
257256
}
258257

259-
Spacer(modifier = Modifier.height(18.dp))
258+
Spacer(modifier = Modifier.height(12.dp))
260259

261260
SubmitButton(
262261
submissionState = submissionState,
@@ -267,7 +266,7 @@ private fun RatingContent(
267266
)
268267
}
269268

270-
/* Right: circular drag dial — use weight so it doesn't steal all width */
269+
/* Right: circular drag dial */
271270
Box(
272271
modifier = Modifier
273272
.weight(0.7f)
@@ -300,10 +299,8 @@ private fun AlbumArtwork(
300299

301300
Box(
302301
modifier = modifier
303-
.shadow(24.dp, ArtworkShape, clip = false, ambientColor = SurfaceShadow, spotColor = SurfaceShadow)
304302
.clip(ArtworkShape)
305-
.background(Color(0x2014191F))
306-
.border(1.dp, CardBorder, ArtworkShape),
303+
.background(Color.White.copy(alpha = 0.04f)),
307304
contentAlignment = Alignment.Center,
308305
) {
309306
if (artworkUrl != null) {
@@ -341,15 +338,15 @@ private fun ArtworkPlaceholder() {
341338
) {
342339
Box(
343340
modifier = Modifier
344-
.size(52.dp)
341+
.size(36.dp)
345342
.clip(CircleShape)
346343
.background(Color.White.copy(alpha = 0.10f)),
347344
contentAlignment = Alignment.Center,
348345
) {
349346
Text(
350347
text = "S",
351348
color = Color.White.copy(alpha = 0.6f),
352-
style = MaterialTheme.typography.headlineSmall.copy(fontWeight = FontWeight.Black),
349+
style = MaterialTheme.typography.titleLarge.copy(fontWeight = FontWeight.Black),
353350
)
354351
}
355352
}
@@ -431,8 +428,8 @@ private fun RatingDial(
431428
contentAlignment = Alignment.Center,
432429
) {
433430
Canvas(modifier = Modifier.fillMaxSize()) {
434-
val strokeWidth = size.minDimension * 0.09f
435-
val pad = strokeWidth / 2f + 4f
431+
val strokeWidth = size.minDimension * 0.07f
432+
val pad = strokeWidth / 2f + 6f
436433
val arcSize = Size(size.width - pad * 2, size.height - pad * 2)
437434
val topLeft = Offset(pad, pad)
438435

@@ -473,14 +470,16 @@ private fun RatingDial(
473470
center.x + radius * cos(thumbAngleRad).toFloat(),
474471
center.y + radius * sin(thumbAngleRad).toFloat(),
475472
)
473+
// Outer white ring
476474
drawCircle(
477475
color = Color.White,
478-
radius = strokeWidth * 0.72f,
476+
radius = strokeWidth * 0.85f,
479477
center = thumbPos,
480478
)
479+
// Inner active color fill
481480
drawCircle(
482481
color = activeColor,
483-
radius = strokeWidth * 0.46f,
482+
radius = strokeWidth * 0.52f,
484483
center = thumbPos,
485484
)
486485
}
@@ -498,7 +497,7 @@ private fun RatingDial(
498497
text = String.format("%.1f", value),
499498
color = if (isLocked) LockedGold else Color.White,
500499
style = MaterialTheme.typography.displaySmall.copy(
501-
fontSize = 38.sp,
500+
fontSize = 36.sp,
502501
fontWeight = FontWeight.Bold,
503502
),
504503
)
@@ -528,30 +527,30 @@ private fun SubmitButton(
528527
val enabled = !isLocked && !isLookingUp && submissionState == SubmissionState.Idle
529528

530529
val backgroundColor = when {
531-
isLocked -> CardSurface
532-
submissionState == SubmissionState.Success -> SpotifyGreen.copy(alpha = 0.25f)
533-
submissionState == SubmissionState.Error -> Color(0x40FF4444)
534-
else -> SpotifyGreen.copy(alpha = 0.18f)
535-
}
536-
val borderColor = when {
537-
isLocked -> LockedGold.copy(alpha = 0.3f)
538-
submissionState == SubmissionState.Success -> SpotifyGreen.copy(alpha = 0.5f)
539-
submissionState == SubmissionState.Error -> Color(0xFFFF4444).copy(alpha = 0.4f)
540-
else -> SpotifyGreen.copy(alpha = 0.35f)
530+
isLocked -> CardBackground
531+
submissionState == SubmissionState.Success -> SpotifyGreen.copy(alpha = 0.15f)
532+
submissionState == SubmissionState.Error -> Color(0xFFFF4444).copy(alpha = 0.12f)
533+
enabled -> SpotifyGreen
534+
else -> SpotifyGreen.copy(alpha = 0.12f)
541535
}
542536
val textColor = when {
543537
isLocked -> LockedGold.copy(alpha = 0.6f)
544-
!enabled -> Color.White.copy(alpha = 0.4f)
545-
else -> Color.White
538+
submissionState == SubmissionState.Success -> SpotifyGreen
539+
submissionState == SubmissionState.Error -> Color(0xFFFF8B8B)
540+
enabled -> Color.Black
541+
else -> Color.White.copy(alpha = 0.4f)
546542
}
547543

548544
Box(
549545
modifier = Modifier
550-
.fillMaxWidth(0.7f)
546+
.fillMaxWidth()
551547
.height(44.dp)
552-
.clip(SquircleShape(14.dp))
548+
.clip(SquircleShape(22.dp))
553549
.background(backgroundColor)
554-
.border(1.dp, borderColor, SquircleShape(14.dp))
550+
.then(
551+
if (isLocked) Modifier.border(1.dp, LockedGold.copy(alpha = 0.2f), SquircleShape(22.dp))
552+
else Modifier,
553+
)
555554
.then(
556555
if (enabled) Modifier.clickable(onClick = onSubmit)
557556
else Modifier,
@@ -569,7 +568,7 @@ private fun SubmitButton(
569568
color = textColor,
570569
style = MaterialTheme.typography.labelLarge.copy(
571570
fontWeight = FontWeight.SemiBold,
572-
letterSpacing = 0.8.sp,
571+
letterSpacing = 0.5.sp,
573572
),
574573
)
575574
}

0 commit comments

Comments
 (0)