Skip to content

Commit 0695fbd

Browse files
Merge remote-tracking branch 'origin/vishesh211/bug-534-interests-multiple-click' into vishesh211/bug-534-interests-multiple-click
# Conflicts: # feature/interests/src/main/java/com/google/samples/apps/nowinandroid/feature/interests/TabContent.kt
2 parents a4eddf6 + 8a25efa commit 0695fbd

File tree

164 files changed

+2959
-3075
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+2959
-3075
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# https://editorconfig.org/
2+
# This configuration is used by ktlint when spotless invokes it
3+
4+
[*.{kt,kts}]
5+
ij_kotlin_allow_trailing_comma=true
6+
ij_kotlin_allow_trailing_comma_on_call_site=true

.github/workflows/AndroidCIWithGmd.yaml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,27 @@ on:
99
jobs:
1010

1111
android-ci:
12-
runs-on: macos-latest
12+
runs-on: macos-12
1313

1414
steps:
15-
- uses: actions/setup-java@v3
16-
with:
17-
distribution: 'zulu'
18-
java-version: '11'
19-
- uses: actions/checkout@v2
15+
- uses: actions/setup-java@v3
16+
with:
17+
distribution: 'zulu'
18+
java-version: '11'
19+
- uses: actions/checkout@v3
2020

21-
- name: Run instrumented tests with GMD
22-
continue-on-error: true
23-
run: ./gradlew cleanManagedDevices --unused-only && ./gradlew pixel4api30DemoDebugAndroidTest -Dorg.gradle.workers.max=1 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true --info
21+
- name: Setup Android SDK
22+
uses: android-actions/setup-android@v2
2423

25-
- name: Upload test reports
26-
if: success() || failure()
27-
uses: actions/upload-artifact@v3
28-
with:
29-
name: test-reports
30-
path: |
31-
'**/*/build/reports/androidTests/'
24+
- name: Run instrumented tests with GMD
25+
run: ./gradlew cleanManagedDevices --unused-only &&
26+
./gradlew pixel4api30DemoDebugAndroidTest -Dorg.gradle.workers.max=1
27+
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true --info
28+
29+
- name: Upload test reports
30+
if: success() || failure()
31+
uses: actions/upload-artifact@v3
32+
with:
33+
name: test-reports
34+
path: |
35+
'**/*/build/reports/androidTests/'

