setBlurEffectPreset
Sets a preset blur effect on the given view on a device running Samsung's One UI.
This function allows applying a predefined blur effect using a color curve preset. It also allows optional customization of the background color and corner radius.
The blur effect will not be applied if a custom theme is applied or if the "reduce transparency" accessibility setting is enabled.
Return
true if the blur effect was successfully applied, false otherwise (e.g., if themes are applied, reduce transparency is enabled, or the blur builder creation failed).
Parameters
The view to apply the blur effect to.
The blur mode to use. Must be one of BLUR_MODE_WINDOW, BLUR_MODE_WINDOW_CAPTURED, or BLUR_MODE_CANVAS.
The preset for the color curve of the blur effect. Refer to constants like BLUR_UI_HIGH_ULTRA_THICK_DARK for available presets.
Optional: The background color for the blur effect. If null, a default color based on the will might be used.
Optional: The corner radius for the blurred background. If null, a default corner radius might be used.
Whether the canvas blur should be dynamic, one of CANVAS_BLUR_USE_TYPE_STATIC or CANVAS_BLUR_USE_TYPE_DYNAMIC.
Sets a blur effect with a custom color curve on the given view on a device running Samsung's One UI.
This function allows applying a blur effect using explicit CurveParameter values instead of an integer preset. It also allows optional customization of the background color and corner radius.
Return
true if the blur effect was successfully applied, false otherwise.
Parameters
The view to apply the blur effect to.
The blur mode to use. Must be one of BLUR_MODE_WINDOW, BLUR_MODE_WINDOW_CAPTURED, or BLUR_MODE_CANVAS.
The custom color curve parameters.
Optional: The background color for the blur effect. If null, a default color might be used.
Optional: The corner radius for the blurred background. If null, a default corner radius might be used.
Whether the canvas blur should be dynamic, one of CANVAS_BLUR_USE_TYPE_STATIC or CANVAS_BLUR_USE_TYPE_DYNAMIC.