public final class

ProtoLayoutInflater.Config.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.wear.protolayout.renderer.inflater.ProtoLayoutInflater.Config.Builder

Overview

Builder for the Config class.

Summary

Constructors
publicBuilder(Context uiContext, LayoutElementProto.Layout layout, ResourceResolvers layoutResourceResolvers)

Methods
public ProtoLayoutInflater.Configbuild()

Builds a Config instance.

public ProtoLayoutInflater.Config.BuildersetAllowLayoutChangingBindsWithoutDefault(boolean allowLayoutChangingBindsWithoutDefault)

Sets whether a "layout changing" data bind can be applied without the "value_for_layout" field being filled in, or being set to zero / empty.

public ProtoLayoutInflater.Config.BuildersetAnimationEnabled(boolean animationEnabled)

Sets whether animation is enabled, which decides whether to load contentUpdateAnimations.

public ProtoLayoutInflater.Config.BuildersetApplyFontVariantBodyAsDefault(boolean applyFontVariantBodyAsDefault)

Apply FONT_VARIANT_BODY as default variant.

public ProtoLayoutInflater.Config.BuildersetClickableIdExtra(java.lang.String clickableIdExtra)

Sets the ID for the Intent extra containing the ID of a Clickable.

public ProtoLayoutInflater.Config.BuildersetDynamicDataPipeline(ProtoLayoutDynamicDataPipeline dataPipeline)

Sets the pipeline for dynamic data.

public ProtoLayoutInflater.Config.BuildersetExtensionViewProvider(ProtoLayoutExtensionViewProvider extensionViewProvider)

Sets the view provider for the renderer extension.

public ProtoLayoutInflater.Config.BuildersetInflaterStatsLogger(ProviderStatsLogger.InflaterStatsLogger inflaterStatsLogger)

Sets the stats logger used for telemetry.

public ProtoLayoutInflater.Config.BuildersetLoadActionExecutor(java.util.concurrent.Executor loadActionExecutor)

Sets the Executor to dispatch loadActionListener on.

public ProtoLayoutInflater.Config.BuildersetLoadActionListener(ProtoLayoutInflater.LoadActionListener loadActionListener)

Sets the listener for clicks that will cause contents to be reloaded.

public ProtoLayoutInflater.Config.BuildersetLoggingUtils(LoggingUtils loggingUtils)

Sets the debug logger used for extensive logging.

public ProtoLayoutInflater.Config.BuildersetProtoLayoutTheme(ProtoLayoutTheme protoLayoutTheme)

Sets the theme to use for this ProtoLayoutInflater instance.

public ProtoLayoutInflater.Config.BuildersetRendererResources(Resources rendererResources)

Sets the Renderer internal Resources object.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(Context uiContext, LayoutElementProto.Layout layout, ResourceResolvers layoutResourceResolvers)

Parameters:

uiContext: A suitable for interacting with UI with.
layout: The layout to be rendered.
layoutResourceResolvers: Resolvers for the resources used for rendering this layout.

Methods

public ProtoLayoutInflater.Config.Builder setLoadActionExecutor(java.util.concurrent.Executor loadActionExecutor)

Sets the Executor to dispatch loadActionListener on. This is required when setting ProtoLayoutInflater.Config.Builder.setLoadActionListener(ProtoLayoutInflater.LoadActionListener).

public ProtoLayoutInflater.Config.Builder setLoadActionListener(ProtoLayoutInflater.LoadActionListener loadActionListener)

Sets the listener for clicks that will cause contents to be reloaded. Defaults to no-op. This is required if the given layout contains a load action. When this is set, it's also required to set an executor with ProtoLayoutInflater.Config.Builder.setLoadActionExecutor(Executor).

public ProtoLayoutInflater.Config.Builder setRendererResources(Resources rendererResources)

Sets the Renderer internal Resources object. This should be specified when loading the renderer from a separate APK. This can usually be retrieved with android.content.pm.PackageManager. If not specified, this is retrieved from the Ui Context.

public ProtoLayoutInflater.Config.Builder setProtoLayoutTheme(ProtoLayoutTheme protoLayoutTheme)

Sets the theme to use for this ProtoLayoutInflater instance. This can be used to customise things like the default font family. If not set, the default theme is used.

public ProtoLayoutInflater.Config.Builder setDynamicDataPipeline(ProtoLayoutDynamicDataPipeline dataPipeline)

Sets the pipeline for dynamic data. If null, the dynamic properties would not be registered for update.

public ProtoLayoutInflater.Config.Builder setExtensionViewProvider(ProtoLayoutExtensionViewProvider extensionViewProvider)

Sets the view provider for the renderer extension.

public ProtoLayoutInflater.Config.Builder setAnimationEnabled(boolean animationEnabled)

Sets whether animation is enabled, which decides whether to load contentUpdateAnimations. Defaults to true.

public ProtoLayoutInflater.Config.Builder setClickableIdExtra(java.lang.String clickableIdExtra)

Sets the ID for the Intent extra containing the ID of a Clickable. Defaults to ProtoLayoutInflater.Config.DEFAULT_CLICKABLE_ID_EXTRA if not specified.

public ProtoLayoutInflater.Config.Builder setLoggingUtils(LoggingUtils loggingUtils)

Sets the debug logger used for extensive logging.

public ProtoLayoutInflater.Config.Builder setInflaterStatsLogger(ProviderStatsLogger.InflaterStatsLogger inflaterStatsLogger)

Sets the stats logger used for telemetry.

public ProtoLayoutInflater.Config.Builder setAllowLayoutChangingBindsWithoutDefault(boolean allowLayoutChangingBindsWithoutDefault)

Sets whether a "layout changing" data bind can be applied without the "value_for_layout" field being filled in, or being set to zero / empty. Defaults to false.

This is to support legacy apps which use layout-changing data bind before the full support was built.

public ProtoLayoutInflater.Config.Builder setApplyFontVariantBodyAsDefault(boolean applyFontVariantBodyAsDefault)

Apply FONT_VARIANT_BODY as default variant.

Builds a Config instance.