Justify the tracker toolbar rows edge to edge (v0.3.2)

Each transport-toolbar row now distributes its elements across the full width
(Arrangement.SpaceBetween) instead of clustering at the left: dropped the
per-row horizontalScroll (which gave the row infinite width and defeated any
distribution) and the manual landscape spacer. Rows no longer scroll — elements
fill the bar edge to edge. Patch bump to 0.3.2 (versionCode 5).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Reactorcoremeltdown
2026-07-18 00:08:42 +02:00
parent 26931dd501
commit 9ab7660012
2 changed files with 14 additions and 17 deletions

View File

@@ -22,8 +22,8 @@ android {
// (android.media.midi) and AAudio low-latency audio we rely on.
minSdk = 26
targetSdk = 34
versionCode = 4
versionName = "0.3.1"
versionCode = 5
versionName = "0.3.2"
// We provide our own instrumentation runner if/when tests are added.
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

View File

@@ -4,20 +4,17 @@
package space.rcmd.android.sizzle.ui.tracker
import androidx.compose.foundation.background
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
@@ -102,37 +99,37 @@ private fun TrackerLandscape(vm: AppViewModel) {
}
}
/** The transport toolbar. Three scrolling rows in portrait; in landscape the
* length/scale and edit groups are merged into one row so it's only two rows tall,
* leaving the (short) height for the pattern grid. */
/** The transport toolbar. Three rows in portrait; in landscape the length/scale and
* edit groups are merged into one row so it's only two rows tall, leaving the (short)
* height for the pattern grid. Each row is JUSTIFIED — its elements are distributed
* edge to edge across the full width (Arrangement.SpaceBetween), so the toolbar fills
* the bar instead of clustering at the left. */
@Composable
private fun TransportToolbar(vm: AppViewModel) {
val c = LocalRetro.current
val landscape = isLandscape()
@Composable
fun scrollRow(topPad: Boolean, content: @Composable RowScope.() -> Unit) {
fun barRow(topPad: Boolean, content: @Composable RowScope.() -> Unit) {
Row(
Modifier.fillMaxWidth()
.then(if (topPad) Modifier.padding(top = 6.dp) else Modifier)
.horizontalScroll(rememberScrollState()),
horizontalArrangement = Arrangement.spacedBy(6.dp),
.then(if (topPad) Modifier.padding(top = 6.dp) else Modifier),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically,
content = content,
)
}
Column(Modifier.fillMaxWidth().background(c.surface).padding(6.dp)) {
scrollRow(topPad = false) { TransportButtons(vm) }
barRow(topPad = false) { TransportButtons(vm) }
if (landscape) {
scrollRow(topPad = true) {
barRow(topPad = true) {
PatternButtons(vm)
Spacer(Modifier.width(16.dp))
EditButtons(vm)
}
} else {
scrollRow(topPad = true) { PatternButtons(vm) }
scrollRow(topPad = true) { EditButtons(vm) }
barRow(topPad = true) { PatternButtons(vm) }
barRow(topPad = true) { EditButtons(vm) }
}
}
}