@@ -21,40 +21,49 @@ sample together with the
21
21
22
22
# Getting Started
23
23
24
- ## Widget Samples
24
+ ## Canonical Widget Layout Samples
25
25
26
- The sample contains 3 type of widgets:
26
+ These [ layouts] ( ./src/main/java/com/example/platform/ui/appwidgets/glance/layout ) demonstrate how
27
+ to write responsive, high-quality layouts for use with your Glance widgets.
27
28
28
- - ToDo list: showcasing how to create a list of items
29
- - Buttons: showcasing how to use the new CompoundedButtons and handle click events
30
- - Weather: showcasing a "real-life" weather widget.
29
+ The ` layouts ` directory contains following layout categories:
31
30
32
- Those are implemented in two packages:
31
+ * [ collections] ( ./src/main/java/com/example/platform/ui/appwidgets/glance/layout/collections )
32
+ * [ Action list] ( ./src/main/java/com/example/platform/ui/appwidgets/glance/layout/collections/ActionListAppWidget.kt )
33
+ * [ Check list] ( ./src/main/java/com/example/platform/ui/appwidgets/glance/layout/collections/CheckListAppWidget.kt )
34
+ * [ Image grid] ( ./src/main/java/com/example/platform/ui/appwidgets/glance/layout/collections/ImageGridAppWidget.kt )
35
+ * [ Image text list] ( ./src/main/java/com/example/platform/ui/appwidgets/glance/layout/collections/ImageTextListAppWidget.kt )
33
36
34
- - [ rv] ( src/main/java/com/example/platform/ui/appwidgets/rv ) for RemoteViews implementation
35
- - [ glance] ( src/main/java/com/example/platform/ui/appwidgets/glance ) for Glance implementation
37
+ * [ text] ( ./src/main/java/com/example/platform/ui/appwidgets/glance/layout/text )
38
+ * [ Long Text] ( ./src/main/java/com/example/platform/ui/appwidgets/glance/layout/text/LongTextAppWidget.kt )
39
+ * [ Text with image] ( ./src/main/java/com/example/platform/ui/appwidgets/glance/layout/text/TextWithImageAppWidget.kt )
36
40
37
- ## Widget Pinning
41
+ * [ toolbars] ( ./src/main/java/com/example/platform/ui/appwidgets/glance/layout/toolbars )
42
+ * [ Toolbar with app name] ( ./src/main/java/com/example/platform/ui/appwidgets/glance/layout/toolbars/ToolBarAppWidget.kt )
43
+ * [ Toolbar with search bar] ( ./src/main/java/com/example/platform/ui/appwidgets/glance/layout/toolbars/SearchToolBarAppWidget.kt )
38
44
39
- In addition, the [ AppWidgets.kt] ( src/main/java/com/example/platform/ui/appwidgets/AppWidgets.kt )
40
- showcases how to request the launcher to "pin" an appwidget.
45
+ Each of these layout categories contains a ` layout ` sub-directory that can be copied to your project
46
+ to reuse the layouts in your code.
47
+
48
+ The ` {layoutType}Layout ` file e.g. ` ToolBarLayout ` contains:
49
+ * A top level composable e.g. ` ToolBarLayout ` ,
50
+ * Sub components,
51
+ * A breakpoints definition e.g. ` ToolBarLayoutSize ` ,
52
+ * Constants / dimensions e.g. ` ToolBarLayoutDimens ` ,
53
+ * Followed by Android Studio Preview for the layout.
41
54
42
- <img src="screenshots/todo-gif.gif" width="256px"
43
- alt="TODO widget showcase"
44
- title="Showcase of the TODO widget implementation" />
45
- <img src="screenshots/weather-gif.gif" width="256px"
46
- alt="Weather widget showcase"
47
- title="Showcase of the Weather widget implementation" />
48
- <img src="screenshots/images-gif.gif" width="256px"
49
- alt="Images widget showcase"
50
- title="Showcase of the Images widget implementation" />
55
+ Read more about the layouts: https://developer.android.com/design/ui/mobile/guides/widgets/layouts
56
+
57
+ <img src="screenshots/CanonicalLayouts.png" width="256px"
58
+ alt="Canonical Widget Layouts Showcase"
59
+ title="Showcase of canonical widget layouts" />
51
60
52
61
> More showcasing resources in the [ screenshots folder] ( screenshots )
53
62
54
- ## Canonical Layouts
63
+ ## Widget Pinning
55
64
56
- These [ layouts ] ( ./ src/main/java/com/example/platform/ui/appwidgets/glance/layout ) demonstrate how to write responsive, high-quality layouts for use with your
57
- Glance widgets.
65
+ In addition, the [ AppWidgets.kt ] ( src/main/java/com/example/platform/ui/appwidgets/AppWidgets.kt )
66
+ showcases how to request the launcher to "pin" an appwidget.
58
67
59
68
## Run a new configuration
60
69
0 commit comments