Feature/alarm widget font size#19
Merged
Merged
Conversation
Sharing WidgetRoot across GlanceAppWidget subclasses caused Glance to assign the same layout resource ID to both widgets, making the temp widget display alarm content after the alarm widget was placed. Each widget now owns its full Box > Box scaffold so their composable trees are unique. WidgetRoot.kt deleted. Docs updated with the constraint.
Updates package from com.wassupluke.simpleweather to com.wassupluke.widgets, adds AlarmWidget/AlarmWidgetReceiver to the package structure, refreshes all dependency versions, and documents the Glance layout isolation constraint.
Reviewer's GuideRefactors Glance widget layout scaffolding so Weather and Alarm widgets each own their full clickable root instead of sharing a common WidgetRoot composable, fixing cross-widget content bleed, and updates documentation (CLAUDE.md and adding-a-widget.md) to describe the architecture, constraints, and new Glance isolation pattern. Class diagram for isolated Glance widget roots (WeatherWidget and AlarmWidget)classDiagram
class GlanceAppWidget
class WeatherWidget {
+provideGlance(context)
-suspend Content()
}
class AlarmWidget {
+provideGlance(context)
-suspend Content()
}
class WeatherWidgetContent {
+WeatherWidgetContent(displayTemp, textColorProvider, tapAction, fontSize)
}
class AlarmWidgetContent {
+AlarmWidgetContent(alarmText, textColorProvider, tapAction, fontSize)
}
class WidgetRoot {
-WidgetRoot(tapAction, content)
}
GlanceAppWidget <|-- WeatherWidget
GlanceAppWidget <|-- AlarmWidget
WeatherWidget --> WeatherWidgetContent : uses
AlarmWidget --> AlarmWidgetContent : uses
WidgetRoot .. WeatherWidget : previously_used_by
WidgetRoot .. AlarmWidget : previously_used_by
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix regression introduced in ee0aaef and fe0c35c where all widgets shared the same root, and would update to show text for the most recent widget type placed. e.g., place the weather widget, then place the alarm widget and the weather widget would switch to also showing the upcoming alarm.
Summary by Sourcery
Isolate each widget's Glance layout to prevent cross-widget content bleed and update project documentation to reflect the multi-widget architecture and constraints.
Bug Fixes:
Enhancements: