Skip to content

Instantly share code, notes, and snippets.

@NedaTop
Last active July 24, 2023 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NedaTop/db2594d528e6093d6dd55b0907e563ce to your computer and use it in GitHub Desktop.
Save NedaTop/db2594d528e6093d6dd55b0907e563ce to your computer and use it in GitHub Desktop.
Tiles to ProtoLayout imports rename

Note: There is a script available that does this for you!

To manually change imports in order to migrate from Tiles to ProtoLayout, follow:

  1. Replace all androidx.wear.tiles.material imports with the androidx.wear.protolayout.material (this includes .layouts library too)
  2. Replace all other androidx.wear.tiles imports with the androidx.wear.protolayout a. Imports for androidx.wear.tiles.EventBuilders, androidx.wear.tiles.RequestBuilders, androidx.wear.tiles.TileBuilders, androidx.wear.tiles.TileService should stay the same
  3. Rename a few methods from TileService/TileBuilder classes that have been deprecated and replaced: a. get/setTimeline to get/setTileTimeline b. onResourcesRequest to onTileResourcesRequest c. get/setDeviceParameters to get/setDeviceConfiguration d. get/setState to get/setCurrentState i. Note that this is for RequestBuilders’ method and that there is a v1.2 method with the same name in TileBuilders that is valid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment