Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seo-4d696b75/glance-widget-demo
Android demo app & widget implemented with androidx.glance
https://github.com/seo-4d696b75/glance-widget-demo
Last synced: 27 days ago
JSON representation
Android demo app & widget implemented with androidx.glance
- Host: GitHub
- URL: https://github.com/seo-4d696b75/glance-widget-demo
- Owner: Seo-4d696b75
- License: mit
- Created: 2023-12-04T08:57:04.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-14T07:56:25.000Z (4 months ago)
- Last Synced: 2024-09-14T19:10:35.875Z (4 months ago)
- Language: Kotlin
- Size: 185 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# glance-widget-demo
Android demo widget implemented
with [Glance](https://developer.android.com/jetpack/androidx/releases/glance)> [!NOTE]
>
> version androidx.glance:glance*:1.1.0 is used## Features
- ✅ Stateful widget
- ✅ Handles user interaction
- ✅ Async operation on Worker
- ✅ Supports dark mode by Material3 color system
- ✅ Supports widget configuration (optional for Android 12 and above)
- ✅ Supports reconfiguration (only for Android 12 and above)
- ✅ Hilt with GlanceAppWidget and Worker
- ✅ Unit test for glance ui
- ✅ Can be added with in-app operationBuild app & widget
```shell
./gradlew app:assembleRelease
```Run unit test
```shell
./gradlew widget:test
```### widget overview
| user interaction | dark mode |
|--------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
| ![async_glance](https://github.com/Seo-4d696b75/glance-widget-demo/assets/25225028/f0250095-3e51-47da-af41-a86527637c90) | ![tap_glance_dark](https://github.com/Seo-4d696b75/glance-widget-demo/assets/25225028/de8c82e8-25c8-4299-a95b-8a7f4ac29a0c) |### configuration
| configuration when added | reconfiguration for existing |
|------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
| ![glance_configure](https://github.com/Seo-4d696b75/glance-widget-demo/assets/25225028/bc5ea08c-7656-4737-bf4a-fa2038fb0f6e) | ![glance_reconfigure](https://github.com/Seo-4d696b75/glance-widget-demo/assets/25225028/4a19ea9a-2a9e-4783-b6fd-6cb638a063ff) |## Adding a widget in-app
Can be added from in-app operation as well as from the home screen.
| No configuration | With configuration |
|------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|
| ![add_widget_inapp](https://github.com/user-attachments/assets/69d4f323-817b-4ca6-b00c-2a1108c31740) | ![add_widget_inapp_configure](https://github.com/user-attachments/assets/0d41dde1-f952-407a-b743-f58ded9fdd7c) |## Modules structures
- `app`
- `theme` common Material3 color and theme definition for Jetpack Compose and Glance
- `ui` implementation with Jetpack Compose
- `widget` implementation with Glance
- `domain` repository interface definition
- `data` repository implementation