From 65b414df93874777cfcb1f063dc5487386d97088 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Sun, 1 Nov 2026 01:26:30 -0400 Subject: [PATCH] feat: Strip HUD size, a one-line bar across the top or bottom edge (#1935) --- .../launcher/hud/DroidDeckHudHost.kt | 3 +- .../launcher/hud/DroidDeckHudModels.kt | 7 +- .../launcher/hud/DroidDeckHudView.kt | 113 +++++++++++++++++- .../launcher/ui/DroidDeckHudSettings.kt | 4 +- app/src/main/res/values-ar/strings.xml | 1 + app/src/main/res/values-b+es+419/strings.xml | 1 + app/src/main/res/values-bg/strings.xml | 1 + app/src/main/res/values-cs/strings.xml | 1 + app/src/main/res/values-da/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-el/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fi/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-hi/strings.xml | 1 + app/src/main/res/values-hu/strings.xml | 1 + app/src/main/res/values-in/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-ko/strings.xml | 1 + app/src/main/res/values-ms/strings.xml | 1 + app/src/main/res/values-nb/strings.xml | 1 + app/src/main/res/values-nl/strings.xml | 1 + app/src/main/res/values-pl/strings.xml | 1 + app/src/main/res/values-pt-rPT/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-ro/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values-th/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values-uk/strings.xml | 1 + app/src/main/res/values-vi/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rHK/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + .../launcher/hud/DroidDeckHudPanelTest.kt | 68 +++++++++++ 38 files changed, 222 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudHost.kt b/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudHost.kt index b6b775f4ba..a43878ecec 100644 --- a/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudHost.kt +++ b/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudHost.kt @@ -88,7 +88,7 @@ class DroidDeckHudHost(context: Context) { hud.onRefresh = Runnable { refreshLabels(hud) } hud.setOnMovedListener { x, y -> wantX = x; wantY = y - dockEdgeFor(hud)?.let { edge -> setDock(hud, edge); return@setOnMovedListener } + if (!hud.isStrip) dockEdgeFor(hud)?.let { edge -> setDock(hud, edge); return@setOnMovedListener } keepOnScreen(hud) wantX = hud.x; wantY = hud.y SessionPrefs.setDroidDeckHudPosition(context, hud.x, hud.y) @@ -324,6 +324,7 @@ class DroidDeckHudHost(context: Context) { val maxY = (p.height - v.height).toFloat().coerceAtLeast(0f) var x = wantX.coerceIn(0f, maxX) var y = wantY.coerceIn(0f, maxY) + if ((v as? DroidDeckHudView)?.isStrip == true) y = if (y + v.height / 2f < p.height / 2f) 0f else maxY when (v.let { it as? DroidDeckHudView }?.dock) { DroidDeckHudDock.LEFT -> x = 0f DroidDeckHudDock.RIGHT -> x = maxX diff --git a/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudModels.kt b/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudModels.kt index a5a5e42893..ab61d670bd 100644 --- a/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudModels.kt +++ b/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudModels.kt @@ -23,9 +23,10 @@ enum class DroidDeckHudSize(val token: String, val label: String) { TILES("tiles", "Tiles"), PILL("pill", "Pill"), MINIMAL("minimal", "Minimal"), - MEGA("mega", "Mega"); + MEGA("mega", "Mega"), + STRIP("strip", "Strip"); - /** Next size in the tap-cycle: Full → Tiles → Pill → Minimal → Mega → Full. */ + /** Next size in the tap-cycle: Full → Tiles → Pill → Minimal → Mega → Strip → Full. */ fun next(): DroidDeckHudSize { val all = values() return all[(ordinal + 1) % all.size] @@ -40,7 +41,7 @@ enum class DroidDeckHudSize(val token: String, val label: String) { fun supportedChips(): Set = when (this) { MINIMAL -> MINIMAL_CHIPS PILL -> PILL_CHIPS - FULL, TILES -> STANDARD_CHIPS + FULL, TILES, STRIP -> STANDARD_CHIPS MEGA -> MEGA_CHIPS } diff --git a/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudView.kt b/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudView.kt index a60846ad7a..ca2a3d2288 100644 --- a/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudView.kt +++ b/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudView.kt @@ -152,6 +152,8 @@ class DroidDeckHudView(context: Context) : View(context) { var dock = DroidDeckHudDock.NONE private set private var tabRect: RectF? = null + // The Strip is a bar across the whole screen, kept against the top or bottom edge. + private var stripRect: RectF? = null private val tabPath = Path() // Every size sits in the DroidDeck mark's D: a straight left side, round on the @@ -534,7 +536,7 @@ class DroidDeckHudView(context: Context) : View(context) { // ---- Layout builders -------------------------------------------------- private fun rebuild() { glyphs.clear(); tileRects.clear(); graphRect = null - headerMark = null; chipRect = null; dPanel = null; dDividerTop = -1f; tabRect = null + headerMark = null; chipRect = null; dPanel = null; dDividerTop = -1f; tabRect = null; stripRect = null val s = snap if (s == null) { contentW = 0f; contentH = 0f; return } if (dock != DroidDeckHudDock.NONE) { buildDockTab(); return } @@ -544,6 +546,7 @@ class DroidDeckHudView(context: Context) : View(context) { DroidDeckHudSize.PILL -> { buildPill(s); intoPanel(sp(10f), header = false) } DroidDeckHudSize.MINIMAL -> buildMinimal(s) DroidDeckHudSize.MEGA -> { buildMega(s); intoPanel(sp(10f), header = true) } + DroidDeckHudSize.STRIP -> buildStrip(s) } } @@ -1074,6 +1077,94 @@ class DroidDeckHudView(context: Context) : View(context) { finishPanel(panel, halfRound = true) } + /** + * Full's readouts on one line across the screen: the mark, the FPS, the graph, the lows, then GPU, CPU, + * memory, battery, display server and GPU model, with the clock on the right end. Groups that no longer + * fit before the clock are left off, from the end. + */ + private fun buildStrip(s: HudMetrics.Snapshot) { + val rowPx = sp(11.5f); val unitPx = rowPx * 0.8f; val fpsPx = sp(15f) + val padX = sp(10f); val groupGap = sp(13f) + val h = sp(26f) + val w = ((parent as? View)?.width?.takeIf { it > 0 } ?: resources.displayMetrics.widthPixels).toFloat() + val mid = h / 2f + val baseline = mid + capHeight(fpsPx) / 2f + + val markH = sp(13f) + val markLeft = padX - DroidDeckMark.inkLeftFor(markH) + headerMark = RectF(markLeft, mid - markH / 2f, markLeft + DroidDeckMark.widthFor(markH), mid + markH / 2f) + var x = markLeft + DroidDeckMark.inkRightFor(markH) + sp(8f) + + var right = w - padX + if (showClockTime) { + val t = clockTimeString() + right -= measure(t, rowPx) + glyphs.add(Glyph(right, baseline, t, blend(colDim), rowPx)) + right -= groupGap + } + + val generating = differs(fpsNow) + val fps = ArrayList() + if (apiLabel() != "FPS") fps += Span("${apiLabel()} ", colDim, rowPx) + fps += Span(fpsText(fpsNow), colValue, if (generating) fpsPx * 0.8f else fpsPx, glow = true) + fps += Span("fps", colDim, unitPx) + x = placeRun(x, baseline, fps) + groupGap + + if (showGraph) { + val gw = sp(72f); val gh = h * 0.55f + if (x + gw <= right) { + graphRect = RectF(x, mid - gh / 2f, x + gw, mid + gh / 2f) + x += gw + groupGap + } + } + + val groups = ArrayList>() + run { + val l = ArrayList() + l += Span("1% ", colDim, rowPx); l += Span(lowText(lows.low1Fps) ?: "—", colFps, rowPx) + l += Span(" 0.1% ", colDim, rowPx); l += Span(lowText(lows.low01Fps) ?: "—", colFps, rowPx) + if (showLow001) { l += Span(" 0.01% ", colDim, rowPx); l += Span(lowText(lows.low001Fps) ?: "—", colFps, rowPx) } + groups += l + } + if (showGPU || showGpuTemp) { + val l = arrayListOf(Span("GPU", colGpu, rowPx)) + if (showGPU) l += Span(" ${s.gpuPercent ?: "—"}%", colGpu, rowPx) + if (showGpuTemp && s.gpuTempC != null) { l += Span(" ", colDim, rowPx); l += tempSpans(s.gpuTempC, HudMetrics.TempSensor.GPU, rowPx, unitPx) } + groups += l + } + if (showCPU || showCpuTemp) { + val l = arrayListOf(Span("CPU", colCpu, rowPx)) + if (showCPU) l += Span(" ${s.cpuPercent ?: "—"}%", colCpu, rowPx) + if (showCpuTemp && s.cpuTempC != null) { l += Span(" ", colDim, rowPx); l += tempSpans(s.cpuTempC, HudMetrics.TempSensor.CPU, rowPx, unitPx) } + groups += l + } + if (showVram) s.vramText()?.let { groups += listOf(Span("VRAM $it", colVram, rowPx)) } + if (showRAM) groups += listOf(Span("RAM ${s.ramPercent.roundToInt()}%", colRam, rowPx)) + if (showBattery || showPower || showBatteryTemp) { + val l = ArrayList() + fun part(spans: List) { + l += if (l.isEmpty()) Span("BAT ", colBat, rowPx) else Span(" ", colDim, rowPx) + l += spans + } + if (showBattery && s.battery.percent != null) part(listOf(Span("${s.battery.percent}%", colBat, rowPx))) + if (showBatteryTemp && s.battery.tempC != null) + part(tempSpans(s.battery.tempC, HudMetrics.TempSensor.BATTERY, rowPx, unitPx)) + if (showPower && s.battery.watts > 0f) part(listOf(Span("${fmt1(s.battery.watts)}W", colDim, rowPx))) + if (l.isNotEmpty()) groups += l + } + if (displayServer.isNotBlank()) groups += listOf(Span(displayServer, colDisp, rowPx)) + if (hdrState != DroidDeckHudHdr.NONE) groups += hdrLine(rowPx) + if (showGpuModel && gpuNameText().isNotBlank()) groups += gpuModelSpans(rowPx, colDim, compact = true) + + for (g in groups) { + if (x + runWidth(g) > right) break + x = placeRun(x, baseline, g) + groupGap + } + + stripRect = RectF(0f, 0f, w, h) + contentW = w; contentH = h + } + private fun capHeight(px: Float): Float { measurePaint.textSize = px measurePaint.getTextBounds("0", 0, 1, inkRect) @@ -1263,6 +1354,8 @@ class DroidDeckHudView(context: Context) : View(context) { // ---- Measure / draw --------------------------------------------------- override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { + // The Strip spans the parent, past the side margin the floating sizes keep. + if (stripRect != null) { setMeasuredDimension(contentW.roundToInt(), resolveSize(contentH.roundToInt(), heightMeasureSpec)); return } setMeasuredDimension( resolveSize(contentW.roundToInt(), widthMeasureSpec), resolveSize(contentH.roundToInt(), heightMeasureSpec), @@ -1283,6 +1376,7 @@ class DroidDeckHudView(context: Context) : View(context) { chipRect?.let { drawChip(canvas, it) } tabRect?.let { drawTab(canvas, it) } + stripRect?.let { drawStrip(canvas, it) } // Text for (g in glyphs) { @@ -1324,6 +1418,21 @@ class DroidDeckHudView(context: Context) : View(context) { canvas.drawPath(graphPath, graphPaint) } + /** The bar, with the accent line on the side that faces the game (under it at the top, over it at the bottom). */ + private fun drawStrip(canvas: Canvas, rect: RectF) { + headerPaint.shader = null + headerPaint.color = panelColor() + canvas.drawRect(rect, headerPaint) + val stroke = outlineWidth() + if (stroke <= 0f) return + val line = max(stroke / 2f, density) + val p = parent as? View + val atBottom = p != null && p.height > 0 && y + height / 2f > p.height / 2f + headerPaint.color = withAlpha(outlineColor(), (110 + 145 * outlineIntensity).roundToInt().coerceAtMost(255)) + if (atBottom) canvas.drawRect(rect.left, rect.top, rect.right, rect.top + line, headerPaint) + else canvas.drawRect(rect.left, rect.bottom - line, rect.right, rect.bottom, headerPaint) + } + private fun outlineWidth(): Float = if (outlineIntensity > 0f) outlineIntensity * sp(3.5f) else 0f private fun outlineColor(): Int = if (outlineFollowAccent) accent else Color.rgb(200, 200, 200) private fun panelColor(): Int = Color.argb((bgOpacity.coerceIn(0f, 1f) * 255f).roundToInt(), @@ -1439,6 +1548,8 @@ class DroidDeckHudView(context: Context) : View(context) { return lockController.onTouchEvent(event) } + internal val isStrip: Boolean get() = stripRect != null + internal val contentWidth: Float get() = contentW internal val contentHeight: Float get() = contentH diff --git a/app/src/main/java/com/droiddeck/launcher/ui/DroidDeckHudSettings.kt b/app/src/main/java/com/droiddeck/launcher/ui/DroidDeckHudSettings.kt index 9b1902c33e..7a90ea33dd 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/DroidDeckHudSettings.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/DroidDeckHudSettings.kt @@ -24,6 +24,7 @@ internal fun DroidDeckHudSettings(host: MenuHost, a: DrawerActions, track: (Stri DroidDeckHudSize.PILL to stringResource(R.string.hud_size_pill), DroidDeckHudSize.MINIMAL to stringResource(R.string.hud_size_minimal), DroidDeckHudSize.MEGA to stringResource(R.string.hud_size_mega), + DroidDeckHudSize.STRIP to stringResource(R.string.hud_size_strip), ), size, chipModifier = track("hud-size")) { a.onHudSetting("hudSize", it.token) } ToggleRow(host, "hud-locked", stringResource(R.string.hud_locked), stringResource(R.string.hud_locked_hint), on("hudLocked"), @@ -125,9 +126,10 @@ private val METRICS = listOf( ) // Switches a size lists but never draws (DroidDeckHudView): the Pill and Minimal always show the FPS, the -// Pill has no graph, Tiles has no graph and no 0.01% low. +// Pill has no graph, Tiles has no graph and no 0.01% low, the Strip always shows the FPS. private val HIDDEN = mapOf( DroidDeckHudSize.PILL to setOf("FPS", "FPS graph"), DroidDeckHudSize.MINIMAL to setOf("FPS"), DroidDeckHudSize.TILES to setOf("FPS graph", "0.01% low"), + DroidDeckHudSize.STRIP to setOf("FPS"), ) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index a70a67de3a..e01b13dc1a 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -659,6 +659,7 @@ كبسولة مصغّر ضخم + شريط تثبيت في مكانه اسحب HUD لتحريكه؛ والضغط مطولًا يثبّته أو يلغي تثبيته. أثناء تثبيته، تظل عناصر التحكم على الشاشة الموجودة تحته تعمل. المظهر 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 6525fb886f..b3b6182c56 100644 --- a/app/src/main/res/values-b+es+419/strings.xml +++ b/app/src/main/res/values-b+es+419/strings.xml @@ -653,6 +653,7 @@ Píldora Mínimo Mega + Barra Fijar posición Arrastra el HUD para moverlo; una pulsación larga lo bloquea o lo desbloquea. Mientras está bloqueado, los controles en pantalla que tiene debajo siguen funcionando. Aspecto diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index 8b19eb84f6..11d3ea0a2e 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -651,6 +651,7 @@ Хапче Минимален Мега + Лента Заключване на място Плъзнете HUD, за да го преместите; продължително натискане го заключва или отключва. Докато е заключен, екранните контроли под него продължават да работят. Визия diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index f3fd6ccb22..e9d4f0e1bf 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -655,6 +655,7 @@ Pilulka Minimální Mega + Lišta Zamknout na místě Přetažením HUD přesunete; dlouhým stiskem ho zamknete nebo odemknete. Když je zamknutý, ovládací prvky na obrazovce pod ním dál fungují. Vzhled diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index b3010fd6ef..84b82baf10 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -651,6 +651,7 @@ Pille Minimal Mega + Bjælke Lås fast Træk i HUD for at flytte det; et langt tryk låser eller frigør det. Mens det er låst, virker skærmknapperne under det stadig. Udseende diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 94820d51b5..3885cf4ada 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -651,6 +651,7 @@ Kapsel Minimal Mega + Leiste Position sperren Ziehe das HUD, um es zu verschieben; langes Drücken sperrt oder entsperrt es. Solange es gesperrt ist, funktionieren die Bildschirmsteuerungen darunter weiter. Aussehen diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index fe7436ed00..5739417aca 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -651,6 +651,7 @@ Κάψουλα Ελάχιστο Μέγα + Λωρίδα Κλείδωμα θέσης Σύρετε το HUD για να το μετακινήσετε· ένα παρατεταμένο πάτημα το κλειδώνει ή το ξεκλειδώνει. Όσο είναι κλειδωμένο, τα χειριστήρια οθόνης από κάτω του εξακολουθούν να λειτουργούν. Εμφάνιση diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 1926467ede..994b130f80 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -653,6 +653,7 @@ Píldora Mínimo Mega + Barra Fijar posición Arrastra el HUD para moverlo; una pulsación larga lo bloquea o lo desbloquea. Mientras está bloqueado, los controles en pantalla que tiene debajo siguen funcionando. Aspecto diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 0d15d50ed8..2730dd290f 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -651,6 +651,7 @@ Kapseli Minimaalinen Mega + Palkki Lukitse paikalleen Siirrä HUD:ia vetämällä; pitkä painallus lukitsee tai vapauttaa sen. Lukittuna sen alla olevat näytön ohjaimet toimivat edelleen. Ulkoasu diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 4d20f39d88..6e78ba0557 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -653,6 +653,7 @@ Pilule Minimal Méga + Bandeau Verrouiller la position Faites glisser le HUD pour le déplacer ; un appui long le verrouille ou le déverrouille. Tant qu\'il est verrouillé, les commandes à l\'écran situées dessous restent utilisables. Apparence diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index cf457b84c9..060d657ea5 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -651,6 +651,7 @@ पिल मिनिमल मेगा + पट्टी जगह पर लॉक करें HUD को खिसकाने के लिए उसे ड्रैग करें; देर तक दबाने से वह लॉक या अनलॉक होता है। लॉक रहने पर भी उसके नीचे के ऑन-स्क्रीन कंट्रोल काम करते रहते हैं। लुक diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 48094b1e5d..c4c76a01f6 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -651,6 +651,7 @@ Kapszula Minimális Mega + Sáv Rögzítés a helyén Húzd a HUD-ot az áthelyezéshez; hosszú nyomással rögzítheted vagy feloldhatod. Rögzítve is működnek az alatta lévő képernyős vezérlők. Megjelenés diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 00cf8f78ff..59830bff3b 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -649,6 +649,7 @@ Pil Minimal Mega + Bilah Kunci posisi Seret HUD untuk memindahkannya; tekan lama untuk mengunci atau membuka kuncinya. Saat terkunci, kontrol layar di bawahnya tetap berfungsi. Tampilan diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index f149bdf127..85557daf8a 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -653,6 +653,7 @@ Pillola Minimo Mega + Barra Blocca in posizione Trascina l\'HUD per spostarlo; una pressione prolungata lo blocca o lo sblocca. Mentre è bloccato, i controlli su schermo sotto di esso continuano a funzionare. Aspetto diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 28592e569f..e3d31e2789 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -638,6 +638,7 @@ カプセル ミニマル メガ + バー 位置を固定 HUDはドラッグで移動できます。長押しで固定または解除します。固定中も、下にある画面上のコントロールは使えます。 外観 diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index e8bf230009..68c7876fac 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -649,6 +649,7 @@ 캡슐 미니멀 메가 + 바 위치 고정 HUD를 드래그하여 이동하고, 길게 눌러 고정하거나 해제합니다. 고정된 동안에도 아래에 있는 화면 컨트롤은 계속 작동합니다. 외관 diff --git a/app/src/main/res/values-ms/strings.xml b/app/src/main/res/values-ms/strings.xml index e3f0442f7b..6646eba055 100644 --- a/app/src/main/res/values-ms/strings.xml +++ b/app/src/main/res/values-ms/strings.xml @@ -649,6 +649,7 @@ Pil Minimal Mega + Jalur Kunci di tempat Seret HUD untuk mengalihkannya; tekan lama untuk mengunci atau membuka kuncinya. Semasa dikunci, kawalan skrin di bawahnya masih berfungsi. Rupa diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index 9fd07d25a2..fffb4958eb 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -651,6 +651,7 @@ Pille Minimal Mega + Linje Lås på plass Dra HUD-en for å flytte den; et langt trykk låser eller låser den opp. Mens den er låst, fungerer skjermkontrollene under den fortsatt. Utseende diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 4ed7d92464..29753d0b8b 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -651,6 +651,7 @@ Pil Minimaal Mega + Balk Vastzetten Sleep de HUD om hem te verplaatsen; lang drukken zet hem vast of los. Zolang hij vastzit, blijven de schermknoppen eronder werken. Weergave diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 7825c8daea..2e426238e2 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -655,6 +655,7 @@ Pigułka Minimalny Mega + Pasek Zablokuj w miejscu Przeciągnij HUD, aby go przesunąć; długie naciśnięcie blokuje go lub odblokowuje. Gdy jest zablokowany, sterowanie ekranowe pod nim nadal działa. Wygląd diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 72a0a53025..30174c1fbc 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -653,6 +653,7 @@ Pílula Mínimo Mega + Barra Bloquear posição Arraste o HUD para o mover; um toque longo bloqueia-o ou desbloqueia-o. Enquanto estiver bloqueado, os controlos no ecrã por baixo dele continuam a funcionar. Aspeto diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index ce64e5a1b4..299c61ef05 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -653,6 +653,7 @@ Pílula Mínimo Mega + Barra Travar posição Arraste o HUD para movê-lo; um toque longo o trava ou destrava. Enquanto estiver travado, os controles na tela embaixo dele continuam funcionando. Aparência diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 5738521958..3451398da6 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -653,6 +653,7 @@ Pastilă Minimal Mega + Bară Blochează pe loc Trage HUD-ul pentru a-l muta; o apăsare lungă îl blochează sau îl deblochează. Cât timp e blocat, comenzile de pe ecran de sub el funcționează în continuare. Aspect diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 3c83e4f843..5e6084f340 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -655,6 +655,7 @@ Капсула Минимальный Мега + Полоса Закрепить на месте Перетащите HUD, чтобы переместить его; долгое нажатие закрепляет или открепляет его. Пока он закреплён, экранные элементы управления под ним продолжают работать. Внешний вид diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 7f6e707ffc..d4b1a4970d 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -651,6 +651,7 @@ Piller Minimal Mega + List Lås på plats Dra HUD:en för att flytta den; ett långt tryck låser eller låser upp den. När den är låst fungerar skärmkontrollerna under den fortfarande. Utseende diff --git a/app/src/main/res/values-th/strings.xml b/app/src/main/res/values-th/strings.xml index a733c37011..402fef534c 100644 --- a/app/src/main/res/values-th/strings.xml +++ b/app/src/main/res/values-th/strings.xml @@ -649,6 +649,7 @@ แคปซูล มินิมอล เมกะ + แถบ ล็อกตำแหน่ง ลาก HUD เพื่อย้าย กดค้างเพื่อล็อกหรือปลดล็อก ขณะล็อก ปุ่มควบคุมบนหน้าจอที่อยู่ด้านล่างยังใช้งานได้ รูปลักษณ์ diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 72e503ff0e..7281c0abca 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -651,6 +651,7 @@ Hap Minimal Mega + Şerit Yerinde kilitle Taşımak için HUD\'u sürükleyin; uzun basmak onu kilitler veya kilidini açar. Kilitliyken altındaki ekran kontrolleri çalışmaya devam eder. Görünüm diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 64f9e0d486..0bc9dd50c2 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -655,6 +655,7 @@ Капсула Мінімальний Мега + Смуга Закріпити на місці Перетягніть HUD, щоб перемістити його; довге натискання закріплює або відкріплює його. Поки його закріплено, екранні елементи керування під ним працюють і далі. Вигляд diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index bbe26802f2..22b16a39b0 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -649,6 +649,7 @@ Dạng viên Tối giản Mega + Thanh Khóa vị trí Kéo HUD để di chuyển; nhấn giữ để khóa hoặc mở khóa. Khi đã khóa, các nút điều khiển trên màn hình bên dưới vẫn hoạt động. Giao diện diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index d4548e42d8..cf3b140009 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -638,6 +638,7 @@ 胶囊 极简 超大 + 横条 锁定位置 拖动 HUD 可移动位置;长按可锁定或解锁。锁定时,下方的屏幕控件仍可使用。 外观 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 9cda1d2d3e..196062110d 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -638,6 +638,7 @@ 膠囊 極簡 超大 + 橫條 鎖定位置 拖曳 HUD 可移動位置;長按可鎖定或解鎖。鎖定時,下方的螢幕控制項仍可使用。 外觀 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index f2d2b3a854..2b7470534a 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -638,6 +638,7 @@ 膠囊 極簡 超大 + 橫條 鎖定位置 拖曳 HUD 可移動位置;長按可鎖定或解鎖。鎖定時,下方的螢幕控制項仍可使用。 外觀 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ed1ebe5455..cdba72bf35 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -675,6 +675,7 @@ Pill Minimal Mega + Strip Lock in place Drag the HUD to move it; a long press locks or unlocks it. While it is locked, on-screen controls under it still work. Look diff --git a/app/src/test/java/com/droiddeck/launcher/hud/DroidDeckHudPanelTest.kt b/app/src/test/java/com/droiddeck/launcher/hud/DroidDeckHudPanelTest.kt index 3774607855..32c58a41f0 100644 --- a/app/src/test/java/com/droiddeck/launcher/hud/DroidDeckHudPanelTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/hud/DroidDeckHudPanelTest.kt @@ -45,6 +45,7 @@ class DroidDeckHudPanelTest { } val snapshot = SNAPSHOT for (size in DroidDeckHudSize.values()) { + if (size == DroidDeckHudSize.STRIP) continue val view = DroidDeckHudView(RuntimeEnvironment.getApplication()) view.applyConfig(DroidDeckHudConfig.encode(DroidDeckHudConfig.DEFAULTS + ("hudSize" to size.token))) view.setFrameStats(stats) @@ -70,6 +71,73 @@ class DroidDeckHudPanelTest { } } + @Test fun stripIsOneLineAcrossTheParentWithTheClockOnTheRight() { + val app = RuntimeEnvironment.getApplication() + val parent = FrameLayout(app) + val view = DroidDeckHudView(app) + parent.addView(view, FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT)) + parent.measure(View.MeasureSpec.makeMeasureSpec(2400, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(1080, View.MeasureSpec.EXACTLY)) + parent.layout(0, 0, 2400, 1080) + view.applyConfig(DroidDeckHudConfig.encode(DroidDeckHudConfig.DEFAULTS + ("hudSize" to DroidDeckHudSize.STRIP.token) + + ("showBattery" to "1"))) + view.showForTest(SNAPSHOT, "DXVK", 0L) + val unspecified = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED) + view.measure(unspecified, unspecified) + + assertTrue(view.isStrip) + assertEquals(2400, view.measuredWidth) + val lines = view.linesForTest() + assertEquals(lines.toString(), 1, lines.size) + val line = lines.single() + listOf("DXVK", "fps", "GPU", "CPU", "RAM", "BAT 79%").forEach { assertTrue(line, it in line) } + assertTrue(line, line.indexOf("DXVK") < line.indexOf("GPU") && line.indexOf("GPU") < line.indexOf("BAT")) + + val bitmap = Bitmap.createBitmap(view.measuredWidth, view.measuredHeight, Bitmap.Config.ARGB_8888) + view.layout(0, 0, view.measuredWidth, view.measuredHeight) + view.draw(Canvas(bitmap)) + val png = ByteArrayOutputStream().also { bitmap.compress(Bitmap.CompressFormat.PNG, 100, it) } + println("DROIDDECKHUD-STRIP-PNG ${Base64.getEncoder().encodeToString(png.toByteArray())}") + } + + @Test fun stripLeavesOffWhatNoLongerFitsBeforeTheClock() { + val app = RuntimeEnvironment.getApplication() + val parent = FrameLayout(app) + val view = DroidDeckHudView(app) + parent.addView(view, FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT)) + parent.measure(View.MeasureSpec.makeMeasureSpec(700, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(400, View.MeasureSpec.EXACTLY)) + parent.layout(0, 0, 700, 400) + view.applyConfig(DroidDeckHudConfig.encode(DroidDeckHudConfig.DEFAULTS + ("hudSize" to DroidDeckHudSize.STRIP.token))) + view.showForTest(SNAPSHOT, "DXVK", 0L) + val line = view.linesForTest().single() + assertTrue(line, "fps" in line) + assertFalse(line, "BAT" in line) + } + + @Test fun stripFollowsTheHudScaleInHeightAndKeepsTheFullWidth() { + val app = RuntimeEnvironment.getApplication() + val parent = FrameLayout(app) + val view = DroidDeckHudView(app) + parent.addView(view, FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT)) + parent.measure(View.MeasureSpec.makeMeasureSpec(2400, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(1080, View.MeasureSpec.EXACTLY)) + parent.layout(0, 0, 2400, 1080) + fun at(scale: Int): Pair { + view.applyConfig(DroidDeckHudConfig.encode(DroidDeckHudConfig.DEFAULTS + ("hudSize" to DroidDeckHudSize.STRIP.token) + + ("hudScale" to scale.toString()))) + view.showForTest(SNAPSHOT, "DXVK", 0L) + val unspecified = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED) + view.measure(unspecified, unspecified) + view.layout(0, 0, view.measuredWidth, view.measuredHeight) + val bitmap = Bitmap.createBitmap(view.measuredWidth, view.measuredHeight, Bitmap.Config.ARGB_8888) + view.draw(Canvas(bitmap)) + val png = ByteArrayOutputStream().also { bitmap.compress(Bitmap.CompressFormat.PNG, 100, it) } + println("DROIDDECKHUD-STRIP$scale-PNG ${Base64.getEncoder().encodeToString(png.toByteArray())}") + return Pair(view.contentWidth, view.contentHeight) + } + val small = at(70); val big = at(150) + assertEquals(2400f, small.first); assertEquals(2400f, big.first) + assertEquals(big.second / small.second, 150f / 70f, 0.01f) + } + @Test fun pillShowsEachBatteryPartOnItsOwnSwitch() { fun pill(vararg settings: Pair): List { val view = DroidDeckHudView(RuntimeEnvironment.getApplication())