Library cards: store banner above the art, title and size below it

In All, Favorites and Hidden, the store chip that sat over the top-left of the
art becomes a full-width band in the store's colours above it. The eye menu gets
a "Show store" switch for it there (on by default).

When Show title or Show size is on, the title and size now sit in a caption
under the art instead of over its bottom edge, so covers stay clean. A focused
card still shows whichever of the two is off over the art, so tiles never change
height on focus. Store browse cards share ArtCard and get the same caption.
The card-to-detail transition now starts from the art's bounds, not the tile's.
This commit is contained in:
Kurt Himebauch committed 2026-12-04 11:08:06 -05:00
1 parent 26b11c6838
commit 5a35700ebb
40 files changed
+184 -59

No files matched your search

@@ -15,6 +15,7 @@ import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import com.droiddeck.launcher.R
import com.droiddeck.launcher.input.SecondScreenMode
import com.droiddeck.launcher.session.SessionPrefs
/** The launcher as a whole: rail and page, opened on each tab through FrontEndState.navigate. */
@Composable
@@ -25,6 +26,23 @@ private fun Launcher(tab: String, games: List<com.droiddeck.launcher.frontend.Li
@DroidDeckPreviews @Composable private fun SteamEmptyPreview() = Launcher("steam", games = emptyList())
@DroidDeckPreviews @Composable private fun LibraryPreview() = Launcher("games")
@DroidDeckPreviews @Composable private fun LibraryEmptyPreview() = Launcher("games", games = emptyList())
/** The Library in [view] with its display options set as given, the way the eye menu saves them. */
@Composable
private fun LibraryShown(view: String, title: Boolean, size: Boolean, store: Boolean = true) {
val ctx = androidx.compose.ui.platform.LocalContext.current
androidx.compose.runtime.remember {
SessionPrefs.setLibraryShowTitle(ctx, title)
SessionPrefs.setLibraryShowSize(ctx, size)
SessionPrefs.setLibraryShowStore(ctx, store)
}
PreviewHost { FrontEndScreen(sampleState(navigate = "games", storesView = view), sampleActions) }
}
@DroidDeckPreviews @Composable private fun LibraryCapsulesPreview() = LibraryShown("capsules", title = true, size = true)
@DroidDeckPreviews @Composable private fun LibraryCardsTitlePreview() = LibraryShown("cards", title = true, size = false)
@DroidDeckPreviews @Composable private fun LibraryCapsulesNoStorePreview() = LibraryShown("capsules", title = false, size = false, store = false)
@DroidDeckPreviews @Composable private fun StoresPreview() = Launcher("stores")
@DroidDeckPreviews @Composable private fun DownloadsPreview() = Launcher("downloads")
@DroidDeckPreviews @Composable private fun SettingsPreview() = Launcher("setup")
@@ -115,6 +133,11 @@ private val storesLoaded = { com.droiddeck.launcher.stores.StoresState.accountsL
internal val previewCases: List<PreviewCase> = listOf(
PreviewCase("steam-tab") { Launcher("steam") },
PreviewCase("library", storesLoaded) { Launcher("games") },
PreviewCase("library-capsules-title-size", storesLoaded) { LibraryShown("capsules", title = true, size = true) },
PreviewCase("library-cards-title", storesLoaded) { LibraryShown("cards", title = true, size = false) },
PreviewCase("library-cards-size", storesLoaded) { LibraryShown("cards", title = false, size = true) },
PreviewCase("library-capsules-bare", storesLoaded) { LibraryShown("capsules", title = false, size = false, store = false) },
PreviewCase("library-capsules-store-title-off", storesLoaded) { LibraryShown("capsules", title = true, size = false, store = false) },
PreviewCase("library-empty", storesLoaded) { Launcher("games", games = emptyList()) },
PreviewCase("stores", storesLoaded) { Launcher("stores") },
PreviewCase("downloads") { Launcher("downloads") },
@@ -50,10 +50,11 @@ internal fun sampleState(
games: List<Library.SteamGame> = sampleGames,
navigate: String? = null,
ready: Boolean = true,
storesView: String = SessionPrefs.DEFAULT_STORES_VIEW,
): FrontEndState = FrontEndState(
installed = "ubuntu-r1", ready = ready, available = "ubuntu-r1", busy = false, stage = "", percent = 0,
desktopInstalled = true, offlineAccount = null, offline = false, frameGenLabel = "Off", romsDir = null, logsEnabled = true,
steamGames = games, emulators = emptyList(), running = null, navigate = navigate,
steamGames = games, emulators = emptyList(), running = null, navigate = navigate, storesView = storesView,
)
internal val sampleActions: FrontEndActions = FrontEndActions(
@@ -376,6 +376,12 @@ object SessionPrefs {
prefs(context).edit().putBoolean("libraryShowSize", show).apply()
}
fun libraryShowStore(context: Context): Boolean = prefs(context).getBoolean("libraryShowStore", true)
fun setLibraryShowStore(context: Context, show: Boolean) {
prefs(context).edit().putBoolean("libraryShowStore", show).apply()
}
fun libraryShowHidden(context: Context): Boolean = prefs(context).getBoolean("libraryShowHidden", false)
fun setLibraryShowHidden(context: Context, show: Boolean) {
@@ -66,9 +66,11 @@ import androidx.compose.material.icons.filled.ViewModule
import androidx.compose.material.icons.filled.Visibility
import androidx.compose.material.icons.outlined.Download
import androidx.compose.material3.Icon
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.getValue
@@ -209,11 +211,14 @@ internal object LibraryDisplay {
private set
var size by mutableStateOf(false)
private set
var store by mutableStateOf(true)
private set
fun load(context: android.content.Context) {
level = SessionPrefs.libraryCardLevel(context).coerceIn(0, scales.lastIndex)
title = SessionPrefs.libraryShowTitle(context)
size = SessionPrefs.libraryShowSize(context)
store = SessionPrefs.libraryShowStore(context)
}
fun step(context: android.content.Context, by: Int) {
@@ -230,8 +235,16 @@ internal object LibraryDisplay {
size = !size
SessionPrefs.setLibraryShowSize(context, size)
}
fun toggleStore(context: android.content.Context) {
store = !store
SessionPrefs.setLibraryShowStore(context, store)
}
}
/** Views that mix stores, where each card says which store it comes from. */
private fun showsSource(source: String) = source == LIBRARY_ALL || source == LIBRARY_FAVORITES || source == LIBRARY_HIDDEN
private enum class ToggleAt { NONE, TOP, SPLIT, BOTTOM }
private const val NOT_INSTALLED_ROW = "library-not-installed"
@@ -709,7 +722,7 @@ private fun LibraryGrid(
enter.animateTo(1f, Motion.tw(320))
}
Box(Modifier.graphicsLayer { alpha = enter.value; translationY = (1f - enter.value) * 18.dp.toPx() }) {
if (listMode) LibraryRow(e, first, navigation, choose, onOpen) else LibraryTile(e, capsules, first, navigation, choose, onOpen, showSource = source == LIBRARY_ALL || source == LIBRARY_FAVORITES || source == LIBRARY_HIDDEN)
if (listMode) LibraryRow(e, first, navigation, choose, onOpen) else LibraryTile(e, capsules, first, navigation, choose, onOpen, showSource = showsSource(source))
}
}
var rowFocused by remember { mutableStateOf(false) }
@@ -897,7 +910,7 @@ private fun LibraryHeader(
}
if (soundMode) HeaderIconButton(stringResource(R.string.soundtracks_saved), Icons.Filled.BookmarkBorder, "collections", onClick = onCollections)
if (!soundMode && DeveloperTools.on && DevPreview.shortcuts) LibraryPreviewButton()
DisplayButton()
DisplayButton(storeOption = !soundMode && showsSource(source))
if (!soundMode && xbox) LibraryFilterButton(null, onShowUninstalled, xbox)
if (collections != null) CollectionsButton(collections)
SortButton(s, a)
@@ -1088,13 +1101,13 @@ private fun LibraryTile(e: LibraryEntry, capsule: Boolean, first: Boolean, navig
onOpen(e.key)
}
Column(
modifier = Modifier.fillMaxWidth().onGloballyPositioned { placed[0] = it }
modifier = Modifier.fillMaxWidth()
.then(navigation).paneItem("card:${e.key}").then(if (first) Modifier.firstTile().paneEntry() else Modifier).graphicsLayer { scaleX = scale; scaleY = scale }
.clip(RoundedCornerShape(10.dp)).glideBorder(hot, RoundedCornerShape(10.dp), pal.signal, pal.line)
.hoverable(src).clickable(role = Role.Button, interactionSource = src, indication = LocalIndication.current, onClick = open)
.controllerConfirm(onClick = choose ?: open),
) {
LibraryArt(e, wide, tall, download, hot, capsule, showSource)
LibraryArt(e, wide, tall, download, hot, capsule, showSource) { placed[0] = it }
}
}
@@ -1103,7 +1116,10 @@ internal val LibraryCardWidth = 150.dp
internal fun libraryTileWidth() = LibraryCardWidth * LibraryDisplay.scales[LibraryDisplay.level]
@Composable
private fun LibraryArt(e: LibraryEntry, wide: Any?, tall: Any?, download: DownloadEntry?, hot: Boolean, capsule: Boolean, showSource: Boolean) {
private fun LibraryArt(
e: LibraryEntry, wide: Any?, tall: Any?, download: DownloadEntry?, hot: Boolean, capsule: Boolean, showSource: Boolean,
onArtPlaced: (androidx.compose.ui.layout.LayoutCoordinates) -> Unit,
) {
val chip = when {
download != null -> "${(steadyProgress(download) * 100).toInt()}%"
e.item != null && StoresState.isUnfinished(e.item) -> stringResource(R.string.stores_resume)
@@ -1112,65 +1128,86 @@ private fun LibraryArt(e: LibraryEntry, wide: Any?, tall: Any?, download: Downlo
}
ArtCard(
e.title, wide, tall, download, hot, capsule, chip,
badge = if (showSource) ({ SourceChip(e.source, small = true, modifier = Modifier.align(Alignment.TopStart).padding(6.dp), label = favoritesBadge(e), colours = favoritesColours(e)) }) else null,
banner = if (showSource && LibraryDisplay.store) ({ SourceBanner(e.source, label = favoritesBadge(e), colours = favoritesColours(e)) }) else null,
onArtPlaced = onArtPlaced,
) { LibrarySize(e) }
}
/**
* A game's art with an optional [banner] above it. The title and [detail] the display options turn on sit in a caption
* below the art; a focused card shows the ones that are off over the bottom of the art instead, so its height never changes.
*/
@Composable
internal fun ArtCard(
title: String, wide: Any?, tall: Any?, download: DownloadEntry?, hot: Boolean, capsule: Boolean, chip: String?,
badge: (@Composable BoxScope.() -> Unit)? = null, detail: @Composable () -> Unit,
badge: (@Composable BoxScope.() -> Unit)? = null, banner: (@Composable () -> Unit)? = null,
onArtPlaced: (androidx.compose.ui.layout.LayoutCoordinates) -> Unit = {}, detail: @Composable () -> Unit,
) {
val colors = MaterialTheme.colorScheme
val url = if (capsule) tall ?: wide else wide ?: tall
val art = cardArtRequest(url, tall)
val ratio = if (capsule) 5f / 7f else 16f / 9f
var offRatio by remember(url) { mutableStateOf(false) }
var trim by remember(url) { mutableStateOf(false) }
val blurs = android.os.Build.VERSION.SDK_INT >= 31
Box(
Modifier.fillMaxWidth().aspectRatio(ratio).background(Color(0xFF101318))
.then(if (url == null) Modifier.background(artBrush(hueOf(title))) else Modifier),
) {
if (art != null && offRatio) {
AsyncImage(model = art, contentDescription = null, contentScale = ContentScale.Crop, modifier = Modifier.matchParentSize().blur(32.dp))
Spacer(Modifier.matchParentSize().background(Color.Black.copy(alpha = if (blurs) 0.18f else 0.6f)))
}
if (art != null) AsyncImage(
model = art, contentDescription = null, contentScale = if (trim) ContentScale.Crop else ContentScale.Fit, modifier = Modifier.matchParentSize(),
onSuccess = { r ->
val d = r.result.drawable
if (d.intrinsicWidth > 0 && d.intrinsicHeight > 0) {
val shape = d.intrinsicWidth.toFloat() / d.intrinsicHeight
trim = !capsule && shape > ratio * 1.25f
offRatio = !trim && kotlin.math.abs(shape / ratio - 1f) > 0.03f
}
},
)
badge?.invoke(this)
if (chip != null) Box(Modifier.align(Alignment.TopEnd).padding(6.dp)) {
StateChip(chip, ChipTone.BUSY, small = true, fraction = download?.let { steadyProgress(it) }, key = download?.key)
}
val showName = LibraryDisplay.title || hot
val showDetail = LibraryDisplay.size || hot
if (showName || showDetail) {
val top = with(androidx.compose.ui.platform.LocalDensity.current) { 20.dp.roundToPx() }
val bottom = with(androidx.compose.ui.platform.LocalDensity.current) { (if (download != null) 14.dp else 6.dp).roundToPx() }
Column(
verticalArrangement = Arrangement.spacedBy(1.dp),
modifier = Modifier.align(Alignment.BottomCenter).fillMaxWidth()
.background(Brush.verticalGradient(0f to Color.Transparent, 0.6f to Color.Black.copy(alpha = 0.78f), 1f to Color.Black.copy(alpha = 0.92f)))
.layout { measurable, constraints ->
val inner = measurable.measure(constraints)
if (inner.height == 0) layout(inner.width, 0) {} else layout(inner.width, inner.height + top + bottom) { inner.place(0, top) }
val captionName = LibraryDisplay.title
val captionDetail = LibraryDisplay.size
Column(Modifier.fillMaxWidth()) {
banner?.invoke()
Box(
Modifier.fillMaxWidth().aspectRatio(ratio).onGloballyPositioned(onArtPlaced).background(Color(0xFF101318))
.then(if (url == null) Modifier.background(artBrush(hueOf(title))) else Modifier),
) {
if (art != null && offRatio) {
AsyncImage(model = art, contentDescription = null, contentScale = ContentScale.Crop, modifier = Modifier.matchParentSize().blur(32.dp))
Spacer(Modifier.matchParentSize().background(Color.Black.copy(alpha = if (blurs) 0.18f else 0.6f)))
}
if (art != null) AsyncImage(
model = art, contentDescription = null, contentScale = if (trim) ContentScale.Crop else ContentScale.Fit, modifier = Modifier.matchParentSize(),
onSuccess = { r ->
val d = r.result.drawable
if (d.intrinsicWidth > 0 && d.intrinsicHeight > 0) {
val shape = d.intrinsicWidth.toFloat() / d.intrinsicHeight
trim = !capsule && shape > ratio * 1.25f
offRatio = !trim && kotlin.math.abs(shape / ratio - 1f) > 0.03f
}
.padding(horizontal = 8.dp),
) {
if (showName) Text(title, fontSize = 11.sp, fontWeight = FontWeight.Bold, color = Color.White, maxLines = if (hot) 2 else 1, overflow = TextOverflow.Ellipsis, lineHeight = 13.sp)
if (showDetail) detail()
},
)
badge?.invoke(this)
if (chip != null) Box(Modifier.align(Alignment.TopEnd).padding(6.dp)) {
StateChip(chip, ChipTone.BUSY, small = true, fraction = download?.let { steadyProgress(it) }, key = download?.key)
}
val overlayName = hot && !captionName
val overlayDetail = hot && !captionDetail
if (overlayName || overlayDetail) {
val top = with(androidx.compose.ui.platform.LocalDensity.current) { 20.dp.roundToPx() }
val bottom = with(androidx.compose.ui.platform.LocalDensity.current) { (if (download != null) 14.dp else 6.dp).roundToPx() }
Column(
verticalArrangement = Arrangement.spacedBy(1.dp),
modifier = Modifier.align(Alignment.BottomCenter).fillMaxWidth()
.background(Brush.verticalGradient(0f to Color.Transparent, 0.6f to Color.Black.copy(alpha = 0.78f), 1f to Color.Black.copy(alpha = 0.92f)))
.layout { measurable, constraints ->
val inner = measurable.measure(constraints)
if (inner.height == 0) layout(inner.width, 0) {} else layout(inner.width, inner.height + top + bottom) { inner.place(0, top) }
}
.padding(horizontal = 8.dp),
) {
if (overlayName) Text(title, fontSize = 11.sp, fontWeight = FontWeight.Bold, color = Color.White, maxLines = 2, overflow = TextOverflow.Ellipsis, lineHeight = 13.sp)
if (overlayDetail) CompositionLocalProvider(LocalContentColor provides Color.White) { detail() }
}
}
if (download != null) Box(Modifier.align(Alignment.BottomCenter).padding(start = 6.dp, end = 6.dp, bottom = 5.dp)) {
ProgressBarThin(download.fraction, paused = download.state == DownloadState.PAUSED, verify = download.stage == DownloadStage.VERIFY)
}
}
if (download != null) Box(Modifier.align(Alignment.BottomCenter).padding(start = 6.dp, end = 6.dp, bottom = 5.dp)) {
ProgressBarThin(download.fraction, paused = download.state == DownloadState.PAUSED, verify = download.stage == DownloadStage.VERIFY)
if (captionName || captionDetail) Column(
verticalArrangement = Arrangement.spacedBy(1.dp),
modifier = Modifier.fillMaxWidth().background(colors.surface).padding(horizontal = 8.dp, vertical = 6.dp),
) {
if (captionName) Text(title, fontSize = 12.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis, lineHeight = 15.sp)
if (captionDetail) Box(Modifier.fillMaxWidth().height(15.dp), contentAlignment = Alignment.CenterStart) {
CompositionLocalProvider(LocalContentColor provides colors.onSurfaceVariant) { detail() }
}
}
}
}
@@ -1197,7 +1234,7 @@ private fun librarySize(e: LibraryEntry): Long? = if (e.installed) e.storeKey?.l
@Composable
private fun LibrarySize(e: LibraryEntry) {
val size = librarySize(e)?.takeIf { it > 0 } ?: return
Text(formatBytes(size), fontSize = 11.sp, fontWeight = FontWeight.Bold, color = Color.White, maxLines = 1)
Text(formatBytes(size), fontSize = 11.sp, fontWeight = FontWeight.Bold, color = LocalContentColor.current, maxLines = 1)
}
@Composable
@@ -1391,7 +1428,7 @@ private fun CollectionsButton(store: Store) {
}
@Composable
internal fun DisplayButton() {
internal fun DisplayButton(storeOption: Boolean = false) {
val pal = LocalPalette.current
val ctx = LocalContext.current
val title = stringResource(R.string.library_display)
@@ -1400,7 +1437,7 @@ internal fun DisplayButton() {
HeaderIconButton(title, Icons.Filled.Visibility, "display") {
val from = at ?: return@HeaderIconButton
Steps.ask(StepAsk(
anchor = from, side = StepSide.Left, accent = pal.signal, pillCorner = 8.dp, items = 4,
anchor = from, side = StepSide.Left, accent = pal.signal, pillCorner = 8.dp, items = if (storeOption) 5 else 4,
handle = { Icon(Icons.Filled.Visibility, null, tint = pal.signal, modifier = Modifier.size(18.dp)) },
) {
StepTitle(title)
@@ -1423,6 +1460,10 @@ internal fun DisplayButton() {
stringResource(R.string.library_display_size), selected = LibraryDisplay.size, enabled = open,
modifier = Modifier.fillMaxWidth().stepItem(3),
) { LibraryDisplay.toggleSize(ctx) }
if (storeOption) StepChoice(
stringResource(R.string.library_display_store), selected = LibraryDisplay.store, enabled = open,
modifier = Modifier.fillMaxWidth().stepItem(4),
) { LibraryDisplay.toggleStore(ctx) }
}
})
}
@@ -2,16 +2,20 @@ package com.droiddeck.launcher.ui
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.droiddeck.launcher.R
@@ -73,6 +77,18 @@ internal fun SourceChip(source: String, small: Boolean = false, modifier: Modifi
)
}
/** The store a card comes from, as a full-width band above its art. */
@Composable
internal fun SourceBanner(source: String, modifier: Modifier = Modifier, label: String? = null, colours: SourceColours? = null) {
val c = colours ?: sourceColours(source)
Box(modifier.fillMaxWidth().heightIn(min = 20.dp).background(c.fill).padding(horizontal = 8.dp, vertical = 3.dp), contentAlignment = Alignment.CenterStart) {
Text(
label ?: sourceLabel(source), fontSize = 10.sp, fontWeight = FontWeight.Bold, letterSpacing = 0.5.sp, lineHeight = 12.sp,
color = c.ink, maxLines = 1, overflow = TextOverflow.Ellipsis,
)
}
}
@Composable
internal fun StateChip(text: String, tone: ChipTone, small: Boolean = false, fraction: Float? = null, key: Any? = null) {
val pal = LocalPalette.current
@@ -1190,7 +1190,6 @@ private fun GameCard(
Column(
modifier = Modifier.fillMaxWidth()
.onGloballyPositioned { c ->
placed[0] = c
if (item.accessible && item.sizeBytes <= 0) {
val b = c.boundsInWindow()
if (b.bottom > -ahead && b.top < screen + ahead && b.width > 0f) com.droiddeck.launcher.stores.StoreSizes.request(ctx, item)
@@ -1209,10 +1208,10 @@ private fun GameCard(
val priced = installed || item.isFree || item.isDiscounted || item.hasPrice
val pill: (@Composable BoxScope.() -> Unit)? = if (priced && !LibraryDisplay.size && !hot) ({
Box(Modifier.align(Alignment.TopStart).padding(6.dp).clip(RoundedCornerShape(6.dp)).background(Color.Black.copy(alpha = 0.82f)).padding(horizontal = 6.dp, vertical = 2.dp)) {
CardMarker(item, installed, download, compact = true, status = false)
CompositionLocalProvider(androidx.compose.material3.LocalContentColor provides Color.White) { CardMarker(item, installed, download, compact = true, status = false) }
}
}) else null
ArtCard(item.title, item.imageUrl, item.tallImageUrl, download, hot, capsule = false, chip = chip, badge = pill) { CardMarker(item, installed, download, status = false) }
ArtCard(item.title, item.imageUrl, item.tallImageUrl, download, hot, capsule = false, chip = chip, badge = pill, onArtPlaced = { placed[0] = it }) { CardMarker(item, installed, download, status = false) }
}
}
@@ -1256,19 +1255,19 @@ private fun CardMarker(item: CatalogItem, installed: Boolean, download: com.droi
val ctx = LocalContext.current
val game = StoresState.installedGame(item.store, item.id)
if (game != null && !compact) androidx.compose.runtime.LaunchedEffect(item.key) { com.droiddeck.launcher.stores.StoreSizes.requestDisk(ctx, item.key, game) }
if (!compact) com.droiddeck.launcher.stores.StoreSizes.onDisk[item.key]?.let { Text(formatBytes(it), fontSize = 11.sp, fontWeight = FontWeight.Bold, color = Color.White, maxLines = 1) }
if (!compact) com.droiddeck.launcher.stores.StoreSizes.onDisk[item.key]?.let { Text(formatBytes(it), fontSize = 11.sp, fontWeight = FontWeight.Bold, color = androidx.compose.material3.LocalContentColor.current, maxLines = 1) }
Icon(Icons.Filled.Check, stringResource(R.string.stores_installed_chip), tint = pal.good, modifier = Modifier.size(11.dp))
}
status && download != null -> Text("${download.percent}%", fontSize = small, fontWeight = FontWeight.Bold, color = pal.signal, maxLines = 1)
status && item.accessible && StoresState.isUnfinished(item) -> Text(stringResource(R.string.stores_resume), fontSize = small, fontWeight = FontWeight.Bold, color = pal.signal, maxLines = 1)
item.accessible && compact -> Unit
item.accessible -> com.droiddeck.launcher.stores.StoreSizes.size(item).takeIf { it > 0 }?.let { Text(formatBytes(it), fontSize = 11.sp, fontWeight = FontWeight.Bold, color = Color.White, maxLines = 1) }
item.accessible -> com.droiddeck.launcher.stores.StoreSizes.size(item).takeIf { it > 0 }?.let { Text(formatBytes(it), fontSize = 11.sp, fontWeight = FontWeight.Bold, color = androidx.compose.material3.LocalContentColor.current, maxLines = 1) }
item.isFree -> Text(stringResource(R.string.stores_free), fontSize = small, fontWeight = FontWeight.Bold, color = pal.good, maxLines = 1)
item.isDiscounted -> Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(4.dp)) {
StateChip("-${item.discountPercent}%", ChipTone.DEAL, small = true)
Text(item.finalPrice, fontSize = small, fontWeight = FontWeight.Bold, color = Color.White, maxLines = 1)
Text(item.finalPrice, fontSize = small, fontWeight = FontWeight.Bold, color = androidx.compose.material3.LocalContentColor.current, maxLines = 1)
}
item.hasPrice -> Text(item.finalPrice, fontSize = small, fontWeight = FontWeight.Bold, color = Color.White, maxLines = 1)
item.hasPrice -> Text(item.finalPrice, fontSize = small, fontWeight = FontWeight.Bold, color = androidx.compose.material3.LocalContentColor.current, maxLines = 1)
}
}
+1
View File
@@ -2732,6 +2732,7 @@
<string name="library_display_smaller">بطاقات أصغر</string>
<string name="library_display_title">إظهار العنوان</string>
<string name="library_display_size">إظهار الحجم</string>
<string name="library_display_store">إظهار المتجر</string>
<string name="stores_sort_last_played">لُعب مؤخرًا</string>
<string name="stores_sort_recently_installed">ثُبت مؤخرًا</string>
<string name="stores_sort_title_asc">العنوان أ–ي</string>
@@ -2690,6 +2690,7 @@
<string name="library_display_smaller">Tarjetas más pequeñas</string>
<string name="library_display_title">Mostrar título</string>
<string name="library_display_size">Mostrar tamaño</string>
<string name="library_display_store">Mostrar tienda</string>
<string name="stores_sort_last_played">Jugados recientemente</string>
<string name="stores_sort_recently_installed">Instalados recientemente</string>
<string name="stores_sort_title_asc">Título A–Z</string>
+1
View File
@@ -2628,6 +2628,7 @@
<string name="library_display_smaller">По-малки карти</string>
<string name="library_display_title">Показване на заглавието</string>
<string name="library_display_size">Показване на размера</string>
<string name="library_display_store">Показване на магазина</string>
<string name="stores_sort_last_played">Играни наскоро</string>
<string name="stores_sort_recently_installed">Инсталирани наскоро</string>
<string name="stores_sort_title_asc">Заглавие А–Я</string>
+1
View File
@@ -2680,6 +2680,7 @@
<string name="library_display_smaller">Menší karty</string>
<string name="library_display_title">Zobrazit název</string>
<string name="library_display_size">Zobrazit velikost</string>
<string name="library_display_store">Zobrazit obchod</string>
<string name="stores_sort_last_played">Nedávno hrané</string>
<string name="stores_sort_recently_installed">Nedávno nainstalované</string>
<string name="stores_sort_title_asc">Název A–Z</string>
+1
View File
@@ -2628,6 +2628,7 @@
<string name="library_display_smaller">Mindre kort</string>
<string name="library_display_title">Vis titel</string>
<string name="library_display_size">Vis størrelse</string>
<string name="library_display_store">Vis butik</string>
<string name="stores_sort_last_played">Senest spillet</string>
<string name="stores_sort_recently_installed">Senest installeret</string>
<string name="stores_sort_title_asc">Titel A–Å</string>
+1
View File
@@ -2620,6 +2620,7 @@
<string name="library_display_smaller">Kleinere Karten</string>
<string name="library_display_title">Titel anzeigen</string>
<string name="library_display_size">Größe anzeigen</string>
<string name="library_display_store">Store anzeigen</string>
<string name="stores_sort_last_played">Zuletzt gespielt</string>
<string name="stores_sort_recently_installed">Zuletzt installiert</string>
<string name="stores_sort_title_asc">Titel A–Z</string>
+1
View File
@@ -2628,6 +2628,7 @@
<string name="library_display_smaller">Μικρότερες κάρτες</string>
<string name="library_display_title">Εμφάνιση τίτλου</string>
<string name="library_display_size">Εμφάνιση μεγέθους</string>
<string name="library_display_store">Εμφάνιση καταστήματος</string>
<string name="stores_sort_last_played">Παίχτηκαν πρόσφατα</string>
<string name="stores_sort_recently_installed">Εγκαταστήθηκαν πρόσφατα</string>
<string name="stores_sort_title_asc">Τίτλος Α–Ω</string>
+1
View File
@@ -2654,6 +2654,7 @@
<string name="library_display_smaller">Tarjetas más pequeñas</string>
<string name="library_display_title">Mostrar título</string>
<string name="library_display_size">Mostrar tamaño</string>
<string name="library_display_store">Mostrar tienda</string>
<string name="stores_sort_last_played">Jugados recientemente</string>
<string name="stores_sort_recently_installed">Instalados recientemente</string>
<string name="stores_sort_title_asc">Título A–Z</string>
+1
View File
@@ -2628,6 +2628,7 @@
<string name="library_display_smaller">Pienemmät kortit</string>
<string name="library_display_title">Näytä nimi</string>
<string name="library_display_size">Näytä koko</string>
<string name="library_display_store">Näytä kauppa</string>
<string name="stores_sort_last_played">Viimeksi pelatut</string>
<string name="stores_sort_recently_installed">Viimeksi asennetut</string>
<string name="stores_sort_title_asc">Nimi A–Ö</string>
+1
View File
@@ -2653,6 +2653,7 @@
<string name="library_display_smaller">Cartes plus petites</string>
<string name="library_display_title">Afficher le titre</string>
<string name="library_display_size">Afficher la taille</string>
<string name="library_display_store">Afficher la boutique</string>
<string name="stores_sort_last_played">Joués récemment</string>
<string name="stores_sort_recently_installed">Installés récemment</string>
<string name="stores_sort_title_asc">Titre A–Z</string>
+1
View File
@@ -2628,6 +2628,7 @@
<string name="library_display_smaller">छोटे कार्ड</string>
<string name="library_display_title">टाइटल दिखाएं</string>
<string name="library_display_size">साइज़ दिखाएं</string>
<string name="library_display_store">स्टोर दिखाएं</string>
<string name="stores_sort_last_played">हाल में खेले गए</string>
<string name="stores_sort_recently_installed">हाल में इंस्टॉल किए गए</string>
<string name="stores_sort_title_asc">शीर्षक A–Z</string>
+1
View File
@@ -2628,6 +2628,7 @@
<string name="library_display_smaller">Kisebb kártyák</string>
<string name="library_display_title">Cím megjelenítése</string>
<string name="library_display_size">Méret megjelenítése</string>
<string name="library_display_store">Áruház megjelenítése</string>
<string name="stores_sort_last_played">Nemrég játszott</string>
<string name="stores_sort_recently_installed">Nemrég telepített</string>
<string name="stores_sort_title_asc">Cím A–Z</string>
+1
View File
@@ -2603,6 +2603,7 @@
<string name="library_display_smaller">Kartu lebih kecil</string>
<string name="library_display_title">Tampilkan judul</string>
<string name="library_display_size">Tampilkan ukuran</string>
<string name="library_display_store">Tampilkan toko</string>
<string name="stores_sort_last_played">Baru dimainkan</string>
<string name="stores_sort_recently_installed">Baru dipasang</string>
<string name="stores_sort_title_asc">Judul A–Z</string>
+1
View File
@@ -2645,6 +2645,7 @@
<string name="library_display_smaller">Schede più piccole</string>
<string name="library_display_title">Mostra titolo</string>
<string name="library_display_size">Mostra dimensione</string>
<string name="library_display_store">Mostra negozio</string>
<string name="stores_sort_last_played">Giocate di recente</string>
<string name="stores_sort_recently_installed">Installate di recente</string>
<string name="stores_sort_title_asc">Titolo A–Z</string>
+1
View File
@@ -2603,6 +2603,7 @@
<string name="library_display_smaller">小さいカード</string>
<string name="library_display_title">タイトルを表示</string>
<string name="library_display_size">サイズを表示</string>
<string name="library_display_store">ストアを表示</string>
<string name="stores_sort_last_played">最近プレイ</string>
<string name="stores_sort_recently_installed">最近インストール</string>
<string name="stores_sort_title_asc">タイトル A–Z</string>
+1
View File
@@ -2603,6 +2603,7 @@
<string name="library_display_smaller">카드 작게</string>
<string name="library_display_title">제목 표시</string>
<string name="library_display_size">크기 표시</string>
<string name="library_display_store">스토어 표시</string>
<string name="stores_sort_last_played">최근 플레이</string>
<string name="stores_sort_recently_installed">최근 설치</string>
<string name="stores_sort_title_asc">제목 A–Z</string>
+1
View File
@@ -2603,6 +2603,7 @@
<string name="library_display_smaller">Kad lebih kecil</string>
<string name="library_display_title">Paparkan tajuk</string>
<string name="library_display_size">Paparkan saiz</string>
<string name="library_display_store">Paparkan kedai</string>
<string name="stores_sort_last_played">Baru dimainkan</string>
<string name="stores_sort_recently_installed">Baru dipasang</string>
<string name="stores_sort_title_asc">Tajuk A–Z</string>
+1
View File
@@ -2628,6 +2628,7 @@
<string name="library_display_smaller">Mindre kort</string>
<string name="library_display_title">Vis tittel</string>
<string name="library_display_size">Vis størrelse</string>
<string name="library_display_store">Vis butikk</string>
<string name="stores_sort_last_played">Nylig spilt</string>
<string name="stores_sort_recently_installed">Nylig installert</string>
<string name="stores_sort_title_asc">Tittel A–Å</string>
+1
View File
@@ -2628,6 +2628,7 @@
<string name="library_display_smaller">Kleinere kaarten</string>
<string name="library_display_title">Titel tonen</string>
<string name="library_display_size">Grootte tonen</string>
<string name="library_display_store">Winkel tonen</string>
<string name="stores_sort_last_played">Onlangs gespeeld</string>
<string name="stores_sort_recently_installed">Onlangs geïnstalleerd</string>
<string name="stores_sort_title_asc">Titel A–Z</string>
+1
View File
@@ -2680,6 +2680,7 @@
<string name="library_display_smaller">Mniejsze karty</string>
<string name="library_display_title">Pokazuj tytuł</string>
<string name="library_display_size">Pokazuj rozmiar</string>
<string name="library_display_store">Pokazuj sklep</string>
<string name="stores_sort_last_played">Ostatnio grane</string>
<string name="stores_sort_recently_installed">Ostatnio zainstalowane</string>
<string name="stores_sort_title_asc">Tytuł A–Z</string>
@@ -2660,6 +2660,7 @@
<string name="library_display_smaller">Cartões mais pequenos</string>
<string name="library_display_title">Mostrar título</string>
<string name="library_display_size">Mostrar tamanho</string>
<string name="library_display_store">Mostrar loja</string>
<string name="stores_sort_last_played">Jogados recentemente</string>
<string name="stores_sort_recently_installed">Instalados recentemente</string>
<string name="stores_sort_title_asc">Título A–Z</string>
+1
View File
@@ -2670,6 +2670,7 @@
<string name="library_display_smaller">Cards menores</string>
<string name="library_display_title">Mostrar título</string>
<string name="library_display_size">Mostrar tamanho</string>
<string name="library_display_store">Mostrar loja</string>
<string name="stores_sort_last_played">Jogados recentemente</string>
<string name="stores_sort_recently_installed">Instalados recentemente</string>
<string name="stores_sort_title_asc">Título A–Z</string>
+1
View File
@@ -2654,6 +2654,7 @@
<string name="library_display_smaller">Carduri mai mici</string>
<string name="library_display_title">Afișează titlul</string>
<string name="library_display_size">Afișează dimensiunea</string>
<string name="library_display_store">Afișează magazinul</string>
<string name="stores_sort_last_played">Jucate recent</string>
<string name="stores_sort_recently_installed">Instalate recent</string>
<string name="stores_sort_title_asc">Titlu A–Z</string>
+1
View File
@@ -2681,6 +2681,7 @@
<string name="library_display_smaller">Мелкие карточки</string>
<string name="library_display_title">Показывать название</string>
<string name="library_display_size">Показывать размер</string>
<string name="library_display_store">Показывать магазин</string>
<string name="stores_sort_last_played">Недавно запущенные</string>
<string name="stores_sort_recently_installed">Недавно установленные</string>
<string name="stores_sort_title_asc">Название А–Я</string>
+1
View File
@@ -2628,6 +2628,7 @@
<string name="library_display_smaller">Mindre kort</string>
<string name="library_display_title">Visa titel</string>
<string name="library_display_size">Visa storlek</string>
<string name="library_display_store">Visa butik</string>
<string name="stores_sort_last_played">Senast spelade</string>
<string name="stores_sort_recently_installed">Senast installerade</string>
<string name="stores_sort_title_asc">Titel A–Ö</string>
+1
View File
@@ -2603,6 +2603,7 @@
<string name="library_display_smaller">การ์ดเล็กลง</string>
<string name="library_display_title">แสดงชื่อ</string>
<string name="library_display_size">แสดงขนาด</string>
<string name="library_display_store">แสดงร้านค้า</string>
<string name="stores_sort_last_played">เล่นล่าสุด</string>
<string name="stores_sort_recently_installed">เพิ่งติดตั้ง</string>
<string name="stores_sort_title_asc">ชื่อ A–Z</string>
+1
View File
@@ -2620,6 +2620,7 @@
<string name="library_display_smaller">Daha küçük kartlar</string>
<string name="library_display_title">Başlığı göster</string>
<string name="library_display_size">Boyutu göster</string>
<string name="library_display_store">Mağazayı göster</string>
<string name="stores_sort_last_played">Son oynanan</string>
<string name="stores_sort_recently_installed">Son yüklenen</string>
<string name="stores_sort_title_asc">Başlık A–Z</string>
+1
View File
@@ -2680,6 +2680,7 @@
<string name="library_display_smaller">Малі картки</string>
<string name="library_display_title">Показувати назву</string>
<string name="library_display_size">Показувати розмір</string>
<string name="library_display_store">Показувати магазин</string>
<string name="stores_sort_last_played">Нещодавно запущені</string>
<string name="stores_sort_recently_installed">Нещодавно встановлені</string>
<string name="stores_sort_title_asc">Назва А–Я</string>
+1
View File
@@ -2603,6 +2603,7 @@
<string name="library_display_smaller">Thẻ nhỏ hơn</string>
<string name="library_display_title">Hiện tiêu đề</string>
<string name="library_display_size">Hiện kích thước</string>
<string name="library_display_store">Hiện cửa hàng</string>
<string name="stores_sort_last_played">Chơi gần đây</string>
<string name="stores_sort_recently_installed">Cài gần đây</string>
<string name="stores_sort_title_asc">Tên A–Z</string>
@@ -2680,6 +2680,7 @@
<string name="library_display_smaller">较小卡片</string>
<string name="library_display_title">显示标题</string>
<string name="library_display_size">显示大小</string>
<string name="library_display_store">显示商店</string>
<string name="stores_sort_last_played">最近游玩</string>
<string name="stores_sort_recently_installed">最近安装</string>
<string name="stores_sort_title_asc">标题 A–Z</string>
@@ -2600,6 +2600,7 @@
<string name="library_display_smaller">較小卡片</string>
<string name="library_display_title">顯示標題</string>
<string name="library_display_size">顯示大小</string>
<string name="library_display_store">顯示商店</string>
<string name="stores_sort_last_played">最近遊玩</string>
<string name="stores_sort_recently_installed">最近安裝</string>
<string name="stores_sort_title_asc">標題 A–Z</string>
@@ -2600,6 +2600,7 @@
<string name="library_display_smaller">較小的卡片</string>
<string name="library_display_title">顯示標題</string>
<string name="library_display_size">顯示大小</string>
<string name="library_display_store">顯示商店</string>
<string name="stores_sort_last_played">最近遊玩</string>
<string name="stores_sort_recently_installed">最近安裝</string>
<string name="stores_sort_title_asc">標題 A–Z</string>
+1
View File
@@ -2985,6 +2985,7 @@
<string name="library_display_smaller">Smaller cards</string>
<string name="library_display_title">Show title</string>
<string name="library_display_size">Show size</string>
<string name="library_display_store">Show store</string>
<string name="stores_sort_last_played">Recently played</string>
<string name="stores_sort_recently_installed">Recently installed</string>
<string name="stores_sort_title_asc">Title A–Z</string>
@@ -25,11 +25,17 @@ class LibraryDisplayTest {
assertFalse(LibraryDisplay.size)
}
@Test fun storeBannerDefaultsOn() {
assertTrue(LibraryDisplay.store)
}
@Test fun savedChoicesStillLoad() {
LibraryDisplay.toggleTitle(context)
LibraryDisplay.toggleSize(context)
LibraryDisplay.toggleStore(context)
LibraryDisplay.load(context)
assertTrue(LibraryDisplay.title)
assertTrue(LibraryDisplay.size)
assertFalse(LibraryDisplay.store)
}
}