A comprehensive digital wellbeing system that tracks app usage, calculates physical scroll distance, and enforces time limits through real-time monitoring and system-level overlays.
The ScrollLess module is a sophisticated digital wellbeing engine designed to combat mindless scrolling. Unlike standard screen-time trackers, it focuses on active engagement by measuring physical scroll distance and providing real-time interventions. It leverages Android’s to observe user behavior and for persistent limit enforcement and data synchronization.
The heart of the module is the ScrollTrackService. It acts as the primary data collector, capturing events, app opens, and typing frequency. It doesn’t just log data; it orchestrates the “Blocking” UI when limits are exceeded.
3. The Enforcer (BlockingStateManager & OverlayEnforcer)
These components manage the “Locked” state. When the LimitMonitor determines a limit is hit, the BlockingStateManager updates a reactive . The ScrollTrackService observes this and triggers the OverlayEnforcer to draw a system-level barrier, preventing further app interaction.
The enforcement loop is highly optimized to prevent “flicker” or bypasses:
Epsilon Buffering: The system uses an EPSILON_MS (usually 1-5 seconds) to trigger blocks slightly before the limit is hit, ensuring the user cannot “squeeze” extra time during transition animations.
Midnight Rollover: A dedicated handleMidnightRollover logic clears all blocks and resets daily counters exactly at 00:00, preventing stale blocks from the previous day.
The module performs complex transformations to turn raw pixels into meaningful human metrics:
Pixel-to-Meter Conversion: Uses the device’s to translate screen pixels into physical meters of scrolling.
Inferred Scroll Heuristics: For apps that don’t report precise pixel deltas (like some custom lists), the system uses a sqrt(count) * multiplier model to estimate distance based on content change events.