player: scroll the info text in thirds of a screen (#23)
One D-pad press moved 85% of the panel, so consecutive stops barely overlapped and the middle of a long description was never on screen — on tube.jeena.net/w/p4HtZrDCMbPfGYpMfG9fMN Jeena could not read the passage about the credit-card outlier at all (#23 review). A press now moves about a third of a screenful, so each stop repeats two thirds of the previous one and every line gets shown on the way down.
This commit is contained in:
parent
d338e50375
commit
ab1890b931
1 changed files with 5 additions and 1 deletions
|
|
@ -245,7 +245,11 @@ private fun DescriptionScroll(
|
||||||
.background(if (focused) Color(0x0DFFFFFF) else Color.Transparent)
|
.background(if (focused) Color(0x0DFFFFFF) else Color.Transparent)
|
||||||
.onPreviewKeyEvent { ke ->
|
.onPreviewKeyEvent { ke ->
|
||||||
if (ke.type != KeyEventType.KeyDown) return@onPreviewKeyEvent false
|
if (ke.type != KeyEventType.KeyDown) return@onPreviewKeyEvent false
|
||||||
val step = (viewportPx * 0.85f).coerceAtLeast(240f)
|
// One press moves a third of a screenful, so consecutive stops
|
||||||
|
// overlap and every line of a long description gets shown (issue
|
||||||
|
// #23 review: the old 85% step jumped past the middle of the text
|
||||||
|
// on tube.jeena.net/w/p4HtZrDCMbPfGYpMfG9fMN).
|
||||||
|
val step = (viewportPx * 0.34f).coerceAtLeast(150f)
|
||||||
val code = ke.nativeKeyEvent.keyCode
|
val code = ke.nativeKeyEvent.keyCode
|
||||||
// Match Compose's normalised key AND the raw keycode: remotes don't all
|
// Match Compose's normalised key AND the raw keycode: remotes don't all
|
||||||
// report the same native codes, and matching only the raw one left UP
|
// report the same native codes, and matching only the raw one left UP
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue