amoledwatchfaces
10/26/2023, 8:04 AMprivate fun refreshTileService(context: Context) {
TileService.getUpdater(context)
.requestUpdate(FavoriteAppsTileService::class.java)
}
to refresh Tile layout to see user preferred apps. (Screenrecord1)
Tile refreshes correctly with right amount of shortcuts but the Images are not rendered. TileRequest is firing but ResourceRequest is not.
Because of this, app shortcut works but Icon is not visible.(Screenrecord2). ResourceRequest sometimes comes after 1minutes, sometimes in 5 minutes, sometimes not at all. Only way to force request is to remove and add tile again.
I have used MessagingTile example from wearos-samples.
Is there any way to force refresh of resources?
Any help is appreciated ๐
Tomasyschimke
10/26/2023, 9:19 AMyschimke
10/26/2023, 9:19 AMyschimke
10/26/2023, 9:19 AMyschimke
10/26/2023, 9:20 AMyschimke
10/26/2023, 9:21 AMyschimke
10/26/2023, 9:21 AMpublic open fun getResourcesVersionForTileState(state: T): String = PERMANENT_RESOURCES_VERSION
yschimke
10/26/2023, 9:22 AM/**
* A constant for non updating resources where each id will always contain the same content.
*/
public const val PERMANENT_RESOURCES_VERSION: String = "0"
amoledwatchfaces
10/26/2023, 9:49 AMoverride fun getResourcesVersionForTileState(state: UserPreferences): String {
super.getResourcesVersionForTileState(state)
return Random.nextInt(1001).toString()
}
amoledwatchfaces
10/26/2023, 9:52 AMyschimke
10/26/2023, 9:55 AMyschimke
10/26/2023, 9:56 AMlistOf(id1, id2).sorted().joinToString("-")
yschimke
10/26/2023, 9:57 AMyschimke
10/26/2023, 9:57 AMreturn Tile.Builder()
.setResourcesVersion(
if (debugResourceMode) {
UUID.randomUUID().toString()
} else {
getResourcesVersionForTileState(state)
},
)
amoledwatchfaces
10/26/2023, 9:57 AMamoledwatchfaces
10/26/2023, 9:58 AMyschimke
10/26/2023, 10:32 AMamoledwatchfaces
10/26/2023, 3:50 PMyschimke
10/26/2023, 4:46 PMamoledwatchfaces
10/26/2023, 5:23 PMamoledwatchfaces
11/03/2023, 12:44 PMamoledwatchfaces
11/03/2023, 12:45 PMyschimke
11/04/2023, 6:53 AMyschimke
11/04/2023, 6:54 AMamoledwatchfaces
11/04/2023, 12:03 PMyschimke
11/05/2023, 11:25 AMamoledwatchfaces
11/05/2023, 11:30 AMamoledwatchfaces
11/05/2023, 11:35 AMyschimke
11/05/2023, 11:36 AMyschimke
11/05/2023, 11:37 AMamoledwatchfaces
11/05/2023, 12:23 PMyschimke
11/05/2023, 7:35 PM