Fix McButton parameter order for Compose trailing lambdas.
This commit is contained in:
parent
921fe57bd8
commit
09be3be3a5
2 changed files with 9 additions and 9 deletions
|
|
@ -418,11 +418,11 @@ private fun HeroHeader(
|
||||||
}
|
}
|
||||||
Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) {
|
Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) {
|
||||||
if (hero != null) {
|
if (hero != null) {
|
||||||
McButton(if ((hero.positionMs) > 30_000) "Verder kijken" else "Afspelen", onPlayHero, primary = true)
|
McButton(if ((hero.positionMs) > 30_000) "Verder kijken" else "Afspelen", primary = true, onClick = onPlayHero)
|
||||||
McButton("Details", onOpenHero)
|
McButton("Details", onClick = onOpenHero)
|
||||||
}
|
}
|
||||||
McButton("Planken", onSettings)
|
McButton("Planken", onClick = onSettings)
|
||||||
McButton("Uitloggen", onLogout)
|
McButton("Uitloggen", onClick = onLogout)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -497,7 +497,7 @@ private fun MovieDetailScreen(
|
||||||
.padding(40.dp),
|
.padding(40.dp),
|
||||||
verticalArrangement = Arrangement.spacedBy(14.dp),
|
verticalArrangement = Arrangement.spacedBy(14.dp),
|
||||||
) {
|
) {
|
||||||
McButton("Terug", onBack)
|
McButton("Terug", onClick = onBack)
|
||||||
Spacer(Modifier.height(8.dp))
|
Spacer(Modifier.height(8.dp))
|
||||||
Text(title, color = McColors.Text, fontSize = 36.sp, fontWeight = FontWeight.Bold, maxLines = 3)
|
Text(title, color = McColors.Text, fontSize = 36.sp, fontWeight = FontWeight.Bold, maxLines = 3)
|
||||||
if (year != null) Text(year.toString(), color = McColors.TextDim, fontSize = 16.sp)
|
if (year != null) Text(year.toString(), color = McColors.TextDim, fontSize = 16.sp)
|
||||||
|
|
@ -506,7 +506,7 @@ private fun MovieDetailScreen(
|
||||||
Spacer(Modifier.height(8.dp))
|
Spacer(Modifier.height(8.dp))
|
||||||
Row(horizontalArrangement = Arrangement.spacedBy(10.dp)) {
|
Row(horizontalArrangement = Arrangement.spacedBy(10.dp)) {
|
||||||
files.firstOrNull()?.let { (id, _) ->
|
files.firstOrNull()?.let { (id, _) ->
|
||||||
McButton("Afspelen", { onPlay(id, title, 0) }, primary = true)
|
McButton("Afspelen", primary = true) { onPlay(id, title, 0) }
|
||||||
}
|
}
|
||||||
McButton("Als gekeken") {
|
McButton("Als gekeken") {
|
||||||
scope.launch {
|
scope.launch {
|
||||||
|
|
@ -576,7 +576,7 @@ private fun SeriesDetailScreen(
|
||||||
verticalArrangement = Arrangement.spacedBy(10.dp),
|
verticalArrangement = Arrangement.spacedBy(10.dp),
|
||||||
) {
|
) {
|
||||||
item {
|
item {
|
||||||
McButton("Terug", onBack)
|
McButton("Terug", onClick = onBack)
|
||||||
Spacer(Modifier.height(12.dp))
|
Spacer(Modifier.height(12.dp))
|
||||||
Text(title, color = McColors.Text, fontSize = 34.sp, fontWeight = FontWeight.Bold)
|
Text(title, color = McColors.Text, fontSize = 34.sp, fontWeight = FontWeight.Bold)
|
||||||
Spacer(Modifier.height(6.dp))
|
Spacer(Modifier.height(6.dp))
|
||||||
|
|
@ -623,7 +623,7 @@ private fun SettingsScreen(api: ApiClient, onBack: () -> Unit) {
|
||||||
verticalArrangement = Arrangement.spacedBy(12.dp),
|
verticalArrangement = Arrangement.spacedBy(12.dp),
|
||||||
) {
|
) {
|
||||||
item {
|
item {
|
||||||
McButton("Terug", onBack)
|
McButton("Terug", onClick = onBack)
|
||||||
Spacer(Modifier.height(12.dp))
|
Spacer(Modifier.height(12.dp))
|
||||||
Text("Planken", color = McColors.Text, fontSize = 30.sp, fontWeight = FontWeight.Bold)
|
Text("Planken", color = McColors.Text, fontSize = 30.sp, fontWeight = FontWeight.Bold)
|
||||||
Text("Kies wat je op home ziet en in welke volgorde.", color = McColors.TextDim, fontSize = 15.sp)
|
Text("Kies wat je op home ziet en in welke volgorde.", color = McColors.TextDim, fontSize = 15.sp)
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,9 @@ import nl.vonas.mediacluster.tv.ui.theme.McColors
|
||||||
@Composable
|
@Composable
|
||||||
fun McButton(
|
fun McButton(
|
||||||
label: String,
|
label: String,
|
||||||
onClick: () -> Unit,
|
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
primary: Boolean = false,
|
primary: Boolean = false,
|
||||||
|
onClick: () -> Unit,
|
||||||
) {
|
) {
|
||||||
Surface(
|
Surface(
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue