Skip to content

Add Glance Widget recipe for Transform - #10

Open
droid-wan-kenobi wants to merge 1 commit into
mainfrom
glance-transform
Open

droid-wan-kenobi wants to merge 1 commit into
mainfrom
glance-transform

Conversation

@droid-wan-kenobi

Copy link
Copy Markdown
Collaborator

Adds a Glance Widget recipe (com.example.appstaterecipes.glance) showing how to define a transform for a GlanceAppWidget and share upstream transform state across an app screen and a home-screen widget.

  • FocusSessionManager.summary combines sessionFlow and tasksFlow into State<FocusSummary>, returning early while idle so tasksFlow is only collected during active sessions.
  • focusWidgetTransform layers a widget-specific transform scoped to FocusWidget.provideGlance to combine summary with completedTodayFlow into State<FocusWidgetUiState>.
  • FocusContainer uses listener to call FocusWidget().updateAll(...) when state changes while widgets are placed on the home screen.
  • Adds glance/README.md, updates RecipePickerActivity and the root README.md, and adds unit tests in GlanceTransformTest using transformTest.

Testing: ./gradlew assembleDebug test and ./gradlew :app:assembleRelease :app:lintDebug pass.

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