Skip to content

Add tracker activity timeline#543

Merged
kasnder merged 6 commits intomasterfrom
claude/timeline-main-activity
Apr 6, 2026
Merged

Add tracker activity timeline#543
kasnder merged 6 commits intomasterfrom
claude/timeline-main-activity

Conversation

@kasnder
Copy link
Copy Markdown
Member

@kasnder kasnder commented Apr 3, 2026

Summary

  • Adds a new ActivityTimeline screen showing a recency-sorted timeline of tracker contacts grouped by app, with per-company blocked/allowed indicators and time-bucket section headers ("Last hour", "Today", "Yesterday", "This week")
  • Reachable from the main activity's overflow menu as "Tracker activity" — the main activity is unchanged
  • Tapping any entry navigates to DetailsActivity for that app, so users can adjust blocking
  • Also includes the completed Material 3 migration: unified edge-to-edge via EdgeToEdge.enable(), AlertDialog → MaterialAlertDialogBuilder, all remaining AppCompat/MaterialComponents XML references migrated

Design

Each timeline row shows:

  • App icon + name + relative timestamp
  • Up to 3 tracker companies with blocked (⛔) / allowed (✅) indicators, "+N more" overflow
  • Blocked trackers sorted first so they're immediately visible

Data comes from one SQL query grouping the access table by (uid, daddr, allowed) over 7 days, with tracker resolution via TrackerList.findTracker(). Non-tracker destinations are filtered out. No schema changes.

Full design doc: docs/design-timeline-main.md

New files

File Purpose
ActivityTimeline.java Activity with RecyclerView, async data loading
TimelineAdapter.java Adapter with section headers + entry rows
TimelineEntry.java Data model: grouped tracker contacts per app
TrackerContact.java Data model: single company contact with blocked state
activity_timeline.xml Layout: toolbar + recyclerview + empty state
item_timeline_entry.xml Row: app icon/name/time + tracker list
item_timeline_section.xml Section header
docs/design-timeline-main.md Design document

Test plan

  • Open main menu, tap "Tracker activity" — timeline appears with recent tracker data
  • Verify time sections display correctly (Last hour / Today / Yesterday / This week)
  • Verify blocked trackers show ⛔ prefix, allowed show ✅
  • Tap a timeline entry — navigates to DetailsActivity for that app
  • Return from DetailsActivity — timeline refreshes with updated data
  • With VPN off / no data — empty state message displays
  • Verify M3 migration: dialogs have rounded corners, text appearances are M3, edge-to-edge works on all API levels

https://claude.ai/code/session_01AKoCWnAeeHrRa4KjngEiTM

@kasnder
Copy link
Copy Markdown
Member Author

kasnder commented Apr 4, 2026

@nmarteybotchway this is an extremely extensive set of changes, including a major design migration. probably too much to review at once. But would still be curious to hear from you if the approach runs for you

@nmarteybotchway
Copy link
Copy Markdown
Contributor

@kasnder sure, I'll have a look at it and let you know, thanks

claude added 6 commits April 5, 2026 13:53
Replace the manual edge-to-edge workaround in ApplicationEx (which only
handled Android 15+ with custom insets/padding/background hacks) with a
single EdgeToEdge.enable() call that works across all API levels. This
uses SystemBarStyle.dark(colorPrimaryDark) for the status bar and
transparent auto-scrim for the navigation bar.

- Remove AppTheme.EdgeToEdge style and DetailsActivity manual setup
- Migrate all AlertDialog.Builder → MaterialAlertDialogBuilder (7 files)
- Migrate all TextAppearance.AppCompat → Material3 equivalents in XML
- Migrate all Widget.AppCompat.Button → Material3 equivalents in XML
- Migrate Theme.AppCompat/MaterialComponents → Material3 in layouts
- Update ActionBarTitleText and text utility styles to M3 parents
- Add explicit androidx.activity dependency for EdgeToEdge API

https://claude.ai/code/session_01AKoCWnAeeHrRa4KjngEiTM
Without the explicit dark status bar style, EdgeToEdge.enable() defaults
to transparent, and M3's light theme makes the status bar invisible.

https://claude.ai/code/session_01AKoCWnAeeHrRa4KjngEiTM
The M3 migration section was completed work, not actionable. The
important warning about dark status bar style now lives as a comment
next to the EdgeToEdge.enable() call where it's most useful.

https://claude.ai/code/session_01AKoCWnAeeHrRa4KjngEiTM
Proposes replacing the flat app list with a tracker activity timeline
grouped by app and time, surfacing active blocking and mixed states
to guide users toward DetailsActivity for adjustment.

https://claude.ai/code/session_01AKoCWnAeeHrRa4KjngEiTM
Simplify to a standalone ActivityTimeline reachable from the menu.
Drop the "active blocking" section in favor of a flat recency-sorted
timeline. Emphasize unblocked tracker contacts as the scary/educational
case. Main activity stays unchanged.

https://claude.ai/code/session_01AKoCWnAeeHrRa4KjngEiTM
New ActivityTimeline reachable from the main activity menu. Shows a
recency-sorted timeline of tracker contacts grouped by app, with
per-company blocked/allowed indicators and time-bucket section headers.

- TimelineEntry/TrackerContact: data models for grouped tracker activity
- TimelineAdapter: RecyclerView adapter with section headers and entries
- ActivityTimeline: queries access table, resolves tracker companies via
  TrackerList.findTracker(), groups by app, sorts by most recent
- DB: getRecentTrackerActivity() groups by (uid, daddr, allowed) over 7 days
- Menu: "Tracker activity" item between lockdown and traffic log
- Tapping an entry navigates to DetailsActivity for that app

https://claude.ai/code/session_01AKoCWnAeeHrRa4KjngEiTM
@kasnder kasnder force-pushed the claude/timeline-main-activity branch from 557d00d to f2c438e Compare April 5, 2026 13:53
@nmarteybotchway
Copy link
Copy Markdown
Contributor

@kasnder I tested the application on both my tablet and the Android Studio Pixel 7 emulator. In both cases, the tracking statistics section on the menu page appears to be hidden beneath the app bar (see attached screenshot).
image
The time sections display correctly during testing, and navigation from the Tracker Activity to the timeline section works as expected. Blocked and unblocked trackers also show the correct prefixes.

However, when I click on a timeline entry, it correctly opens the detail activity for the selected app, but upon returning, it navigates back to the main page instead of the updated Tracker Activity timeline page.

Reinstalling the application with VPN off and using applications with trackers (Duolingo) leads to no entries in the Tracker Activity timeline page - once VPN is turned back on and the same app is used, trackers are detected in the Tracker Activity page.

From what I see, M3 Integration seems to be functional.

@kasnder
Copy link
Copy Markdown
Member Author

kasnder commented Apr 6, 2026

thanks, @nmarteybotchway . i'll fix those changes and then create a new version

@kasnder kasnder merged commit f2c438e into master Apr 6, 2026
1 check passed
@kasnder kasnder deleted the claude/timeline-main-activity branch April 6, 2026 08:14
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.

3 participants