mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-24 03:36:51 +00:00
refactor: remove action parameters from TvLibraryPosterSection and TvSectionHeader for cleaner UI
This commit is contained in:
@@ -122,7 +122,6 @@ fun TvHomeContent(
|
|||||||
TvLibraryPosterSection(
|
TvLibraryPosterSection(
|
||||||
title = item.name,
|
title = item.name,
|
||||||
items = libraryContent[item.id] ?: emptyList(),
|
items = libraryContent[item.id] ?: emptyList(),
|
||||||
action = "See All",
|
|
||||||
onFocusedItem = onMediaFocused,
|
onFocusedItem = onMediaFocused,
|
||||||
onMovieSelected = onMovieSelected,
|
onMovieSelected = onMovieSelected,
|
||||||
onSeriesSelected = onSeriesSelected,
|
onSeriesSelected = onSeriesSelected,
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ import org.jellyfin.sdk.model.api.BaseItemKind
|
|||||||
import org.jellyfin.sdk.model.api.ImageType
|
import org.jellyfin.sdk.model.api.ImageType
|
||||||
|
|
||||||
private val TvHomeSectionsThumbShape = RoundedCornerShape(20.dp)
|
private val TvHomeSectionsThumbShape = RoundedCornerShape(20.dp)
|
||||||
private val TvHomeSectionsPillShape = RoundedCornerShape(18.dp)
|
|
||||||
private val TvHomeSectionsHorizontalPadding = 32.dp
|
private val TvHomeSectionsHorizontalPadding = 32.dp
|
||||||
private val TvHomeSectionsRowSpacing = 18.dp
|
private val TvHomeSectionsRowSpacing = 18.dp
|
||||||
private val TvHomeLandscapeCardWidth = 248.dp
|
private val TvHomeLandscapeCardWidth = 248.dp
|
||||||
@@ -72,7 +71,6 @@ fun TvContinueWatchingSection(
|
|||||||
if (items.isEmpty()) return
|
if (items.isEmpty()) return
|
||||||
TvSectionHeader(
|
TvSectionHeader(
|
||||||
title = "Continue Watching",
|
title = "Continue Watching",
|
||||||
action = null
|
|
||||||
)
|
)
|
||||||
LazyRow(
|
LazyRow(
|
||||||
modifier = modifier.fillMaxWidth(),
|
modifier = modifier.fillMaxWidth(),
|
||||||
@@ -142,7 +140,6 @@ fun TvNextUpSection(
|
|||||||
if (items.isEmpty()) return
|
if (items.isEmpty()) return
|
||||||
TvSectionHeader(
|
TvSectionHeader(
|
||||||
title = "Next Up",
|
title = "Next Up",
|
||||||
action = null
|
|
||||||
)
|
)
|
||||||
LazyRow(
|
LazyRow(
|
||||||
modifier = modifier.fillMaxWidth(),
|
modifier = modifier.fillMaxWidth(),
|
||||||
@@ -183,7 +180,6 @@ fun TvNextUpSection(
|
|||||||
fun TvLibraryPosterSection(
|
fun TvLibraryPosterSection(
|
||||||
title: String,
|
title: String,
|
||||||
items: List<PosterItem>,
|
items: List<PosterItem>,
|
||||||
action: String?,
|
|
||||||
onFocusedItem: (FocusableItem) -> Unit = {},
|
onFocusedItem: (FocusableItem) -> Unit = {},
|
||||||
firstItemFocusRequester: FocusRequester? = null,
|
firstItemFocusRequester: FocusRequester? = null,
|
||||||
firstItemTestTag: String? = null,
|
firstItemTestTag: String? = null,
|
||||||
@@ -194,7 +190,6 @@ fun TvLibraryPosterSection(
|
|||||||
) {
|
) {
|
||||||
TvSectionHeader(
|
TvSectionHeader(
|
||||||
title = title,
|
title = title,
|
||||||
action = action
|
|
||||||
)
|
)
|
||||||
LazyRow(
|
LazyRow(
|
||||||
modifier = modifier.fillMaxWidth(),
|
modifier = modifier.fillMaxWidth(),
|
||||||
@@ -235,9 +230,7 @@ fun TvLibraryPosterSection(
|
|||||||
@Composable
|
@Composable
|
||||||
fun TvSectionHeader(
|
fun TvSectionHeader(
|
||||||
title: String,
|
title: String,
|
||||||
action: String?,
|
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
onActionClick: () -> Unit = {}
|
|
||||||
) {
|
) {
|
||||||
val scheme = MaterialTheme.colorScheme
|
val scheme = MaterialTheme.colorScheme
|
||||||
Row(
|
Row(
|
||||||
@@ -253,24 +246,6 @@ fun TvSectionHeader(
|
|||||||
fontSize = 22.sp,
|
fontSize = 22.sp,
|
||||||
fontWeight = FontWeight.SemiBold
|
fontWeight = FontWeight.SemiBold
|
||||||
)
|
)
|
||||||
if (action != null) {
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.clip(TvHomeSectionsPillShape)
|
|
||||||
.background(scheme.surfaceContainerHigh.copy(alpha = 0.82f))
|
|
||||||
.border(1.dp, scheme.outlineVariant.copy(alpha = 0.6f), TvHomeSectionsPillShape)
|
|
||||||
.clickable { onActionClick() }
|
|
||||||
.padding(horizontal = 12.dp, vertical = 7.dp),
|
|
||||||
contentAlignment = Alignment.Center
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = action,
|
|
||||||
color = scheme.onSurfaceVariant,
|
|
||||||
fontSize = 12.sp,
|
|
||||||
fontWeight = FontWeight.SemiBold
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user