diff --git a/app/src/debug/java/com/droiddeck/launcher/ui/LauncherPreviews.kt b/app/src/debug/java/com/droiddeck/launcher/ui/LauncherPreviews.kt index 626359e1c5..c235f28d80 100644 --- a/app/src/debug/java/com/droiddeck/launcher/ui/LauncherPreviews.kt +++ b/app/src/debug/java/com/droiddeck/launcher/ui/LauncherPreviews.kt @@ -60,16 +60,6 @@ private fun BottomPanelBar() = PreviewHost { @DroidDeckPreviews @Composable private fun SessionMenuDockedDisplayPreview() = DockedMenu(SessionDrawerPage.DISPLAY) @DroidDeckPreviews @Composable private fun BottomPanelBarPreview() = BottomPanelBar() -/** The dashboard's stats page with no game running: the game highlighted in Steam. */ -@Composable -private fun BottomIdle() = PreviewHost { - Column(Modifier.fillMaxSize().background(Color.Black).padding(12.dp)) { - IdleHomeCard(IdleGame(1145360, "Hades", null, 2843, System.currentTimeMillis() / 1000 - 2 * 86_400, highlighted = true)) {} - } -} - -@DroidDeckPreviews @Composable private fun BottomIdlePreview() = BottomIdle() - /** The Stardew Valley companion page, fed with the mod's messages. */ @Composable private fun BottomStardew() = PreviewHost { @@ -119,7 +109,6 @@ internal val previewCases: List = listOf( PreviewCase("session-menu-docked") { DockedMenu(SessionDrawerPage.CONTROLLER) }, PreviewCase("session-menu-docked-display") { DockedMenu(SessionDrawerPage.DISPLAY) }, PreviewCase("bottom-panel-bar") { BottomPanelBar() }, - PreviewCase("bottom-idle-home") { BottomIdle() }, PreviewCase("bottom-companion-stardew") { BottomStardew() }, PreviewCase("bottom-companion-pipboy") { BottomPipBoy() }, ) diff --git a/app/src/main/java/com/droiddeck/launcher/input/SecondScreenMode.kt b/app/src/main/java/com/droiddeck/launcher/input/SecondScreenMode.kt index 4cfdba7aab..252bb69662 100644 --- a/app/src/main/java/com/droiddeck/launcher/input/SecondScreenMode.kt +++ b/app/src/main/java/com/droiddeck/launcher/input/SecondScreenMode.kt @@ -19,9 +19,10 @@ enum class SecondScreenMode(val id: String, @StringRes val label: Int, val bindi MIRROR("mirror", R.string.bottom_page_mirror), COMPANION("companion", R.string.bottom_page_companion), STEAM_QAM("steam-qam", R.string.bottom_qam_title), + ART("art", R.string.bottom_art_title), DESKTOP("desktop", R.string.second_mode_desktop); - val sessionPanel: Boolean get() = this == GUIDES || this == MIRROR || this == COMPANION || this == STEAM_QAM + val sessionPanel: Boolean get() = this == GUIDES || this == MIRROR || this == COMPANION || this == STEAM_QAM || this == ART val controls: Boolean get() = this == CUSTOM_CONTROLS || bindings != null @@ -32,7 +33,7 @@ enum class SecondScreenMode(val id: String, @StringRes val label: Int, val bindi fun opening(remembered: String?, deckPad: Boolean, dashboard: Boolean = false, bottomDesktop: Boolean = false, steam: Boolean = false): SecondScreenMode = entries.firstOrNull { - it != NONE && it.id == remembered && (it != DECK_CONTROLS || deckPad) && (it != DASHBOARD && !it.sessionPanel || dashboard) && (it != STEAM_QAM || steam) && + it != NONE && it.id == remembered && (it != DECK_CONTROLS || deckPad) && (it != DASHBOARD && !it.sessionPanel || dashboard) && (it != STEAM_QAM && it != ART || steam) && (it != DESKTOP || bottomDesktop) } ?: MENU } diff --git a/app/src/main/java/com/droiddeck/launcher/session/GameLinks.kt b/app/src/main/java/com/droiddeck/launcher/session/GameLinks.kt index 9cc33f733f..b503da1959 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/GameLinks.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/GameLinks.kt @@ -9,7 +9,7 @@ import java.net.URL import java.net.URLEncoder object GameLinks { - enum class Kind { WIKI, STRATEGYWIKI, PCGAMINGWIKI, GAMEFAQS, IGN, HOWLONGTOBEAT } + enum class Kind { WIKI, STRATEGYWIKI, PCGAMINGWIKI, GAMEFAQS, IGN, HOWLONGTOBEAT, MAPGENIE } data class Link(val kind: Kind, val url: String) @@ -50,7 +50,54 @@ object GameLinks { ) } - fun links(context: Context, appId: Long): List { + /** Site slugs to try for a game name, longest first: "Bully: Scholarship Edition" gives bully-scholarship-edition, then bully. */ + internal fun slugs(name: String): List { + fun slug(s: String) = s.lowercase().replace("&", "and").replace(Regex("['’™®©]"), "") + .replace(Regex("[^a-z0-9]+"), "-").trim('-') + val short = name.split(Regex(":| - | – |\\("), limit = 2).first() + return listOf(slug(name), slug(short)).filter { it.isNotEmpty() }.distinct() + } + + /** Direct pages for what Wikidata has no ID for, found from each site's own routes rather than a web search. */ + internal fun direct(name: String, found: List, exists: (String) -> Boolean, strategyWiki: (String) -> String?): List { + val have = found.map { it.kind }.toSet() + val slugs = slugs(name) + fun first(urls: List) = urls.firstOrNull(exists) + val ignWiki = found.firstOrNull { it.kind == Kind.IGN }?.url?.substringAfter("/games/", "")?.takeIf { it.isNotEmpty() } + val extra = listOfNotNull( + first(slugs.map { "https://mapgenie.io/$it" })?.let { Link(Kind.MAPGENIE, it) }, + first((listOfNotNull(ignWiki) + slugs).distinct().map { "https://www.ign.com/wikis/$it" })?.let { Link(Kind.IGN, it) }, + // Fandom answers pages with a bot check, but its API with 200 for a wiki that exists and 404 for one that does not. + if (Kind.WIKI in have) null else slugs.map { it.replace("-", "") }.distinct() + .firstOrNull { exists("https://$it.fandom.com/api.php?action=query&meta=siteinfo&format=json") } + ?.let { Link(Kind.WIKI, "https://$it.fandom.com/") }, + if (Kind.STRATEGYWIKI in have) null else strategyWiki(name.split(":").first().trim())?.let { Link(Kind.STRATEGYWIKI, it) }, + ) + return found.filterNot { it.kind == Kind.IGN && extra.any { e -> e.kind == Kind.IGN } } + extra + } + + internal fun parseOpenSearch(json: String, title: String): String? = runCatching { + val a = JSONArray(json) + val titles = a.getJSONArray(1) + val urls = a.getJSONArray(3) + (0 until titles.length()).firstOrNull { titles.getString(it).equals(title, ignoreCase = true) }?.let { urls.getString(it) } + }.getOrNull() + + private fun exists(url: String): Boolean = runCatching { + val c = URL(url).openConnection() as HttpURLConnection + c.instanceFollowRedirects = false + c.connectTimeout = 6_000 + c.readTimeout = 6_000 + c.setRequestProperty("User-Agent", BROWSER) + try { c.responseCode in 200..399 } finally { c.disconnect() } + }.getOrDefault(false) + + private fun strategyWiki(title: String): String? = runCatching { + parseOpenSearch(get("https://strategywiki.org/w/api.php?action=opensearch&namespace=0&limit=5&format=json&search=" + + URLEncoder.encode(title, "UTF-8")), title) + }.getOrNull() + + fun links(context: Context, appId: Long, name: String? = null): List { val cache = File(context.cacheDir, "game-links/$appId.json") val fresh = cache.isFile && System.currentTimeMillis() - cache.lastModified() < CACHE_MS val text = if (fresh) runCatching { cache.readText() }.getOrNull() else null @@ -58,9 +105,23 @@ object GameLinks { get("https://query.wikidata.org/sparql?format=json&query=" + URLEncoder.encode(sparql(appId), "UTF-8")) }.getOrNull()?.also { runCatching { cache.parentFile?.mkdirs(); cache.writeText(it) } } ?: runCatching { cache.readText() }.getOrNull() - val found = json?.let { runCatching { parse(it) }.getOrNull() }.orEmpty() - return if (found.any { it.kind == Kind.PCGAMINGWIKI }) found - else found + Link(Kind.PCGAMINGWIKI, "https://www.pcgamingwiki.com/api/appid.php?appid=$appId") + val wikidata = json?.let { runCatching { parse(it) }.getOrNull() }.orEmpty() + val withFixes = if (wikidata.any { it.kind == Kind.PCGAMINGWIKI }) wikidata + else wikidata + Link(Kind.PCGAMINGWIKI, "https://www.pcgamingwiki.com/api/appid.php?appid=$appId") + if (name.isNullOrBlank()) return withFixes + val directCache = File(context.cacheDir, "game-links/$appId-direct-v2.json") + val cached = directCache.takeIf { it.isFile && System.currentTimeMillis() - it.lastModified() < CACHE_MS } + ?.let { runCatching { readLinks(it.readText()) }.getOrNull() } + if (cached != null) return cached + return direct(name, withFixes, ::exists, ::strategyWiki) + .also { runCatching { directCache.parentFile?.mkdirs(); directCache.writeText(writeLinks(it)) } } + } + + internal fun writeLinks(links: List): String = + JSONArray(links.map { JSONObject().put("kind", it.kind.name).put("url", it.url) }).toString() + + internal fun readLinks(json: String): List = JSONArray(json).let { a -> + (0 until a.length()).map { a.getJSONObject(it) }.map { Link(Kind.valueOf(it.getString("kind")), it.getString("url")) } } fun protonTier(appId: Long): String? = runCatching { @@ -70,20 +131,12 @@ object GameLinks { internal fun parseTier(json: String): String? = JSONObject(json).optString("tier").takeIf { it in TIERS } - fun searches(name: String): List { + /** Searches on the sites themselves, for what has no direct page. */ + fun searches(name: String, found: List): List { val q = URLEncoder.encode(name, "UTF-8") - return listOf( + return listOfNotNull( Search("youtube", "https://m.youtube.com/results?search_query=$q+walkthrough"), - Search("gamefaqs", "https://gamefaqs.gamespot.com/search?game=$q"), - Search("ign", "https://www.ign.com/search?q=$q+guide"), - ) - } - - fun mapSearches(name: String): List { - val q = URLEncoder.encode(name, "UTF-8") - return listOf( - Search("mapgenie", "https://duckduckgo.com/html/?q=site%3Amapgenie.io+$q"), - Search("vgmaps", "https://duckduckgo.com/html/?q=site%3Avgmaps.com+$q"), + Search("gamefaqs", "https://gamefaqs.gamespot.com/search?game=$q").takeIf { found.none { it.kind == Kind.GAMEFAQS } }, ) } @@ -105,6 +158,7 @@ object GameLinks { val TIERS = listOf("platinum", "gold", "silver", "bronze", "borked") private const val CACHE_MS = 7L * 24 * 3600 * 1000 + private const val BROWSER = "Mozilla/5.0 (Linux; Android 14) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0 Mobile Safari/537.36" } object GuideLibrary { diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BottomArtPanel.kt b/app/src/main/java/com/droiddeck/launcher/ui/BottomArtPanel.kt new file mode 100644 index 0000000000..23d72378ba --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/BottomArtPanel.kt @@ -0,0 +1,115 @@ +package com.droiddeck.launcher.ui + +import androidx.compose.animation.Crossfade +import androidx.compose.animation.core.LinearEasing +import androidx.compose.animation.core.RepeatMode +import androidx.compose.animation.core.animateFloat +import androidx.compose.animation.core.infiniteRepeatable +import androidx.compose.animation.core.rememberInfiniteTransition +import androidx.compose.animation.core.tween +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.BoxWithConstraints +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.widthIn +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Brush +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.graphicsLayer +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.testTag +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 coil.compose.AsyncImage +import com.droiddeck.launcher.R +import com.droiddeck.launcher.agent.AgentGuest +import com.droiddeck.launcher.frontend.Library +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay +import kotlinx.coroutines.isActive +import kotlinx.coroutines.withContext + +private const val ART_POLL_MS = 2_000L +private const val DRIFT_MS = 28_000 + +/** The game's art filling the bottom screen with a slow pan and zoom, for the running game or the one selected in Steam. */ +@Composable +internal fun ArtPanel(runningGame: () -> String?) { + val context = LocalContext.current.applicationContext + var game by remember { mutableStateOf(null) } + var playing by remember { mutableStateOf(false) } + FullScreenChrome() + LaunchedEffect(Unit) { + val games = withContext(Dispatchers.IO) { runCatching { Library.steamGames(context) }.getOrDefault(emptyList()) } + while (isActive) { + val running = runningGame()?.toLongOrNull() + val shown = running ?: withContext(Dispatchers.IO) { runCatching { AgentGuest.selectedSteamAppId(context) }.getOrNull() } + if (shown == null || shown != game?.appId?.toLong()) { + withContext(Dispatchers.IO) { IdleHome.load(context, games, shown) }?.let { game = it } + } + playing = running != null && running == game?.appId?.toLong() + delay(ART_POLL_MS) + } + } + Box(Modifier.fillMaxSize().background(Color.Black).testTag("bottom-art")) { + Crossfade(game, label = "art") { g -> + if (g != null) ArtScene(g, playing) + } + } +} + +@Composable +private fun ArtScene(game: IdleGame, playing: Boolean) { + val drift = rememberInfiniteTransition(label = "drift") + val t by drift.animateFloat(0f, 1f, infiniteRepeatable(tween(DRIFT_MS, easing = LinearEasing), RepeatMode.Reverse), label = "t") + val eased = t * t * (3 - 2 * t) + BoxWithConstraints(Modifier.fillMaxSize()) { + if (game.art != null) AsyncImage( + model = game.art, contentDescription = null, contentScale = ContentScale.Crop, + modifier = Modifier.fillMaxSize().graphicsLayer { + val scale = 1.08f + 0.14f * eased + scaleX = scale + scaleY = scale + translationX = (eased - 0.5f) * size.width * (scale - 1f) + translationY = (0.5f - eased) * size.height * (scale - 1f) * 0.5f + }, + ) + Box( + Modifier.fillMaxSize().background( + Brush.verticalGradient(0.55f to Color.Transparent, 1f to Color.Black.copy(alpha = 0.78f)), + ), + ) + Column(Modifier.align(Alignment.BottomStart).padding(28.dp).fillMaxWidth(0.6f)) { + Text( + stringResource(if (playing) R.string.bottom_art_playing else if (game.highlighted) R.string.bottom_idle_selected + else R.string.bottom_idle_recent).uppercase(), + fontSize = 12.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 1.4.sp, color = Color.White.copy(alpha = 0.7f), + ) + if (game.logo != null) AsyncImage( + model = game.logo, contentDescription = game.name, contentScale = ContentScale.Fit, alignment = Alignment.BottomStart, + modifier = Modifier.padding(top = 10.dp).widthIn(max = 460.dp).height(128.dp), + ) else Text( + game.name, fontSize = 34.sp, fontWeight = FontWeight.Bold, color = Color.White, maxLines = 2, + overflow = TextOverflow.Ellipsis, modifier = Modifier.padding(top = 4.dp), + ) + Text(idleDetails(game), fontSize = 14.sp, color = Color.White.copy(alpha = 0.75f), maxLines = 1, + modifier = Modifier.padding(top = 8.dp)) + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BottomChrome.kt b/app/src/main/java/com/droiddeck/launcher/ui/BottomChrome.kt new file mode 100644 index 0000000000..f4d569fa83 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/BottomChrome.kt @@ -0,0 +1,80 @@ +package com.droiddeck.launcher.ui + +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.clickable +import androidx.compose.foundation.gestures.detectVerticalDragGestures +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.outlined.ExpandMore +import androidx.compose.material3.Icon +import androidx.compose.runtime.Composable +import androidx.compose.runtime.DisposableEffect +import androidx.compose.runtime.mutableIntStateOf +import androidx.compose.runtime.mutableStateOf +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.input.pointer.pointerInput +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.Role +import androidx.compose.ui.semantics.contentDescription +import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.unit.dp +import com.droiddeck.launcher.R + +/** Whether the bottom screen's bar is shown. Panels that need the whole screen ask for it hidden; a pull tab brings it back. */ +internal object BottomChrome { + private val requests = mutableIntStateOf(0) + + /** The user's choice, which wins until a panel's request changes; null follows the requests. */ + private val chosen = mutableStateOf(null) + + val barShown: Boolean get() = chosen.value ?: (requests.intValue == 0) + + fun show(shown: Boolean) { + chosen.value = shown + } + + fun reset() { + chosen.value = null + } + + internal fun request(on: Boolean) { + requests.intValue = (requests.intValue + if (on) 1 else -1).coerceAtLeast(0) + chosen.value = null + } +} + +/** Asks for the bar hidden while this is composed, as art, a page being read or a map being viewed do. */ +@Composable +internal fun FullScreenChrome() { + DisposableEffect(Unit) { + BottomChrome.request(true) + onDispose { BottomChrome.request(false) } + } +} + +/** The tab at the top edge that brings the hidden bar back, by a tap or a pull down. */ +@Composable +internal fun PullTab() { + val description = stringResource(R.string.bottom_bar_show) + val shape = RoundedCornerShape(bottomStart = 14.dp, bottomEnd = 14.dp) + Box(Modifier.fillMaxSize(), contentAlignment = Alignment.TopCenter) { + Box( + contentAlignment = Alignment.Center, + modifier = Modifier.testTag("bottom-pull-tab").size(width = 72.dp, height = 26.dp) + .semantics { contentDescription = description } + .clip(shape).background(Color.Black.copy(alpha = 0.55f)).border(1.dp, Color.White.copy(alpha = 0.14f), shape) + .pointerInput(Unit) { detectVerticalDragGestures { change, drag -> if (drag > 6f) { change.consume(); BottomChrome.show(true) } } } + .clickable(role = Role.Button) { BottomChrome.show(true) }, + ) { + Icon(Icons.Outlined.ExpandMore, contentDescription = null, tint = Color.White.copy(alpha = 0.85f), modifier = Modifier.size(22.dp)) + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BottomGuidesPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/BottomGuidesPage.kt index e4559fa530..2f99e17fd0 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/BottomGuidesPage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/BottomGuidesPage.kt @@ -121,6 +121,7 @@ internal fun GuidesPanel(runningGame: () -> String?) { var cookieHeader by remember(id) { mutableStateOf(null) } var name by remember(id) { mutableStateOf(null) } var openMap by remember(id) { mutableStateOf(null) } + if (reading != null || openMap != null) FullScreenChrome() var libraryRevision by remember(id) { mutableIntStateOf(0) } var note by remember(id) { mutableStateOf(null) } LaunchedEffect(id) { @@ -183,13 +184,13 @@ internal fun GuidesPanel(runningGame: () -> String?) { } PanelColumn { TabStrip(GuideSection.entries.map { stringResource(it.label) }, section.ordinal, { section = GuideSection.entries[it] }, - modifier = Modifier.fillMaxWidth(), compact = true) + modifier = Modifier.fillMaxWidth(), compact = true, centered = true) Column(Modifier.weight(1f).fillMaxWidth().verticalScroll(rememberScrollState())) { when (section) { GuideSection.GUIDES -> GuidesSection(host, list, tag, SteamGuides.place(context, game), onTag = { tag = it }, onOpen = { reading = it }) GuideSection.ACHIEVEMENTS -> AchievementsSection(id) GuideSection.WIKI -> WikiSection(id, name, onOpen = { reading = it }) - GuideSection.MAPS -> MapsSection(game, name, libraryRevision, onOpenMap = { openMap = it }, onOpen = { reading = it }) + GuideSection.MAPS -> MapsSection(id, game, name, libraryRevision, onOpenMap = { openMap = it }, onOpen = { reading = it }) GuideSection.SAVED -> SavedSection(game, libraryRevision, onOpen = { reading = Uri.fromFile(it).toString() }, onDelete = { GuideLibrary.delete(it) libraryRevision++ @@ -233,7 +234,7 @@ private fun WikiSection(appId: Long, name: String?, onOpen: (String) -> Unit) { LaunchedEffect(appId) { val (found, t) = withContext(Dispatchers.IO) { val pending = async { GameLinks.protonTier(appId) } - GameLinks.links(context, appId) to pending.await() + GameLinks.links(context, appId, name) to pending.await() } tier = t links = found @@ -251,20 +252,20 @@ private fun WikiSection(appId: Long, name: String?, onOpen: (String) -> Unit) { } } SettingsGroup(stringResource(R.string.bottom_guides_wiki)) { - for (link in found) PanelRow(stringResource(linkLabel(link.kind)), Uri.parse(link.url).host.orEmpty().removePrefix("www."), + for (link in found.filter { it.kind != GameLinks.Kind.MAPGENIE }) PanelRow(stringResource(linkLabel(link.kind)), Uri.parse(link.url).host.orEmpty().removePrefix("www."), onClick = { onOpen(link.url) }, trailing = { SecondaryButton(open, compact = true, modifier = Modifier.testTag("guides-link-${link.kind.name.lowercase()}")) { onOpen(link.url) } }) } name?.let { n -> SettingsGroup(stringResource(R.string.bottom_guides_search)) { - for (s in GameLinks.searches(n)) PanelRow(stringResource(searchLabel(s.id)), n, onClick = { onOpen(s.url) }, + for (s in GameLinks.searches(n, found)) PanelRow(stringResource(searchLabel(s.id)), n, onClick = { onOpen(s.url) }, trailing = { SecondaryButton(open, compact = true, modifier = Modifier.testTag("guides-search-${s.id}")) { onOpen(s.url) } }) } } } @Composable -private fun MapsSection(game: String, name: String?, revision: Int, onOpenMap: (File) -> Unit, onOpen: (String) -> Unit) { +private fun MapsSection(appId: Long, game: String, name: String?, revision: Int, onOpenMap: (File) -> Unit, onOpen: (String) -> Unit) { val context = LocalContext.current var maps by remember(game) { mutableStateOf>(emptyList()) } LaunchedEffect(game, revision) { maps = withContext(Dispatchers.IO) { GuideLibrary.maps(context, game) } } @@ -281,11 +282,16 @@ private fun MapsSection(game: String, name: String?, revision: Int, onOpenMap: ( ) } } - name?.let { n -> + var mapSite by remember(name) { mutableStateOf(null) } + LaunchedEffect(name) { + if (name != null) mapSite = withContext(Dispatchers.IO) { GameLinks.links(context, appId, name) }.firstOrNull { it.kind == GameLinks.Kind.MAPGENIE } + } + mapSite?.let { link -> val open = stringResource(R.string.store_open) SettingsGroup(stringResource(R.string.bottom_guides_find_maps)) { - for (s in GameLinks.mapSearches(n)) PanelRow(stringResource(searchLabel(s.id)), n, onClick = { onOpen(s.url) }, - trailing = { SecondaryButton(open, compact = true, modifier = Modifier.testTag("guides-maps-${s.id}")) { onOpen(s.url) } }) + PanelRow(stringResource(R.string.bottom_guides_search_mapgenie), Uri.parse(link.url).run { host.orEmpty() + path.orEmpty() }, + onClick = { onOpen(link.url) }, + trailing = { SecondaryButton(open, compact = true, modifier = Modifier.testTag("guides-maps-mapgenie")) { onOpen(link.url) } }) } } } @@ -542,14 +548,12 @@ private fun linkLabel(kind: GameLinks.Kind): Int = when (kind) { GameLinks.Kind.GAMEFAQS -> R.string.bottom_guides_link_gamefaqs GameLinks.Kind.IGN -> R.string.bottom_guides_link_ign GameLinks.Kind.HOWLONGTOBEAT -> R.string.bottom_guides_link_hltb + GameLinks.Kind.MAPGENIE -> R.string.bottom_guides_search_mapgenie } private fun searchLabel(id: String): Int = when (id) { "youtube" -> R.string.bottom_guides_search_youtube - "gamefaqs" -> R.string.bottom_guides_link_gamefaqs - "ign" -> R.string.bottom_guides_link_ign - "mapgenie" -> R.string.bottom_guides_search_mapgenie - else -> R.string.bottom_guides_search_vgmaps + else -> R.string.bottom_guides_link_gamefaqs } private fun tierLabel(tier: String): Int = when (tier) { diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BottomIdleHome.kt b/app/src/main/java/com/droiddeck/launcher/ui/BottomIdleHome.kt index 76b03e1894..87b6d1480f 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/BottomIdleHome.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/BottomIdleHome.kt @@ -2,49 +2,24 @@ package com.droiddeck.launcher.ui import android.content.Context import android.text.format.DateUtils -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue -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.layout.ContentScale import androidx.compose.ui.platform.LocalContext 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 coil.compose.AsyncImage import com.droiddeck.launcher.R -import androidx.compose.ui.platform.testTag -import androidx.compose.material3.MaterialTheme -import androidx.compose.foundation.layout.size -import androidx.compose.foundation.border import com.droiddeck.launcher.agent.AgentGuest import com.droiddeck.launcher.frontend.Library import com.droiddeck.launcher.session.SessionPrefs import com.droiddeck.launcher.session.SteamLocalConfig +import java.io.File import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay import kotlinx.coroutines.isActive import kotlinx.coroutines.withContext -import java.io.File class IdleGame( val appId: Int, @@ -53,6 +28,7 @@ class IdleGame( val playtimeMinutes: Long, val lastPlayed: Long, val highlighted: Boolean, + val logo: File? = null, ) internal object IdleHome { @@ -79,21 +55,21 @@ internal object IdleHome { fun load(context: Context, games: List, selected: Long?): IdleGame? { if (selected != null) overview(context, selected)?.let { o -> val id = selected.toInt() - val art = games.firstOrNull { it.appId == id }?.let { it.hero ?: it.art } ?: runCatching { - Library.steamCacheImage(File(SessionPrefs.activeSteamRoot(context), "appcache/librarycache"), id, - listOf("library_hero.jpg", "library_600x900.jpg", "header.jpg")) + val known = games.firstOrNull { it.appId == id } + val cache = File(SessionPrefs.activeSteamRoot(context), "appcache/librarycache") + val art = known?.let { it.hero ?: it.art } ?: runCatching { + Library.steamCacheImage(cache, id, listOf("library_hero.jpg", "library_600x900.jpg", "header.jpg")) }.getOrNull() - return IdleGame(id, o.name, art, o.minutes, o.lastPlayed, highlighted = true) + val logo = known?.logo ?: runCatching { Library.steamCacheImage(cache, id, Library.STEAM_LOGOS) }.getOrNull() + return IdleGame(id, o.name, art, o.minutes, o.lastPlayed, highlighted = true, logo = logo) } val (game, highlighted) = pick(games, selected) ?: return null val stats = runCatching { SteamLocalConfig.appStats(SessionPrefs.activeSteamRoot(context), game.appId) }.getOrNull() return IdleGame( game.appId, game.name, game.hero ?: game.art, stats?.playtimeMinutes ?: 0L, - maxOf(stats?.lastPlayed ?: 0L, game.lastPlayed), highlighted, + maxOf(stats?.lastPlayed ?: 0L, game.lastPlayed), highlighted, game.logo, ) } - - fun runExpression(appId: Int): String = "SteamClient.Apps.RunGame('$appId', '', -1, 100)" } private const val SELECTION_MS = 2_000L @@ -113,50 +89,7 @@ internal fun rememberShownGame(runningGame: () -> String?): Long? { } @Composable -internal fun BottomIdleHome(modifier: Modifier = Modifier) { - val context = LocalContext.current - var game by remember { mutableStateOf(null) } - LaunchedEffect(Unit) { - val games = withContext(Dispatchers.IO) { runCatching { Library.steamGames(context) }.getOrDefault(emptyList()) } - while (isActive) { - val selected = withContext(Dispatchers.IO) { runCatching { AgentGuest.selectedSteamAppId(context) }.getOrNull() } - val next = withContext(Dispatchers.IO) { IdleHome.load(context, games, selected) } - if (next?.appId != game?.appId || next?.highlighted != game?.highlighted) game = next - delay(SELECTION_MS) - } - } - game?.let { g -> - IdleHomeCard(g, modifier) { - Thread { runCatching { AgentGuest.steamEval(context, IdleHome.runExpression(g.appId), 5_000) } }.start() - } - } -} - -@Composable -internal fun IdleHomeCard(game: IdleGame, modifier: Modifier = Modifier, onPlay: () -> Unit) { - val pal = LocalPalette.current - val colors = MaterialTheme.colorScheme - val shape = RoundedCornerShape(14.dp) - Row( - modifier.fillMaxWidth().clip(shape).background(colors.surface).border(1.dp, pal.line, shape).padding(8.dp), - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.spacedBy(12.dp), - ) { - Box(Modifier.size(width = 112.dp, height = 52.dp).clip(RoundedCornerShape(8.dp)).background(pal.line)) { - if (game.art != null) AsyncImage(model = game.art, contentDescription = null, contentScale = ContentScale.Crop, modifier = Modifier.fillMaxSize()) - } - Column(Modifier.weight(1f)) { - Text(stringResource(if (game.highlighted) R.string.bottom_idle_selected else R.string.bottom_idle_recent).uppercase(), - fontSize = 10.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 1.2.sp, color = colors.onSurfaceVariant) - Text(game.name, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis) - Text(details(game), fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis) - } - SecondaryButton(stringResource(R.string.bottom_idle_play), compact = true, modifier = Modifier.testTag("bottom-idle-play"), onClick = onPlay) - } -} - -@Composable -private fun details(game: IdleGame): String { +internal fun idleDetails(game: IdleGame): String { val hours = game.playtimeMinutes / 60 val played = when { game.playtimeMinutes <= 0 -> stringResource(R.string.bottom_idle_never) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BottomScreenBar.kt b/app/src/main/java/com/droiddeck/launcher/ui/BottomScreenBar.kt index c9f1e27b3f..ecd5aa53a8 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/BottomScreenBar.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/BottomScreenBar.kt @@ -27,6 +27,7 @@ import androidx.compose.material.icons.outlined.Close import androidx.compose.material.icons.outlined.Dashboard import androidx.compose.material.icons.outlined.Extension import androidx.compose.material.icons.outlined.ViewSidebar +import androidx.compose.material.icons.outlined.Wallpaper import androidx.compose.material.icons.outlined.CropFree import androidx.compose.material.icons.outlined.MenuBook import androidx.compose.material.icons.outlined.DesktopAccessDisabled @@ -244,6 +245,7 @@ internal val SecondScreenMode.icon: ImageVector get() = when (this) { SecondScreenMode.MIRROR -> Icons.Outlined.CropFree SecondScreenMode.COMPANION -> Icons.Outlined.Extension SecondScreenMode.STEAM_QAM -> Icons.Outlined.ViewSidebar + SecondScreenMode.ART -> Icons.Outlined.Wallpaper SecondScreenMode.DESKTOP -> Icons.Outlined.DesktopWindows } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BottomSessionPanels.kt b/app/src/main/java/com/droiddeck/launcher/ui/BottomSessionPanels.kt index d50c565e68..ebe4908a1b 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/BottomSessionPanels.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/BottomSessionPanels.kt @@ -37,6 +37,7 @@ internal fun BottomSessionPanel(mode: SecondScreenMode, actions: BottomPageActio SecondScreenMode.MIRROR -> MirrorPanel(actions) SecondScreenMode.COMPANION -> CompanionPanel(actions.runningGame) SecondScreenMode.STEAM_QAM -> SteamQamPanel() + SecondScreenMode.ART -> ArtPanel(actions.runningGame) else -> Unit } } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BottomTelemetryPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/BottomTelemetryPage.kt index 73e67c1039..4c454b52d1 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/BottomTelemetryPage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/BottomTelemetryPage.kt @@ -297,7 +297,6 @@ fun BottomTelemetryPage(fps: () -> Float?, runningGame: () -> String? = { null } BoxWithConstraints(Modifier.fillMaxSize()) { val viewport = maxHeight Column(Modifier.fillMaxSize().verticalScroll(rememberScrollState()), verticalArrangement = Arrangement.spacedBy(10.dp)) { - if (running == null && steamClient != null) BottomIdleHome() if (!hudOn) Unit else if (noData) hudTick.let { perfTick.let { diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt b/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt index 42d48df3f6..6c34f4a5af 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt @@ -16,6 +16,7 @@ import android.widget.FrameLayout import android.widget.LinearLayout import androidx.activity.setViewTreeOnBackPressedDispatcherOwner import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.outlined.ExpandLess import androidx.compose.material.icons.outlined.LightMode import androidx.lifecycle.setViewTreeLifecycleOwner import androidx.lifecycle.setViewTreeViewModelStoreOwner @@ -76,6 +77,7 @@ class SecondScreenPresentation( androidx.compose.ui.platform.ComposeView(context).apply { setContent { DroidDeckTheme { + if (!BottomChrome.barShown && currentMode.hasBar) PullTab() if (brightnessOpen.value) BrightnessDrop(brightness.intValue, ::setBrightness, onScreenOff = { brightnessOpen.value = false; screenOff() }, onDismiss = { brightnessOpen.value = false }) } @@ -146,6 +148,7 @@ class SecondScreenPresentation( if (currentMode == mode && isShowing) return currentMode = mode brightnessOpen.value = false + BottomChrome.reset() if (created) renderMode() } @@ -377,7 +380,7 @@ class SecondScreenPresentation( attachKeyboard() } SecondScreenMode.DASHBOARD -> renderDashboard() - SecondScreenMode.GUIDES, SecondScreenMode.MIRROR, SecondScreenMode.COMPANION, SecondScreenMode.STEAM_QAM -> renderPanel(mode) + SecondScreenMode.GUIDES, SecondScreenMode.MIRROR, SecondScreenMode.COMPANION, SecondScreenMode.STEAM_QAM, SecondScreenMode.ART -> renderPanel(mode) SecondScreenMode.DESKTOP -> { root.addView(BottomDesktopPanel(context, onClose, onMenu, (onSteamMenu to onQam).takeIf { SessionState.mode == SessionService.MODE_STEAM }, onSwap, @@ -392,13 +395,26 @@ class SecondScreenPresentation( private fun bar(mode: SecondScreenMode) { val first = barModel(mode) ?: return - root.addView(bottomScreenBarView(context) { barModel(mode) ?: first }, LinearLayout.LayoutParams(-1, -2)) + root.addView(androidx.compose.ui.platform.ComposeView(context).apply { + setContent { + DroidDeckTheme { + androidx.compose.animation.AnimatedVisibility(BottomChrome.barShown, + enter = androidx.compose.animation.expandVertically(), exit = androidx.compose.animation.shrinkVertically()) { + BottomScreenBar(barModel(mode) ?: first) + } + } + } + }, LinearLayout.LayoutParams(-1, -2)) } internal fun barModel(mode: SecondScreenMode): BottomBarModel? { val extras = listOfNotNull(onSwap?.let { BarExtra(context.getString(R.string.swap_screens), icon = R.drawable.ic_bottom_swap, tag = "bottom-swap", onClick = it) }) + BarExtra(context.getString(R.string.bottom_brightness), vector = Icons.Outlined.LightMode, active = brightnessOpen.value, - tag = "bottom-brightness-toggle", onClick = ::toggleBrightness) + tag = "bottom-brightness-toggle", onClick = ::toggleBrightness) + + BarExtra(context.getString(R.string.bottom_bar_hide), vector = Icons.Outlined.ExpandLess, tag = "bottom-bar-hide") { + brightnessOpen.value = false + BottomChrome.show(false) + } fun model(extras: List, tabs: BarTabs? = null) = sessionBarModel(context.getString(mode.label), onClose, onMenu, onSteamMenu, onQam, extras, tabs, picker?.invoke(mode)) return when (mode) { @@ -412,7 +428,7 @@ class SecondScreenPresentation( tag = "bottom-qam-layout") { QamFit.choose(context, fit.next) }) + extras) } SecondScreenMode.DASHBOARD, SecondScreenMode.CUSTOM_CONTROLS, SecondScreenMode.GUIDES, SecondScreenMode.MIRROR, - SecondScreenMode.COMPANION -> model(extras) + SecondScreenMode.COMPANION, SecondScreenMode.ART -> model(extras) SecondScreenMode.TERMINAL -> model(listOf(BarExtra(context.getString(R.string.drawer_keyboard), icon = R.drawable.ic_bottom_keyboard, tag = "bottom-keyboard") { terminalPanel?.showKeyboard() }) + extras) else -> null @@ -501,3 +517,6 @@ internal enum class BottomScreenLight(val brightness: Float) { fun autoDims(mode: SecondScreenMode) = mode == SecondScreenMode.DASHBOARD } } + +/** Modes drawn with the bottom bar, which the pull tab can bring back. */ +internal val SecondScreenMode.hasBar: Boolean get() = this != SecondScreenMode.NONE && this != SecondScreenMode.MENU && this != SecondScreenMode.DESKTOP diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt b/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt index e9dae8a923..55230927da 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt @@ -1438,7 +1438,7 @@ internal fun secondScreenModes(none: Boolean, deckPad: Boolean, dashboard: Boole (if (none) listOf(SecondScreenMode.NONE) else emptyList()) + listOf(SecondScreenMode.KEYBOARD_TRACKPAD, SecondScreenMode.TERMINAL) + (if (deckPad) listOf(SecondScreenMode.DECK_CONTROLS) else emptyList()) + listOf(SecondScreenMode.CUSTOM_CONTROLS) + (if (dashboard) listOf(SecondScreenMode.DASHBOARD) else emptyList()) + - (if (dashboard && steam) listOf(SecondScreenMode.STEAM_QAM) else emptyList()) + + (if (dashboard && steam) listOf(SecondScreenMode.STEAM_QAM, SecondScreenMode.ART) else emptyList()) + (if (dashboard) listOf(SecondScreenMode.GUIDES, SecondScreenMode.MIRROR, SecondScreenMode.COMPANION) else emptyList()) + (if (desktop) listOf(SecondScreenMode.DESKTOP) else emptyList()) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SettingsWidgets.kt b/app/src/main/java/com/droiddeck/launcher/ui/SettingsWidgets.kt index 977fb98c44..e6bda83fa5 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SettingsWidgets.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SettingsWidgets.kt @@ -170,7 +170,7 @@ internal val LocalRevealChecked = androidx.compose.runtime.compositionLocalOf { internal fun TabStrip( tabs: List, selected: Int, onSelect: (Int) -> Unit, modifier: Modifier = Modifier, focusRequesters: List? = null, - bumpers: Boolean = true, compact: Boolean = false, + bumpers: Boolean = true, compact: Boolean = false, centered: Boolean = false, ) { val colors = MaterialTheme.colorScheme val pal = LocalPalette.current @@ -181,8 +181,9 @@ internal fun TabStrip( val tabPadding = if (compact) 10.dp else if (tight) 10.dp else 16.dp Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp), modifier = modifier) { if (bumpers) BumperKey("LB", stringResource(R.string.widgets_prev_tab)) { onSelect((selected + tabs.size - 1) % tabs.size) } - Row( - modifier = Modifier.weight(1f, fill = false).clip(shape).background(colors.surfaceVariant).border(1.dp, pal.line2, shape) + // Centred, the bumpers sit at the edges and the tabs in the middle, as in the bottom bar. + Box(if (centered) Modifier.weight(1f) else Modifier.weight(1f, fill = false), contentAlignment = Alignment.Center) { Row( + modifier = Modifier.clip(shape).background(colors.surfaceVariant).border(1.dp, pal.line2, shape) .horizontalScroll(scroll).selectableGroup().padding(3.dp), ) { tabs.forEachIndexed { i, label -> @@ -208,7 +209,7 @@ internal fun TabStrip( .padding(horizontal = tabPadding, vertical = if (compact) 6.dp else 12.dp), ) } - } + } } if (bumpers) BumperKey("RB", stringResource(R.string.widgets_next_tab)) { onSelect((selected + 1) % tabs.size) } } } diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index debcfc8de2..5a17285ea4 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -2149,9 +2149,10 @@ العلامة الحمراء هي النقطة التي تُظهر فيها المؤشرات درجة الحرارة باللون الأحمر. الجهاز بالكامل البطارية + صور اللعبة + قيد اللعب محدد في Steam آخر ما لُعب - العب لم يُلعب بعد %1$d دقيقة لعب %1$d ساعة لعب @@ -2177,6 +2178,8 @@ الميكروفون متوقف الميكروفون متوقف لهذه اللعبة. للتحدث، فعِّل «الميكروفون» في إعدادات Steam في DroidDeck (الصوت) وابدأ اللعبة من جديد. مستوى الصوت %1$d%% + إخفاء الشريط + إظهار الشريط سطوع الشاشة السفلية أطفئ الشاشة السفلية الأدلة diff --git a/app/src/main/res/values-b+es+419/strings.xml b/app/src/main/res/values-b+es+419/strings.xml index 7b9d55f8e0..fa2d7aae7a 100644 --- a/app/src/main/res/values-b+es+419/strings.xml +++ b/app/src/main/res/values-b+es+419/strings.xml @@ -2144,9 +2144,10 @@ La marca roja indica el punto donde el HUD muestra la temperatura en rojo. todo el dispositivo batería + Arte del juego + Jugando Seleccionado en Steam Jugado por última vez - Jugar Aún sin jugar %1$d min jugados %1$d h jugadas @@ -2172,6 +2173,8 @@ Micro desactivado El micro está desactivado en este juego. Para hablar, activa Micrófono en los ajustes de Steam de DroidDeck (Audio) y vuelve a iniciar el juego. Volumen %1$d%% + Ocultar barra + Mostrar barra Brillo de la pantalla inferior Apagar la pantalla inferior Guías diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index 9ffddb93f8..53641a9929 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -2049,9 +2049,10 @@ Червената маркировка е мястото, където HUD показва температурата в червено. цялото устройство батерия + Изображения на играта + Играе се Избрано в Steam Последно играна - Играй Още не е играна %1$d мин игра %1$d ч игра @@ -2077,6 +2078,8 @@ Микрофонът е изключен Микрофонът е изключен за тази игра. За да говорите, включете „Микрофон“ в настройките на Steam в DroidDeck (Звук) и стартирайте играта отново. Сила на звука %1$d%% + Скриване на лентата + Показване на лентата Яркост на долния екран Изключи долния екран Ръководства diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 90b60743e6..fc825f98f3 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -2099,9 +2099,10 @@ Červená značka označuje místo, kde HUD zobrazuje teplotu červeně. celé zařízení baterie + Obrázky hry + Hraje se Vybráno ve Steamu Naposledy hráno - Hrát Zatím nehráno Odehráno %1$d min Odehráno %1$d h @@ -2127,6 +2128,8 @@ Mikrofon vypnut Mikrofon je pro tuto hru vypnutý. Chcete-li mluvit, zapněte Mikrofon v nastavení Steamu v DroidDecku (Zvuk) a spusťte hru znovu. Hlasitost %1$d%% + Skrýt lištu + Zobrazit lištu Jas spodní obrazovky Vypnout spodní obrazovku Návody diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 7a41c7406f..decfbbe5f4 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -2049,9 +2049,10 @@ Det røde mærke angiver, hvor HUD viser temperaturen i rødt. hele enheden batteri + Spilgrafik + Spiller Valgt i Steam Senest spillet - Spil Ikke spillet endnu %1$d min spillet %1$d t spillet @@ -2077,6 +2078,8 @@ Mikrofon fra Mikrofonen er slået fra for dette spil. For at tale skal du slå Mikrofon til i DroidDecks Steam-indstillinger (Lyd) og starte spillet igen. Lydstyrke %1$d%% + Skjul bjælke + Vis bjælke Lysstyrke på nederste skærm Sluk den nederste skærm Guides diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 830889f504..ef28848005 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -2041,9 +2041,10 @@ Die rote Markierung kennzeichnet die Stelle, an der das HUD die Temperatur rot anzeigt. ganzes Gerät Akku + Spielgrafik + Wird gespielt In Steam ausgewählt Zuletzt gespielt - Spielen Noch nicht gespielt %1$d Min. gespielt %1$d Std. gespielt @@ -2069,6 +2070,8 @@ Mikro aus Das Mikro ist für dieses Spiel aus. Um zu sprechen, aktiviere „Mikrofon“ in den Steam-Einstellungen von DroidDeck (Audio) und starte das Spiel neu. Lautstärke %1$d%% + Leiste ausblenden + Leiste einblenden Helligkeit des unteren Bildschirms Unteren Bildschirm ausschalten Anleitungen diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index b60ca8b380..780139db12 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -2049,9 +2049,10 @@ Η κόκκινη ένδειξη είναι το σημείο όπου το HUD εμφανίζει τη θερμοκρασία με κόκκινο. ολόκληρη η συσκευή μπαταρία + Εικόνες παιχνιδιού + Παίζεται Επιλεγμένο στο Steam Παίχτηκε τελευταία - Παίξε Δεν έχει παιχτεί %1$d λεπ. παιχνιδιού %1$d ώρ. παιχνιδιού @@ -2077,6 +2078,8 @@ Μικρόφωνο κλειστό Το μικρόφωνο είναι απενεργοποιημένο για αυτό το παιχνίδι. Για να μιλήσετε, ενεργοποιήστε το Μικρόφωνο στις ρυθμίσεις Steam του DroidDeck (Ήχος) και ξεκινήστε ξανά το παιχνίδι. Ένταση %1$d%% + Απόκρυψη γραμμής + Εμφάνιση γραμμής Φωτεινότητα κάτω οθόνης Απενεργοποίηση κάτω οθόνης Οδηγοί diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index ed607bee7f..858bff5155 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -2074,9 +2074,10 @@ La marca roja señala el punto en el que el HUD muestra la temperatura en rojo. todo el dispositivo batería + Arte del juego + Jugando Seleccionado en Steam Jugado por última vez - Jugar Aún sin jugar %1$d min jugados %1$d h jugadas @@ -2102,6 +2103,8 @@ Micro desactivado El micro está desactivado en este juego. Para hablar, activa Micrófono en los ajustes de Steam de DroidDeck (Audio) y vuelve a iniciar el juego. Volumen %1$d%% + Ocultar barra + Mostrar barra Brillo de la pantalla inferior Apagar la pantalla inferior Guías diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 2383705888..1dc776670e 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -2049,9 +2049,10 @@ Punainen merkki on kohta, jossa HUD alkaa näyttää lämpötilan punaisena. koko laite akku + Pelin kuvitus + Pelataan Valittu Steamissä Viimeksi pelattu - Pelaa Ei vielä pelattu Pelattu %1$d min Pelattu %1$d h @@ -2077,6 +2078,8 @@ Mikrofoni pois Mikrofoni on pois päältä tässä pelissä. Jos haluat puhua, kytke Mikrofoni päälle DroidDeckin Steam-asetuksissa (Ääni) ja käynnistä peli uudelleen. Äänenvoimakkuus %1$d %% + Piilota palkki + Näytä palkki Alanäytön kirkkaus Sammuta alanäyttö Oppaat diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index f912e72419..cbecf2402e 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -2073,9 +2073,10 @@ Le repère rouge indique où le HUD affiche la température en rouge. appareil entier batterie + Illustration du jeu + En cours Sélectionné dans Steam Joué récemment - Jouer Pas encore joué %1$d min de jeu %1$d h de jeu @@ -2101,6 +2102,8 @@ Micro désactivé Le micro est désactivé pour ce jeu. Pour parler, activez Microphone dans les paramètres Steam de DroidDeck (Audio), puis relancez le jeu. Volume %1$d %% + Masquer la barre + Afficher la barre Luminosité de l’écran inférieur Éteindre l’écran du bas Guides diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index d48494c3d1..0f8b3ac88b 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -2049,9 +2049,10 @@ लाल निशान वह बिंदु है जहाँ HUD तापमान को लाल रंग में दिखाता है। पूरा डिवाइस बैटरी + गेम आर्ट + खेल रहे हैं Steam में चुना गया पिछली बार खेला - खेलें अभी तक नहीं खेला %1$d मिनट खेला %1$d घंटे खेला @@ -2077,6 +2078,8 @@ माइक बंद इस गेम के लिए माइक बंद है। बात करने के लिए DroidDeck की Steam सेटिंग (ऑडियो) में माइक्रोफ़ोन चालू करें और गेम फिर से शुरू करें। वॉल्यूम %1$d%% + बार छिपाएँ + बार दिखाएँ नीचे की स्क्रीन की चमक नीचे की स्क्रीन बंद करें गाइड diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 7d9b57e085..995333bd23 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -2049,9 +2049,10 @@ A piros jelölés jelzi, hol jeleníti meg pirosan a HUD a hőmérsékletet. teljes eszköz akkumulátor + Játékgrafika + Játékban Kiválasztva a Steamben Legutóbb játszott - Játék Még nem játszott %1$d perc játék %1$d óra játék @@ -2077,6 +2078,8 @@ Mikrofon ki A mikrofon ki van kapcsolva ennél a játéknál. A beszédhez kapcsolja be a Mikrofon opciót a DroidDeck Steam-beállításaiban (Hang), majd indítsa újra a játékot. Hangerő %1$d%% + Sáv elrejtése + Sáv megjelenítése Alsó kijelző fényereje Alsó képernyő kikapcsolása Útmutatók diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 026de6bc50..e7b9abea11 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -2025,9 +2025,10 @@ Tanda merah adalah batas saat HUD menampilkan suhu berwarna merah. seluruh perangkat baterai + Gambar game + Sedang dimainkan Dipilih di Steam Terakhir dimainkan - Main Belum dimainkan %1$d mnt dimainkan %1$d jam dimainkan @@ -2053,6 +2054,8 @@ Mik mati Mik mati untuk gim ini. Untuk berbicara, aktifkan Mikrofon di setelan Steam DroidDeck (Audio) lalu mulai gim lagi. Volume %1$d%% + Sembunyikan bilah + Tampilkan bilah Kecerahan layar bawah Matikan layar bawah Panduan diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index ace521d182..aaf41dc03c 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -2065,9 +2065,10 @@ Il segno rosso indica dove l\'HUD mostra la temperatura in rosso. intero dispositivo batteria + Immagini del gioco + In gioco Selezionato in Steam Giocato di recente - Gioca Non ancora giocato %1$d min di gioco %1$d h di gioco @@ -2093,6 +2094,8 @@ Microfono disattivato Il microfono è disattivato per questo gioco. Per parlare, attiva Microfono nelle impostazioni Steam di DroidDeck (Audio) e riavvia il gioco. Volume %1$d%% + Nascondi barra + Mostra barra Luminosità dello schermo inferiore Spegni lo schermo inferiore Guide diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index a78d2018c1..e076d37572 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -2025,9 +2025,10 @@ 赤いマークは、HUD が温度を赤で表示する位置です。 デバイス全体 バッテリー + ゲームアート + プレイ中 Steam で選択中 最近プレイ - プレイ 未プレイ %1$d 分プレイ %1$d 時間プレイ @@ -2053,6 +2054,8 @@ マイク オフ このゲームではマイクがオフです。話すには、DroidDeckのSteam設定(オーディオ)でマイクをオンにして、ゲームを再起動してください。 音量 %1$d%% + バーを隠す + バーを表示 下画面の明るさ 下の画面をオフにする ガイド diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 811d6b3149..4fbd88fbba 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -2025,9 +2025,10 @@ 빨간색 표시는 HUD가 온도를 빨간색으로 표시하는 지점입니다. 기기 전체 배터리 + 게임 아트 + 플레이 중 Steam에서 선택됨 최근 플레이 - 플레이 아직 플레이 안 함 %1$d분 플레이 %1$d시간 플레이 @@ -2053,6 +2054,8 @@ 마이크 꺼짐 이 게임에서는 마이크가 꺼져 있습니다. 대화하려면 DroidDeck의 Steam 설정(오디오)에서 마이크를 켜고 게임을 다시 시작하세요. 볼륨 %1$d%% + 막대 숨기기 + 막대 표시 아래쪽 화면 밝기 아래 화면 끄기 가이드 diff --git a/app/src/main/res/values-ms/strings.xml b/app/src/main/res/values-ms/strings.xml index 5055e7bed1..ea2e7e3f30 100644 --- a/app/src/main/res/values-ms/strings.xml +++ b/app/src/main/res/values-ms/strings.xml @@ -2025,9 +2025,10 @@ Tanda merah ialah tempat HUD memaparkan suhu dalam warna merah. seluruh peranti bateri + Seni permainan + Sedang dimainkan Dipilih dalam Steam Terakhir dimainkan - Main Belum dimainkan %1$d min dimainkan %1$d jam dimainkan @@ -2053,6 +2054,8 @@ Mikrofon mati Mikrofon dimatikan untuk permainan ini. Untuk bercakap, hidupkan Mikrofon dalam tetapan Steam DroidDeck (Audio) dan mulakan permainan semula. Kelantangan %1$d%% + Sembunyikan bar + Tunjukkan bar Kecerahan skrin bawah Matikan skrin bawah Panduan diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index bd3b2b41ca..bd0784c78d 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -2049,9 +2049,10 @@ Den røde markeringen er der HUD-en viser temperaturen i rødt. hele enheten batteri + Spillgrafikk + Spiller Valgt i Steam Sist spilt - Spill Ikke spilt ennå %1$d min spilt %1$d t spilt @@ -2077,6 +2078,8 @@ Mikrofon av Mikrofonen er av for dette spillet. For å snakke, slå på Mikrofon i DroidDecks Steam-innstillinger (Lyd) og start spillet på nytt. Volum %1$d%% + Skjul linjen + Vis linjen Lysstyrke på nedre skjerm Slå av den nederste skjermen Guider diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 25025094db..d44d14132f 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -2049,9 +2049,10 @@ De rode markering is het punt waarop de HUD de temperatuur in het rood weergeeft. hele apparaat accu + Game-afbeelding + Speelt Geselecteerd in Steam Laatst gespeeld - Spelen Nog niet gespeeld %1$d min gespeeld %1$d u gespeeld @@ -2077,6 +2078,8 @@ Microfoon uit De microfoon staat uit voor deze game. Zet Microfoon aan in de Steam-instellingen van DroidDeck (Audio) en start de game opnieuw om te praten. Volume %1$d%% + Balk verbergen + Balk tonen Helderheid van het onderste scherm Onderste scherm uitzetten Handleidingen diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index c6681a7a0c..d1d647e328 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -2099,9 +2099,10 @@ Czerwony znacznik wskazuje temperaturę, od której HUD wyświetla ją na czerwono. całe urządzenie bateria + Grafika gry + W grze Wybrano w Steam Ostatnio grane - Graj Jeszcze nie grano %1$d min gry %1$d godz. gry @@ -2127,6 +2128,8 @@ Mikrofon wył. Mikrofon jest wyłączony dla tej gry. Aby rozmawiać, włącz Mikrofon w ustawieniach Steam w DroidDeck (Dźwięk) i uruchom grę ponownie. Głośność %1$d%% + Ukryj pasek + Pokaż pasek Jasność dolnego ekranu Wyłącz dolny ekran Poradniki diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index f1fe7fc907..9c7a1aa0b2 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -2079,9 +2079,10 @@ A marca vermelha é o ponto em que o HUD mostra a temperatura a vermelho. todo o dispositivo bateria + Arte do jogo + A jogar Selecionado no Steam Jogado por último - Jogar Ainda não jogado %1$d min jogados %1$d h jogadas @@ -2107,6 +2108,8 @@ Microfone desligado O microfone está desligado neste jogo. Para falar, ative Microfone nas definições do Steam do DroidDeck (Áudio) e volte a iniciar o jogo. Volume %1$d%% + Ocultar barra + Mostrar barra Brilho do ecrã inferior Desligar o ecrã inferior Guias diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index bbb61fae65..c160ae8c99 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -2087,9 +2087,10 @@ A marca vermelha indica onde o HUD mostra a temperatura em vermelho. dispositivo inteiro bateria + Arte do jogo + Jogando Selecionado no Steam Jogado por último - Jogar Ainda não jogado %1$d min jogados %1$d h jogadas @@ -2115,6 +2116,8 @@ Microfone desligado O microfone está desligado neste jogo. Para falar, ative Microfone nas configurações da Steam do DroidDeck (Áudio) e inicie o jogo de novo. Volume %1$d%% + Ocultar barra + Mostrar barra Brilho da tela inferior Desligar a tela inferior Guias diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index e9b22d73b6..17c12b8b85 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -2074,9 +2074,10 @@ Marcajul roșu indică locul în care HUD-ul afișează temperatura în roșu. tot dispozitivul baterie + Imagini din joc + Se joacă Selectat în Steam Jucat ultima dată - Joacă Nejucat încă %1$d min jucate %1$d h jucate @@ -2102,6 +2103,8 @@ Microfon oprit Microfonul este oprit pentru acest joc. Pentru a vorbi, activează Microfon în setările Steam din DroidDeck (Sunet) și pornește din nou jocul. Volum %1$d%% + Ascunde bara + Afișează bara Luminozitatea ecranului de jos Oprește ecranul de jos Ghiduri diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index fc304ed493..8564773077 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -2100,9 +2100,10 @@ Красная отметка — температура, с которой HUD показывает значение красным. все устройство батарея + Обложка игры + Идёт игра Выбрано в Steam Последняя игра - Играть Ещё не запускалась Сыграно %1$d мин Сыграно %1$d ч @@ -2128,6 +2129,8 @@ Микрофон выкл. Микрофон для этой игры выключен. Чтобы говорить, включите «Микрофон» в настройках Steam в DroidDeck (Аудио) и запустите игру снова. Громкость %1$d%% + Скрыть панель + Показать панель Яркость нижнего экрана Выключить нижний экран Руководства diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index dd4ea35072..48e53c3473 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -2049,9 +2049,10 @@ Det röda märket är där HUD:en visar temperaturen i rött. hela enheten batteri + Spelgrafik + Spelar Vald i Steam Senast spelad - Spela Inte spelad än %1$d min spelat %1$d tim spelat @@ -2077,6 +2078,8 @@ Mikrofon av Mikrofonen är avstängd för det här spelet. Slå på Mikrofon i DroidDecks Steam-inställningar (Ljud) och starta spelet igen för att prata. Volym %1$d%% + Dölj fältet + Visa fältet Ljusstyrka för nedre skärmen Stäng av den nedre skärmen Guider diff --git a/app/src/main/res/values-th/strings.xml b/app/src/main/res/values-th/strings.xml index a68ac07c33..5308ba2d9e 100644 --- a/app/src/main/res/values-th/strings.xml +++ b/app/src/main/res/values-th/strings.xml @@ -2025,9 +2025,10 @@ ขีดสีแดงคือจุดที่ HUD แสดงอุณหภูมิเป็นสีแดง ทั้งเครื่อง แบตเตอรี่ + ภาพเกม + กำลังเล่น เลือกใน Steam เล่นล่าสุด - เล่น ยังไม่ได้เล่น เล่นแล้ว %1$d นาที เล่นแล้ว %1$d ชม. @@ -2053,6 +2054,8 @@ ไมค์ปิด ไมค์ปิดอยู่สำหรับเกมนี้ หากต้องการพูด ให้เปิดไมโครโฟนในการตั้งค่า Steam ของ DroidDeck (เสียง) แล้วเริ่มเกมอีกครั้ง ระดับเสียง %1$d%% + ซ่อนแถบ + แสดงแถบ ความสว่างของหน้าจอล่าง ปิดหน้าจอล่าง คู่มือ diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 2f5d99f447..8ff7b3d952 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -2041,9 +2041,10 @@ Kırmızı işaret, sıcaklığın HUD üzerinde kırmızı göründüğü yerdir. tüm cihaz pil + Oyun görseli + Oynanıyor Steam\'de seçili Son oynanan - Oyna Henüz oynanmadı %1$d dk oynandı %1$d sa oynandı @@ -2069,6 +2070,8 @@ Mikrofon kapalı Bu oyun için mikrofon kapalı. Konuşmak için DroidDeck\'in Steam ayarlarında (Ses) Mikrofon\'u açın ve oyunu yeniden başlatın. Ses düzeyi %1$d%% + Çubuğu gizle + Çubuğu göster Alt ekran parlaklığı Alt ekranı kapat Rehberler diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 654e0b2688..60d0a73c45 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -2099,9 +2099,10 @@ Червона позначка — це поріг, після якого HUD показує температуру червоним. весь пристрій акумулятор + Обкладинка гри + Триває гра Вибрано в Steam Остання гра - Грати Ще не запускалася Зіграно %1$d хв Зіграно %1$d год @@ -2127,6 +2128,8 @@ Мікрофон вимкнено Для цієї гри мікрофон вимкнено. Щоб говорити, увімкніть «Мікрофон» у налаштуваннях Steam у DroidDeck (Звук) і запустіть гру знову. Гучність %1$d%% + Сховати панель + Показати панель Яскравість нижнього екрана Вимкнути нижній екран Посібники diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 44908ec85e..2db3936346 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -2025,9 +2025,10 @@ Vạch đỏ là vị trí HUD hiển thị nhiệt độ bằng màu đỏ. toàn thiết bị pin + Hình ảnh trò chơi + Đang chơi Đã chọn trong Steam Chơi gần đây - Chơi Chưa chơi Đã chơi %1$d phút Đã chơi %1$d giờ @@ -2053,6 +2054,8 @@ Micro tắt Micro đang tắt cho game này. Để nói chuyện, hãy bật Micro trong thiết lập Steam của DroidDeck (Âm thanh) rồi khởi động lại game. Âm lượng %1$d%% + Ẩn thanh + Hiện thanh Độ sáng màn hình dưới Tắt màn hình dưới Hướng dẫn diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 6f6b78da7f..a7869d7fbf 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -2102,9 +2102,10 @@ 红色标记处,HUD 会以红色显示温度。 整机 电池 + 游戏插图 + 正在游玩 在 Steam 中选中 最近玩过 - 开始游戏 尚未玩过 已玩 %1$d 分钟 已玩 %1$d 小时 @@ -2130,6 +2131,8 @@ 麦克风已关 此游戏的麦克风已关闭。如需语音通话,请在 DroidDeck 的 Steam 设置(音频)中开启麦克风,然后重新启动游戏。 音量 %1$d%% + 隐藏栏 + 显示栏 下屏幕亮度 关闭下屏 指南 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 7950f4bb40..77c605964c 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -2024,9 +2024,10 @@ 紅色標記是 HUD 將溫度顯示為紅色的界線。 整機 電池 + 遊戲美術 + 遊玩中 在 Steam 中選取 最近玩過 - 開始遊戲 尚未玩過 已玩 %1$d 分鐘 已玩 %1$d 小時 @@ -2052,6 +2053,8 @@ 麥克風已關閉 此遊戲的麥克風已關閉。若要說話,請在 DroidDeck 的 Steam 設定(音訊)中開啟麥克風,然後重新啟動遊戲。 音量 %1$d%% + 隱藏列 + 顯示列 下方螢幕亮度 關閉下螢幕 指南 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 7eca8f9652..9ae9247277 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -2024,9 +2024,10 @@ 紅色標記是 HUD 將溫度顯示為紅色的位置。 整台裝置 電池 + 遊戲美術 + 遊玩中 在 Steam 中選取 最近玩過 - 開始遊戲 尚未玩過 已玩 %1$d 分鐘 已玩 %1$d 小時 @@ -2052,6 +2053,8 @@ 麥克風已關閉 此遊戲的麥克風已關閉。若要說話,請在 DroidDeck 的 Steam 設定(音訊)中開啟麥克風,然後重新啟動遊戲。 音量 %1$d%% + 隱藏列 + 顯示列 下方螢幕亮度 關閉下螢幕 指南 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5961f75760..172e8ede8b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2319,9 +2319,10 @@ The red mark is where the HUD shows the temperature in red. whole device battery + Game art + Playing Selected in Steam Last played - Play Not played yet %1$d min played %1$d h played @@ -2348,6 +2349,8 @@ Mic off Mic is off for this game. To talk, turn on Microphone in DroidDeck\'s Steam settings (Audio) and start the game again. Volume %1$d%% + Hide bar + Show bar Bottom screen brightness Turn off the bottom screen Guides @@ -2406,7 +2409,6 @@ IGN HowLongToBeat Map Genie - VGMaps Platinum Gold Silver diff --git a/app/src/test/java/com/droiddeck/launcher/input/SecondScreenModeTest.kt b/app/src/test/java/com/droiddeck/launcher/input/SecondScreenModeTest.kt index a8e21929f6..dc93a5591a 100644 --- a/app/src/test/java/com/droiddeck/launcher/input/SecondScreenModeTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/input/SecondScreenModeTest.kt @@ -105,6 +105,12 @@ class SecondScreenModeTest { assertEquals(SecondScreenMode.MENU, SecondScreenMode.opening("steam-qam", deckPad = true, steam = true)) } + @Test fun gameArtOpensAgainOnlyInASteamSession() { + assertEquals(SecondScreenMode.ART, SecondScreenMode.opening("art", deckPad = true, dashboard = true, steam = true)) + assertEquals(SecondScreenMode.MENU, SecondScreenMode.opening("art", deckPad = true, dashboard = true)) + assertTrue(SecondScreenMode.ART.sessionPanel) + } + @Test fun theDesktopOpensAgainOnlyWhileItCanRun() { assertEquals(SecondScreenMode.DESKTOP, SecondScreenMode.opening("desktop", deckPad = true, dashboard = true, bottomDesktop = true)) assertEquals(SecondScreenMode.MENU, SecondScreenMode.opening("desktop", deckPad = true, dashboard = true)) diff --git a/app/src/test/java/com/droiddeck/launcher/session/GameLinksTest.kt b/app/src/test/java/com/droiddeck/launcher/session/GameLinksTest.kt index 8bf8b3f80d..d98cd898e8 100644 --- a/app/src/test/java/com/droiddeck/launcher/session/GameLinksTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/session/GameLinksTest.kt @@ -47,10 +47,54 @@ class GameLinksTest { } @Test - fun searchesEncodeTheName() { - val youtube = GameLinks.searches("Arcade Paradise").first { it.id == "youtube" }.url + fun searchesStayOnTheSitesAndSkipGameFaqsWhenItHasAPage() { + val youtube = GameLinks.searches("Arcade Paradise", emptyList()).first { it.id == "youtube" }.url assertEquals("https://m.youtube.com/results?search_query=Arcade+Paradise+walkthrough", youtube) - assertTrue(GameLinks.mapSearches("Elden Ring").all { it.url.startsWith("https://duckduckgo.com/html/?q=site%3A") }) + assertTrue(GameLinks.searches("Bully", emptyList()).none { "duckduckgo" in it.url }) + val faqs = GameLinks.Link(GameLinks.Kind.GAMEFAQS, "https://gamefaqs.gamespot.com/-/1-") + assertEquals(listOf("youtube"), GameLinks.searches("Bully", listOf(faqs)).map { it.id }) + } + + @Test + fun slugsTryTheFullNameThenTheShortOne() { + assertEquals(listOf("bully-scholarship-edition", "bully"), GameLinks.slugs("Bully: Scholarship Edition")) + assertEquals(listOf("sonic-mania"), GameLinks.slugs("Sonic Mania")) + assertEquals(listOf("tom-clancys-the-division-2"), GameLinks.slugs("Tom Clancy’s The Division 2")) + assertEquals(listOf("hotline-miami"), GameLinks.slugs("Hotline Miami™")) + } + + @Test + fun directPagesComeFromTheSitesOwnRoutes() { + val live = setOf("https://mapgenie.io/bully", "https://www.ign.com/wikis/bully", "https://bully.fandom.com/api.php?action=query&meta=siteinfo&format=json") + val found = GameLinks.direct("Bully: Scholarship Edition", + listOf(GameLinks.Link(GameLinks.Kind.IGN, "https://www.ign.com/games/bully-scholarship-edition")), + exists = { it in live }, strategyWiki = { if (it == "Bully") "https://strategywiki.org/wiki/Bully" else null }) + assertEquals(mapOf( + GameLinks.Kind.MAPGENIE to "https://mapgenie.io/bully", + GameLinks.Kind.IGN to "https://www.ign.com/wikis/bully", + GameLinks.Kind.WIKI to "https://bully.fandom.com/", + GameLinks.Kind.STRATEGYWIKI to "https://strategywiki.org/wiki/Bully", + ), found.associate { it.kind to it.url }) + assertTrue(found.none { "duckduckgo" in it.url }) + } + + @Test + fun aMissingSiteLeavesWikidataLinksAlone() { + val ign = GameLinks.Link(GameLinks.Kind.IGN, "https://www.ign.com/games/x") + assertEquals(listOf(ign), GameLinks.direct("X", listOf(ign), exists = { false }, strategyWiki = { null })) + } + + @Test + fun openSearchPicksTheExactTitle() { + val json = """["Bully",["Bully's Sporting Darts","Bully"],["",""],["https://strategywiki.org/wiki/Bully%27s_Sporting_Darts","https://strategywiki.org/wiki/Bully"]]""" + assertEquals("https://strategywiki.org/wiki/Bully", GameLinks.parseOpenSearch(json, "Bully")) + assertNull(GameLinks.parseOpenSearch(json, "Canis Canem Edit")) + } + + @Test + fun cachedLinksRoundTrip() { + val links = listOf(GameLinks.Link(GameLinks.Kind.MAPGENIE, "https://mapgenie.io/bully")) + assertEquals(links, GameLinks.readLinks(GameLinks.writeLinks(links))) } @Test diff --git a/app/src/test/java/com/droiddeck/launcher/ui/BottomChromeTest.kt b/app/src/test/java/com/droiddeck/launcher/ui/BottomChromeTest.kt new file mode 100644 index 0000000000..26d51288fa --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/ui/BottomChromeTest.kt @@ -0,0 +1,36 @@ +package com.droiddeck.launcher.ui + +import org.junit.After +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Test + +class BottomChromeTest { + @After fun clear() { + BottomChrome.reset() + } + + @Test fun aFullScreenPanelHidesTheBarAndThePullTabBringsItBack() { + assertTrue(BottomChrome.barShown) + BottomChrome.request(true) + assertFalse(BottomChrome.barShown) + BottomChrome.show(true) + assertTrue(BottomChrome.barShown) + BottomChrome.request(false) + assertTrue(BottomChrome.barShown) + } + + @Test fun hidingByHandLastsUntilAPanelChangesItsRequest() { + BottomChrome.show(false) + assertFalse(BottomChrome.barShown) + BottomChrome.request(true) + BottomChrome.request(false) + assertTrue(BottomChrome.barShown) + } + + @Test fun moreReleasesThanRequestsNeverHideTheBarForGood() { + BottomChrome.request(false) + BottomChrome.request(false) + assertTrue(BottomChrome.barShown) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/ui/SecondScreenBarTest.kt b/app/src/test/java/com/droiddeck/launcher/ui/SecondScreenBarTest.kt index 2601d3a78a..2239382b37 100644 --- a/app/src/test/java/com/droiddeck/launcher/ui/SecondScreenBarTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/ui/SecondScreenBarTest.kt @@ -112,13 +112,13 @@ class SecondScreenBarTest { assertEquals(context.getString(R.string.second_mode_keyboard_trackpad), bar.title) assertNotNull(bar.onClose); assertNotNull(bar.onMenu); assertNotNull(bar.onSteam); assertNotNull(bar.onQam) assertNull(bar.tabs) - assertEquals(listOf("bottom-keyboard", "bottom-swap", "bottom-brightness-toggle"), bar.extras.map { it.tag }) + assertEquals(listOf("bottom-keyboard", "bottom-swap", "bottom-brightness-toggle", "bottom-bar-hide"), bar.extras.map { it.tag }) val keyboard = bar.extras.first() assertEquals(context.getString(R.string.second_show_keyboard), keyboard.description) assertFalse(keyboard.active) bar.extras.first { it.tag == "bottom-swap" }.onClick() assertEquals(1, swaps) - assertEquals(listOf("bottom-keyboard", "bottom-swap", "bottom-brightness-toggle"), panel.barModel(SecondScreenMode.TERMINAL)!!.extras.map { it.tag }) + assertEquals(listOf("bottom-keyboard", "bottom-swap", "bottom-brightness-toggle", "bottom-bar-hide"), panel.barModel(SecondScreenMode.TERMINAL)!!.extras.map { it.tag }) ReflectionHelpers.getField>(panel, "keyboardShown").value = true val shown = panel.barModel(SecondScreenMode.KEYBOARD_TRACKPAD)!!.extras.first() assertEquals(context.getString(R.string.second_hide_keyboard), shown.description) @@ -137,7 +137,7 @@ class SecondScreenBarTest { assertTrue(rootChildren(panel)[0] is ComposeView) val bar = panel.barModel(SecondScreenMode.DECK_CONTROLS)!! assertEquals(context.getString(R.string.second_mode_deck_controls), bar.title) - assertEquals(listOf(context.getString(R.string.swap_screens), context.getString(R.string.bottom_brightness)), bar.extras.map { it.description }) + assertEquals(listOf(context.getString(R.string.swap_screens), context.getString(R.string.bottom_brightness), context.getString(R.string.bottom_bar_hide)), bar.extras.map { it.description }) bar.extras.first { it.tag == "bottom-swap" }.onClick() assertEquals(1, swaps) assertEquals(DeckPanel.entries.map { context.getString(it.label) }, bar.tabs!!.labels) @@ -145,7 +145,7 @@ class SecondScreenBarTest { panel.showMode(SecondScreenMode.CUSTOM_CONTROLS) val profile = panel.barModel(SecondScreenMode.CUSTOM_CONTROLS)!! assertEquals(context.getString(R.string.input_profile_controls_mode), profile.title) - assertEquals(listOf(context.getString(R.string.swap_screens), context.getString(R.string.bottom_brightness)), profile.extras.map { it.description }) + assertEquals(listOf(context.getString(R.string.swap_screens), context.getString(R.string.bottom_brightness), context.getString(R.string.bottom_bar_hide)), profile.extras.map { it.description }) assertNotNull(profile.onClose); assertNotNull(profile.onMenu) profile.extras.first { it.tag == "bottom-swap" }.onClick() assertEquals(2, swaps) @@ -156,9 +156,9 @@ class SecondScreenBarTest { try { noSwap.show() noSwap.showMode(SecondScreenMode.DECK_CONTROLS) - assertEquals(listOf("bottom-brightness-toggle"), noSwap.barModel(SecondScreenMode.DECK_CONTROLS)!!.extras.map { it.tag }) - assertEquals(listOf("bottom-keyboard", "bottom-brightness-toggle"), noSwap.barModel(SecondScreenMode.TERMINAL)!!.extras.map { it.tag }) - assertEquals(listOf("bottom-keyboard", "bottom-brightness-toggle"), noSwap.barModel(SecondScreenMode.KEYBOARD_TRACKPAD)!!.extras.map { it.tag }) + assertEquals(listOf("bottom-brightness-toggle", "bottom-bar-hide"), noSwap.barModel(SecondScreenMode.DECK_CONTROLS)!!.extras.map { it.tag }) + assertEquals(listOf("bottom-keyboard", "bottom-brightness-toggle", "bottom-bar-hide"), noSwap.barModel(SecondScreenMode.TERMINAL)!!.extras.map { it.tag }) + assertEquals(listOf("bottom-keyboard", "bottom-brightness-toggle", "bottom-bar-hide"), noSwap.barModel(SecondScreenMode.KEYBOARD_TRACKPAD)!!.extras.map { it.tag }) } finally { noSwap.closeControls() } } diff --git a/docs/development/bottom-screen.md b/docs/development/bottom-screen.md index 984c7f9797..9811257675 100644 --- a/docs/development/bottom-screen.md +++ b/docs/development/bottom-screen.md @@ -98,7 +98,9 @@ Ordered by value for effort. Each is independent unless noted. ### 1. Idle home page -**Status:** first version built and checked on a Retroid Pocket Duo Lite Plus. With no game running, the In-game stats page starts with one compact row for the game selected in Big Picture (art, name, play time, last played, Play), read from Steam's `appStore` overview, or the most recently played installed game. The performance HUD stays below it. Code: [`ui/BottomIdleHome.kt`](../../app/src/main/java/com/droiddeck/launcher/ui/BottomIdleHome.kt). +**Status:** built as its own panel, Game art (Steam sessions), after a first version as a row on the dashboard was removed. The bottom screen shows the hero art of the running game, or the one selected in Big Picture, or the most recently played, with a slow pan and zoom, its logo, and play time; it cross-fades when the selection changes and starts with the bar hidden. Checked on a Retroid Pocket Duo Lite Plus. Code: [`ui/BottomArtPanel.kt`](../../app/src/main/java/com/droiddeck/launcher/ui/BottomArtPanel.kt), selection in [`ui/BottomIdleHome.kt`](../../app/src/main/java/com/droiddeck/launcher/ui/BottomIdleHome.kt). + +![](evidence/bottom-screen-art-2026-11-27.png) When no game is focused, replace the Steam-client FPS card with a page about the game highlighted in Steam: art, play time, last played, achievement progress, and Play / Stream buttons. Add downloads in progress and friends online. @@ -133,12 +135,18 @@ Rearrangeable tiles on the dashboard: FPS limit, 60/120 Hz, per-screen brightnes ### 5. Bottom screen off and auto-dim -**Status:** built and checked on a Retroid Pocket Duo Lite Plus, where the window brightness override is per display: screen off sets the bottom display to 0.0 and auto-dim to 0.05 (`mBrightnessReason=override(com.droiddeck.launcher)`), while the top display stays at the user's manual level. Every panel's bar has a screen-off button: the panel goes black and asks for the lowest window brightness (`BRIGHTNESS_OVERRIDE_OFF`); a touch wakes it. The dashboard dims after 60 s without touch (pref `bottomAutoDim`, on by default); trackpad and keyboard panels never dim. Hardware buttons are not claimed. +**Status:** built and checked on a Retroid Pocket Duo Lite Plus, where the window brightness override is per display: screen off sets the bottom display to 0.0 and auto-dim to 0.05 (`mBrightnessReason=override(com.droiddeck.launcher)`), while the top display stays at the user's manual level. Every panel's bar has a sun button that drops down a brightness slider for the bottom screen only (5–100 %, saved; it never reaches 0) with the screen-off button at its end: the panel goes black and asks for the lowest window brightness (`BRIGHTNESS_OVERRIDE_OFF`); a touch wakes it to the chosen level, and the waking touch does not reach the panel. Auto-dim never brightens a level set below it. The dashboard dims after 60 s without touch (pref `bottomAutoDim`, on by default); trackpad and keyboard panels never dim. Hardware buttons are not claimed. - A real off state for the bottom panel during a game (the backlight off, not a black Presentation), toggled from the bar or a button hold. - Dim after a period without touch, wake on touch. Off by default for the trackpad and keyboard modes. - Investigate which hardware buttons we can claim on the Thor and Duo without fighting the stock assistant. +**Bar:** every panel's bar can be hidden with its chevron button; a pull tab at the top edge brings it back by a tap or a pull down. Game art, a page open in the Guides reader and a pinned map hide it on their own, and leaving them shows it again. + +| Brightness | Bar hidden | +| --- | --- | +| ![](evidence/bottom-screen-brightness-2026-11-27.png) | ![](evidence/bottom-screen-bar-hidden-2026-11-27.png) | + ### 6. Region mirror from our compositor **Status:** milestone 1 built as its own bottom-screen panel (Mirror in the panel picker): the live region on the left, and Region, Top screen (shown, hidden or dimmed) and Scaling as settings rows on the right. Checked on a Retroid Pocket Duo Lite Plus; see the region mirror doc. @@ -149,7 +157,7 @@ Details: [bottom-screen-region-mirror.md](bottom-screen-region-mirror.md). ### 7. Guides panel -**Status:** milestones 1 and 4 built as their own bottom-screen panel (Guides in the panel picker), checked on a Retroid Pocket Duo Lite Plus. Five sections, switched with the app's tab strip and LB/RB, for the running game or the one selected in Steam: Guides (top-rated Steam guides in the device's language with a category choice and Continue reading), Achievements, Wiki & fixes (ProtonDB tier, and the wiki, StrategyWiki, PCGamingWiki, GameFAQs, IGN and HowLongToBeat through Wikidata, plus web searches), Maps (images pinned by long-press, with zoom and markers per map) and Saved (web archives for offline reading). The reader never takes focus, blocks common ad hosts and stays on the opened site unless the user follows a link. Code: [`session/SteamGuides.kt`](../../app/src/main/java/com/droiddeck/launcher/session/SteamGuides.kt), [`session/GameLinks.kt`](../../app/src/main/java/com/droiddeck/launcher/session/GameLinks.kt), [`ui/BottomGuidesPage.kt`](../../app/src/main/java/com/droiddeck/launcher/ui/BottomGuidesPage.kt). +**Status:** milestones 1 and 4 built as their own bottom-screen panel (Guides in the panel picker), checked on a Retroid Pocket Duo Lite Plus. Five sections, switched with the app's tab strip and LB/RB, for the running game or the one selected in Steam: Guides (top-rated Steam guides in the device's language with a category choice and Continue reading), Achievements, Wiki & fixes (ProtonDB tier, and the wiki, StrategyWiki, PCGamingWiki, GameFAQs, IGN and HowLongToBeat through Wikidata; what Wikidata lacks is found from each site's own routes, such as Map Genie and IGN wiki slugs, Fandom's API and StrategyWiki's search API, so every row opens the page itself rather than a web search; only YouTube walkthroughs stay a search), Maps (images pinned by long-press, with zoom and markers per map, and the game's Map Genie page) and Saved (web archives for offline reading). The reader never takes focus, blocks common ad hosts and stays on the opened site unless the user follows a link. Code: [`session/SteamGuides.kt`](../../app/src/main/java/com/droiddeck/launcher/session/SteamGuides.kt), [`session/GameLinks.kt`](../../app/src/main/java/com/droiddeck/launcher/session/GameLinks.kt), [`ui/BottomGuidesPage.kt`](../../app/src/main/java/com/droiddeck/launcher/ui/BottomGuidesPage.kt). A per-game tab with Steam Community guides for the exact app id, Steam achievements as a spoiler-safe checklist, the game's wiki and fixes (found through Wikidata), saved pages for offline use, and a workspace that reopens at the last section. It must never take focus from the game, and pauses pages it is not showing. diff --git a/docs/development/evidence/bottom-screen-art-2026-11-27.png b/docs/development/evidence/bottom-screen-art-2026-11-27.png new file mode 100644 index 0000000000..32e8572364 Binary files /dev/null and b/docs/development/evidence/bottom-screen-art-2026-11-27.png differ diff --git a/docs/development/evidence/bottom-screen-bar-hidden-2026-11-27.png b/docs/development/evidence/bottom-screen-bar-hidden-2026-11-27.png new file mode 100644 index 0000000000..55f04e1779 Binary files /dev/null and b/docs/development/evidence/bottom-screen-bar-hidden-2026-11-27.png differ diff --git a/docs/development/evidence/bottom-screen-brightness-2026-11-27.png b/docs/development/evidence/bottom-screen-brightness-2026-11-27.png new file mode 100644 index 0000000000..7cd71288e4 Binary files /dev/null and b/docs/development/evidence/bottom-screen-brightness-2026-11-27.png differ diff --git a/docs/development/evidence/bottom-screen-guides-bottom-2026-11-27.png b/docs/development/evidence/bottom-screen-guides-bottom-2026-11-27.png index c43f23e012..8d056b9acd 100644 Binary files a/docs/development/evidence/bottom-screen-guides-bottom-2026-11-27.png and b/docs/development/evidence/bottom-screen-guides-bottom-2026-11-27.png differ diff --git a/docs/development/evidence/bottom-screen-guides-maps-bottom-2026-11-27.png b/docs/development/evidence/bottom-screen-guides-maps-bottom-2026-11-27.png index 30f1a0203d..8af6fc61ae 100644 Binary files a/docs/development/evidence/bottom-screen-guides-maps-bottom-2026-11-27.png and b/docs/development/evidence/bottom-screen-guides-maps-bottom-2026-11-27.png differ