Rings were capped at a fixed 86dp; now each gauge fills its half of the widget
(weighted ImageView) so they grow with the placed widget size. Bumped RingRenderer
default bitmap to 360px/36 stroke to stay crisp at the larger display size.
Add RingRenderer (circular gauge mirror of BarRenderer), a widget_layout_rings
layout, a Bars/Rings preference + in-app toggle, and ring rendering branch in
ClaudeUsageWidget. Full (4x2) widget honors the chosen style; compact size stays
bars. Phase 1 of porting hamed-elfayome/Claude-Usage-Tracker features.
Replace the configurable threshold sliders with two fixed alert levels —
90% and 100% — per metric. Anti-spam now uses hysteresis instead of the
API reset-epoch (which could drift and re-fire): each level fires once
when crossed and re-arms only after usage drops back below it. Alerts are
posted only by the background worker, never the in-app refresh loop, so
you're not pinged while looking at the app. UI drops the sliders for a
one-line description; settings keep just the on/off switch.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add an in-app 7-day history chart and opt-in usage alerts, the two
features requested from the macOS Claude-Usage-Tracker that map cleanly
to an Android widget app.
History:
- UsageSnapshot model; PreferencesManager records session/weekly
utilization on every refresh (7-day retention, <=600 points, collapses
readings under 2 min apart to avoid worker+manual double-logging).
- HistoryChartView: dependency-free Canvas line chart (session/weekly,
0/50/100% gridlines), breaks the line across >35-min gaps.
- New HISTORY card with chart + legend.
Notifications:
- Notifier posts when session/weekly crosses a user threshold, at most
once per limit window (keyed on reset-epoch, re-arms on rollover).
- USAGE ALERTS card: enable switch + session/weekly sliders (50-100%,
defaults 90/85). POST_NOTIFICATIONS permission + runtime request.
- Wired into the existing 5-min background worker.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a pace tick to each usage bar showing where you should be to finish
at 100% by reset, color-coded by projected tier, plus a Claude burst icon
that lights up during Anthropic peak hours (5-11 AM PT, Mon-Fri). Bars now
rendered as bitmaps so the same renderer drives both the widget and the app.
New: PaceCalc, PeakHours, BarRenderer, ic_claude_burst drawable.
versionCode 12 / versionName 1.11. Includes rebuilt signed release APK.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Make every TextView in both widget layouts fully white (#FFFFFF) with
textStyle=bold — SESSION/WEEKLY labels, session/weekly sub-labels,
status line, and last-updated timestamp.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Android 16 bug: EncryptedSharedPreferences threw on ANY exception (Keystore
busy during screen-lock/BG wakeup) and the code deleted the encrypted prefs
file on any failure, permanently erasing session cookies. Now only
KeyPermanentlyInvalidatedException (biometric/PIN change) triggers delete;
transient failures preserve the file for the next session.
Also prevents saving cookies to plain-text fallback prefs if encrypted prefs
are unavailable.
WorkManager periodic (15 min, requires network) added alongside AlarmManager
as a Doze-mode backup for Android 16, where inexact alarms can be batched up
to 75 min.
UI: sync icon 24→32dp (large widget), 20→28dp (small); reset-time font
9→11sp (large), 8→10sp (small).
Security:
- All Log.d response-body and URL-bearing logs gated behind BuildConfig.DEBUG
- Cookie header value stripped of CRLF to prevent HTTP header injection
- LoginActivity coroutine migrated from bare CoroutineScope to lifecycleScope
- Widget removed from keyguard (lock-screen) category — usage data is sensitive
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>