Skip to content

Wear: Migrate LoopStatusActivity and WizardResultActivity to Jetpack Compose#4624

Merged
MilosKozak merged 4 commits intonightscout:composefrom
olorinmaia:wear_migrate_compose_wizardresult_loopstatus
Mar 23, 2026
Merged

Wear: Migrate LoopStatusActivity and WizardResultActivity to Jetpack Compose#4624
MilosKozak merged 4 commits intonightscout:composefrom
olorinmaia:wear_migrate_compose_wizardresult_loopstatus

Conversation

@olorinmaia
Copy link
Contributor

@olorinmaia olorinmaia commented Mar 22, 2026

Tested ok with Virtual Pump (Dash). Some screenshots:

Header Header
image image
image image
image image

Dependencies:

  • Add androidx.wear.compose:compose-material3 + compose-foundation 1.5.6

LoopStatusActivity:

  • Replace XML/Views with Compose Column + verticalScroll
  • Sealed UiState (Loading/Error/Success), AnimatedVisibility for expandable OpenAPS reason
  • Custom animated RefreshButton (press scale/alpha via pointerInput)

WizardResultActivity:

  • Align WizardResult calculation row order and formatting with phone app
  • Replace ViewPager2 + fragments with HorizontalPager (wear pager)
  • WizardResultFragment, WizardConfirmFragment, WizardResultViewBuilder deleted
  • WizardResultScreen: collapsed/expanded layout with verticalScroll when expanded
  • HorizontalPageIndicator replacing swipe-hint arrows
  • WearActivitiesModule: remove fragment @ContributesAndroidInjector entries

Cleanup:

  • Delete 8 orphaned layout XMLs, 3 drawables

…Compose

Dependencies:
  - Add androidx.wear.compose:compose-material3 + compose-foundation 1.5.6

LoopStatusActivity:
  - Replace XML/Views with Compose Column + verticalScroll
  - Sealed UiState (Loading/Error/Success), AnimatedVisibility for expandable OpenAPS reason
  - Custom animated RefreshButton (press scale/alpha via pointerInput)

WizardResultActivity:
  - Replace ViewPager2 + fragments with HorizontalPager (wear pager)
  - WizardResultFragment, WizardConfirmFragment, WizardResultViewBuilder deleted
  - WizardResultScreen: collapsed/expanded layout with verticalScroll when expanded
  - WizardConfirmScreen: centered confirm button with haptic feedback
  - HorizontalPageIndicator replacing swipe-hint arrows
  - WearActivitiesModule: remove fragment @ContributesAndroidInjector entries

Cleanup:
  - Delete 8 orphaned layout XMLs, 3 drawables
…one app

  - Reorder rows: BG → Trend → COB → Carbs → Subtotal → [X%] → IOB → Total
  - Subtotal always shown (computed from scaled components sum)
  - Percentage row (X%) only shown when percentage ≠ 100, value = subtotal × %
  - Rename "Corr. X%" label to "X%"
  - Remove unused totalBeforePercentage
  - Only show HorizontalDivider if IOB row is visible
- Only show the subtotal row if there is more than one calculation component.
- Conditionally show the subtotal/percentage section only when relevant.
@sonarqubecloud
Copy link

@MilosKozak MilosKozak merged commit 995c4d4 into nightscout:compose Mar 23, 2026
2 of 5 checks passed
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.

2 participants