ShadowOverlayHelper.Builder


class ShadowOverlayHelper.Builder


Builder for creating ShadowOverlayHelper.

Summary

Public constructors

Public functions

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.g. Shadow Z value, rounded corner radius.

ShadowOverlayHelper.Builder!
preferZOrder(preferZOrder: Boolean)

Set if prefer z-order shadow.

Public constructors

Builder

Added in 1.1.0
Builder()

Public functions

build

Added in 1.1.0
fun build(context: Context!): ShadowOverlayHelper!

Create ShadowOverlayHelper object

Parameters
context: Context!

The context uses to read Resources settings.

Returns
ShadowOverlayHelper!

The ShadowOverlayHelper object.

keepForegroundDrawable

Added in 1.1.0
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.

Returns
ShadowOverlayHelper.Builder!

The Builder object itself.

needsOverlay

Added in 1.1.0
fun needsOverlay(needsOverlay: Boolean): ShadowOverlayHelper.Builder!

Set if needs overlay color.

Parameters
needsOverlay: Boolean

True if needs overlay.

Returns
ShadowOverlayHelper.Builder!

The Builder object itself.

needsRoundedCorner

Added in 1.1.0
fun needsRoundedCorner(needsRoundedCorner: Boolean): ShadowOverlayHelper.Builder!

Set if needs rounded corner.

Parameters
needsRoundedCorner: Boolean

True if needs rounded corner.

Returns
ShadowOverlayHelper.Builder!

The Builder object itself.

needsShadow

Added in 1.1.0
fun needsShadow(needsShadow: Boolean): ShadowOverlayHelper.Builder!

Set if needs shadow.

Parameters
needsShadow: Boolean

True if needs shadow.

Returns
ShadowOverlayHelper.Builder!

The Builder object itself.

options

Added in 1.1.0
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

Added in 1.1.0
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.

Returns
ShadowOverlayHelper.Builder!

The Builder object itself.