Skip to content

Commit

Permalink
Allow refreshing Wear template tile by tapping anywhere (#2508)
Browse files Browse the repository at this point in the history
- The touch target for the refresh button is really small and there aren't any other conflicting actions, so allow tapping anywhere to refresh the content
  • Loading branch information
jpelgrom authored May 8, 2022
1 parent b1e48d5 commit 1f95e6a
Showing 1 changed file with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,25 +128,28 @@ class TemplateTile : TileService() {
.setResourceId("refresh")
.setWidth(dp(24f))
.setHeight(dp(24f))
.setModifiers(
ModifiersBuilders.Modifiers.Builder()
.setClickable(
ModifiersBuilders.Clickable.Builder()
.setOnClick(
ActionBuilders.LoadAction.Builder().build()
)
.setId("refresh")
.build()
)
.build()
)
.setModifiers(getRefreshModifiers())
.build()
)
.setRotateContents(false)
.build()
)
.build()
)
setModifiers(getRefreshModifiers())
}
.build()

private fun getRefreshModifiers(): ModifiersBuilders.Modifiers {
return ModifiersBuilders.Modifiers.Builder()
.setClickable(
ModifiersBuilders.Clickable.Builder()
.setOnClick(
ActionBuilders.LoadAction.Builder().build()
)
.setId("refresh")
.build()
)
.build()
}
}

0 comments on commit 1f95e6a

Please sign in to comment.