mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 07:29:14 +01:00
keep the artist targets narrow and clear of the controls
Both targets were too greedy. They now hug the text instead of spanning the row, so a tap beside the line does nothing, and the album detail target stops short of the controls instead of reaching down to them. Album detail: the line plus its 4dp lead-in and 8dp below (32dp), with the original spacing kept, so the layout is exactly where it was. Now playing keeps the title+artist block (58dp) but is no longer full width. Both are shorter than the 48dp recommendation on purpose, to stay clear of the slider and the play/shuffle buttons. Tests assert the measured geometry: no full-width target, a 12dp gap above the controls, and the now playing block staying at its own 58dp.
This commit is contained in:
@@ -246,14 +246,13 @@ fun HeroHeader(
|
||||
)
|
||||
val subtitleIsTarget = onSubtitleClick != null && subtitle.isNotEmpty() && comment.isNullOrBlank()
|
||||
if (subtitleIsTarget) {
|
||||
// The target spans the 4dp lead-in and the 20dp gap that would sit below the
|
||||
// line, so the text stays put and the row clears 48dp; without those the
|
||||
// subtitle alone is a single 20dp line.
|
||||
// The line plus the 4dp lead-in above and 8dp below: shorter than the 48dp
|
||||
// recommendation, deliberately, so it stays 12dp clear of the controls rather
|
||||
// than reaching down to them. Hugs the text instead of the row.
|
||||
Box(
|
||||
modifier =
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.heightIn(min = 48.dp)
|
||||
.heightIn(min = 32.dp)
|
||||
.clickable(onClickLabel = "Open artist") { onSubtitleClick?.invoke() },
|
||||
contentAlignment = Alignment.TopCenter,
|
||||
) {
|
||||
@@ -267,7 +266,7 @@ fun HeroHeader(
|
||||
Spacer(Modifier.height(4.dp))
|
||||
HeroSubtitle(comment)
|
||||
}
|
||||
if (!subtitleIsTarget) Spacer(Modifier.height(20.dp))
|
||||
if (!subtitleIsTarget) Spacer(Modifier.height(20.dp)) else Spacer(Modifier.height(12.dp))
|
||||
Row(
|
||||
modifier = controlsModifier.fillMaxWidth(),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
|
||||
@@ -293,7 +293,6 @@ fun NowPlayingScreen(
|
||||
verticalArrangement = Arrangement.spacedBy(6.dp),
|
||||
modifier =
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(top = 12.dp)
|
||||
.height(titleHeight + 6.dp + subtitleHeight)
|
||||
.clickable(
|
||||
|
||||
Reference in New Issue
Block a user