Skip to content

Infinite scrolling for widgets, operated by two-finger scrolling gestures - #2648

Merged
marunjar merged 15 commits into
Neamar:masterfrom
photonsphere-org:widgetsscrolling
Sep 16, 2026
Merged

marunjar merged 15 commits into
Neamar:masterfrom
photonsphere-org:widgetsscrolling

Conversation

@photonsphere-org

Copy link
Copy Markdown
Contributor

Scrollable widget area for minimalistic UI mode

Summary

Adds vertical scrolling to the widget area in minimalistic UI mode (history-hide),
allowing an unlimited number of widgets. Previously, widgets were clamped to the
visible viewport and could overflow silently.

Motivation

Users in minimalistic UI mode who add multiple widgets run out of screen space. There
was no way to reach widgets below the fold. This PR adds a two-finger scroll gesture
to navigate the widget area while preserving full single-finger interaction with
widgets (taps, long-presses, internal scrolling).

Behavior

  1. Two fingers down anywhere over the widget area, drag -> widget area scrolls vertically

  2. Single finger over a widget -> widget receives everything: taps, config-taps, long-press menus, internal list scrolling

  3. Single finger on empty space -> forwarded verbatim to the launcher's gesture pipeline (history, favorites, live wallpaper)

  4. "Enable widget scrolling" off ->full existing behavior revert: no scrolling, original viewport clamp, widgets stacked edge-to-edge

Design decisions

  • Two-finger gesture (not single-finger scroll zone): A single-finger scroll
    area cannot coexist with arbitrary widget interaction -- widgets may need taps
    anywhere on their surface. The two-finger gesture cleanly separates scroll from
    widget interaction without visual zones or edge detection.

  • NestedScrollView base class: Used for fling(), scrollBy(), layout/measurement,
    and mouse wheel support via onGenericMotionEvent. The touch pipeline is fully
    overridden to implement two-finger-only scrolling; onStartNestedScroll returns
    false to prevent widgets' internal lists from handing off drags.

  • Empty-area event forwarding: Gestures on empty areas are forwarded verbatim
    (timestamps preserved) to the same pipeline as the rest of the launcher
    (ExperienceTweaks + LiveWallpaper), ensuring taps, double-taps, and swipes
    on empty space behave identically to non-widget areas.

  • WidgetUtils extraction: Widget line-arithmetic (getLineSize, getMinHeight,
    getInitialLineSize) is extracted into a JVM-testable utility class with no Android
    framework dependencies. Two methods were moved from Widgets.java; one
    (getInitialLineSize) is new logic for the scroll feature.

  • WidgetView long-press fix: Adds onTouchEvent handling for ACTION_CANCEL and
    ACTION_POINTER_DOWN to cancel the pending long-press check. This is
    defense-in-depth: WidgetScrollView.cancelWidgetLongPresses() already provides the
    primary cancellation, but the fix ensures correctness if any parent intercepts for
    any reason (ACTION_CANCEL bypasses onInterceptTouchEvent).

Settings

Two new preferences under Advanced:

  • Enable widget scrolling (switch, default on) -- disables scrolling entirely,
    reverting to exiting behavior viewport-clamped behavior
  • Space between widgets (dp) (numeric, default 10, range 0-50) -- adjustable
    spacing between stacked widgets; disabled when scrolling is off

Testing

  • JVM unit tests for WidgetUtils (7 test methods: zero-height, partial lines,
    exact multiples, target cell height, upsize/forbid logic)
  • Manual QA checklist added to qa-suite.md (14 items covering two-finger scroll,
    single-finger passthrough, empty-area forwarding, settings toggling, long-press
    menus, rotation, and process death)

@photonsphere-org

photonsphere-org commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

scrolled to top:
Screenshot_20260825_161625_KISS launcher

scrolled down:
Screenshot_20260825_161639_KISS launcher

scrolled to bottom:
Screenshot_20260825_170714_KISS launcher

Comment thread app/src/main/java/fr/neamar/kiss/forwarder/Widgets.java Outdated
Comment thread app/src/main/java/fr/neamar/kiss/ui/WidgetScrollView.java Outdated
Comment thread app/src/main/java/fr/neamar/kiss/ui/WidgetScrollView.java
Comment thread app/src/main/java/fr/neamar/kiss/ui/WidgetScrollView.java
Comment thread app/src/main/res/xml/preferences.xml Outdated
@marunjar

marunjar commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

@Neamar any thoughts on these changes
Your last comment on #2524 (comment) was was about adding multiple pages for widgets which is quite different to scrolling.

Or should KISS support both at some point?

Comment thread app/src/main/java/fr/neamar/kiss/forwarder/Widgets.java Outdated
Comment thread app/src/main/java/fr/neamar/kiss/forwarder/Widgets.java Outdated
Comment thread app/src/main/java/fr/neamar/kiss/forwarder/Widgets.java Outdated
Comment thread app/src/main/java/fr/neamar/kiss/forwarder/Widgets.java Outdated
Comment thread app/src/main/java/fr/neamar/kiss/forwarder/Widgets.java
@marunjar

Copy link
Copy Markdown
Collaborator

@photonsphere-org Tried it again with last changes and widgets are not yet reacting on changes of widget-spacing setting. Can you please check?

@photonsphere-org

photonsphere-org commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

@photonsphere-org Tried it again with last changes and widgets are not yet reacting on changes of widget-spacing setting. Can you please check?

Oh, biscuits... Indeed, something's off and I missed it because I did not try to change widgets spacing in setting. Sorry about that; investigating...

Updates:
A. I think the problem is fixed;
B. fixed another thing (when scrolling because of a fling touching screen does not abort the earlier fling gesture, one has to wait until scrolling has finished);
C. Investigated Android logs because stress testing revealed what seems to be erratic behaviour -- two fixes for pre-existing issues made.

@marunjar

Copy link
Copy Markdown
Collaborator

It works now.
Thank's a lot for your effort.

@marunjar
marunjar merged commit 59b1b25 into Neamar:master Sep 16, 2026
2 checks passed
@photonsphere-org
photonsphere-org deleted the widgetsscrolling branch September 16, 2026 19:29
@photonsphere-org

Copy link
Copy Markdown
Contributor Author

Thank you for your patience and reviews! I hope scrolling widgets will be of use to KISS users (using it already on all my devices myself)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants