Scroll Time Store
Persistent storage for scrolling time, breaks, streaks, and session statistics.
This object manages all time-related data storage:
- Scrolling time: Tracks time spent scrolling per app and total per day
- Break events: Counts when user takes breaks or gets locked
- Avoided time: Tracks time "saved" by interventions
- Streak tracking: Maintains consecutive days of taking breaks
- Session statistics: Tracks warnings shown, actions taken, cooldowns, etc.
Data is stored in SharedPreferences with keys like:
- `scroll_2025-10-30_total` - Total scroll time for a day
- `scroll_2025-10-30_com.instagram.android` - Time for specific app
- `scroll_2025-10-30_breaks` - Number of breaks taken
- `scroll_2025-10-30_avoided_ms` - Time avoided in milliseconds
See also
Functions
Ends the current scrolling session and saves the duration.
Optionally: list all apps for today (to show top apps)
How many breaks user took TODAY (for "You avoided doomscroll 3 times today")
Get per-app scroll time for today (ms)
Get total scroll time for today (ms)
Avoided doomscroll last week: sum of avoided_ms for last 7 days
Weekly summary (last 7 days): how many times user avoided doomscroll (for "Weekly summary 30 times")
Doomscrolled last week: sum of TOTAL scroll time for last 7 days (for "1h 02 min")
Records when a user takes a break from scrolling.
Starts tracking a new scrolling session for the specified app.