Skip to content

Commit 3bc67bb

Browse files
Add android_wear_m3_interaction_loadaction_request tag
1 parent 88d1bd6 commit 3bc67bb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

wear/src/main/java/com/example/wear/snippets/m3/tile/Interaction.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,20 +174,19 @@ class InteractionDeepLink : TileService() {
174174

175175
class InteractionLoadAction : BaseTileService() {
176176

177+
// [START android_wear_m3_interaction_loadaction_request]
177178
override fun onTileRequest(
178179
requestParams: RequestBuilders.TileRequest
179180
): ListenableFuture<Tile> {
180181

181-
val name: String?
182-
val age: Int?
183-
184182
// When triggered by loadAction(), "name" will be "Javier", and "age" will
185183
// be 37.
186184
with(requestParams.currentState.stateMap) {
187-
name = this[stringAppDataKey("name")]
188-
age = this[intAppDataKey("age")]
185+
val name = this[stringAppDataKey("name")]
186+
val age = this[intAppDataKey("age")]
189187
}
190188

189+
// [START_EXCLUDE]
191190
return Futures.immediateFuture(
192191
Tile.Builder()
193192
.setResourcesVersion(RESOURCES_VERSION)
@@ -200,7 +199,9 @@ class InteractionLoadAction : BaseTileService() {
200199
)
201200
.build()
202201
)
202+
// [END_EXCLUDE]
203203
}
204+
// [START android_wear_m3_interaction_loadaction_request]
204205

205206
override fun MaterialScope.tileLayout(
206207
requestParams: RequestBuilders.TileRequest

0 commit comments

Comments
 (0)