Infinite scrolling for widgets, operated by two-finger scrolling gestures - #2648
Conversation
|
@Neamar any thoughts on these changes Or should KISS support both at some point? |
|
@photonsphere-org Tried it again with last changes and widgets are not yet reacting on changes of |
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: |
|
It works now. |
|
Thank you for your patience and reviews! I hope scrolling widgets will be of use to |



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
Two fingers down anywhere over the widget area, drag -> widget area scrolls vertically
Single finger over a widget -> widget receives everything: taps, config-taps, long-press menus, internal list scrolling
Single finger on empty space -> forwarded verbatim to the launcher's gesture pipeline (history, favorites, live wallpaper)
"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 fullyoverridden to implement two-finger-only scrolling;
onStartNestedScrollreturnsfalse 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 swipeson 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 Androidframework dependencies. Two methods were moved from
Widgets.java; one(
getInitialLineSize) is new logic for the scroll feature.WidgetView long-press fix: Adds
onTouchEventhandling forACTION_CANCELandACTION_POINTER_DOWNto cancel the pending long-press check. This isdefense-in-depth:
WidgetScrollView.cancelWidgetLongPresses()already provides theprimary cancellation, but the fix ensures correctness if any parent intercepts for
any reason (
ACTION_CANCELbypassesonInterceptTouchEvent).Settings
Two new preferences under Advanced:
reverting to exiting behavior viewport-clamped behavior
spacing between stacked widgets; disabled when scrolling is off
Testing
WidgetUtils(7 test methods: zero-height, partial lines,exact multiples, target cell height, upsize/forbid logic)
qa-suite.md(14 items covering two-finger scroll,single-finger passthrough, empty-area forwarding, settings toggling, long-press
menus, rotation, and process death)