Added in API level 35

Builder


class Builder
kotlin.Any
   ↳ android.service.notification.ZenDeviceEffects.Builder

Builder class for ZenDeviceEffects objects.

Summary

Public constructors

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

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

ZenDeviceEffects.Builder

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

ZenDeviceEffects.Builder

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(suppressAmbientDisplay: Boolean)

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

ZenDeviceEffects.Builder

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

Public constructors

Builder

Added in API level 35
Builder()

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

Builder

Added in API level 35
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

Added in API level 35
fun build(): ZenDeviceEffects

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

Return
ZenDeviceEffects This value cannot be null.

setShouldDimWallpaper

Added in API level 35
fun setShouldDimWallpaper(dimWallpaper: Boolean): ZenDeviceEffects.Builder

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

Return
ZenDeviceEffects.Builder This value cannot be null.

setShouldDisplayGrayscale

Added in API level 35
fun setShouldDisplayGrayscale(grayscale: Boolean): ZenDeviceEffects.Builder

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.

Return
ZenDeviceEffects.Builder This value cannot be null.

setShouldSuppressAmbientDisplay

Added in API level 35
fun setShouldSuppressAmbientDisplay(suppressAmbientDisplay: Boolean): ZenDeviceEffects.Builder

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.

Return
ZenDeviceEffects.Builder This value cannot be null.

setShouldUseNightMode

Added in API level 35
fun setShouldUseNightMode(nightMode: Boolean): ZenDeviceEffects.Builder

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

Return
ZenDeviceEffects.Builder This value cannot be null.