Builder
class Builder
kotlin.Any | |
↳ | android.service.notification.ZenDeviceEffects.Builder |
Builder class for ZenDeviceEffects
objects.
Summary
Public constructors | |
---|---|
Builder() Instantiates a new |
|
Builder(zenDeviceEffects: ZenDeviceEffects) Instantiates a new |
Public methods | |
---|---|
ZenDeviceEffects |
build() Builds a |
ZenDeviceEffects.Builder |
setShouldDimWallpaper(dimWallpaper: Boolean) Sets whether the wallpaper should be dimmed while the rule is active. |
ZenDeviceEffects.Builder |
setShouldDisplayGrayscale(grayscale: Boolean) 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 |
setShouldUseNightMode(nightMode: Boolean) Sets whether night mode (aka dark theme) should be applied while the rule is active. |
Public constructors
Builder
Builder()
Instantiates a new ZenPolicy.Builder
with all effects set to default (disabled).
Builder
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
fun build(): ZenDeviceEffects
Builds a ZenDeviceEffects
object based on the builder's state.
Return | |
---|---|
ZenDeviceEffects |
This value cannot be null . |
setShouldDimWallpaper
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
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
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
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 . |