Documentation Index
Fetch the complete documentation index at: https://mintlify.com/QmDeve/QmBlurView-Docs/llms.txt
Use this file to discover all available pages before exploring further.
BlurSwitchButtonView is an Android toggle switch that renders a real-time frosted-glass blur effect behind the thumb and track. Its key design feature is a single-color API: you supply one base color and the library automatically derives the correct tints for both the on and off states — no manual color pairing required.
Usage
Attribute Description
| Attribute Name | Type | Default Value | Description |
|---|---|---|---|
app:baseColor | color | #0161F2 | Base color; on/off states are auto-calculated from this value |
app:useSolidColorMode | boolean | false | Enable solid (non-blur) color mode |
app:solidOnColor | color | — | Sets the solid “on” state color (only applied when useSolidColorMode is true) |
app:solidOffColor | color | — | Sets the solid “off” state color (only applied when useSolidColorMode is true) |
API Reference
| Method | Description |
|---|---|
setBaseColor(int) | Set the base color for the switch |
setUseSolidColorMode(boolean) | Enable or disable solid (non-blur) color mode |
isUseSolidColorMode() | Returns whether solid color mode is currently enabled |
setSolidColors(int onColor, int offColor) | Set explicit solid colors for the on and off states |
getSolidOnColor() | Returns the current solid on-state color |
getSolidOffColor() | Returns the current solid off-state color |
setOnCheckedChangeListener(listener) | Register a callback invoked when the checked state changes |
Listening to State Changes
UsesetOnCheckedChangeListener to react whenever the user toggles the switch: