这是indexloc提供的服务,不要输入任何密码
Skip to content

Instantly share code, notes, and snippets.

@NedaTop
Last active July 24, 2023 16:48
Show Gist options
  • Save NedaTop/db2594d528e6093d6dd55b0907e563ce to your computer and use it in GitHub Desktop.
Save NedaTop/db2594d528e6093d6dd55b0907e563ce to your computer and use it in GitHub Desktop.

Revisions

  1. NedaTop renamed this gist Jul 24, 2023. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions gistfile1.txt → ProtoLayoutImportsManualRename.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    Note: There is a [script](https://gist.github.com/NedaTop/5c3b72cda4c6450df3670eb6300db4e4) 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
  2. NedaTop created this gist Jul 24, 2023.
    9 changes: 9 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    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.