mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-23 19:26:50 +00:00
refactor: update MediaActionButton styles for improved consistency
This commit is contained in:
@@ -142,15 +142,15 @@ internal fun EpisodeDetails(
|
|||||||
)
|
)
|
||||||
VerticalDivider(
|
VerticalDivider(
|
||||||
color = MaterialTheme.colorScheme.secondary,
|
color = MaterialTheme.colorScheme.secondary,
|
||||||
thickness = 4.dp,
|
thickness = 2.dp,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.height(48.dp)
|
.height(48.dp)
|
||||||
.padding(horizontal = 16.dp, vertical = 8.dp)
|
.padding(horizontal = 16.dp, vertical = 8.dp)
|
||||||
)
|
)
|
||||||
Row() {
|
Row() {
|
||||||
MediaActionButton(
|
MediaActionButton(
|
||||||
backgroundColor = MaterialTheme.colorScheme.secondary,
|
backgroundColor = MaterialTheme.colorScheme.surface,
|
||||||
iconColor = MaterialTheme.colorScheme.onSecondary,
|
iconColor = MaterialTheme.colorScheme.onSurface,
|
||||||
icon = when (downloadState) {
|
icon = when (downloadState) {
|
||||||
is DownloadState.NotDownloaded -> Icons.Outlined.Download
|
is DownloadState.NotDownloaded -> Icons.Outlined.Download
|
||||||
is DownloadState.Downloading -> Icons.Outlined.Close
|
is DownloadState.Downloading -> Icons.Outlined.Close
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ internal fun MovieTopBar(
|
|||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
modifier: Modifier = Modifier
|
modifier: Modifier = Modifier
|
||||||
) {
|
) {
|
||||||
val scheme = MaterialTheme.colorScheme
|
|
||||||
Row(
|
Row(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
@@ -107,8 +106,8 @@ internal fun MovieDetails(
|
|||||||
)
|
)
|
||||||
Row() {
|
Row() {
|
||||||
MediaActionButton(
|
MediaActionButton(
|
||||||
backgroundColor = MaterialTheme.colorScheme.secondary,
|
backgroundColor = MaterialTheme.colorScheme.surface,
|
||||||
iconColor = MaterialTheme.colorScheme.onSecondary,
|
iconColor = MaterialTheme.colorScheme.onSurface,
|
||||||
icon = when (downloadState) {
|
icon = when (downloadState) {
|
||||||
is DownloadState.NotDownloaded -> Icons.Outlined.Download
|
is DownloadState.NotDownloaded -> Icons.Outlined.Download
|
||||||
is DownloadState.Downloading -> Icons.Outlined.Close
|
is DownloadState.Downloading -> Icons.Outlined.Close
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ private fun SeriesScreenInternal(
|
|||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
val scheme = MaterialTheme.colorScheme
|
val scheme = MaterialTheme.colorScheme
|
||||||
val textMutedStrong = scheme.onSurfaceVariant.copy(alpha = 0.7f)
|
|
||||||
|
|
||||||
fun getDefaultSeason() : Season {
|
fun getDefaultSeason() : Season {
|
||||||
for (season in series.seasons) {
|
for (season in series.seasons) {
|
||||||
@@ -162,7 +161,7 @@ private fun SeriesScreenInternal(
|
|||||||
Spacer(modifier = Modifier.height(24.dp))
|
Spacer(modifier = Modifier.height(24.dp))
|
||||||
MediaSynopsis(
|
MediaSynopsis(
|
||||||
synopsis = series.synopsis,
|
synopsis = series.synopsis,
|
||||||
bodyColor = textMutedStrong,
|
bodyColor = scheme.onSurface,
|
||||||
bodyFontSize = 13.sp,
|
bodyFontSize = 13.sp,
|
||||||
bodyLineHeight = null,
|
bodyLineHeight = null,
|
||||||
titleSpacing = 8.dp
|
titleSpacing = 8.dp
|
||||||
|
|||||||
@@ -151,15 +151,15 @@ internal fun SeriesActionButtons(
|
|||||||
Spacer(modifier = Modifier.width(12.dp))
|
Spacer(modifier = Modifier.width(12.dp))
|
||||||
}
|
}
|
||||||
MediaActionButton(
|
MediaActionButton(
|
||||||
backgroundColor = MaterialTheme.colorScheme.secondary,
|
backgroundColor = MaterialTheme.colorScheme.surface,
|
||||||
iconColor = MaterialTheme.colorScheme.onSecondary,
|
iconColor = MaterialTheme.colorScheme.onSurface,
|
||||||
icon = Icons.Outlined.Add,
|
icon = Icons.Outlined.Add,
|
||||||
height = 48.dp
|
height = 48.dp
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.width(12.dp))
|
Spacer(modifier = Modifier.width(12.dp))
|
||||||
MediaActionButton(
|
MediaActionButton(
|
||||||
backgroundColor = scheme.secondary,
|
backgroundColor = MaterialTheme.colorScheme.surface,
|
||||||
iconColor = scheme.onSecondary,
|
iconColor = MaterialTheme.colorScheme.onSurface,
|
||||||
icon = when {
|
icon = when {
|
||||||
seriesDownloadState is DownloadState.Downloading -> Icons.Outlined.Close
|
seriesDownloadState is DownloadState.Downloading -> Icons.Outlined.Close
|
||||||
seriesDownloadState is DownloadState.Downloaded -> Icons.Outlined.DownloadDone
|
seriesDownloadState is DownloadState.Downloaded -> Icons.Outlined.DownloadDone
|
||||||
|
|||||||
@@ -2,21 +2,18 @@ package hu.bbara.purefin.ui.common.button
|
|||||||
|
|
||||||
import androidx.compose.animation.animateColorAsState
|
import androidx.compose.animation.animateColorAsState
|
||||||
import androidx.compose.animation.core.animateFloatAsState
|
import androidx.compose.animation.core.animateFloatAsState
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.clickable
|
|
||||||
import androidx.compose.foundation.layout.Box
|
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
|
import androidx.compose.material3.FilledIconButton
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.IconButtonDefaults
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
|
||||||
import androidx.compose.ui.focus.onFocusChanged
|
import androidx.compose.ui.focus.onFocusChanged
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.graphicsLayer
|
import androidx.compose.ui.graphics.graphicsLayer
|
||||||
@@ -51,7 +48,13 @@ internal fun CircularIconButton(
|
|||||||
label = "background"
|
label = "background"
|
||||||
)
|
)
|
||||||
|
|
||||||
Box(
|
FilledIconButton(
|
||||||
|
onClick = onClick,
|
||||||
|
colors = IconButtonDefaults.filledIconButtonColors(
|
||||||
|
containerColor = backgroundColor,
|
||||||
|
contentColor = iconColor
|
||||||
|
),
|
||||||
|
shape = CircleShape,
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.graphicsLayer { scaleX = scale; scaleY = scale }
|
.graphicsLayer { scaleX = scale; scaleY = scale }
|
||||||
.size(size)
|
.size(size)
|
||||||
@@ -60,16 +63,11 @@ internal fun CircularIconButton(
|
|||||||
color = borderColor,
|
color = borderColor,
|
||||||
shape = CircleShape
|
shape = CircleShape
|
||||||
)
|
)
|
||||||
.clip(CircleShape)
|
|
||||||
.background(backgroundColor)
|
|
||||||
.onFocusChanged { isFocused = it.isFocused || it.hasFocus }
|
.onFocusChanged { isFocused = it.isFocused || it.hasFocus }
|
||||||
.clickable { onClick() },
|
|
||||||
contentAlignment = Alignment.Center
|
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = icon,
|
imageVector = icon,
|
||||||
contentDescription = contentDescription,
|
contentDescription = contentDescription
|
||||||
tint = iconColor
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ fun MediaActionButton(
|
|||||||
CircularIconButton(
|
CircularIconButton(
|
||||||
icon = icon,
|
icon = icon,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
containerColor = backgroundColor.copy(alpha = 0.6f),
|
containerColor = backgroundColor,
|
||||||
focusedBackgroundColor = focusedBackgroundColor ?: backgroundColor.copy(alpha = 0.6f),
|
focusedBackgroundColor = focusedBackgroundColor ?: backgroundColor,
|
||||||
iconColor = iconColor,
|
iconColor = iconColor,
|
||||||
size = height,
|
size = height,
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
|
|||||||
Reference in New Issue
Block a user