From 50fbbab05e30626667e40672222267718fde0e1e Mon Sep 17 00:00:00 2001 From: liannacasper <67953602+liannacasper@users.noreply.github.com> Date: Mon, 6 Apr 2026 16:53:48 +0300 Subject: [PATCH] Document fade scrollbar speed units and examples --- .../src/com/codename1/ui/plaf/LookAndFeel.java | 14 +++++++++++++- docs/developer-guide/Advanced-Theming.asciidoc | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CodenameOne/src/com/codename1/ui/plaf/LookAndFeel.java b/CodenameOne/src/com/codename1/ui/plaf/LookAndFeel.java index 5aeaf1814c..33a5bfaf43 100644 --- a/CodenameOne/src/com/codename1/ui/plaf/LookAndFeel.java +++ b/CodenameOne/src/com/codename1/ui/plaf/LookAndFeel.java @@ -1490,7 +1490,19 @@ public int getFadeScrollBarSpeed() { /// #### Parameters /// - /// - `fadeScrollBarSpeed`: the fadeScrollBarSpeed to set + /// - `fadeScrollBarSpeed`: per-frame opacity decrement used for fading the scrollbar. + /// Larger values fade out faster. + /// + /// #### Notes + /// + /// - This value is **not milliseconds**. + /// - Approximate fade duration in milliseconds: + /// `durationMs ~= (255 / fadeScrollBarSpeed) * (1000 / Display.getInstance().getFrameRate())` + /// - At 60 FPS, common values are: + /// - `5` -> about `850ms` + /// - `3` -> about `1400ms` + /// - `2` -> about `2100ms` + /// - `1` -> about `4250ms` public void setFadeScrollBarSpeed(int fadeScrollBarSpeed) { this.fadeScrollBarSpeed = fadeScrollBarSpeed; } diff --git a/docs/developer-guide/Advanced-Theming.asciidoc b/docs/developer-guide/Advanced-Theming.asciidoc index 47c5bf243d..582468f84b 100644 --- a/docs/developer-guide/Advanced-Theming.asciidoc +++ b/docs/developer-guide/Advanced-Theming.asciidoc @@ -238,6 +238,9 @@ SoftKey, Touch, Bar, Title, Right, Native |fadeScrollBarBool |Boolean indicating if the scrollbar should fade when there is inactivity +|setFadeScrollBarSpeed(int) _(API)_ +|Sets the per-frame opacity decrement for scrollbar fading (not milliseconds). Approximate fade duration is `durationMs ~= (255 / speed) * (1000 / frameRate)`. At 60 FPS: speed `5` ~= `850ms`, `3` ~= `1400ms`, `2` ~= `2100ms`, `1` ~= `4250ms` + |fadeScrollEdgeBool |Places a fade effect at the edges of the screen to indicate that it's possible to scroll until we reach the edge (common on Android)