mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-18 16:01:44 +00:00
Refactor save button to use Surface and Row
This commit is contained in:
parent
9affc87efd
commit
83b5a6c94c
1 changed files with 39 additions and 24 deletions
|
|
@ -17,9 +17,9 @@ import androidx.compose.material3.Button
|
||||||
import androidx.compose.material3.ButtonDefaults
|
import androidx.compose.material3.ButtonDefaults
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.OutlinedButton
|
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
|
@ -40,6 +40,7 @@ fun DetailActionButtons(
|
||||||
onPlayClick: () -> Unit = {},
|
onPlayClick: () -> Unit = {},
|
||||||
onPlayLongClick: (() -> Unit)? = null,
|
onPlayLongClick: (() -> Unit)? = null,
|
||||||
onSaveClick: () -> Unit = {},
|
onSaveClick: () -> Unit = {},
|
||||||
|
onSaveLongClick: (() -> Unit)? = null,
|
||||||
) {
|
) {
|
||||||
val playPainter = appIconPainter(AppIconResource.PlayerPlay)
|
val playPainter = appIconPainter(AppIconResource.PlayerPlay)
|
||||||
val libraryAddPainter = appIconPainter(AppIconResource.LibraryAddPlus)
|
val libraryAddPainter = appIconPainter(AppIconResource.LibraryAddPlus)
|
||||||
|
|
@ -92,11 +93,24 @@ fun DetailActionButtons(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OutlinedButton(
|
Surface(
|
||||||
onClick = onSaveClick,
|
|
||||||
modifier = rowButtonModifier.height(50.dp),
|
modifier = rowButtonModifier.height(50.dp),
|
||||||
shape = RoundedCornerShape(40.dp),
|
shape = RoundedCornerShape(40.dp),
|
||||||
|
color = Color.Transparent,
|
||||||
|
contentColor = MaterialTheme.colorScheme.onSurface,
|
||||||
border = BorderStroke(1.dp, MaterialTheme.colorScheme.outline),
|
border = BorderStroke(1.dp, MaterialTheme.colorScheme.outline),
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.combinedClickable(
|
||||||
|
onClick = onSaveClick,
|
||||||
|
onLongClick = onSaveLongClick,
|
||||||
|
role = Role.Button,
|
||||||
|
)
|
||||||
|
.height(50.dp),
|
||||||
|
horizontalArrangement = Arrangement.Center,
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
if (isSaved) {
|
if (isSaved) {
|
||||||
Icon(
|
Icon(
|
||||||
|
|
@ -124,3 +138,4 @@ fun DetailActionButtons(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue