Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup old code samples and adjust weather sample background / radius with Scaffold component #226

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

shamalip
Copy link
Contributor

@shamalip shamalip commented Jan 18, 2025

  1. Removes the button and image code samples. For samples of specific Glance components, the Glance demos directory should help (https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:glance/glance-appwidget/integration-tests/demos/)

  2. Adjust the weather sample's size, preview and use Scaffold component as widget container.

    NOTE: We don't yet have a similar layout in canonical widget layouts sample (i.e. layout directory), so, keeping the weather widget around until we have a UX designed for such layout.

  3. The weather sample also was updated to calculate inner radius based on system radius and widget's padding (which is 12dp in all layouts and Scaffold).

  4. Additionally, update the AppWidgets entry-point page to call out canonical widget layout samples - which contain recommended UX design for widgets

image
image

- "rv" is not recommended and "glance" is the preferred widget framework.
- Sizing on those widgets is off. The new canonical layouts are recommended.
- "rv" is not recommended and "glance" is the preferred widget framework.
- Sizing on those widgets is off. The new canonical layout contain example of lists and are recommended.
…t samples.

The main "AppWidgets" page now displays link to the canonical layout showcase page and then below it, demonstrates the functionality to pin and show widget information.
- 4x2 is the recommended size for such widget
- avoid 3x? sizes
- Uses glance loading layout resource instead of the local xml
- Update the preview image
- To closely match the appWidgetBackground color used in glance.
- The Scaffold component in glance handles the background color, widget radius for you.
- For the inner content, calculate widget radius based on the padding and system radius.
@shamalip
Copy link
Contributor Author

shamalip commented Jan 18, 2025

+@secondsun I'm deleting old code here and we should recommend the canonical layout samples which are well-designed UX samples.

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