public final class

ShadowOverlayHelper.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.leanback.widget.ShadowOverlayHelper.Builder

Overview

Builder for creating ShadowOverlayHelper.

Summary

Constructors
publicBuilder()

Methods
public ShadowOverlayHelperbuild(Context context)

Create ShadowOverlayHelper object

public ShadowOverlayHelper.BuilderkeepForegroundDrawable(boolean keepForegroundDrawable)

Set if not using foreground drawable for overlay color.

public ShadowOverlayHelper.BuilderneedsOverlay(boolean needsOverlay)

Set if needs overlay color.

public ShadowOverlayHelper.BuilderneedsRoundedCorner(boolean needsRoundedCorner)

Set if needs rounded corner.

public ShadowOverlayHelper.BuilderneedsShadow(boolean needsShadow)

Set if needs shadow.

public ShadowOverlayHelper.Builderoptions(ShadowOverlayHelper.Options options)

Set option values e.g.

public ShadowOverlayHelper.BuilderpreferZOrder(boolean preferZOrder)

Set if prefer z-order shadow.

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

Constructors

public Builder()

Methods

public ShadowOverlayHelper.Builder needsOverlay(boolean needsOverlay)

Set if needs overlay color.

Parameters:

needsOverlay: True if needs overlay.

Returns:

The Builder object itself.

public ShadowOverlayHelper.Builder needsShadow(boolean needsShadow)

Set if needs shadow.

Parameters:

needsShadow: True if needs shadow.

Returns:

The Builder object itself.

public ShadowOverlayHelper.Builder needsRoundedCorner(boolean needsRoundedCorner)

Set if needs rounded corner.

Parameters:

needsRoundedCorner: True if needs rounded corner.

Returns:

The Builder object itself.

public ShadowOverlayHelper.Builder preferZOrder(boolean preferZOrder)

Set if prefer z-order shadow. On old devices, z-order shadow might be slow, set to false to fall back to static 9-patch shadow. Recommend to read from system wide Setting value: see Settings.

Parameters:

preferZOrder: True if prefer Z shadow. Default is true.

Returns:

The Builder object itself.

public ShadowOverlayHelper.Builder keepForegroundDrawable(boolean keepForegroundDrawable)

Set if not using foreground drawable for overlay color. For example if the view has already assigned a foreground drawable for other purposes. When it's true, helper will use a ShadowOverlayContainer for overlay color.

Parameters:

keepForegroundDrawable: True to keep the original foreground drawable.

Returns:

The Builder object itself.

Set option values e.g. Shadow Z value, rounded corner radius.

Parameters:

options: The Options object to create ShadowOverlayHelper.

public ShadowOverlayHelper build(Context context)

Create ShadowOverlayHelper object

Parameters:

context: The context uses to read Resources settings.

Returns:

The ShadowOverlayHelper object.