v1.3.0
Full Changelog: v1.2.0...v1.3.0
feat(chart): decouple today and weekly usage charts with dynamic formats
Refactored the screen usage chart implementation to completely separate the
logic and layout for the "Today" (24-hour histogram) and "7 Days" (calendar week) ranges.
-
AppUsageViewModel.kt:
- Replaced the rolling week logic with calendar weeks (Monday–Sunday) and strict daily bounds.
- Replaced
weekOffsetwith a generictimeOffsetstate to track days or weeks dynamically. - Replaced
weeklyDatalist withChartDataStatecontaining eitherDailyorHourlymodels. - Dynamically configured
modelProducertransactions for hourly (24 series) vs weekly (7 series) points.
-
AppUsageScreen.kt & TimeColumnChart.kt:
- Subscribed to
chartDataStateand adjusted titles to reflect calendar weeks ("Oct 17 - Oct 23") or calendar days. - Updated horizontal axis label rendering to use 12/24hr format based on the system configuration.
- Added an
xItemPlacerparameter to the customTimeColumnChartimplementation. - Switched horizontal axis placements to use Vico's
ItemPlacer.alignedconfiguration to prevent empty-string formatting crashes on non-labeled intervals. - Adapted the pagination buttons (< and >) to shift by days or weeks depending on the selected range.
- Subscribed to
-
ScreenUsageHelper.kt:
- Added
fetchHourlyScreenTimeto parse raw UsageEvents and bucket active screen usage into 24 one-hour segments.
- Added