Skip to content

feat: system widgets foundation + price widget#895

Open
jvsena42 wants to merge 64 commits intomasterfrom
feat/system-widgets-foundation
Open

feat: system widgets foundation + price widget#895
jvsena42 wants to merge 64 commits intomasterfrom
feat/system-widgets-foundation

Conversation

@jvsena42
Copy link
Copy Markdown
Member

@jvsena42 jvsena42 commented Apr 9, 2026

This PR:

  1. Adds a Bitcoin Price home screen widget using Jetpack Glance
  2. Implements independent widget preferences stored in a separate DataStore
  3. Uses WorkManager for periodic background data refresh (15-minute intervals)
  4. Includes a configuration Activity for widget settings on click
  5. Renders a sparkline chart via Bitmap using Android Canvas API

Description

Introduces the foundation for Android home screen widgets (AppWidgets) using Jetpack Glance, starting with the Price widget. The widget displays enabled trading pairs with price, change percentage, and a line chart — matching the in-app Price widget layout.

The architecture reuses the existing PriceService for data fetching (via a new fetchData(period) overload) while keeping widget preferences completely independent from the in-app widget system through a dedicated AppWidgetPreferencesStore backed by its own DataStore file.

A Glance design system (GlanceTextStyles, GlanceColors) ports the app's typography and color tokens to Glance equivalents, and shared components (GlanceWidgetScaffold, GlanceDataRow) provide consistent widget layouts.

Preview

Screen_recording_20260421_153032.webm

QA Notes

  1. Long-press the home screen and select "Widgets"
    • Find "Bitcoin Price" in the widget picker
    • Verify the preview shows a price layout with mock data
  2. Add the widget to the home screen
    • Verify the configuration screen opens with trading pair and period options
    • Toggle pairs and period, tap Save
    • Verify the widget updates to show selected pairs with price, change %, and sparkline chart
  3. Wait 15+ minutes or force-stop and reopen
    • Verify the widget refreshes data via WorkManager
  4. Tap the widget
    • Verify it opens the widget settings screen
    • Verify the widget update after saving new preferences
  5. Long-press the widget
    • Verify the widget is resizable
    • Verify the chat is hidden if not enough vertical space
  6. Verify the OS widget settings are independent from internal app widgets

@jvsena42 jvsena42 changed the title feat: add price home screen widget feat: System widgets foundation + price widget Apr 9, 2026
@jvsena42 jvsena42 self-assigned this Apr 10, 2026
claude[bot]

This comment was marked as resolved.

@jvsena42 jvsena42 marked this pull request as draft April 22, 2026 13:01
@jvsena42 jvsena42 marked this pull request as ready for review April 22, 2026 13:08
Comment thread app/src/main/java/to/bitkit/appwidget/ui/price/PriceGlanceWidget.kt Outdated
Comment thread app/src/main/java/to/bitkit/appwidget/AppWidgetRefreshWorker.kt Outdated
@jvsena42 jvsena42 marked this pull request as draft April 22, 2026 14:29
@jvsena42 jvsena42 marked this pull request as ready for review April 22, 2026 14:39
@jvsena42 jvsena42 requested review from ovitrif and pwltr April 22, 2026 17:07
Comment thread app/src/main/java/to/bitkit/data/widgets/PriceService.kt Outdated
Comment thread app/src/main/java/to/bitkit/appwidget/ui/components/GlanceText.kt Outdated
@jvsena42 jvsena42 marked this pull request as draft April 27, 2026 16:08
@jvsena42 jvsena42 marked this pull request as ready for review April 27, 2026 16:17
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.

1 participant