RequestBuilders.ResourcesRequest.Builder


public final class RequestBuilders.ResourcesRequest.Builder


Builder for ResourcesRequest

Summary

Public constructors

@RequiresSchemaVersion(major = 1, minor = 0)
Builder()

Creates an instance of Builder.

Public methods

@NonNull RequestBuilders.ResourcesRequest.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
addResourceId(@NonNull String resourceId)

Adds one item to requested resource IDs.

@NonNull RequestBuilders.ResourcesRequest

Builds an instance from accumulated values.

@NonNull RequestBuilders.ResourcesRequest.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setDeviceConfiguration(
    @NonNull DeviceParametersBuilders.DeviceParameters deviceConfiguration
)

Sets the androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters object describing the device requesting the resources.

@NonNull RequestBuilders.ResourcesRequest.Builder

This method is deprecated.

Use ( instead.

@NonNull RequestBuilders.ResourcesRequest.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setTileId(int tileId)

Sets the ID of the tile for which resources are being requested.

@NonNull RequestBuilders.ResourcesRequest.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setVersion(@NonNull String version)

Sets the version of the resources being fetched.

Public constructors

Builder

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public Builder()

Creates an instance of Builder.

Public methods

addResourceId

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull RequestBuilders.ResourcesRequest.Builder addResourceId(@NonNull String resourceId)

Adds one item to requested resource IDs. This specifies which tile resources should be returned in the androidx.wear.protolayout.ResourceBuilders.Resources response. If not specified, all resources for the given version must be provided in the response.

Note that resource IDs here correspond to tile resources (i.e. keys that would be used in androidx.wear.protolayout.ResourceBuilders.Resources.idToImage), not Android resource names or similar.

build

Added in 1.0.0
public @NonNull RequestBuilders.ResourcesRequest build()

Builds an instance from accumulated values.

setDeviceConfiguration

Added in 1.2.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull RequestBuilders.ResourcesRequest.Builder setDeviceConfiguration(
    @NonNull DeviceParametersBuilders.DeviceParameters deviceConfiguration
)

Sets the androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters object describing the device requesting the resources.

setDeviceParameters

Added in 1.0.0
Deprecated in 1.2.0
public @NonNull RequestBuilders.ResourcesRequest.Builder setDeviceParameters(
    @NonNull DeviceParametersBuilders.DeviceParameters deviceParameters
)

Sets the androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters describing the device requesting the resources.

setTileId

Added in 1.2.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull RequestBuilders.ResourcesRequest.Builder setTileId(int tileId)

Sets the ID of the tile for which resources are being requested.

setVersion

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull RequestBuilders.ResourcesRequest.Builder setVersion(@NonNull String version)

Sets the version of the resources being fetched. This is the same as the requested resource version, passed in androidx.wear.tiles.TileBuilders.Tile.