lightbulb_outline Help shape the future of the Google Play Console, Android Studio, and Firebase. Start survey
added in version 24.1.0
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1

ShadowOverlayHelper.Builder

public static final class ShadowOverlayHelper.Builder
extends Object

java.lang.Object
   ↳ android.support.v17.leanback.widget.ShadowOverlayHelper.Builder


Builder for creating ShadowOverlayHelper.

Summary

Public constructors

ShadowOverlayHelper.Builder()

Public methods

ShadowOverlayHelper build(Context context)

Create ShadowOverlayHelper object

ShadowOverlayHelper.Builder keepForegroundDrawable(boolean keepForegroundDrawable)

Set if not using foreground drawable for overlay color.

ShadowOverlayHelper.Builder needsOverlay(boolean needsOverlay)

Set if needs overlay color.

ShadowOverlayHelper.Builder needsRoundedCorner(boolean needsRoundedCorner)

Set if needs rounded corner.

ShadowOverlayHelper.Builder needsShadow(boolean needsShadow)

Set if needs shadow.

ShadowOverlayHelper.Builder options(ShadowOverlayHelper.Options options)

Set option values e.g.

ShadowOverlayHelper.Builder preferZOrder(boolean preferZOrder)

Set if prefer z-order shadow.

Inherited methods

From class java.lang.Object

Public constructors

ShadowOverlayHelper.Builder

added in version 24.1.0
ShadowOverlayHelper.Builder ()

Public methods

build

added in version 24.1.0
ShadowOverlayHelper build (Context context)

Create ShadowOverlayHelper object

Parameters
context Context: The context uses to read Resources settings.

Returns
ShadowOverlayHelper The ShadowOverlayHelper object.

keepForegroundDrawable

added in version 24.1.0
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 boolean: True to keep the original foreground drawable.

Returns
ShadowOverlayHelper.Builder The Builder object itself.

needsOverlay

added in version 24.1.0
ShadowOverlayHelper.Builder needsOverlay (boolean needsOverlay)

Set if needs overlay color.

Parameters
needsOverlay boolean: True if needs overlay.

Returns
ShadowOverlayHelper.Builder The Builder object itself.

needsRoundedCorner

added in version 24.1.0
ShadowOverlayHelper.Builder needsRoundedCorner (boolean needsRoundedCorner)

Set if needs rounded corner.

Parameters
needsRoundedCorner boolean: True if needs rounded corner.

Returns
ShadowOverlayHelper.Builder The Builder object itself.

needsShadow

added in version 24.1.0
ShadowOverlayHelper.Builder needsShadow (boolean needsShadow)

Set if needs shadow.

Parameters
needsShadow boolean: True if needs shadow.

Returns
ShadowOverlayHelper.Builder The Builder object itself.

options

added in version 24.1.0
ShadowOverlayHelper.Builder options (ShadowOverlayHelper.Options options)

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

Parameters
options ShadowOverlayHelper.Options: The Options object to create ShadowOverlayHelper.

Returns
ShadowOverlayHelper.Builder

preferZOrder

added in version 24.1.0
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 boolean: True if prefer Z shadow. Default is true.

Returns
ShadowOverlayHelper.Builder The Builder object itself.