Note: There is a script available that does this for you!
To manually change imports in order to migrate from Tiles to ProtoLayout, follow:
- Replace all
androidx.wear.tiles.material
imports with theandroidx.wear.protolayout.material
(this includes .layouts library too) - Replace all other
androidx.wear.tiles
imports with theandroidx.wear.protolayout
a. Imports forandroidx.wear.tiles.EventBuilders
,androidx.wear.tiles.RequestBuilders
,androidx.wear.tiles.TileBuilders
,androidx.wear.tiles.TileService
should stay the same - Rename a few methods from
TileService
/TileBuilder
classes that have been deprecated and replaced: a.get/setTimeline
toget/setTileTimeline
b.onResourcesRequest
toonTileResourcesRequest
c.get/setDeviceParameters
to get/setDeviceConfiguration d.get/setState
toget/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.