Builder

class Builder
kotlin.Any
   ↳ androidx.leanback.widget.ShadowOverlayHelper.Builder

Builder for creating ShadowOverlayHelper.

Summary

Public constructors

Builder for creating ShadowOverlayHelper.

Public methods

ShadowOverlayHelper!
build(context: Context!)

Create ShadowOverlayHelper object

ShadowOverlayHelper.Builder!
keepForegroundDrawable(keepForegroundDrawable: Boolean)

Set if not using foreground drawable for overlay color.

ShadowOverlayHelper.Builder!
needsOverlay(needsOverlay: Boolean)

Set if needs overlay color.

ShadowOverlayHelper.Builder!
needsRoundedCorner(needsRoundedCorner: Boolean)

Set if needs rounded corner.

ShadowOverlayHelper.Builder!
needsShadow(needsShadow: Boolean)

Set if needs shadow.

ShadowOverlayHelper.Builder!

Set option values e.

ShadowOverlayHelper.Builder!
preferZOrder(preferZOrder: Boolean)

Set if prefer z-order shadow.

Public constructors

<init>

Builder()

Builder for creating ShadowOverlayHelper.

Public methods

build

fun build(context: Context!): ShadowOverlayHelper!

Create ShadowOverlayHelper object

Parameters
context Context!: The context uses to read Resources settings.
Return
ShadowOverlayHelper!: The ShadowOverlayHelper object.

keepForegroundDrawable

fun keepForegroundDrawable(keepForegroundDrawable: Boolean): ShadowOverlayHelper.Builder!

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.
Return
ShadowOverlayHelper.Builder!: The Builder object itself.

needsOverlay

fun needsOverlay(needsOverlay: Boolean): ShadowOverlayHelper.Builder!

Set if needs overlay color.

Parameters
needsOverlay Boolean: True if needs overlay.
Return
ShadowOverlayHelper.Builder!: The Builder object itself.

needsRoundedCorner

fun needsRoundedCorner(needsRoundedCorner: Boolean): ShadowOverlayHelper.Builder!

Set if needs rounded corner.

Parameters
needsRoundedCorner Boolean: True if needs rounded corner.
Return
ShadowOverlayHelper.Builder!: The Builder object itself.

needsShadow

fun needsShadow(needsShadow: Boolean): ShadowOverlayHelper.Builder!

Set if needs shadow.

Parameters
needsShadow Boolean: True if needs shadow.
Return
ShadowOverlayHelper.Builder!: The Builder object itself.

options

fun options(options: ShadowOverlayHelper.Options!): ShadowOverlayHelper.Builder!

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

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

preferZOrder

fun preferZOrder(preferZOrder: Boolean): ShadowOverlayHelper.Builder!

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.
Return
ShadowOverlayHelper.Builder!: The Builder object itself.