app-nia-catalog/src/main/java/com/google/samples/apps/niacatalog/ui/Catalog.kt

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fun NiaCatalog() {
6666
LazyColumn(
6767
modifier = Modifier.fillMaxSize(),
6868
contentPadding = contentPadding,
69-
verticalArrangement = Arrangement.spacedBy(16.dp)
69+
verticalArrangement = Arrangement.spacedBy(16.dp),
7070
) {
7171
item {
7272
Text(
@@ -93,19 +93,19 @@ fun NiaCatalog() {
9393
FlowRow(mainAxisSpacing = 16.dp) {
9494
NiaButton(
9595
onClick = {},
96-
enabled = false
96+
enabled = false,
9797
) {
9898
Text(text = "Disabled")
9999
}
100100
NiaOutlinedButton(
101101
onClick = {},
102-
enabled = false
102+
enabled = false,
103103
) {
104104
Text(text = "Disabled")
105105
}
106106
NiaTextButton(
107107
onClick = {},
108-
enabled = false
108+
enabled = false,
109109
) {
110110
Text(text = "Disabled")
111111
}
@@ -119,21 +119,21 @@ fun NiaCatalog() {
119119
text = { Text(text = "Enabled") },
120120
leadingIcon = {
121121
Icon(imageVector = NiaIcons.Add, contentDescription = null)
122-
}
122+
},
123123
)
124124
NiaOutlinedButton(
125125
onClick = {},
126126
text = { Text(text = "Enabled") },
127127
leadingIcon = {
128128
Icon(imageVector = NiaIcons.Add, contentDescription = null)
129-
}
129+
},
130130
)
131131
NiaTextButton(
132132
onClick = {},
133133
text = { Text(text = "Enabled") },
134134
leadingIcon = {
135135
Icon(imageVector = NiaIcons.Add, contentDescription = null)
136-
}
136+
},
137137
)
138138
}
139139
}
@@ -146,23 +146,23 @@ fun NiaCatalog() {
146146
text = { Text(text = "Disabled") },
147147
leadingIcon = {
148148
Icon(imageVector = NiaIcons.Add, contentDescription = null)
149-
}
149+
},
150150
)
151151
NiaOutlinedButton(
152152
onClick = {},
153153
enabled = false,
154154
text = { Text(text = "Disabled") },
155155
leadingIcon = {
156156
Icon(imageVector = NiaIcons.Add, contentDescription = null)
157-
}
157+
},
158158
)
159159
NiaTextButton(
160160
onClick = {},
161161
enabled = false,
162162
text = { Text(text = "Disabled") },
163163
leadingIcon = {
164164
Icon(imageVector = NiaIcons.Add, contentDescription = null)
165-
}
165+
},
166166
)
167167
}
168168
}
@@ -173,14 +173,14 @@ fun NiaCatalog() {
173173
text = { Text("Enabled") },
174174
items = listOf("Item 1", "Item 2", "Item 3"),
175175
onItemClick = {},
176-
itemText = { item -> Text(item) }
176+
itemText = { item -> Text(item) },
177177
)
178178
NiaDropdownMenuButton(
179179
text = { Text("Disabled") },
180180
items = listOf("Item 1", "Item 2", "Item 3"),
181181
onItemClick = {},
182182
itemText = { item -> Text(item) },
183-
enabled = false
183+
enabled = false,
184184
)
185185
}
186186
}
@@ -191,25 +191,25 @@ fun NiaCatalog() {
191191
NiaFilterChip(
192192
selected = firstChecked,
193193
onSelectedChange = { checked -> firstChecked = checked },
194-
label = { Text(text = "Enabled") }
194+
label = { Text(text = "Enabled") },
195195
)
196196
var secondChecked by remember { mutableStateOf(true) }
197197
NiaFilterChip(
198198
selected = secondChecked,
199199
onSelectedChange = { checked -> secondChecked = checked },
200-
label = { Text(text = "Enabled") }
200+
label = { Text(text = "Enabled") },
201201
)
202202
NiaFilterChip(
203203
selected = false,
204204
onSelectedChange = {},
205205
enabled = false,
206-
label = { Text(text = "Disabled") }
206+
label = { Text(text = "Disabled") },
207207
)
208208
NiaFilterChip(
209209
selected = true,
210210
onSelectedChange = {},
211211
enabled = false,
212-
label = { Text(text = "Disabled") }
212+
label = { Text(text = "Disabled") },
213213
)
214214
}
215215
}
@@ -223,15 +223,15 @@ fun NiaCatalog() {
223223
icon = {
224224
Icon(
225225
painter = painterResource(id = NiaIcons.BookmarkBorder),
226-
contentDescription = null
226+
contentDescription = null,
227227
)
228228
},
229229
checkedIcon = {
230230
Icon(
231231
painter = painterResource(id = NiaIcons.Bookmark),
232-
contentDescription = null
232+
contentDescription = null,
233233
)
234-
}
234+
},
235235
)
236236
var secondChecked by remember { mutableStateOf(true) }
237237
NiaIconToggleButton(
@@ -240,49 +240,49 @@ fun NiaCatalog() {
240240
icon = {
241241
Icon(
242242
painter = painterResource(id = NiaIcons.BookmarkBorder),
243-
contentDescription = null
243+
contentDescription = null,
244244
)
245245
},
246246
checkedIcon = {
247247
Icon(
248248
painter = painterResource(id = NiaIcons.Bookmark),
249-
contentDescription = null
249+
contentDescription = null,
250250
)
251-
}
251+
},
252252
)
253253
NiaIconToggleButton(
254254
checked = false,
255255
onCheckedChange = {},
256256
icon = {
257257
Icon(
258258
painter = painterResource(id = NiaIcons.BookmarkBorder),
259-
contentDescription = null
259+
contentDescription = null,
260260
)
261261
},
262262
checkedIcon = {
263263
Icon(
264264
painter = painterResource(id = NiaIcons.Bookmark),
265-
contentDescription = null
265+
contentDescription = null,
266266
)
267267
},
268-
enabled = false
268+
enabled = false,
269269
)
270270
NiaIconToggleButton(
271271
checked = true,
272272
onCheckedChange = {},
273273
icon = {
274274
Icon(
275275
painter = painterResource(id = NiaIcons.BookmarkBorder),
276-
contentDescription = null
276+
contentDescription = null,
277277
)
278278
},
279279
checkedIcon = {
280280
Icon(
281281
painter = painterResource(id = NiaIcons.Bookmark),
282-
contentDescription = null
282+
contentDescription = null,
283283
)
284284
},
285-
enabled = false
285+
enabled = false,
286286
)
287287
}
288288
}
@@ -294,21 +294,21 @@ fun NiaCatalog() {
294294
expanded = firstExpanded,
295295
onExpandedChange = { expanded -> firstExpanded = expanded },
296296
compactText = { Text(text = "Compact view") },
297-
expandedText = { Text(text = "Expanded view") }
297+
expandedText = { Text(text = "Expanded view") },
298298
)
299299
var secondExpanded by remember { mutableStateOf(true) }
300300
NiaViewToggleButton(
301301
expanded = secondExpanded,
302302
onExpandedChange = { expanded -> secondExpanded = expanded },
303303
compactText = { Text(text = "Compact view") },
304-
expandedText = { Text(text = "Expanded view") }
304+
expandedText = { Text(text = "Expanded view") },
305305
)
306306
NiaViewToggleButton(
307307
expanded = false,
308308
onExpandedChange = {},
309309
compactText = { Text(text = "Disabled") },
310310
expandedText = { Text(text = "Disabled") },
311-
enabled = false
311+
enabled = false,
312312
)
313313
}
314314
}
@@ -330,7 +330,7 @@ fun NiaCatalog() {
330330
text = { Text(text = "Topic 1".uppercase()) },
331331
followText = { Text(text = "Follow") },
332332
unFollowText = { Text(text = "Unfollow") },
333-
browseText = { Text(text = "Browse topic") }
333+
browseText = { Text(text = "Browse topic") },
334334
)
335335
var secondFollowed by remember { mutableStateOf(true) }
336336
NiaTopicTag(
@@ -345,7 +345,7 @@ fun NiaCatalog() {
345345
text = { Text(text = "Topic 2".uppercase()) },
346346
followText = { Text(text = "Follow") },
347347
unFollowText = { Text(text = "Unfollow") },
348-
browseText = { Text(text = "Browse topic") }
348+
browseText = { Text(text = "Browse topic") },
349349
)
350350
NiaTopicTag(
351351
expanded = false,
@@ -355,7 +355,7 @@ fun NiaCatalog() {
355355
onUnfollowClick = {},
356356
onBrowseClick = {},
357357
text = { Text(text = "Disabled".uppercase()) },
358-
enabled = false
358+
enabled = false,
359359
)
360360
}
361361
}
@@ -368,7 +368,7 @@ fun NiaCatalog() {
368368
NiaTab(
369369
selected = selectedTabIndex == index,
370370
onClick = { selectedTabIndex = index },
371-
text = { Text(text = title) }
371+
text = { Text(text = title) },
372372
)
373373
}
374374
}
@@ -380,12 +380,12 @@ fun NiaCatalog() {
380380
val icons = listOf(
381381
NiaIcons.UpcomingBorder,
382382
NiaIcons.MenuBookBorder,
383-
NiaIcons.BookmarksBorder
383+
NiaIcons.BookmarksBorder,
384384
)
385385
val selectedIcons = listOf(
386386
NiaIcons.Upcoming,
387387
NiaIcons.MenuBook,
388-
NiaIcons.Bookmarks
388+
NiaIcons.Bookmarks,
389389
)
390390
val tagIcon = NiaIcons.Tag
391391
NiaNavigationBar {
@@ -397,7 +397,7 @@ fun NiaCatalog() {
397397
} else {
398398
Icon(
399399
painter = painterResource(id = icons[index]),
400-
contentDescription = item
400+
contentDescription = item,
401401
)
402402
}
403403
},
@@ -407,13 +407,13 @@ fun NiaCatalog() {
407407
} else {
408408
Icon(
409409
painter = painterResource(id = selectedIcons[index]),
410-
contentDescription = item
410+
contentDescription = item,
411411
)
412412
}
413413
},
414414
label = { Text(item) },
415415
selected = selectedItem == index,
416-
onClick = { selectedItem = index }
416+
onClick = { selectedItem = index },
417417
)
418418
}
419419
}

app/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
import com.google.samples.apps.nowinandroid.NiaBuildType
17+
import com.android.build.api.dsl.ManagedVirtualDevice
1718

1819
plugins {
1920
id("nowinandroid.android.application")
@@ -76,7 +77,7 @@ android {
7677
// TODO: Convert it as a convention plugin once Flamingo goes out (https://github.com/android/nowinandroid/issues/523)
7778
managedDevices {
7879
devices {
79-
maybeCreate<com.android.build.api.dsl.ManagedVirtualDevice>("pixel4api30").apply {
80+
maybeCreate<ManagedVirtualDevice>("pixel4api30").apply {
8081
device = "Pixel 4"
8182
apiLevel = 30
8283
// ATDs currently support only API level 30.

0 commit comments

Comments
 (0)