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.materialimports with theandroidx.wear.protolayout.material(this includes .layouts library too) - Replace all other
androidx.wear.tilesimports with theandroidx.wear.protolayouta. Imports forandroidx.wear.tiles.EventBuilders,androidx.wear.tiles.RequestBuilders,androidx.wear.tiles.TileBuilders,androidx.wear.tiles.TileServiceshould stay the same - Rename a few methods from
TileService/TileBuilderclasses that have been deprecated and replaced: a.get/setTimelinetoget/setTileTimelineb.onResourcesRequesttoonTileResourcesRequestc.get/setDeviceParametersto get/setDeviceConfiguration d.get/setStatetoget/setCurrentStatei. Note that this is for RequestBuilders’ method and that there is a v1.2 method with the same name in TileBuilders that is valid.