mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
feat: HUD shrinks into its tab as it is dragged off an edge, and snaps to the sides (#1937)
This commit is contained in:
1 parent
ec9573643a
commit
9c5f1e4df9
38 files changed
+400
-48
No files matched your search
@@ -10,7 +10,7 @@ internal object DroidDeckHudConfig {
|
||||
* locked, so like the old HUD it lets touches through until it is unlocked to move it.
|
||||
*/
|
||||
val DEFAULTS: Map<String, String> = linkedMapOf(
|
||||
"hudSize" to "minimal", "hudLocked" to "1", "hudScale" to "100", "hudDock" to "none", "hudOpacity" to "80", "hudColor" to "mid",
|
||||
"hudSize" to "minimal", "hudLocked" to "1", "hudSnap" to "1", "hudScale" to "100", "hudDock" to "none", "hudOpacity" to "80", "hudColor" to "mid",
|
||||
"hudOutline" to "40", "hudOutlineAccent" to "1",
|
||||
"showFPS" to "1", "showFPSGraph" to "1", "showCPUUsage" to "1", "showCPULoad" to "1", "showGPULoad" to "1",
|
||||
"showVram" to "1", "showRAM" to "1", "showPower" to "1", "showTemp" to "1", "showBatteryTemp" to "1",
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context
|
||||
import android.os.Environment
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.animation.ValueAnimator
|
||||
import android.view.Choreographer
|
||||
import android.view.View
|
||||
import android.view.animation.PathInterpolator
|
||||
@@ -35,6 +36,13 @@ class DroidDeckHudHost(context: Context) {
|
||||
private var polling = false
|
||||
private var wantX = Float.NaN
|
||||
private var wantY = Float.NaN
|
||||
// With snapping on, the side the HUD keeps to (0 = left, 1 = right), so it stays against that side when its
|
||||
// size changes. NaN = not snapped.
|
||||
private var anchorX = Float.NaN
|
||||
private var snaps = true
|
||||
private var snapping = false
|
||||
private var previewFade: ValueAnimator? = null
|
||||
private var flingX = 0f
|
||||
private var engine = ""
|
||||
private var gpuName = ""
|
||||
private var protonPid = 0
|
||||
@@ -86,12 +94,29 @@ class DroidDeckHudHost(context: Context) {
|
||||
hud.setMangoReadings(readings)
|
||||
hud.setGpuModel(cleanGpuName(GpuInfo.detect().displayName(context)))
|
||||
hud.onRefresh = Runnable { refreshLabels(hud) }
|
||||
hud.setOnDraggedListener { rawX, rawY ->
|
||||
anchorX = Float.NaN; snapping = false
|
||||
previewFade?.cancel(); previewFade = null
|
||||
stopMotion(hud)
|
||||
shrinkPastEdge(hud, rawX, rawY)
|
||||
}
|
||||
hud.setOnFlungListener { vx, _ -> flingX = vx }
|
||||
hud.setOnTabDraggedListener { x, y -> dragTab(hud, x, y) }
|
||||
hud.setOnTabDroppedListener { dropTab(hud) }
|
||||
hud.setOnTabDragCancelledListener { snapping = false; keepOnScreen(hud) }
|
||||
hud.setOnMovedListener { x, y ->
|
||||
wantX = x; wantY = y
|
||||
if (!hud.isStrip) dockEdgeFor(hud)?.let { edge -> setDock(hud, edge); return@setOnMovedListener }
|
||||
val vx = flingX
|
||||
flingX = 0f
|
||||
dockEdgeFor(hud)?.let { edge -> setDock(hud, edge); return@setOnMovedListener }
|
||||
stopMotion(hud)
|
||||
fadeDockPreview(hud)
|
||||
if (snaps && !hud.isStrip) { snapToAnchor(hud, vx); return@setOnMovedListener }
|
||||
val fromX = hud.x; val fromY = hud.y
|
||||
keepOnScreen(hud)
|
||||
wantX = hud.x; wantY = hud.y
|
||||
SessionPrefs.setDroidDeckHudPosition(context, hud.x, hud.y)
|
||||
glideFrom(hud, fromX, fromY)
|
||||
}
|
||||
hud.setOnSizeCycledListener { size -> DroidDeckHudConfig.set(context, "hudSize", size); onConfigChanged?.invoke() }
|
||||
hud.setOnDockChangedListener { token -> setDock(hud, DroidDeckHudDock.from(token)) }
|
||||
@@ -118,7 +143,10 @@ class DroidDeckHudHost(context: Context) {
|
||||
}
|
||||
|
||||
fun applyConfig() {
|
||||
view?.applyConfig(DroidDeckHudConfig.encode(DroidDeckHudConfig.load(context)))
|
||||
val config = DroidDeckHudConfig.load(context)
|
||||
snaps = config["hudSnap"] != "0"
|
||||
if (!snaps) anchorX = Float.NaN
|
||||
view?.applyConfig(DroidDeckHudConfig.encode(config))
|
||||
}
|
||||
|
||||
fun refresh() {
|
||||
@@ -216,15 +244,141 @@ class DroidDeckHudHost(context: Context) {
|
||||
|
||||
/** The edge the HUD was dropped over, once a good part of it hangs past that edge; null when it stays. */
|
||||
private fun dockEdgeFor(v: View): DroidDeckHudDock? {
|
||||
val over = overhang(v) ?: return null
|
||||
return over.key.takeIf { over.value >= DOCK_OVERHANG }
|
||||
}
|
||||
|
||||
/** The edge the HUD hangs furthest past, with how much of it does, as a share of its own size. */
|
||||
private fun overhang(v: View): Map.Entry<DroidDeckHudDock, Float>? {
|
||||
val p = v.parent as? View ?: return null
|
||||
if (p.width <= 0 || p.height <= 0 || v.width <= 0 || v.height <= 0) return null
|
||||
val over = mapOf(
|
||||
DroidDeckHudDock.LEFT to -v.x / v.width,
|
||||
DroidDeckHudDock.RIGHT to (v.x + v.width - p.width) / v.width,
|
||||
DroidDeckHudDock.TOP to -v.y / v.height,
|
||||
DroidDeckHudDock.BOTTOM to (v.y + v.height - p.height) / v.height,
|
||||
).maxByOrNull { it.value } ?: return null
|
||||
return over.key.takeIf { over.value >= DOCK_OVERHANG }
|
||||
// The Strip spans the screen and is short: measure its pull in a set distance rather than its own size.
|
||||
val strip = (v as? DroidDeckHudView)?.isStrip == true
|
||||
val density = v.resources.displayMetrics.density
|
||||
val w = if (strip) minOf(v.width.toFloat(), STRIP_PULL_ACROSS_DP * density) else v.width.toFloat()
|
||||
val h = if (strip) maxOf(v.height.toFloat(), STRIP_PULL_OFF_DP * density) else v.height.toFloat()
|
||||
return mapOf(
|
||||
DroidDeckHudDock.LEFT to -v.x / w,
|
||||
DroidDeckHudDock.RIGHT to (v.x + v.width - p.width) / w,
|
||||
DroidDeckHudDock.TOP to -v.y / h,
|
||||
DroidDeckHudDock.BOTTOM to (v.y + v.height - p.height) / h,
|
||||
).maxByOrNull { it.value }
|
||||
}
|
||||
|
||||
/** The tab follows the finger along its edge and away from it, staying on screen. */
|
||||
private fun dragTab(hud: DroidDeckHudView, x: Float, y: Float) {
|
||||
val p = hud.parent as? View ?: return
|
||||
stopMotion(hud)
|
||||
snapping = false
|
||||
hud.x = x.coerceIn(0f, (p.width - hud.width).toFloat().coerceAtLeast(0f))
|
||||
hud.y = y.coerceIn(0f, (p.height - hud.height).toFloat().coerceAtLeast(0f))
|
||||
}
|
||||
|
||||
/** A tab pulled out by more than its own size comes out as the HUD there; a shorter pull slides it back onto its edge. */
|
||||
private fun dropTab(hud: DroidDeckHudView) {
|
||||
val p = hud.parent as? View ?: return
|
||||
val maxX = (p.width - hud.width).toFloat().coerceAtLeast(0f)
|
||||
val maxY = (p.height - hud.height).toFloat().coerceAtLeast(0f)
|
||||
val pulled = when (hud.dock) {
|
||||
DroidDeckHudDock.LEFT -> hud.x / hud.width
|
||||
DroidDeckHudDock.RIGHT -> (maxX - hud.x) / hud.width
|
||||
DroidDeckHudDock.TOP -> hud.y / hud.height
|
||||
DroidDeckHudDock.BOTTOM -> (maxY - hud.y) / hud.height
|
||||
DroidDeckHudDock.NONE -> 0f
|
||||
}
|
||||
if (pulled >= 1f) { setDock(hud, DroidDeckHudDock.NONE); return }
|
||||
wantX = hud.x; wantY = hud.y
|
||||
val (x, y) = settled(p, hud.dock, hud.width.toFloat(), hud.height.toFloat())
|
||||
wantX = x; wantY = y
|
||||
SessionPrefs.setDroidDeckHudPosition(context, x, y)
|
||||
if (Motion.scale == 0f) { hud.x = x; hud.y = y; return }
|
||||
snapping = true
|
||||
hud.animate().x(x).y(y).setDuration(Motion.ms(220).toLong()).setInterpolator(EASE)
|
||||
.withEndAction { snapping = false }.start()
|
||||
}
|
||||
|
||||
/** Stops the HUD's running move, and the per-frame listener a dock animation hangs on it, which outlives a cancel. */
|
||||
private fun stopMotion(hud: DroidDeckHudView) {
|
||||
hud.animate().setUpdateListener(null)
|
||||
hud.animate().cancel()
|
||||
}
|
||||
|
||||
/** Glides the HUD from (fromX, fromY) to where it now is, back at full size. */
|
||||
private fun glideFrom(hud: DroidDeckHudView, fromX: Float, fromY: Float) {
|
||||
if (Motion.scale == 0f || (fromX == hud.x && fromY == hud.y && hud.scaleX == 1f && hud.scaleY == 1f)) {
|
||||
hud.scaleX = 1f; hud.scaleY = 1f
|
||||
return
|
||||
}
|
||||
val toX = hud.x; val toY = hud.y
|
||||
hud.x = fromX; hud.y = fromY
|
||||
snapping = true
|
||||
hud.animate().x(toX).y(toY).scaleX(1f).scaleY(1f).setDuration(Motion.ms(220).toLong()).setInterpolator(EASE)
|
||||
.withEndAction { snapping = false; keepOnScreen(hud) }.start()
|
||||
}
|
||||
|
||||
/** A drop short of docking fades the tab preview back out. */
|
||||
private fun fadeDockPreview(hud: DroidDeckHudView) {
|
||||
val from = hud.dockPreviewBlend
|
||||
if (from <= 0f) return
|
||||
val edge = overhang(hud)?.key ?: DroidDeckHudDock.NONE
|
||||
if (Motion.scale == 0f) { hud.setDockPreview(DroidDeckHudDock.NONE, 0f); return }
|
||||
previewFade?.cancel()
|
||||
previewFade = ValueAnimator.ofFloat(from, 0f).apply {
|
||||
duration = Motion.ms(200).toLong()
|
||||
addUpdateListener { hud.setDockPreview(edge, it.animatedValue as Float) }
|
||||
start()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dropped, the HUD glides to the nearer side of the screen at the height it was let go, as a picture-in-picture
|
||||
* window does, carried to the side a fling throws it toward.
|
||||
*/
|
||||
private fun snapToAnchor(hud: DroidDeckHudView, vx: Float) {
|
||||
val p = hud.parent as? View ?: return
|
||||
val maxX = (p.width - hud.width).toFloat().coerceAtLeast(0f)
|
||||
val maxY = (p.height - hud.height).toFloat().coerceAtLeast(0f)
|
||||
anchorX = if (hud.x + vx * FLING_REACH_S < maxX / 2f) 0f else 1f
|
||||
wantX = anchorX * maxX
|
||||
wantY = hud.y.coerceIn(0f, maxY)
|
||||
SessionPrefs.setDroidDeckHudPosition(context, wantX, wantY)
|
||||
stopMotion(hud)
|
||||
if (Motion.scale == 0f) {
|
||||
hud.scaleX = 1f; hud.scaleY = 1f
|
||||
hud.x = wantX; hud.y = wantY
|
||||
return
|
||||
}
|
||||
snapping = true
|
||||
hud.animate().x(wantX).y(wantY).scaleX(1f).scaleY(1f).setDuration(Motion.ms(260).toLong()).setInterpolator(EASE)
|
||||
.withEndAction { snapping = false; keepOnScreen(hud) }.start()
|
||||
}
|
||||
|
||||
/**
|
||||
* Dragged past an edge, the HUD shrinks around the finger toward the tab it docks as, reaching the tab's
|
||||
* size where a drop would dock it, so the drop finishes a contraction the drag already started.
|
||||
*/
|
||||
private fun shrinkPastEdge(hud: DroidDeckHudView, rawX: Float, rawY: Float) {
|
||||
if (hud.dock != DroidDeckHudDock.NONE) return
|
||||
val p = hud.parent as? View ?: return
|
||||
val edge = overhang(hud) ?: return
|
||||
val over = edge.value
|
||||
val t = (over / DOCK_OVERHANG).coerceIn(0f, 1f)
|
||||
val fade = ((t - PREVIEW_FROM) / (1f - PREVIEW_FROM)).coerceIn(0f, 1f)
|
||||
hud.setDockPreview(edge.key, fade * fade * (3f - 2f * fade))
|
||||
val (tabW, tabH) = hud.dockTabSize()
|
||||
val e = t * t * (3f - 2f * t)
|
||||
val at = IntArray(2).also { p.getLocationOnScreen(it) }
|
||||
hud.pivotX = rawX - at[0] - hud.x
|
||||
hud.pivotY = rawY - at[1] - hud.y
|
||||
if (hud.isStrip) {
|
||||
// The bar draws in sideways toward the tab's width; scaled evenly it would thin to a line.
|
||||
hud.scaleX = 1f + (tabW / hud.width - 1f) * e
|
||||
hud.scaleY = 1f
|
||||
return
|
||||
}
|
||||
val tabScale = maxOf(tabW / hud.width, tabH / hud.height).coerceAtMost(1f)
|
||||
val s = 1f + (tabScale - 1f) * e
|
||||
hud.scaleX = s; hud.scaleY = s
|
||||
}
|
||||
|
||||
/** Tucks the HUD against [edge] as its FPS tab, or with [DroidDeckHudDock.NONE] brings it back out from where it was docked. */
|
||||
@@ -234,15 +388,8 @@ class DroidDeckHudHost(context: Context) {
|
||||
}
|
||||
|
||||
private fun commitDock(hud: DroidDeckHudView, edge: DroidDeckHudDock) {
|
||||
if (edge == DroidDeckHudDock.NONE) {
|
||||
when (hud.dock) {
|
||||
DroidDeckHudDock.LEFT -> wantX = 0f
|
||||
DroidDeckHudDock.RIGHT -> wantX = Float.MAX_VALUE
|
||||
DroidDeckHudDock.TOP -> wantY = 0f
|
||||
DroidDeckHudDock.BOTTOM -> wantY = Float.MAX_VALUE
|
||||
DroidDeckHudDock.NONE -> {}
|
||||
}
|
||||
} else {
|
||||
val tabX = hud.x; val tabY = hud.y
|
||||
if (edge != DroidDeckHudDock.NONE) {
|
||||
val p = hud.parent as? View
|
||||
if (p != null) {
|
||||
wantX = wantX.coerceIn(0f, p.width.toFloat())
|
||||
@@ -252,35 +399,65 @@ class DroidDeckHudHost(context: Context) {
|
||||
}
|
||||
DroidDeckHudConfig.set(context, "hudDock", edge.token)
|
||||
applyConfig()
|
||||
if (edge == DroidDeckHudDock.NONE) settleOutOfTab(hud, tabX, tabY)
|
||||
hud.post { keepOnScreen(hud) }
|
||||
onConfigChanged?.invoke()
|
||||
}
|
||||
|
||||
/**
|
||||
* Where the HUD comes out of its tab, decided before it expands so it grows straight there: where the tab is
|
||||
* (against its edge, or wherever it was pulled to), and with snapping on, against the nearer side.
|
||||
*/
|
||||
private fun settleOutOfTab(hud: DroidDeckHudView, tabX: Float, tabY: Float) {
|
||||
val p = hud.parent as? View
|
||||
val maxX = if (p == null) Float.MAX_VALUE else (p.width - hud.contentWidth).coerceAtLeast(0f)
|
||||
val maxY = if (p == null) Float.MAX_VALUE else (p.height - hud.contentHeight).coerceAtLeast(0f)
|
||||
wantX = tabX.coerceIn(0f, maxX); wantY = tabY.coerceIn(0f, maxY)
|
||||
anchorX = if (snaps && !hud.isStrip && p != null) (if (wantX < maxX / 2f) 0f else 1f) else Float.NaN
|
||||
if (!anchorX.isNaN()) wantX = anchorX * maxX
|
||||
SessionPrefs.setDroidDeckHudPosition(context, wantX, wantY)
|
||||
}
|
||||
|
||||
/**
|
||||
* One shape contracts into the tab, and the tab expands back out to the HUD: the view is scaled onto the
|
||||
* tab's exact rectangle, and the layouts swap at that same size and place. Timing and curve are the
|
||||
* launcher's own ([Motion]), and off when animations are off.
|
||||
*/
|
||||
private fun animateDock(hud: DroidDeckHudView, edge: DroidDeckHudDock, commit: () -> Unit) {
|
||||
hud.animate().cancel()
|
||||
hud.scaleX = 1f; hud.scaleY = 1f; hud.alpha = 1f
|
||||
stopMotion(hud)
|
||||
previewFade?.cancel(); previewFade = null
|
||||
snapping = false
|
||||
hud.alpha = 1f
|
||||
val p = hud.parent as? View
|
||||
if (Motion.scale == 0f || p == null || !hud.isLaidOut || hud.width <= 0) { commit(); return }
|
||||
if (Motion.scale == 0f || p == null || !hud.isLaidOut || hud.width <= 0) {
|
||||
hud.scaleX = 1f; hud.scaleY = 1f
|
||||
hud.setDockPreview(DroidDeckHudDock.NONE, 0f)
|
||||
commit(); return
|
||||
}
|
||||
if (edge != DroidDeckHudDock.NONE) {
|
||||
// Continue from what the drag left on screen: the shrunk HUD, and the tab where it is along the edge.
|
||||
val left = hud.x + hud.pivotX * (1f - hud.scaleX); val top = hud.y + hud.pivotY * (1f - hud.scaleY)
|
||||
val shownW = hud.width * hud.scaleX; val shownH = hud.height * hud.scaleY
|
||||
hud.pivotX = 0f; hud.pivotY = 0f
|
||||
hud.x = left; hud.y = top
|
||||
val (tabW, tabH) = hud.dockTabSize()
|
||||
wantX = left + (shownW - tabW) / 2f
|
||||
wantY = top + (shownH - tabH) / 2f
|
||||
val (tabX, tabY) = settled(p, edge, tabW, tabH)
|
||||
val sx = tabW / hud.width; val sy = tabH / hud.height
|
||||
hud.pivotX = pivotFor(hud.x, tabX, sx) - hud.x
|
||||
hud.pivotY = pivotFor(hud.y, tabY, sy) - hud.y
|
||||
hud.animate().scaleX(sx).scaleY(sy).setDuration(Motion.ms(300).toLong()).setInterpolator(EASE)
|
||||
val from = hud.dockPreviewBlend
|
||||
hud.animate().x(tabX).y(tabY).scaleX(sx).scaleY(sy).setDuration(Motion.ms(220).toLong()).setInterpolator(EASE)
|
||||
.setUpdateListener { hud.setDockPreview(edge, from + (1f - from) * it.animatedFraction) }
|
||||
.withEndAction {
|
||||
hud.animate().setUpdateListener(null)
|
||||
commit()
|
||||
hud.setDockPreview(DroidDeckHudDock.NONE, 0f)
|
||||
hud.scaleX = 1f; hud.scaleY = 1f
|
||||
hud.x = tabX; hud.y = tabY
|
||||
hud.alpha = 0.5f
|
||||
hud.animate().alpha(1f).setDuration(Motion.ms(120).toLong()).start()
|
||||
}.start()
|
||||
} else {
|
||||
hud.scaleX = 1f; hud.scaleY = 1f
|
||||
val was = hud.dock
|
||||
val tabX = hud.x; val tabY = hud.y
|
||||
val tabW = hud.width.toFloat(); val tabH = hud.height.toFloat()
|
||||
commit()
|
||||
@@ -291,7 +468,14 @@ class DroidDeckHudHost(context: Context) {
|
||||
hud.pivotX = pivotFor(x, tabX, sx) - x
|
||||
hud.pivotY = pivotFor(y, tabY, sy) - y
|
||||
hud.scaleX = sx; hud.scaleY = sy
|
||||
hud.animate().scaleX(1f).scaleY(1f).setDuration(Motion.ms(360).toLong()).setInterpolator(EASE).start()
|
||||
hud.setDockPreview(was, 1f)
|
||||
hud.animate().scaleX(1f).scaleY(1f).setDuration(Motion.ms(360).toLong()).setInterpolator(EASE)
|
||||
.setUpdateListener {
|
||||
val f = (1f - it.animatedFraction / EXPAND_FADE).coerceIn(0f, 1f)
|
||||
hud.setDockPreview(was, f * f * (3f - 2f * f))
|
||||
}
|
||||
.withEndAction { hud.animate().setUpdateListener(null); hud.setDockPreview(DroidDeckHudDock.NONE, 0f) }
|
||||
.start()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,11 +501,17 @@ class DroidDeckHudHost(context: Context) {
|
||||
// it is drawn: a window that shrinks and grows back (picture-in-picture, a fold) must not leave it in the
|
||||
// corner the small window pushed it to.
|
||||
private fun keepOnScreen(v: View) {
|
||||
if (snapping) return
|
||||
val p = v.parent as? View ?: return
|
||||
if (p.width <= 0 || p.height <= 0 || v.width <= 0 || v.height <= 0) return
|
||||
if (wantX.isNaN()) { wantX = v.x; wantY = v.y }
|
||||
val maxX = (p.width - v.width).toFloat().coerceAtLeast(0f)
|
||||
val maxY = (p.height - v.height).toFloat().coerceAtLeast(0f)
|
||||
val anchored = (v as? DroidDeckHudView)?.let { it.dock == DroidDeckHudDock.NONE && !it.isStrip } == true
|
||||
if (snaps && anchored && anchorX.isNaN()) {
|
||||
anchorX = if (wantX.coerceIn(0f, maxX) < maxX / 2f) 0f else 1f
|
||||
}
|
||||
if (snaps && anchored && !anchorX.isNaN()) wantX = anchorX * maxX
|
||||
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
|
||||
@@ -339,6 +529,15 @@ class DroidDeckHudHost(context: Context) {
|
||||
companion object {
|
||||
/** How much of the HUD, as a share of its own size, must hang past a screen edge for it to dock there. */
|
||||
private const val DOCK_OVERHANG = 0.4f
|
||||
/** How far ahead a fling carries the HUD when picking the spot it snaps to, as seconds of its speed. */
|
||||
private const val FLING_REACH_S = 0.18f
|
||||
/** How far toward docking a drag goes, as a share of the way, before the tab starts to fade in over the HUD. */
|
||||
private const val PREVIEW_FROM = 0.55f
|
||||
/** How far the Strip is pulled sideways, or off its edge, for its overhang to count as its whole size. */
|
||||
private const val STRIP_PULL_ACROSS_DP = 600f
|
||||
private const val STRIP_PULL_OFF_DP = 150f
|
||||
/** The share of the expand animation over which the tab fades out to the HUD. */
|
||||
private const val EXPAND_FADE = 0.5f
|
||||
private val EASE = PathInterpolator(0.2f, 0.8f, 0.2f, 1f)
|
||||
|
||||
/** True while the HUD is on screen; DroidDeck keeps sampling VRAM for it (GpuMemComponent). */
|
||||
|
||||
@@ -24,9 +24,9 @@ import android.graphics.RectF
|
||||
import android.graphics.Typeface
|
||||
import android.os.SystemClock
|
||||
import android.text.format.DateFormat
|
||||
import android.view.GestureDetector
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.ViewConfiguration
|
||||
import androidx.annotation.VisibleForTesting
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
@@ -231,6 +231,12 @@ class DroidDeckHudView(context: Context) : View(context) {
|
||||
fun setOnLockChangedListener(l: Consumer<Boolean>?) { onLockChangedListener = l }
|
||||
private var onDockChangedListener: Consumer<String>? = null
|
||||
private var onScaledListener: IntConsumer? = null
|
||||
private var onDraggedListener: BiConsumer<Float, Float>? = null
|
||||
/** The HUD moved under the finger, at that screen point. */
|
||||
fun setOnDraggedListener(l: BiConsumer<Float, Float>?) { onDraggedListener = l }
|
||||
private var onFlungListener: BiConsumer<Float, Float>? = null
|
||||
/** A drag ended in a fling, at this velocity (pixels per second), just before the move is reported. */
|
||||
fun setOnFlungListener(l: BiConsumer<Float, Float>?) { onFlungListener = l }
|
||||
fun setOnDockChangedListener(l: Consumer<String>?) { onDockChangedListener = l }
|
||||
/** A pinch settled on this size, in percent. */
|
||||
fun setOnScaledListener(l: IntConsumer?) { onScaledListener = l }
|
||||
@@ -238,6 +244,8 @@ class DroidDeckHudView(context: Context) : View(context) {
|
||||
private val lockController = HudLockController(context, this, object : HudLockController.Callbacks {
|
||||
override fun onTap() { cycleSize() }
|
||||
override fun onMoved(x: Float, y: Float) { onMovedListener?.accept(x, y) }
|
||||
override fun onDragged(rawX: Float, rawY: Float) { onDraggedListener?.accept(rawX, rawY) }
|
||||
override fun onFlung(velocityX: Float, velocityY: Float) { onFlungListener?.accept(velocityX, velocityY) }
|
||||
override fun onLockChanged(locked: Boolean) { onLockChangedListener?.accept(locked) }
|
||||
override fun onPinch(factor: Float) {
|
||||
val next = (scale * factor).coerceIn(MIN_SCALE, MAX_SCALE)
|
||||
@@ -248,23 +256,56 @@ class DroidDeckHudView(context: Context) : View(context) {
|
||||
override fun onPinchEnd() { onScaledListener?.accept((scale * 100f).roundToInt()) }
|
||||
})
|
||||
|
||||
// A docked tab always takes touches, locked or not: a tap or a pull away from the edge brings the HUD back.
|
||||
private val dockDetector = GestureDetector(context, object : GestureDetector.SimpleOnGestureListener() {
|
||||
override fun onDown(e: MotionEvent): Boolean = true
|
||||
override fun onSingleTapUp(e: MotionEvent): Boolean { onDockChangedListener?.accept(DroidDeckHudDock.NONE.token); return true }
|
||||
override fun onScroll(e1: MotionEvent?, e2: MotionEvent, distanceX: Float, distanceY: Float): Boolean {
|
||||
if (e1 == null) return false
|
||||
val inward = when (dock) {
|
||||
DroidDeckHudDock.LEFT -> e2.rawX - e1.rawX
|
||||
DroidDeckHudDock.RIGHT -> e1.rawX - e2.rawX
|
||||
DroidDeckHudDock.TOP -> e2.rawY - e1.rawY
|
||||
DroidDeckHudDock.BOTTOM -> e1.rawY - e2.rawY
|
||||
DroidDeckHudDock.NONE -> 0f
|
||||
// A docked tab always takes touches, locked or not: a tap brings the HUD back, a drag moves the tab.
|
||||
private val touchSlop = ViewConfiguration.get(context).scaledTouchSlop
|
||||
private var tabDownRawX = 0f
|
||||
private var tabDownRawY = 0f
|
||||
private var tabStartX = 0f
|
||||
private var tabStartY = 0f
|
||||
private var tabDragging = false
|
||||
private var onTabDraggedListener: BiConsumer<Float, Float>? = null
|
||||
private var onTabDroppedListener: Runnable? = null
|
||||
private var onTabDragCancelledListener: Runnable? = null
|
||||
/** The docked tab is dragged: where the finger would put it (x, y in the parent). */
|
||||
fun setOnTabDraggedListener(l: BiConsumer<Float, Float>?) { onTabDraggedListener = l }
|
||||
fun setOnTabDroppedListener(l: Runnable?) { onTabDroppedListener = l }
|
||||
/** The system took the tab's drag away: the tab goes back to where it was docked. */
|
||||
fun setOnTabDragCancelledListener(l: Runnable?) { onTabDragCancelledListener = l }
|
||||
|
||||
private fun onTabTouch(event: MotionEvent): Boolean {
|
||||
when (event.actionMasked) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
tabDownRawX = event.rawX; tabDownRawY = event.rawY
|
||||
tabStartX = x; tabStartY = y
|
||||
tabDragging = false
|
||||
}
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
val dx = event.rawX - tabDownRawX; val dy = event.rawY - tabDownRawY
|
||||
if (!tabDragging && dx * dx + dy * dy > touchSlop * touchSlop) tabDragging = true
|
||||
if (tabDragging) onTabDraggedListener?.accept(tabStartX + dx, tabStartY + dy)
|
||||
}
|
||||
MotionEvent.ACTION_UP -> {
|
||||
if (tabDragging) { tabDragging = false; onTabDroppedListener?.run() }
|
||||
else onDockChangedListener?.accept(DroidDeckHudDock.NONE.token)
|
||||
}
|
||||
MotionEvent.ACTION_CANCEL -> if (tabDragging) {
|
||||
tabDragging = false
|
||||
onTabDragCancelledListener?.run()
|
||||
}
|
||||
if (inward > 12f * density) onDockChangedListener?.accept(DroidDeckHudDock.NONE.token)
|
||||
return true
|
||||
}
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
// On the way into the tab or out of it, the tab fades in over the HUD at the tab's true size on screen.
|
||||
private var previewEdge = DroidDeckHudDock.NONE
|
||||
private var previewBlend = 0f
|
||||
internal fun setDockPreview(edge: DroidDeckHudDock, blend: Float) {
|
||||
val b = blend.coerceIn(0f, 1f)
|
||||
if (edge == previewEdge && b == previewBlend) return
|
||||
previewEdge = edge; previewBlend = b
|
||||
invalidate()
|
||||
}
|
||||
internal val dockPreviewBlend: Float get() = previewBlend
|
||||
|
||||
// ---- Public surface (symmetric with the other overlays) ---------------
|
||||
fun setEngineLabel(s: String?) { if ((s ?: "") != engineLabel) { engineLabel = s ?: ""; post { rebuildAndInvalidate() } } }
|
||||
@@ -612,10 +653,10 @@ class DroidDeckHudView(context: Context) : View(context) {
|
||||
internal fun dockTabSize(): Pair<Float, Float> =
|
||||
Pair(runWidth(tabSpans()) + 2f * sp(9f), capHeight(sp(20f)) + 2f * sp(7f))
|
||||
|
||||
private fun drawTab(canvas: Canvas, rect: RectF) {
|
||||
private fun drawTab(canvas: Canvas, rect: RectF, edgeOf: DroidDeckHudDock = dock) {
|
||||
val r = sp(8f); val stroke = max(outlineWidth(), sp(1.5f)); val h = stroke / 2f
|
||||
val round = floatArrayOf(r, r, r, r, r, r, r, r)
|
||||
val edge = when (dock) {
|
||||
val edge = when (edgeOf) {
|
||||
DroidDeckHudDock.LEFT -> intArrayOf(0, 3)
|
||||
DroidDeckHudDock.RIGHT -> intArrayOf(1, 2)
|
||||
DroidDeckHudDock.TOP -> intArrayOf(0, 1)
|
||||
@@ -1409,6 +1450,39 @@ class DroidDeckHudView(context: Context) : View(context) {
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
if (contentW <= 0f || contentH <= 0f) { lockController.drawBadge(canvas); return }
|
||||
val blend = if (dock == DroidDeckHudDock.NONE && previewEdge != DroidDeckHudDock.NONE) previewBlend else 0f
|
||||
if (blend <= 0f) { drawContent(canvas); return }
|
||||
if (blend < 1f) {
|
||||
canvas.saveLayerAlpha(0f, 0f, width.toFloat(), height.toFloat(), ((1f - blend) * 255f).roundToInt())
|
||||
drawContent(canvas)
|
||||
canvas.restore()
|
||||
}
|
||||
drawTabPreview(canvas, blend)
|
||||
}
|
||||
|
||||
/** The docked tab drawn at its own size in the middle of the view, undoing the view's scale. */
|
||||
private fun drawTabPreview(canvas: Canvas, blend: Float) {
|
||||
val (w, h) = dockTabSize()
|
||||
if (scaleX <= 0f || scaleY <= 0f) return
|
||||
canvas.save()
|
||||
canvas.translate(width / 2f, height / 2f)
|
||||
canvas.scale(1f / scaleX, 1f / scaleY)
|
||||
canvas.translate(-w / 2f, -h / 2f)
|
||||
canvas.saveLayerAlpha(0f, 0f, w, h, (blend * 255f).roundToInt())
|
||||
drawTab(canvas, RectF(0f, 0f, w, h), previewEdge)
|
||||
var x = sp(9f)
|
||||
val baseline = sp(7f) + capHeight(sp(20f))
|
||||
for (span in tabSpans()) {
|
||||
drawPaint.textSize = span.sizePx
|
||||
drawPaint.color = blend(span.color)
|
||||
canvas.drawText(span.text, x, baseline, drawPaint)
|
||||
x += measure(span.text, span.sizePx)
|
||||
}
|
||||
canvas.restore()
|
||||
canvas.restore()
|
||||
}
|
||||
|
||||
private fun drawContent(canvas: Canvas) {
|
||||
|
||||
dPanel?.let { panel -> panelFrame(panel)?.let { canvas.drawBitmap(it, 0f, 0f, null) } }
|
||||
|
||||
@@ -1587,7 +1661,7 @@ class DroidDeckHudView(context: Context) : View(context) {
|
||||
|
||||
// Declining the down event hands the whole gesture to the views under the HUD.
|
||||
override fun onTouchEvent(event: MotionEvent): Boolean {
|
||||
if (dock != DroidDeckHudDock.NONE) return dockDetector.onTouchEvent(event)
|
||||
if (dock != DroidDeckHudDock.NONE) return onTabTouch(event)
|
||||
if (event.actionMasked == MotionEvent.ACTION_DOWN && lockController.isLocked() &&
|
||||
passesTouchAt?.invoke(event.rawX, event.rawY) == true) return false
|
||||
return lockController.onTouchEvent(event)
|
||||
@@ -1598,7 +1672,7 @@ class DroidDeckHudView(context: Context) : View(context) {
|
||||
internal val contentWidth: Float get() = contentW
|
||||
internal val contentHeight: Float get() = contentH
|
||||
|
||||
internal val isDragging: Boolean get() = lockController.isDragging()
|
||||
internal val isDragging: Boolean get() = lockController.isDragging() || tabDragging
|
||||
|
||||
private companion object {
|
||||
const val REFRESH_MS = 500L
|
||||
|
||||
@@ -57,6 +57,10 @@ public class HudLockController {
|
||||
void onTap();
|
||||
/** Drag released (unlocked): persist the new (x, y). */
|
||||
void onMoved(float x, float y);
|
||||
/** The view moved under a drag (unlocked), with the finger at screen point (rawX, rawY). */
|
||||
default void onDragged(float rawX, float rawY) {}
|
||||
/** The drag ended in a fling (unlocked), in pixels per second; comes just before {@link #onMoved}. */
|
||||
default void onFlung(float velocityX, float velocityY) {}
|
||||
/** Lock toggled by long-press: persist {@code hudLocked} + sync the menu chip. */
|
||||
void onLockChanged(boolean locked);
|
||||
/** Two-finger pinch (unlocked): the change since the previous event, above 1 when the fingers spread. */
|
||||
@@ -156,6 +160,12 @@ public class HudLockController {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
|
||||
if (dragging && !locked && !pinched) cb.onFlung(velocityX, velocityY);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
|
||||
if (pinched) return true;
|
||||
@@ -167,6 +177,7 @@ public class HudLockController {
|
||||
view.setX(startX + (e2.getRawX() - downRawX));
|
||||
view.setY(startY + (e2.getRawY() - downRawY));
|
||||
dragging = true;
|
||||
cb.onDragged(e2.getRawX(), e2.getRawY());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ internal fun DroidDeckHudSettings(host: MenuHost, a: DrawerActions, track: (Stri
|
||||
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"),
|
||||
chipModifier = track("hud-locked")) { a.onHudSetting("hudLocked", flag(it)) }
|
||||
ToggleRow(host, "hud-snap", stringResource(R.string.hud_snap), stringResource(R.string.hud_snap_hint), on("hudSnap"),
|
||||
chipModifier = track("hud-snap")) { a.onHudSetting("hudSnap", flag(it)) }
|
||||
}
|
||||
if (!a.hudOn) return
|
||||
|
||||
|
||||
@@ -662,6 +662,8 @@
|
||||
<string name="hud_size_strip">شريط</string>
|
||||
<string name="hud_locked">تثبيت في مكانه</string>
|
||||
<string name="hud_locked_hint">اسحب HUD لتحريكه؛ والضغط مطولًا يثبّته أو يلغي تثبيته. أثناء تثبيته، تظل عناصر التحكم على الشاشة الموجودة تحته تعمل.</string>
|
||||
<string name="hud_snap">الالتصاق بالجانبين</string>
|
||||
<string name="hud_snap_hint">اترك الواجهة لتنتقل إلى أقرب جانب من الشاشة. اسحبها بسرعة لترميها في ذلك الاتجاه.</string>
|
||||
<string name="hud_group_look">المظهر</string>
|
||||
<string name="hud_scale">الحجم على الشاشة</string>
|
||||
<string name="hud_color_soft">هادئ</string>
|
||||
|
||||
@@ -656,6 +656,8 @@
|
||||
<string name="hud_size_strip">Barra</string>
|
||||
<string name="hud_locked">Fijar posición</string>
|
||||
<string name="hud_locked_hint">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.</string>
|
||||
<string name="hud_snap">Ajustar a los lados</string>
|
||||
<string name="hud_snap_hint">Al soltar el HUD, se mueve al lado más cercano de la pantalla. Un gesto rápido lo lanza en esa dirección.</string>
|
||||
<string name="hud_group_look">Aspecto</string>
|
||||
<string name="hud_scale">Tamaño en pantalla</string>
|
||||
<string name="hud_color_soft">Suave</string>
|
||||
|
||||
@@ -654,6 +654,8 @@
|
||||
<string name="hud_size_strip">Лента</string>
|
||||
<string name="hud_locked">Заключване на място</string>
|
||||
<string name="hud_locked_hint">Плъзнете HUD, за да го преместите; продължително натискане го заключва или отключва. Докато е заключен, екранните контроли под него продължават да работят.</string>
|
||||
<string name="hud_snap">Залепване отстрани</string>
|
||||
<string name="hud_snap_hint">Пуснете HUD и той отива към по-близката страна на екрана. Бързо плъзване го хвърля в тази посока.</string>
|
||||
<string name="hud_group_look">Визия</string>
|
||||
<string name="hud_scale">Размер на екрана</string>
|
||||
<string name="hud_color_soft">Мек</string>
|
||||
|
||||
@@ -658,6 +658,8 @@
|
||||
<string name="hud_size_strip">Lišta</string>
|
||||
<string name="hud_locked">Zamknout na místě</string>
|
||||
<string name="hud_locked_hint">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í.</string>
|
||||
<string name="hud_snap">Přichytit ke stranám</string>
|
||||
<string name="hud_snap_hint">Pusťte HUD a přesune se k bližší straně obrazovky. Rychlým švihnutím ho hodíte tím směrem.</string>
|
||||
<string name="hud_group_look">Vzhled</string>
|
||||
<string name="hud_scale">Velikost na obrazovce</string>
|
||||
<string name="hud_color_soft">Jemná</string>
|
||||
|
||||
@@ -654,6 +654,8 @@
|
||||
<string name="hud_size_strip">Bjælke</string>
|
||||
<string name="hud_locked">Lås fast</string>
|
||||
<string name="hud_locked_hint">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.</string>
|
||||
<string name="hud_snap">Fastgør til siderne</string>
|
||||
<string name="hud_snap_hint">Slip HUD\'en, så flytter den sig til skærmens nærmeste side. Et hurtigt stryg kaster den i den retning.</string>
|
||||
<string name="hud_group_look">Udseende</string>
|
||||
<string name="hud_scale">Størrelse på skærmen</string>
|
||||
<string name="hud_color_soft">Blød</string>
|
||||
|
||||
@@ -654,6 +654,8 @@
|
||||
<string name="hud_size_strip">Leiste</string>
|
||||
<string name="hud_locked">Position sperren</string>
|
||||
<string name="hud_locked_hint">Ziehe das HUD, um es zu verschieben; langes Drücken sperrt oder entsperrt es. Solange es gesperrt ist, funktionieren die Bildschirmsteuerungen darunter weiter.</string>
|
||||
<string name="hud_snap">An Seiten einrasten</string>
|
||||
<string name="hud_snap_hint">Lass das HUD los, und es springt an die nähere Bildschirmseite. Ein Wischen wirft es in diese Richtung.</string>
|
||||
<string name="hud_group_look">Aussehen</string>
|
||||
<string name="hud_scale">Größe auf dem Bildschirm</string>
|
||||
<string name="hud_color_soft">Dezent</string>
|
||||
|
||||
@@ -654,6 +654,8 @@
|
||||
<string name="hud_size_strip">Λωρίδα</string>
|
||||
<string name="hud_locked">Κλείδωμα θέσης</string>
|
||||
<string name="hud_locked_hint">Σύρετε το HUD για να το μετακινήσετε· ένα παρατεταμένο πάτημα το κλειδώνει ή το ξεκλειδώνει. Όσο είναι κλειδωμένο, τα χειριστήρια οθόνης από κάτω του εξακολουθούν να λειτουργούν.</string>
|
||||
<string name="hud_snap">Προσκόλληση στα πλάγια</string>
|
||||
<string name="hud_snap_hint">Αφήστε το HUD και μετακινείται στην πιο κοντινή πλευρά της οθόνης. Μια γρήγορη κίνηση το πετάει προς εκείνη την κατεύθυνση.</string>
|
||||
<string name="hud_group_look">Εμφάνιση</string>
|
||||
<string name="hud_scale">Μέγεθος στην οθόνη</string>
|
||||
<string name="hud_color_soft">Απαλό</string>
|
||||
|
||||
@@ -656,6 +656,8 @@
|
||||
<string name="hud_size_strip">Barra</string>
|
||||
<string name="hud_locked">Fijar posición</string>
|
||||
<string name="hud_locked_hint">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.</string>
|
||||
<string name="hud_snap">Ajustar a los lados</string>
|
||||
<string name="hud_snap_hint">Al soltar el HUD, se mueve al lado más cercano de la pantalla. Un gesto rápido lo lanza en esa dirección.</string>
|
||||
<string name="hud_group_look">Aspecto</string>
|
||||
<string name="hud_scale">Tamaño en pantalla</string>
|
||||
<string name="hud_color_soft">Suave</string>
|
||||
|
||||
@@ -654,6 +654,8 @@
|
||||
<string name="hud_size_strip">Palkki</string>
|
||||
<string name="hud_locked">Lukitse paikalleen</string>
|
||||
<string name="hud_locked_hint">Siirrä HUD:ia vetämällä; pitkä painallus lukitsee tai vapauttaa sen. Lukittuna sen alla olevat näytön ohjaimet toimivat edelleen.</string>
|
||||
<string name="hud_snap">Kiinnitä sivuille</string>
|
||||
<string name="hud_snap_hint">Kun päästät HUDista irti, se siirtyy näytön lähempään reunaan. Nopea pyyhkäisy heittää sen siihen suuntaan.</string>
|
||||
<string name="hud_group_look">Ulkoasu</string>
|
||||
<string name="hud_scale">Koko näytöllä</string>
|
||||
<string name="hud_color_soft">Pehmeä</string>
|
||||
|
||||
@@ -656,6 +656,8 @@
|
||||
<string name="hud_size_strip">Bandeau</string>
|
||||
<string name="hud_locked">Verrouiller la position</string>
|
||||
<string name="hud_locked_hint">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.</string>
|
||||
<string name="hud_snap">Aimanter sur les côtés</string>
|
||||
<string name="hud_snap_hint">Relâchez le HUD et il rejoint le côté de l’écran le plus proche. Un geste rapide le lance dans cette direction.</string>
|
||||
<string name="hud_group_look">Apparence</string>
|
||||
<string name="hud_scale">Taille à l\'écran</string>
|
||||
<string name="hud_color_soft">Douce</string>
|
||||
|
||||
@@ -654,6 +654,8 @@
|
||||
<string name="hud_size_strip">पट्टी</string>
|
||||
<string name="hud_locked">जगह पर लॉक करें</string>
|
||||
<string name="hud_locked_hint">HUD को खिसकाने के लिए उसे ड्रैग करें; देर तक दबाने से वह लॉक या अनलॉक होता है। लॉक रहने पर भी उसके नीचे के ऑन-स्क्रीन कंट्रोल काम करते रहते हैं।</string>
|
||||
<string name="hud_snap">किनारों पर चिपकाएँ</string>
|
||||
<string name="hud_snap_hint">HUD छोड़ने पर यह स्क्रीन की पास वाली ओर चला जाता है। तेज़ी से झटकने पर यह उसी दिशा में जाता है।</string>
|
||||
<string name="hud_group_look">लुक</string>
|
||||
<string name="hud_scale">स्क्रीन पर आकार</string>
|
||||
<string name="hud_color_soft">हल्का</string>
|
||||
|
||||
@@ -654,6 +654,8 @@
|
||||
<string name="hud_size_strip">Sáv</string>
|
||||
<string name="hud_locked">Rögzítés a helyén</string>
|
||||
<string name="hud_locked_hint">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.</string>
|
||||
<string name="hud_snap">Igazítás az oldalakhoz</string>
|
||||
<string name="hud_snap_hint">Engedd el a HUD-ot, és a képernyő közelebbi oldalára ugrik. Egy gyors pöccintés abba az irányba dobja.</string>
|
||||
<string name="hud_group_look">Megjelenés</string>
|
||||
<string name="hud_scale">Méret a képernyőn</string>
|
||||
<string name="hud_color_soft">Lágy</string>
|
||||
|
||||
@@ -652,6 +652,8 @@
|
||||
<string name="hud_size_strip">Bilah</string>
|
||||
<string name="hud_locked">Kunci posisi</string>
|
||||
<string name="hud_locked_hint">Seret HUD untuk memindahkannya; tekan lama untuk mengunci atau membuka kuncinya. Saat terkunci, kontrol layar di bawahnya tetap berfungsi.</string>
|
||||
<string name="hud_snap">Tempel ke sisi</string>
|
||||
<string name="hud_snap_hint">Lepaskan HUD dan HUD akan pindah ke sisi layar yang lebih dekat. Jentikan cepat melemparnya ke arah itu.</string>
|
||||
<string name="hud_group_look">Tampilan</string>
|
||||
<string name="hud_scale">Ukuran di layar</string>
|
||||
<string name="hud_color_soft">Lembut</string>
|
||||
|
||||
@@ -656,6 +656,8 @@
|
||||
<string name="hud_size_strip">Barra</string>
|
||||
<string name="hud_locked">Blocca in posizione</string>
|
||||
<string name="hud_locked_hint">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.</string>
|
||||
<string name="hud_snap">Aggancia ai lati</string>
|
||||
<string name="hud_snap_hint">Rilascia l\'HUD e si sposta sul lato più vicino dello schermo. Un gesto rapido lo lancia in quella direzione.</string>
|
||||
<string name="hud_group_look">Aspetto</string>
|
||||
<string name="hud_scale">Dimensione sullo schermo</string>
|
||||
<string name="hud_color_soft">Tenue</string>
|
||||
|
||||
@@ -641,6 +641,8 @@
|
||||
<string name="hud_size_strip">バー</string>
|
||||
<string name="hud_locked">位置を固定</string>
|
||||
<string name="hud_locked_hint">HUDはドラッグで移動できます。長押しで固定または解除します。固定中も、下にある画面上のコントロールは使えます。</string>
|
||||
<string name="hud_snap">左右に吸着</string>
|
||||
<string name="hud_snap_hint">HUD を離すと、画面の近い方の端に移動します。はじくとその方向へ飛びます。</string>
|
||||
<string name="hud_group_look">外観</string>
|
||||
<string name="hud_scale">画面上のサイズ</string>
|
||||
<string name="hud_color_soft">ソフト</string>
|
||||
|
||||
@@ -652,6 +652,8 @@
|
||||
<string name="hud_size_strip">바</string>
|
||||
<string name="hud_locked">위치 고정</string>
|
||||
<string name="hud_locked_hint">HUD를 드래그하여 이동하고, 길게 눌러 고정하거나 해제합니다. 고정된 동안에도 아래에 있는 화면 컨트롤은 계속 작동합니다.</string>
|
||||
<string name="hud_snap">양옆에 맞추기</string>
|
||||
<string name="hud_snap_hint">HUD를 놓으면 화면에서 더 가까운 쪽으로 이동합니다. 튕기면 그 방향으로 이동합니다.</string>
|
||||
<string name="hud_group_look">외관</string>
|
||||
<string name="hud_scale">화면상 크기</string>
|
||||
<string name="hud_color_soft">은은함</string>
|
||||
|
||||
@@ -652,6 +652,8 @@
|
||||
<string name="hud_size_strip">Jalur</string>
|
||||
<string name="hud_locked">Kunci di tempat</string>
|
||||
<string name="hud_locked_hint">Seret HUD untuk mengalihkannya; tekan lama untuk mengunci atau membuka kuncinya. Semasa dikunci, kawalan skrin di bawahnya masih berfungsi.</string>
|
||||
<string name="hud_snap">Lekap ke sisi</string>
|
||||
<string name="hud_snap_hint">Lepaskan HUD dan ia akan beralih ke sisi skrin yang lebih dekat. Kuis pantas melemparkannya ke arah itu.</string>
|
||||
<string name="hud_group_look">Rupa</string>
|
||||
<string name="hud_scale">Saiz pada skrin</string>
|
||||
<string name="hud_color_soft">Lembut</string>
|
||||
|
||||
@@ -654,6 +654,8 @@
|
||||
<string name="hud_size_strip">Linje</string>
|
||||
<string name="hud_locked">Lås på plass</string>
|
||||
<string name="hud_locked_hint">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.</string>
|
||||
<string name="hud_snap">Fest til sidene</string>
|
||||
<string name="hud_snap_hint">Slipp HUD-en, så flytter den seg til nærmeste side av skjermen. Et raskt sveip kaster den den veien.</string>
|
||||
<string name="hud_group_look">Utseende</string>
|
||||
<string name="hud_scale">Størrelse på skjermen</string>
|
||||
<string name="hud_color_soft">Myk</string>
|
||||
|
||||
@@ -654,6 +654,8 @@
|
||||
<string name="hud_size_strip">Balk</string>
|
||||
<string name="hud_locked">Vastzetten</string>
|
||||
<string name="hud_locked_hint">Sleep de HUD om hem te verplaatsen; lang drukken zet hem vast of los. Zolang hij vastzit, blijven de schermknoppen eronder werken.</string>
|
||||
<string name="hud_snap">Vastklikken aan zijkanten</string>
|
||||
<string name="hud_snap_hint">Laat de HUD los en hij gaat naar de dichtstbijzijnde kant van het scherm. Met een snelle veeg gooi je hem die kant op.</string>
|
||||
<string name="hud_group_look">Weergave</string>
|
||||
<string name="hud_scale">Grootte op scherm</string>
|
||||
<string name="hud_color_soft">Zacht</string>
|
||||
|
||||
@@ -658,6 +658,8 @@
|
||||
<string name="hud_size_strip">Pasek</string>
|
||||
<string name="hud_locked">Zablokuj w miejscu</string>
|
||||
<string name="hud_locked_hint">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.</string>
|
||||
<string name="hud_snap">Przyciągaj do boków</string>
|
||||
<string name="hud_snap_hint">Puść HUD, a przesunie się do bliższego boku ekranu. Szybki ruch rzuca go w tę stronę.</string>
|
||||
<string name="hud_group_look">Wygląd</string>
|
||||
<string name="hud_scale">Rozmiar na ekranie</string>
|
||||
<string name="hud_color_soft">Stonowany</string>
|
||||
|
||||
@@ -656,6 +656,8 @@
|
||||
<string name="hud_size_strip">Barra</string>
|
||||
<string name="hud_locked">Bloquear posição</string>
|
||||
<string name="hud_locked_hint">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.</string>
|
||||
<string name="hud_snap">Encaixar nas laterais</string>
|
||||
<string name="hud_snap_hint">Solte o HUD e ele vai para a lateral mais próxima do ecrã. Um gesto rápido lança-o nessa direção.</string>
|
||||
<string name="hud_group_look">Aspeto</string>
|
||||
<string name="hud_scale">Tamanho no ecrã</string>
|
||||
<string name="hud_color_soft">Suave</string>
|
||||
|
||||
@@ -656,6 +656,8 @@
|
||||
<string name="hud_size_strip">Barra</string>
|
||||
<string name="hud_locked">Travar posição</string>
|
||||
<string name="hud_locked_hint">Arraste o HUD para movê-lo; um toque longo o trava ou destrava. Enquanto estiver travado, os controles na tela embaixo dele continuam funcionando.</string>
|
||||
<string name="hud_snap">Encaixar nas laterais</string>
|
||||
<string name="hud_snap_hint">Solte o HUD e ele vai para a lateral mais próxima da tela. Um gesto rápido o lança nessa direção.</string>
|
||||
<string name="hud_group_look">Aparência</string>
|
||||
<string name="hud_scale">Tamanho na tela</string>
|
||||
<string name="hud_color_soft">Suave</string>
|
||||
|
||||
@@ -656,6 +656,8 @@
|
||||
<string name="hud_size_strip">Bară</string>
|
||||
<string name="hud_locked">Blochează pe loc</string>
|
||||
<string name="hud_locked_hint">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.</string>
|
||||
<string name="hud_snap">Fixare în lateral</string>
|
||||
<string name="hud_snap_hint">Eliberează HUD-ul și se mută în partea mai apropiată a ecranului. Un gest rapid îl aruncă în acea direcție.</string>
|
||||
<string name="hud_group_look">Aspect</string>
|
||||
<string name="hud_scale">Dimensiune pe ecran</string>
|
||||
<string name="hud_color_soft">Discretă</string>
|
||||
|
||||
@@ -658,6 +658,8 @@
|
||||
<string name="hud_size_strip">Полоса</string>
|
||||
<string name="hud_locked">Закрепить на месте</string>
|
||||
<string name="hud_locked_hint">Перетащите HUD, чтобы переместить его; долгое нажатие закрепляет или открепляет его. Пока он закреплён, экранные элементы управления под ним продолжают работать.</string>
|
||||
<string name="hud_snap">Прилипание к бокам</string>
|
||||
<string name="hud_snap_hint">Отпустите HUD, и он переместится к ближайшей стороне экрана. Резкий жест отбросит его в ту сторону.</string>
|
||||
<string name="hud_group_look">Внешний вид</string>
|
||||
<string name="hud_scale">Размер на экране</string>
|
||||
<string name="hud_color_soft">Мягкий</string>
|
||||
|
||||
@@ -654,6 +654,8 @@
|
||||
<string name="hud_size_strip">List</string>
|
||||
<string name="hud_locked">Lås på plats</string>
|
||||
<string name="hud_locked_hint">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.</string>
|
||||
<string name="hud_snap">Fäst mot sidorna</string>
|
||||
<string name="hud_snap_hint">Släpp HUD:en så flyttas den till skärmens närmaste sida. En snabb svepning kastar den åt det hållet.</string>
|
||||
<string name="hud_group_look">Utseende</string>
|
||||
<string name="hud_scale">Storlek på skärmen</string>
|
||||
<string name="hud_color_soft">Mjuk</string>
|
||||
|
||||
@@ -652,6 +652,8 @@
|
||||
<string name="hud_size_strip">แถบ</string>
|
||||
<string name="hud_locked">ล็อกตำแหน่ง</string>
|
||||
<string name="hud_locked_hint">ลาก HUD เพื่อย้าย กดค้างเพื่อล็อกหรือปลดล็อก ขณะล็อก ปุ่มควบคุมบนหน้าจอที่อยู่ด้านล่างยังใช้งานได้</string>
|
||||
<string name="hud_snap">ยึดติดด้านข้าง</string>
|
||||
<string name="hud_snap_hint">ปล่อย HUD แล้วจะย้ายไปด้านที่ใกล้กว่าของหน้าจอ ปัดเร็วๆ เพื่อเหวี่ยงไปทางนั้น</string>
|
||||
<string name="hud_group_look">รูปลักษณ์</string>
|
||||
<string name="hud_scale">ขนาดบนหน้าจอ</string>
|
||||
<string name="hud_color_soft">อ่อน</string>
|
||||
|
||||
@@ -654,6 +654,8 @@
|
||||
<string name="hud_size_strip">Şerit</string>
|
||||
<string name="hud_locked">Yerinde kilitle</string>
|
||||
<string name="hud_locked_hint">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.</string>
|
||||
<string name="hud_snap">Yanlara yapıştır</string>
|
||||
<string name="hud_snap_hint">HUD\'u bıraktığınızda ekranın daha yakın tarafına gider. Hızlı bir kaydırma onu o yöne fırlatır.</string>
|
||||
<string name="hud_group_look">Görünüm</string>
|
||||
<string name="hud_scale">Ekrandaki boyut</string>
|
||||
<string name="hud_color_soft">Yumuşak</string>
|
||||
|
||||
@@ -658,6 +658,8 @@
|
||||
<string name="hud_size_strip">Смуга</string>
|
||||
<string name="hud_locked">Закріпити на місці</string>
|
||||
<string name="hud_locked_hint">Перетягніть HUD, щоб перемістити його; довге натискання закріплює або відкріплює його. Поки його закріплено, екранні елементи керування під ним працюють і далі.</string>
|
||||
<string name="hud_snap">Прилипання до боків</string>
|
||||
<string name="hud_snap_hint">Відпустіть HUD, і він переміститься до ближчого боку екрана. Різкий жест відкине його в той бік.</string>
|
||||
<string name="hud_group_look">Вигляд</string>
|
||||
<string name="hud_scale">Розмір на екрані</string>
|
||||
<string name="hud_color_soft">М\'який</string>
|
||||
|
||||
@@ -652,6 +652,8 @@
|
||||
<string name="hud_size_strip">Thanh</string>
|
||||
<string name="hud_locked">Khóa vị trí</string>
|
||||
<string name="hud_locked_hint">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.</string>
|
||||
<string name="hud_snap">Bám vào cạnh trái/phải</string>
|
||||
<string name="hud_snap_hint">Thả HUD ra và nó sẽ di chuyển sang cạnh màn hình gần hơn. Vuốt nhanh để ném nó theo hướng đó.</string>
|
||||
<string name="hud_group_look">Giao diện</string>
|
||||
<string name="hud_scale">Kích thước trên màn hình</string>
|
||||
<string name="hud_color_soft">Dịu</string>
|
||||
|
||||
@@ -641,6 +641,8 @@
|
||||
<string name="hud_size_strip">横条</string>
|
||||
<string name="hud_locked">锁定位置</string>
|
||||
<string name="hud_locked_hint">拖动 HUD 可移动位置;长按可锁定或解锁。锁定时,下方的屏幕控件仍可使用。</string>
|
||||
<string name="hud_snap">吸附到两侧</string>
|
||||
<string name="hud_snap_hint">松开 HUD 后,它会移到屏幕较近的一侧。轻甩可将它甩向该方向。</string>
|
||||
<string name="hud_group_look">外观</string>
|
||||
<string name="hud_scale">屏幕显示大小</string>
|
||||
<string name="hud_color_soft">柔和</string>
|
||||
|
||||
@@ -641,6 +641,8 @@
|
||||
<string name="hud_size_strip">橫條</string>
|
||||
<string name="hud_locked">鎖定位置</string>
|
||||
<string name="hud_locked_hint">拖曳 HUD 可移動位置;長按可鎖定或解鎖。鎖定時,下方的螢幕控制項仍可使用。</string>
|
||||
<string name="hud_snap">貼齊兩側</string>
|
||||
<string name="hud_snap_hint">放開 HUD 後,它會移到螢幕較近的一側。輕甩可將它甩向該方向。</string>
|
||||
<string name="hud_group_look">外觀</string>
|
||||
<string name="hud_scale">螢幕顯示大小</string>
|
||||
<string name="hud_color_soft">柔和</string>
|
||||
|
||||
@@ -641,6 +641,8 @@
|
||||
<string name="hud_size_strip">橫條</string>
|
||||
<string name="hud_locked">鎖定位置</string>
|
||||
<string name="hud_locked_hint">拖曳 HUD 可移動位置;長按可鎖定或解鎖。鎖定時,下方的螢幕控制項仍可使用。</string>
|
||||
<string name="hud_snap">貼齊兩側</string>
|
||||
<string name="hud_snap_hint">放開 HUD 後,它會移到螢幕較近的一側。輕甩可將它甩向該方向。</string>
|
||||
<string name="hud_group_look">外觀</string>
|
||||
<string name="hud_scale">螢幕顯示大小</string>
|
||||
<string name="hud_color_soft">柔和</string>
|
||||
|
||||
@@ -678,6 +678,8 @@
|
||||
<string name="hud_size_strip">Strip</string>
|
||||
<string name="hud_locked">Lock in place</string>
|
||||
<string name="hud_locked_hint">Drag the HUD to move it; a long press locks or unlocks it. While it is locked, on-screen controls under it still work.</string>
|
||||
<string name="hud_snap">Snap to sides</string>
|
||||
<string name="hud_snap_hint">Let go of the HUD and it moves to the nearer side of the screen. A flick throws it that way.</string>
|
||||
<string name="hud_group_look">Look</string>
|
||||
<string name="hud_scale">Size on screen</string>
|
||||
<string name="hud_color_soft">Soft</string>
|
||||
|
||||
Reference in new issue
Block a user