ZenDeviceEffects.Builder


public static final class ZenDeviceEffects.Builder
extends Object

java.lang.Object
   ↳ android.service.notification.ZenDeviceEffects.Builder


Builder class for ZenDeviceEffects objects.

Summary

Public constructors

Builder()

Instantiates a new ZenPolicy.Builder with all effects set to default (disabled).

Builder(ZenDeviceEffects zenDeviceEffects)

Instantiates a new ZenPolicy.Builder with all effects set to their corresponding values in the supplied ZenDeviceEffects.

Public methods

ZenDeviceEffects build()

Builds a ZenDeviceEffects object based on the builder's state.

ZenDeviceEffects.Builder setShouldDimWallpaper(boolean dimWallpaper)

Sets whether the wallpaper should be dimmed while the rule is active.

ZenDeviceEffects.Builder setShouldDisplayGrayscale(boolean grayscale)

Sets whether the level of color saturation of the display should be set to minimum, effectively switching it to grayscale, while the rule is active.

ZenDeviceEffects.Builder setShouldSuppressAmbientDisplay(boolean suppressAmbientDisplay)

Sets whether the ambient (always-on) display feature should be disabled while the rule is active.

ZenDeviceEffects.Builder setShouldUseNightMode(boolean nightMode)

Sets whether night mode (aka dark theme) should be applied while the rule is active.

Inherited methods

Public constructors

Builder

public Builder ()

Instantiates a new ZenPolicy.Builder with all effects set to default (disabled).

Builder

public Builder (ZenDeviceEffects zenDeviceEffects)

Instantiates a new ZenPolicy.Builder with all effects set to their corresponding values in the supplied ZenDeviceEffects.

Parameters
zenDeviceEffects ZenDeviceEffects: This value cannot be null.

Public methods

build

public ZenDeviceEffects build ()

Builds a ZenDeviceEffects object based on the builder's state.

Returns
ZenDeviceEffects This value cannot be null.

setShouldDimWallpaper

public ZenDeviceEffects.Builder setShouldDimWallpaper (boolean dimWallpaper)

Sets whether the wallpaper should be dimmed while the rule is active.

Parameters
dimWallpaper boolean

Returns
ZenDeviceEffects.Builder This value cannot be null.

setShouldDisplayGrayscale

public ZenDeviceEffects.Builder setShouldDisplayGrayscale (boolean grayscale)

Sets whether the level of color saturation of the display should be set to minimum, effectively switching it to grayscale, while the rule is active.

Parameters
grayscale boolean

Returns
ZenDeviceEffects.Builder This value cannot be null.

setShouldSuppressAmbientDisplay

public ZenDeviceEffects.Builder setShouldSuppressAmbientDisplay (boolean suppressAmbientDisplay)

Sets whether the ambient (always-on) display feature should be disabled while the rule is active. This will have no effect if the device doesn't support always-on display or if it's not generally enabled.

Parameters
suppressAmbientDisplay boolean

Returns
ZenDeviceEffects.Builder This value cannot be null.

setShouldUseNightMode

public ZenDeviceEffects.Builder setShouldUseNightMode (boolean nightMode)

Sets whether night mode (aka dark theme) should be applied while the rule is active.

Parameters
nightMode boolean

Returns
ZenDeviceEffects.Builder This value cannot be null.