Skip to content

v1.3.0

Choose a tag to compare

@spewedprojects spewedprojects released this 08 Jul 11:43

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 weekOffset with a generic timeOffset state to track days or weeks dynamically.
    • Replaced weeklyData list with ChartDataState containing either Daily or Hourly models.
    • Dynamically configured modelProducer transactions for hourly (24 series) vs weekly (7 series) points.
  • AppUsageScreen.kt & TimeColumnChart.kt:

    • Subscribed to chartDataState and 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 xItemPlacer parameter to the custom TimeColumnChart implementation.
    • Switched horizontal axis placements to use Vico's ItemPlacer.aligned configuration 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.
  • ScreenUsageHelper.kt:

    • Added fetchHourlyScreenTime to parse raw UsageEvents and bucket active screen usage into 24 one-hour segments.