Skip to content

Commit ae39c55

Browse files
committed
Updated imagery on preview images.
1 parent df75d2f commit ae39c55

24 files changed

+153
-143
lines changed

samples/user-interface/appwidgets/src/main/java/com/example/platform/ui/appwidgets/glance/layout/collections/data/FakeImageGridDataRepository.kt

Lines changed: 63 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -115,68 +115,69 @@ class FakeImageGridDataRepository {
115115
val supportingText: String? = null,
116116
)
117117

118-
companion object {
119-
private val repositories = mutableMapOf<GlanceId, FakeImageGridDataRepository>()
120-
121-
private val demoItems = listOf(
122-
ImageGridItemBackendData(
123-
key = "1",
124-
imageUrl = "https://images.unsplash.com/photo-1444464666168-49d633b86797",
125-
imageContentDescription = "Perched blue and orange bird",
126-
title = "Perched blue and orange bird",
127-
supportingText = "2000 views"
128-
),
129-
ImageGridItemBackendData(
130-
key = "2",
131-
imageUrl = "https://images.unsplash.com/photo-1500349812227-3264f5f54181",
132-
imageContentDescription = "Orange Lacewing butterfly",
133-
title = "Orange Lacewing butterfly",
134-
supportingText = "1900 views"
135-
),
136-
ImageGridItemBackendData(
137-
key = "3",
138-
imageUrl = "https://images.unsplash.com/photo-1578326457399-3b34dbbf23b8",
139-
imageContentDescription = "Zebra",
140-
title = "Zebra in African safari",
141-
supportingText = "7000 views"
142-
),
143-
ImageGridItemBackendData(
144-
key = "4",
145-
imageUrl = "https://images.unsplash.com/photo-1564349683136-77e08dba1ef7",
146-
imageContentDescription = "Panda",
147-
title = "The hungry panda",
148-
supportingText = "1100 views"
149-
),
150-
ImageGridItemBackendData(
151-
key = "5",
152-
imageUrl = "https://images.unsplash.com/photo-1585256262155-c044dc6ad38e",
153-
imageContentDescription = "Humming bird",
154-
title = "Beautiful humming bird",
155-
supportingText = "700 views"
156-
),
157-
ImageGridItemBackendData(
158-
key = "6",
159-
imageUrl = "https://images.unsplash.com/photo-1497752531616-c3afd9760a11",
160-
imageContentDescription = "Racoon",
161-
title = "Racoon on lawn grass",
162-
supportingText = "1500 views"
163-
),
164-
ImageGridItemBackendData(
165-
key = "7",
166-
imageUrl = "https://images.unsplash.com/photo-1425082661705-1834bfd09dca",
167-
imageContentDescription = "Brown hamster",
168-
title = "Brown hamster",
169-
supportingText = "800 views"
170-
),
171-
ImageGridItemBackendData(
172-
key = "8",
173-
imageUrl = "https://images.unsplash.com/reserve/RFDKkrvXSHqBaWMMl4W5_Heavy_company",
174-
imageContentDescription = "Elephant in afternoon sun",
175-
title = "Elephant in afternoon sun",
176-
supportingText = "1200 views"
177-
)
178-
)
179-
118+
companion object {
119+
private val repositories = mutableMapOf<GlanceId, FakeImageGridDataRepository>()
120+
121+
// Courtesy of https://unsplash.com/@iamliam
122+
// 16:9 images
123+
private val demoItems = listOf(
124+
ImageGridItemBackendData(
125+
key = "1",
126+
imageUrl = "https://images.unsplash.com/photo-1531306760863-7fb02a41db12",
127+
imageContentDescription = "Flowers at a wedding reception",
128+
title = "Flowers at a wedding reception",
129+
supportingText = "33,822 views"
130+
),
131+
ImageGridItemBackendData(
132+
key = "2",
133+
imageUrl = "https://images.unsplash.com/photo-1566964423430-3e52903303a5",
134+
imageContentDescription = "An up-close look at a Blushing Bride Protea flower.",
135+
title = "An up-close look at a Blushing Bride Protea flower.",
136+
supportingText = "31,072 views"
137+
),
138+
ImageGridItemBackendData(
139+
key = "3",
140+
imageUrl = "https://images.unsplash.com/photo-1685540466252-8c21e7c37624",
141+
imageContentDescription = "A single water droplet rests in a budding red pansy.",
142+
title = "A single water droplet rests in a budding red pansy.",
143+
supportingText = "193 views"
144+
),
145+
ImageGridItemBackendData(
146+
key = "4",
147+
imageUrl = "https://images.unsplash.com/photo-1582817954171-c3533fffde89",
148+
imageContentDescription = "Blossom, petal, flower",
149+
title = "Blossom, petal, flower",
150+
supportingText = "23,815 views",
151+
),
152+
ImageGridItemBackendData(
153+
key = "5",
154+
imageUrl = "https://images.unsplash.com/photo-1565314912546-0d18918fdc8f",
155+
imageContentDescription = "Green plant, sky and flowers",
156+
title = "Green plant, sky and flowers",
157+
supportingText = "99,467 views"
158+
),
159+
ImageGridItemBackendData(
160+
key = "6",
161+
imageUrl = "https://images.unsplash.com/photo-1671525784444-392a8f8daa3f",
162+
imageContentDescription = "A snow-shoer walking up Strelapass",
163+
title = "A snow-shoer walking up Strelapass",
164+
supportingText = "3,033 views",
165+
),
166+
ImageGridItemBackendData(
167+
key = "7",
168+
imageUrl = "https://images.unsplash.com/photo-1671525737370-1d490286372e",
169+
imageContentDescription = "Davos at sunrise, viewed from Schatzalp",
170+
title = "Davos at sunrise, viewed from Schatzalp",
171+
supportingText = "4,054 views",
172+
),
173+
ImageGridItemBackendData(
174+
key = "8",
175+
imageUrl = "https://images.unsplash.com/photo-1629027272726-2eed15f90e8e",
176+
imageContentDescription = "Nasturtium plants",
177+
title = "Nasturtium plants",
178+
supportingText = "975 views",
179+
)
180+
)
180181
/**
181182
* Returns the repository instance for the given widget represented by [glanceId].
182183
*/

samples/user-interface/appwidgets/src/main/java/com/example/platform/ui/appwidgets/glance/layout/collections/data/FakeImageTextListDataRepository.kt

Lines changed: 52 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class FakeImageTextListDataRepository {
4545
val showData = Random.nextInt(50) < 5
4646

4747
items = if (showData) {
48-
items.shuffled()
48+
demoItems.take(MAX_ITEMS).shuffled()
4949
} else {
5050
listOf()
5151
}
@@ -130,56 +130,57 @@ class FakeImageTextListDataRepository {
130130
private const val MAX_ITEMS = 10
131131
private const val TAG = "FITLDR"
132132

133-
private val demoItems = listOf(
134-
DemoDataItem(
135-
key = "1",
136-
supportingImageUrl = "https://images.unsplash.com/photo-1563379926898-05f4575a45d8",
137-
title = "Seafood pasta with shrimps and tomatoes in a pan",
138-
supportingText = "45 min",
139-
),
140-
DemoDataItem(
141-
key = "2",
142-
title = "Oat pancakes with honey and bananas",
143-
supportingText = "15 min",
144-
supportingImageUrl = "https://images.unsplash.com/photo-1567620905732-2d1ec7ab7445",
145-
),
146-
DemoDataItem(
147-
key = "3",
148-
title = "The ultimate barbeque platter",
149-
supportingText = "1 hr",
150-
supportingImageUrl = "https://images.unsplash.com/photo-1555939594-58d7cb561ad1"
151-
),
152-
DemoDataItem(
153-
key = "4",
154-
title = "Kale olive salad with onions and pecans",
155-
supportingText = "15 min",
156-
supportingImageUrl = "https://images.unsplash.com/photo-1540189549336-e6e99c3679fe",
157-
),
158-
DemoDataItem(
159-
key = "5",
160-
title = "Indulging strawberry cheesecake",
161-
supportingText = "1 hr",
162-
supportingImageUrl = "https://images.unsplash.com/photo-1565958011703-44f9829ba187",
163-
),
164-
DemoDataItem(
165-
key = "6",
166-
title = "Devil eggs with avacado toast",
167-
supportingText = "30 min",
168-
supportingImageUrl = "https://images.unsplash.com/photo-1482049016688-2d3e1b311543",
169-
),
170-
DemoDataItem(
171-
key = "7",
172-
title = "Salmon and cucumbers!",
173-
supportingText = "1 hr",
174-
supportingImageUrl = "https://images.unsplash.com/photo-1467003909585-2f8a72700288",
175-
),
176-
DemoDataItem(
177-
key = "8",
178-
title = "Salad: the path to a healthier, happier you",
179-
supportingText = "30 min",
180-
supportingImageUrl = "https://images.unsplash.com/photo-1512621776951-a57141f2eefd",
181-
),
182-
)
133+
// Courtesy of https://unsplash.com/@iamliam
134+
private val demoItems = listOf(
135+
DemoDataItem(
136+
key = "1",
137+
title = "Flowers at a wedding reception",
138+
supportingText = "33,822 views",
139+
supportingImageUrl = "https://images.unsplash.com/photo-1531306760863-7fb02a41db12"
140+
),
141+
DemoDataItem(
142+
key = "2",
143+
title = "An up-close look at a Blushing Bride Protea flower.",
144+
supportingText = "31,072 views",
145+
supportingImageUrl = "https://images.unsplash.com/photo-1566964423430-3e52903303a5",
146+
),
147+
DemoDataItem(
148+
key = "3",
149+
supportingImageUrl = "https://images.unsplash.com/photo-1685540466252-8c21e7c37624",
150+
title = "A single water droplet rests in a budding red pansy.",
151+
supportingText = "193 views",
152+
),
153+
DemoDataItem(
154+
key = "4",
155+
title = "Blossom, petal, flower",
156+
supportingText = "23,815 views",
157+
supportingImageUrl = "https://images.unsplash.com/photo-1582817954171-c3533fffde89",
158+
),
159+
DemoDataItem(
160+
key = "5",
161+
title = "Orchids at New York Botanical Garden",
162+
supportingText = "205,481 views",
163+
supportingImageUrl = "https://images.unsplash.com/photo-1565357153781-98bf8686488a",
164+
),
165+
DemoDataItem(
166+
key = "6",
167+
title = "Tabletop composition with flower",
168+
supportingText = "85,060 views",
169+
supportingImageUrl = "https://images.unsplash.com/photo-1591404789216-d03646c78f73",
170+
),
171+
DemoDataItem(
172+
key = "7",
173+
title = "Wild bee on flower",
174+
supportingText = "6,692 views",
175+
supportingImageUrl = "https://images.unsplash.com/photo-1653927050791-5fc981435d12",
176+
),
177+
DemoDataItem(
178+
key = "8",
179+
title = "Flowers on a vine",
180+
supportingText = "31,862 views",
181+
supportingImageUrl = "https://images.unsplash.com/photo-1531307119710-accdb402fe03",
182+
),
183+
)
183184

184185
private val repositories = mutableMapOf<GlanceId, FakeImageTextListDataRepository>()
185186

samples/user-interface/appwidgets/src/main/java/com/example/platform/ui/appwidgets/glance/layout/text/data/FakeTextWithImageRepository.kt

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -118,35 +118,43 @@ class FakeTextWithImageRepository {
118118
val caption: String,
119119
)
120120

121-
val demoItems = listOf(
122-
DemoData(
123-
primary = "Seafood pasta with shrimps and tomatoes in a pan",
124-
secondary = "Savor the taste of the ocean with this simple, one-pan seafood pasta.",
125-
caption = "45 min",
126-
url = "https://images.unsplash.com/photo-1563379926898-05f4575a45d8",
127-
imageContentDescription = "image of seafood pasta",
128-
),
129-
DemoData(
130-
primary = "Ramen noodles with soft boiled egg, shrimp and snow peas.",
131-
secondary = "Slurp up comfort with this simple ramen noodle bowl, brimming with fresh flavors",
132-
caption = "50 min",
133-
url = "https://images.unsplash.com/photo-1569718212165-3a8278d5f624",
134-
imageContentDescription = "image of ramen noodles",
135-
),
136-
DemoData(
137-
primary = "a platter of crackers, strawberries, and fruit",
138-
secondary = "Wine, cheese, crackers and berries. What more could a party ask for?",
139-
caption = "15 min",
140-
url = "https://images.unsplash.com/photo-1496412705862-e0088f16f791",
141-
imageContentDescription = "image of a platter of crackers, strawberries, and fruit",
142-
),
143-
DemoData(
144-
primary = "Salted egg chicken rice for lunch",
145-
secondary = "Treat yourself to this umami-packed lunchtime delight.",
146-
caption = "15 min",
147-
url = "https://images.unsplash.com/photo-1564671165093-20688ff1fffa",
148-
imageContentDescription = "image of a salted egg chicken rice",
121+
// Courtesy of https://unsplash.com/@iamliam
122+
val demoItems = listOf(
123+
DemoData(
124+
primary = "Davos at sunrise, viewed from Schatzalp",
125+
secondary = "Golden light washes over the alpine village of Davos, a breathtaking view unfolding from Schatzalp's vantage point.",
126+
caption = "33,822 views",
127+
url = "https://images.unsplash.com/photo-1671525737370-1d490286372e",
128+
imageContentDescription = "Davos at sunrise, viewed from Schatzalp",
129+
),
130+
DemoData(
131+
primary = "Flowers at a wedding reception",
132+
secondary = "I took this photo at a wedding reception. The flowers were in a vase next to a window",
133+
caption = "33,822 views",
134+
url = "https://images.unsplash.com/photo-1531306760863-7fb02a41db12",
135+
imageContentDescription = "Flowers at a wedding reception",
136+
),
137+
DemoData(
138+
primary = "Blushing Bride",
139+
secondary = "An up-close look at a Blushing Bride Protea flower, native to South Africa",
140+
caption = "31,072 views",
141+
url = "https://images.unsplash.com/photo-1566964423430-3e52903303a5",
142+
imageContentDescription = "Blushing Bride flower",
143+
),
144+
DemoData(
145+
primary = "Winter in Switzerland",
146+
secondary = "A snow-shoer walking up Strelapass on snow lined with deep trails from skiiers",
147+
caption = "15 min",
148+
url = "https://images.unsplash.com/photo-1671525784444-392a8f8daa3f",
149+
imageContentDescription = "A snow-shoer walking up Strelapass on snow lined with deep trails from skiiers",
150+
),
151+
DemoData(
152+
primary = "A single water droplet rests in a budding red pansy.",
153+
secondary = "Secrets held within a drop: A microcosm of beauty in a world of red.",
154+
caption = "193 views",
155+
url = "https://images.unsplash.com/photo-1685540466252-8c21e7c37624",
156+
imageContentDescription = "A single water droplet rests in a budding red pansy.",
157+
)
149158
)
150-
)
151159
}
152160
}
1.15 MB
Loading
-150 KB
Binary file not shown.
324 KB
Loading
-921 Bytes
Loading
579 KB
Loading
1.17 MB
Loading
-135 KB
Binary file not shown.

0 commit comments

Comments
 (0)