StandardResourceResolvers

public class StandardResourceResolvers


Utility class to get ResourceResolvers populated with standard options.

Summary

Public methods

static @NonNull ResourceResolvers.Builder
forLocalApp(
    @NonNull ResourceProto.Resources protoResources,
    @NonNull Context uiContext
)

Get a builder pre-populated with resolvers for the resources of the app hosting the renderer.

static @NonNull ResourceResolvers.Builder
forRemoteService(
    @NonNull ResourceProto.Resources protoResources,
    @NonNull String servicePackageName,
    @NonNull Resources serviceAndroidResources,
    @NonNull Context hostUiContext
)

Get a builder pre-populated with resolvers for the resources of a , hosted within another app on the device.

Public methods

forLocalApp

@NonNull
public static ResourceResolvers.Builder forLocalApp(
    @NonNull ResourceProto.Resources protoResources,
    @NonNull Context uiContext
)

Get a builder pre-populated with resolvers for the resources of the app hosting the renderer.

Use {@code setFooResolver} calls to change the pre-populated ones or add others.

Parameters
@NonNull ResourceProto.Resources protoResources

ProtoLayout resources for the current layout.

@NonNull Context uiContext

UI-capable Context for the app that both owns the resources and displays the layout.

forRemoteService

@NonNull
public static ResourceResolvers.Builder forRemoteService(
    @NonNull ResourceProto.Resources protoResources,
    @NonNull String servicePackageName,
    @NonNull Resources serviceAndroidResources,
    @NonNull Context hostUiContext
)

Get a builder pre-populated with resolvers for the resources of a , hosted within another app on the device.

Use {@code setFooAccessor} calls to change the pre-populated ones or add others.

Parameters
@NonNull ResourceProto.Resources protoResources

ProtoLayout resources for the current layout.

@NonNull String servicePackageName

Package name for the service that owns the resources.

@NonNull Resources serviceAndroidResources

Android resources from the service.

@NonNull Context hostUiContext

UI-capable Context for the app hosting the renderer displaying the layout.