@sbaiahmed1/react-native-blur 4.6.2-beta.0 → 4.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -11
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/BlurType.kt +24 -22
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurSwitch.kt +19 -1
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurSwitchManager.kt +5 -0
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurView.kt +37 -2
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurViewManager.kt +5 -0
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeProgressiveBlurView.kt +34 -2
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeProgressiveBlurViewManager.kt +5 -0
- package/lib/module/BlurSwitch.js +11 -6
- package/lib/module/BlurSwitch.js.map +1 -1
- package/lib/module/BlurView.js +2 -0
- package/lib/module/BlurView.js.map +1 -1
- package/lib/module/LiquidGlassContainer.js.map +1 -1
- package/lib/module/LiquidGlassView.js.map +1 -1
- package/lib/module/ProgressiveBlurView.js +3 -0
- package/lib/module/ProgressiveBlurView.js.map +1 -1
- package/lib/module/ReactNativeBlurSwitchNativeComponent.ts +2 -37
- package/lib/module/ReactNativeBlurViewNativeComponent.ts +2 -0
- package/lib/module/ReactNativeLiquidGlassContainerNativeComponent.ts +0 -5
- package/lib/module/ReactNativeLiquidGlassViewNativeComponent.ts +0 -35
- package/lib/module/ReactNativeProgressiveBlurViewNativeComponent.ts +2 -0
- package/lib/typescript/src/BlurSwitch.d.ts +10 -0
- package/lib/typescript/src/BlurSwitch.d.ts.map +1 -1
- package/lib/typescript/src/BlurView.d.ts +11 -2
- package/lib/typescript/src/BlurView.d.ts.map +1 -1
- package/lib/typescript/src/LiquidGlassContainer.d.ts +3 -2
- package/lib/typescript/src/LiquidGlassContainer.d.ts.map +1 -1
- package/lib/typescript/src/LiquidGlassView.d.ts +25 -15
- package/lib/typescript/src/LiquidGlassView.d.ts.map +1 -1
- package/lib/typescript/src/ProgressiveBlurView.d.ts +11 -2
- package/lib/typescript/src/ProgressiveBlurView.d.ts.map +1 -1
- package/lib/typescript/src/ReactNativeBlurSwitchNativeComponent.d.ts +2 -32
- package/lib/typescript/src/ReactNativeBlurSwitchNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/ReactNativeBlurViewNativeComponent.d.ts +2 -1
- package/lib/typescript/src/ReactNativeBlurViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/ReactNativeLiquidGlassContainerNativeComponent.d.ts +0 -5
- package/lib/typescript/src/ReactNativeLiquidGlassContainerNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/ReactNativeLiquidGlassViewNativeComponent.d.ts +0 -30
- package/lib/typescript/src/ReactNativeLiquidGlassViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/ReactNativeProgressiveBlurViewNativeComponent.d.ts +2 -1
- package/lib/typescript/src/ReactNativeProgressiveBlurViewNativeComponent.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/BlurSwitch.tsx +23 -3
- package/src/BlurView.tsx +14 -2
- package/src/LiquidGlassContainer.tsx +3 -2
- package/src/LiquidGlassView.tsx +25 -15
- package/src/ProgressiveBlurView.tsx +15 -2
- package/src/ReactNativeBlurSwitchNativeComponent.ts +2 -37
- package/src/ReactNativeBlurViewNativeComponent.ts +2 -0
- package/src/ReactNativeLiquidGlassContainerNativeComponent.ts +0 -5
- package/src/ReactNativeLiquidGlassViewNativeComponent.ts +0 -35
- package/src/ReactNativeProgressiveBlurViewNativeComponent.ts +2 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeBlurViewManagerDelegate.java +0 -53
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeBlurViewManagerInterface.java +0 -25
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassEffectContainerManagerDelegate.java +0 -53
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassEffectContainerManagerInterface.java +0 -25
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassViewManagerDelegate.java +0 -38
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassViewManagerInterface.java +0 -20
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -36
- package/android/app/build/generated/source/codegen/jni/ReactNativeBlurViewSpec-generated.cpp +0 -22
- package/android/app/build/generated/source/codegen/jni/ReactNativeBlurViewSpec.h +0 -24
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ComponentDescriptors.cpp +0 -23
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ComponentDescriptors.h +0 -25
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/EventEmitters.cpp +0 -17
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/EventEmitters.h +0 -30
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/Props.cpp +0 -46
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/Props.h +0 -131
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ReactNativeBlurViewSpecJSI-generated.cpp +0 -17
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ReactNativeBlurViewSpecJSI.h +0 -19
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.cpp +0 -18
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.h +0 -43
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/States.cpp +0 -16
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/States.h +0 -41
package/README.md
CHANGED
|
@@ -626,6 +626,7 @@ All props are optional and have sensible defaults.
|
|
|
626
626
|
| ---------------------------------- | ------------ | ----------- | ----------------------------------------------------------------------------- |
|
|
627
627
|
| `blurType` | `BlurType` | `'xlight'` | The type of blur effect to apply |
|
|
628
628
|
| `blurAmount` | `number` | `10.0` | The intensity of the blur effect (0-100) |
|
|
629
|
+
| `blurRounds` | `number` | `5` | The number of blur interactions must be an integer value (1-15) |
|
|
629
630
|
| `ignoreSafeArea` | `boolean` | `true` | (iOS only) Controls whether the blur effect should ignore all safe area edges |
|
|
630
631
|
| `reducedTransparencyFallbackColor` | `string` | `'#FFFFFF'` | Fallback color when reduced transparency is enabled |
|
|
631
632
|
| `overlayColor` | `ColorValue` | `undefined` | The overlay color to apply on top of the blur effect |
|
|
@@ -647,16 +648,17 @@ All props are optional and have sensible defaults.
|
|
|
647
648
|
|
|
648
649
|
All props are optional and have sensible defaults.
|
|
649
650
|
|
|
650
|
-
| Prop | Type | Default | Description
|
|
651
|
-
| ---------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------- |
|
|
652
|
-
| `blurType` | `BlurType` | `'regular'` | The type of blur effect to apply
|
|
653
|
-
| `blurAmount` | `number` | `20.0` | Maximum blur radius in pixels
|
|
654
|
-
| `
|
|
655
|
-
| `
|
|
656
|
-
| `
|
|
657
|
-
| `
|
|
658
|
-
| `
|
|
659
|
-
| `
|
|
651
|
+
| Prop | Type | Default | Description |
|
|
652
|
+
| ---------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------- | --------------------------------------------------------------- |
|
|
653
|
+
| `blurType` | `BlurType` | `'regular'` | The type of blur effect to apply |
|
|
654
|
+
| `blurAmount` | `number` | `20.0` | Maximum blur radius in pixels |
|
|
655
|
+
| `blurRounds` | `number` | `5` | The number of blur interactions must be an integer value (1-15) |
|
|
656
|
+
| `direction` | `'blurredTopClearBottom' \| 'blurredBottomClearTop' \| 'blurredCenterClearTopAndBottom'` | `'blurredTopClearBottom'` | Direction of the blur gradient |
|
|
657
|
+
| `startOffset` | `number` | `0.0` | Where the gradient starts (0.0 to 1.0) |
|
|
658
|
+
| `reducedTransparencyFallbackColor` | `string` | `'#FFFFFF'` | Fallback color when reduced transparency is enabled |
|
|
659
|
+
| `overlayColor` | `ColorValue` | `undefined` | The overlay color to apply on top of the blur effect |
|
|
660
|
+
| `style` | `ViewStyle` | `undefined` | Style object for the blur view |
|
|
661
|
+
| `children` | `ReactNode` | `undefined` | Child components to render inside the blur view |
|
|
660
662
|
|
|
661
663
|
> **Platform Note**: `ProgressiveBlurView` works on both **iOS** and **Android**.
|
|
662
664
|
>
|
|
@@ -696,7 +698,8 @@ All props are optional and have sensible defaults.
|
|
|
696
698
|
| --------------- | ------------------------------------------- | --------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
697
699
|
| `value` | `boolean` | `false` | The current value of the switch |
|
|
698
700
|
| `onValueChange` | `(value: boolean) => void` | `undefined` | Callback invoked when the switch value changes |
|
|
699
|
-
| `blurAmount` | `number` | `10`
|
|
701
|
+
| `blurAmount` | `number` | `10.0` | (Android only) The intensity of the blur effect (0-100) |
|
|
702
|
+
| `blurRounds` | `number` | `5` | The number of blur interactions must be an integer value (1-15) |
|
|
700
703
|
| `thumbColor` | `ColorValue` | `'#FFFFFF'` | (iOS only) The color of the switch thumb |
|
|
701
704
|
| `trackColor` | `{ false?: ColorValue; true?: ColorValue }` | `{ false: '#E5E5EA', true: '#34C759' }` | Track colors. On Android, only `true` is used - QmBlurView auto-calculates on/off colors from base color |
|
|
702
705
|
| `disabled` | `boolean` | `false` | Whether the switch is disabled (prevents interaction but maintains current value) |
|
|
@@ -845,6 +848,7 @@ interface MyGlassContainerProps {
|
|
|
845
848
|
const blurProps: BlurViewProps = {
|
|
846
849
|
blurType: 'systemMaterial',
|
|
847
850
|
blurAmount: 50,
|
|
851
|
+
blurRounds: 10,
|
|
848
852
|
reducedTransparencyFallbackColor: '#FFFFFF',
|
|
849
853
|
overlayColor: '#FF000040',
|
|
850
854
|
};
|
|
@@ -867,6 +871,7 @@ const blurSwitchProps: BlurSwitchProps = {
|
|
|
867
871
|
value: true,
|
|
868
872
|
onValueChange: (value) => console.log(value),
|
|
869
873
|
blurAmount: 20,
|
|
874
|
+
blurRounds: 15,
|
|
870
875
|
trackColor: { true: '#34C759' },
|
|
871
876
|
disabled: false,
|
|
872
877
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.sbaiahmed1.reactnativeblur
|
|
2
2
|
|
|
3
|
+
import android.content.res.Configuration
|
|
3
4
|
import android.graphics.Color
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -9,51 +10,52 @@ import android.graphics.Color
|
|
|
9
10
|
enum class BlurType(val overlayColor: Int) {
|
|
10
11
|
XLIGHT(Color.argb(140, 240, 240, 240)),
|
|
11
12
|
LIGHT(Color.argb(42, 255, 255, 255)),
|
|
12
|
-
DARK(Color.argb(120,
|
|
13
|
+
DARK(Color.argb(120, 26, 22, 22)),
|
|
13
14
|
EXTRA_DARK(Color.argb(160, 35, 35, 35)),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
REGULAR_LIGHT(Color.argb(35, 255, 255, 255)),
|
|
16
|
+
REGULAR_DARK(Color.argb(35, 28, 28, 30)),
|
|
17
|
+
PROMINENT_LIGHT(Color.argb(140, 240, 240, 240)),
|
|
18
|
+
PROMINENT_DARK(Color.argb(140, 28, 28, 30)),
|
|
19
|
+
SYSTEM_ULTRA_THIN_MATERIAL_LIGHT(Color.argb(75, 240, 240, 240)),
|
|
18
20
|
SYSTEM_ULTRA_THIN_MATERIAL_DARK(Color.argb(65, 40, 40, 40)),
|
|
19
|
-
|
|
20
|
-
SYSTEM_THIN_MATERIAL_LIGHT(Color.argb(105, 240, 240, 240)),
|
|
21
|
+
SYSTEM_THIN_MATERIAL_LIGHT(Color.argb(102, 240, 240, 240)),
|
|
21
22
|
SYSTEM_THIN_MATERIAL_DARK(Color.argb(102, 35, 35, 35)),
|
|
22
|
-
|
|
23
|
-
SYSTEM_MATERIAL_LIGHT(Color.argb(130, 245, 245, 245)),
|
|
23
|
+
SYSTEM_MATERIAL_LIGHT(Color.argb(140, 245, 245, 245)),
|
|
24
24
|
SYSTEM_MATERIAL_DARK(Color.argb(215, 65, 60, 60)),
|
|
25
|
-
|
|
26
|
-
SYSTEM_THICK_MATERIAL_LIGHT(Color.argb(160, 242, 242, 242)),
|
|
25
|
+
SYSTEM_THICK_MATERIAL_LIGHT(Color.argb(210, 248, 248, 248)),
|
|
27
26
|
SYSTEM_THICK_MATERIAL_DARK(Color.argb(160, 35, 35, 35)),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
SYSTEM_CHROME_MATERIAL_DARK(Color.argb(90, 32, 32, 32));
|
|
27
|
+
SYSTEM_CHROME_MATERIAL_LIGHT(Color.argb(165, 248, 248, 248)),
|
|
28
|
+
SYSTEM_CHROME_MATERIAL_DARK(Color.argb(100, 32, 32, 32));
|
|
31
29
|
|
|
32
30
|
companion object {
|
|
33
31
|
/**
|
|
34
32
|
* Get BlurType from string, with fallback to LIGHT for unknown types.
|
|
33
|
+
* Uses the provided configuration to determine if dark mode is active for
|
|
34
|
+
* appropriate defaults.
|
|
35
35
|
*/
|
|
36
|
-
fun fromString(type: String): BlurType {
|
|
36
|
+
fun fromString(type: String, configuration: Configuration): BlurType {
|
|
37
|
+
val isDarkMode = (configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES
|
|
38
|
+
|
|
37
39
|
return when (type.lowercase()) {
|
|
38
40
|
"xlight" -> XLIGHT
|
|
39
41
|
"light" -> LIGHT
|
|
40
42
|
"dark" -> DARK
|
|
41
43
|
"extradark" -> EXTRA_DARK
|
|
42
|
-
"regular" ->
|
|
43
|
-
"prominent" ->
|
|
44
|
-
"systemultrathinmaterial" ->
|
|
44
|
+
"regular" -> if (isDarkMode) REGULAR_DARK else REGULAR_LIGHT
|
|
45
|
+
"prominent" -> if (isDarkMode) PROMINENT_DARK else PROMINENT_LIGHT
|
|
46
|
+
"systemultrathinmaterial" -> if (isDarkMode) SYSTEM_ULTRA_THIN_MATERIAL_DARK else SYSTEM_ULTRA_THIN_MATERIAL_LIGHT
|
|
45
47
|
"systemultrathinmateriallight" -> SYSTEM_ULTRA_THIN_MATERIAL_LIGHT
|
|
46
48
|
"systemultrathinmaterialdark" -> SYSTEM_ULTRA_THIN_MATERIAL_DARK
|
|
47
|
-
"systemthinmaterial" ->
|
|
49
|
+
"systemthinmaterial" -> if (isDarkMode) SYSTEM_THIN_MATERIAL_DARK else SYSTEM_THIN_MATERIAL_LIGHT
|
|
48
50
|
"systemthinmateriallight" -> SYSTEM_THIN_MATERIAL_LIGHT
|
|
49
51
|
"systemthinmaterialdark" -> SYSTEM_THIN_MATERIAL_DARK
|
|
50
|
-
"systemmaterial" ->
|
|
52
|
+
"systemmaterial" -> if (isDarkMode) SYSTEM_MATERIAL_DARK else SYSTEM_MATERIAL_LIGHT
|
|
51
53
|
"systemmateriallight" -> SYSTEM_MATERIAL_LIGHT
|
|
52
54
|
"systemmaterialdark" -> SYSTEM_MATERIAL_DARK
|
|
53
|
-
"systemthickmaterial" ->
|
|
55
|
+
"systemthickmaterial" -> if (isDarkMode) SYSTEM_THICK_MATERIAL_DARK else SYSTEM_THICK_MATERIAL_LIGHT
|
|
54
56
|
"systemthickmateriallight" -> SYSTEM_THICK_MATERIAL_LIGHT
|
|
55
57
|
"systemthickmaterialdark" -> SYSTEM_THICK_MATERIAL_DARK
|
|
56
|
-
"systemchromematerial" ->
|
|
58
|
+
"systemchromematerial" -> if (isDarkMode) SYSTEM_CHROME_MATERIAL_DARK else SYSTEM_CHROME_MATERIAL_LIGHT
|
|
57
59
|
"systemchromemateriallight" -> SYSTEM_CHROME_MATERIAL_LIGHT
|
|
58
60
|
"systemchromematerialdark" -> SYSTEM_CHROME_MATERIAL_DARK
|
|
59
61
|
else -> XLIGHT // default fallback
|
|
@@ -22,9 +22,11 @@ class ReactNativeBlurSwitch : BlurSwitchButtonView {
|
|
|
22
22
|
private var onValueChangeListener: ((Boolean) -> Unit)? = null
|
|
23
23
|
private var currentValue = false
|
|
24
24
|
private var isDisabled = false
|
|
25
|
+
private var currentBlurRounds = DEFAULT_BLUR_ROUNDS
|
|
25
26
|
|
|
26
27
|
companion object {
|
|
27
28
|
private const val TAG = "ReactNativeBlurSwitch"
|
|
29
|
+
private const val DEFAULT_BLUR_ROUNDS = 5
|
|
28
30
|
private const val DEFAULT_WIDTH_DP = 65f
|
|
29
31
|
private const val DEFAULT_HEIGHT_DP = 36f
|
|
30
32
|
private const val MIN_BLUR_AMOUNT = 0f
|
|
@@ -70,7 +72,7 @@ class ReactNativeBlurSwitch : BlurSwitchButtonView {
|
|
|
70
72
|
*/
|
|
71
73
|
private fun initializeSwitch() {
|
|
72
74
|
try {
|
|
73
|
-
blurRounds =
|
|
75
|
+
blurRounds = currentBlurRounds
|
|
74
76
|
|
|
75
77
|
setOnCheckedChangeListener { isChecked ->
|
|
76
78
|
if (isDisabled) {
|
|
@@ -172,6 +174,22 @@ class ReactNativeBlurSwitch : BlurSwitchButtonView {
|
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
176
|
|
|
177
|
+
/**
|
|
178
|
+
* Set the number of blur rounds.
|
|
179
|
+
* @param rounds The number of blur rounds (1-15)
|
|
180
|
+
*/
|
|
181
|
+
fun setRounds(rounds: Int) {
|
|
182
|
+
val blurRounds = rounds.coerceIn(1, 15)
|
|
183
|
+
currentBlurRounds = blurRounds
|
|
184
|
+
logDebug("setRounds: $rounds -> $blurRounds")
|
|
185
|
+
|
|
186
|
+
try {
|
|
187
|
+
super.setBlurRounds(blurRounds)
|
|
188
|
+
} catch (e: Exception) {
|
|
189
|
+
logError("Failed to set blur rounds: ${e.message}", e)
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
175
193
|
/**
|
|
176
194
|
* Set whether the switch is disabled.
|
|
177
195
|
* @param disabled True to disable, false to enable
|
package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurSwitchManager.kt
CHANGED
|
@@ -40,6 +40,11 @@ class ReactNativeBlurSwitchManager : SimpleViewManager<ReactNativeBlurSwitch>()
|
|
|
40
40
|
view?.setBlurAmount(blurAmount.toFloat())
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
@ReactProp(name = "blurRounds")
|
|
44
|
+
fun setBlurRounds(view: ReactNativeBlurSwitch?, blurRounds: Int) {
|
|
45
|
+
view?.setRounds(blurRounds)
|
|
46
|
+
}
|
|
47
|
+
|
|
43
48
|
@ReactProp(name = "thumbColor")
|
|
44
49
|
fun setThumbColor(view: ReactNativeBlurSwitch?, color: String?) {
|
|
45
50
|
color?.let {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package com.sbaiahmed1.reactnativeblur
|
|
2
2
|
|
|
3
3
|
import android.content.Context
|
|
4
|
+
import android.content.res.Configuration
|
|
4
5
|
import android.graphics.Color
|
|
5
6
|
import android.graphics.Outline
|
|
6
7
|
import android.util.AttributeSet
|
|
@@ -30,11 +31,13 @@ import android.view.View.MeasureSpec
|
|
|
30
31
|
class ReactNativeBlurView : BlurViewGroup {
|
|
31
32
|
private var currentBlurRadius = DEFAULT_BLUR_RADIUS
|
|
32
33
|
private var currentOverlayColor = Color.TRANSPARENT
|
|
34
|
+
private var currentBlurRounds = DEFAULT_BLUR_ROUNDS
|
|
33
35
|
private var currentCornerRadius = 0f
|
|
34
36
|
private var glassTintColor: Int = Color.TRANSPARENT
|
|
35
37
|
private var glassOpacity: Float = 1.0f
|
|
36
38
|
private var viewType: String = "blur"
|
|
37
39
|
private var glassType: String = "clear"
|
|
40
|
+
private var currentBlurType: String = "xlight"
|
|
38
41
|
private var isBlurInitialized: Boolean = false
|
|
39
42
|
private var initRunnable: Runnable? = null
|
|
40
43
|
|
|
@@ -42,6 +45,7 @@ class ReactNativeBlurView : BlurViewGroup {
|
|
|
42
45
|
private const val TAG = "ReactNativeBlurView"
|
|
43
46
|
private const val MAX_BLUR_RADIUS = 100f
|
|
44
47
|
private const val DEFAULT_BLUR_RADIUS = 10f
|
|
48
|
+
private const val DEFAULT_BLUR_ROUNDS = 5
|
|
45
49
|
private const val DEBUG = false
|
|
46
50
|
|
|
47
51
|
// Cross-platform blur amount constants
|
|
@@ -91,7 +95,7 @@ class ReactNativeBlurView : BlurViewGroup {
|
|
|
91
95
|
super.setBackgroundColor(currentOverlayColor)
|
|
92
96
|
clipChildren = true
|
|
93
97
|
clipToOutline = true
|
|
94
|
-
blurRounds =
|
|
98
|
+
blurRounds = currentBlurRounds
|
|
95
99
|
super.setDownsampleFactor(6.0F)
|
|
96
100
|
}
|
|
97
101
|
|
|
@@ -288,12 +292,29 @@ class ReactNativeBlurView : BlurViewGroup {
|
|
|
288
292
|
}
|
|
289
293
|
}
|
|
290
294
|
|
|
295
|
+
/**
|
|
296
|
+
* Set the number of blur rounds.
|
|
297
|
+
* @param rounds The number of blur rounds (1-15)
|
|
298
|
+
*/
|
|
299
|
+
fun setRounds(rounds: Int) {
|
|
300
|
+
val blurRounds = rounds.coerceIn(1, 15)
|
|
301
|
+
currentBlurRounds = blurRounds
|
|
302
|
+
logDebug("setRounds: $rounds -> $blurRounds")
|
|
303
|
+
|
|
304
|
+
try {
|
|
305
|
+
super.setBlurRounds(blurRounds)
|
|
306
|
+
} catch (e: Exception) {
|
|
307
|
+
logError("Failed to set blur rounds: ${e.message}", e)
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
291
311
|
/**
|
|
292
312
|
* Set the blur type which determines the overlay color.
|
|
293
313
|
* @param type The blur type string (case-insensitive)
|
|
294
314
|
*/
|
|
295
315
|
fun setBlurType(type: String) {
|
|
296
|
-
|
|
316
|
+
currentBlurType = type
|
|
317
|
+
val blurType = BlurType.fromString(type, resources.configuration)
|
|
297
318
|
currentOverlayColor = blurType.overlayColor
|
|
298
319
|
logDebug("setBlurType: $type -> ${blurType.name}")
|
|
299
320
|
|
|
@@ -478,4 +499,18 @@ class ReactNativeBlurView : BlurViewGroup {
|
|
|
478
499
|
// re-positioning children based on its own logic (e.g. gravity), which would
|
|
479
500
|
// conflict with React Native's layout.
|
|
480
501
|
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Handle configuration changes, such as dark mode or orientation changes.
|
|
505
|
+
* This ensures the blur view updates its overlay color based on the new
|
|
506
|
+
* configuration.
|
|
507
|
+
*/
|
|
508
|
+
override fun onConfigurationChanged(newConfig: Configuration) {
|
|
509
|
+
super.onConfigurationChanged(newConfig)
|
|
510
|
+
|
|
511
|
+
if (viewType == "blur") {
|
|
512
|
+
// Re-apply blur type to update overlay color based on new configuration
|
|
513
|
+
setBlurType(currentBlurType)
|
|
514
|
+
}
|
|
515
|
+
}
|
|
481
516
|
}
|
|
@@ -39,6 +39,11 @@ class ReactNativeBlurViewManager : ViewGroupManager<ReactNativeBlurView>(),
|
|
|
39
39
|
view?.setBlurAmount(blurAmount.toFloat())
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
@ReactProp(name = "blurRounds")
|
|
43
|
+
override fun setBlurRounds(view: ReactNativeBlurView?, blurRounds: Int) {
|
|
44
|
+
view?.setRounds(blurRounds)
|
|
45
|
+
}
|
|
46
|
+
|
|
42
47
|
@ReactProp(name = "borderRadius")
|
|
43
48
|
override fun setBorderRadius(view: ReactNativeBlurView?, borderRadius: Float) {
|
|
44
49
|
view?.setBorderRadius(borderRadius)
|
package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeProgressiveBlurView.kt
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package com.sbaiahmed1.reactnativeblur
|
|
2
2
|
|
|
3
3
|
import android.content.Context
|
|
4
|
+
import android.content.res.Configuration
|
|
4
5
|
import android.graphics.Canvas
|
|
5
6
|
import android.graphics.Color
|
|
6
7
|
import android.graphics.LinearGradient
|
|
@@ -30,7 +31,9 @@ class ReactNativeProgressiveBlurView : FrameLayout {
|
|
|
30
31
|
private val gradientPaint = Paint(Paint.ANTI_ALIAS_FLAG)
|
|
31
32
|
|
|
32
33
|
private var currentBlurRadius = DEFAULT_BLUR_RADIUS
|
|
34
|
+
private var currentBlurRounds = DEFAULT_BLUR_ROUNDS
|
|
33
35
|
private var currentOverlayColor = Color.TRANSPARENT
|
|
36
|
+
private var currentBlurType = "xlight"
|
|
34
37
|
private var currentDirection = "topToBottom"
|
|
35
38
|
private var currentStartOffset = 0.0f
|
|
36
39
|
private var hasExplicitBackground: Boolean = false
|
|
@@ -42,6 +45,7 @@ class ReactNativeProgressiveBlurView : FrameLayout {
|
|
|
42
45
|
private const val TAG = "ReactNativeProgressiveBlur"
|
|
43
46
|
private const val MAX_BLUR_RADIUS = 100f
|
|
44
47
|
private const val DEFAULT_BLUR_RADIUS = 10f
|
|
48
|
+
private const val DEFAULT_BLUR_ROUNDS = 5
|
|
45
49
|
private const val DEBUG = false
|
|
46
50
|
|
|
47
51
|
// Cross-platform blur amount constants
|
|
@@ -129,7 +133,7 @@ class ReactNativeProgressiveBlurView : FrameLayout {
|
|
|
129
133
|
blurView = BlurView(context, null).apply {
|
|
130
134
|
layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
|
|
131
135
|
setDownsampleFactor(6.0F)
|
|
132
|
-
blurRounds =
|
|
136
|
+
blurRounds = currentBlurRounds
|
|
133
137
|
}
|
|
134
138
|
addView(blurView)
|
|
135
139
|
}
|
|
@@ -393,6 +397,17 @@ class ReactNativeProgressiveBlurView : FrameLayout {
|
|
|
393
397
|
cleanup()
|
|
394
398
|
}
|
|
395
399
|
|
|
400
|
+
/**
|
|
401
|
+
* Handle configuration changes, such as dark mode or orientation changes.
|
|
402
|
+
* This ensures the blur view updates its overlay color based on the new
|
|
403
|
+
* configuration.
|
|
404
|
+
*/
|
|
405
|
+
override fun onConfigurationChanged(newConfig: Configuration) {
|
|
406
|
+
super.onConfigurationChanged(newConfig)
|
|
407
|
+
|
|
408
|
+
setBlurType(currentBlurType)
|
|
409
|
+
}
|
|
410
|
+
|
|
396
411
|
/**
|
|
397
412
|
* Cleanup method to prevent memory leaks.
|
|
398
413
|
* Resets initialization state so blur is re-initialized on next attach.
|
|
@@ -447,6 +462,22 @@ class ReactNativeProgressiveBlurView : FrameLayout {
|
|
|
447
462
|
}
|
|
448
463
|
}
|
|
449
464
|
|
|
465
|
+
/**
|
|
466
|
+
* Set the number of blur rounds.
|
|
467
|
+
* @param rounds The number of blur rounds (1-15)
|
|
468
|
+
*/
|
|
469
|
+
fun setRounds(rounds: Int) {
|
|
470
|
+
val blurRounds = rounds.coerceIn(1, 15)
|
|
471
|
+
currentBlurRounds = blurRounds
|
|
472
|
+
logDebug("setRounds: $rounds -> $blurRounds")
|
|
473
|
+
|
|
474
|
+
try {
|
|
475
|
+
blurView?.blurRounds = blurRounds
|
|
476
|
+
} catch (e: Exception) {
|
|
477
|
+
logError("Failed to set blur rounds: ${e.message}", e)
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
450
481
|
/**
|
|
451
482
|
* Set the direction of the progressive blur gradient.
|
|
452
483
|
* @param direction The direction string: "blurredTopClearBottom" or "blurredBottomClearTop"
|
|
@@ -494,7 +525,8 @@ class ReactNativeProgressiveBlurView : FrameLayout {
|
|
|
494
525
|
* @param type The blur type string (case-insensitive)
|
|
495
526
|
*/
|
|
496
527
|
fun setBlurType(type: String) {
|
|
497
|
-
|
|
528
|
+
currentBlurType = type
|
|
529
|
+
val blurType = BlurType.fromString(type, resources.configuration)
|
|
498
530
|
currentOverlayColor = blurType.overlayColor
|
|
499
531
|
logDebug("setBlurType: $type -> ${blurType.name} -> ${Integer.toHexString(currentOverlayColor)}")
|
|
500
532
|
|
|
@@ -45,6 +45,11 @@ class ReactNativeProgressiveBlurViewManager : SimpleViewManager<ReactNativeProgr
|
|
|
45
45
|
view?.setBlurAmount(blurAmount.toFloat())
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
@ReactProp(name = "blurRounds")
|
|
49
|
+
override fun setBlurRounds(view: ReactNativeProgressiveBlurView?, blurRounds: Int) {
|
|
50
|
+
view?.setRounds(blurRounds)
|
|
51
|
+
}
|
|
52
|
+
|
|
48
53
|
@ReactProp(name = "direction")
|
|
49
54
|
override fun setDirection(view: ReactNativeProgressiveBlurView?, direction: String?) {
|
|
50
55
|
// Provide default value if direction is null or empty
|
package/lib/module/BlurSwitch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { Platform, Switch } from 'react-native';
|
|
4
|
+
import { Platform, StyleSheet, Switch } from 'react-native';
|
|
5
5
|
import ReactNativeBlurSwitch from './ReactNativeBlurSwitchNativeComponent';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
const toColorString = (color, fallback) => {
|
|
@@ -30,8 +30,9 @@ const toColorString = (color, fallback) => {
|
|
|
30
30
|
*/
|
|
31
31
|
export const BlurSwitch = ({
|
|
32
32
|
value = false,
|
|
33
|
-
onValueChange,
|
|
34
33
|
blurAmount = 10,
|
|
34
|
+
blurRounds = 5,
|
|
35
|
+
onValueChange,
|
|
35
36
|
thumbColor = '#FFFFFF',
|
|
36
37
|
trackColor = {
|
|
37
38
|
false: '#E5E5EA',
|
|
@@ -53,15 +54,13 @@ export const BlurSwitch = ({
|
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
return /*#__PURE__*/_jsx(ReactNativeBlurSwitch, {
|
|
56
|
-
style: [
|
|
57
|
-
width: 65,
|
|
58
|
-
height: 36
|
|
59
|
-
}, style],
|
|
57
|
+
style: [styles.switch, style],
|
|
60
58
|
value: value,
|
|
61
59
|
onValueChange: event => {
|
|
62
60
|
onValueChange?.(event.nativeEvent.value);
|
|
63
61
|
},
|
|
64
62
|
blurAmount: blurAmount,
|
|
63
|
+
blurRounds: blurRounds,
|
|
65
64
|
thumbColor: toColorString(thumbColor, '#FFFFFF'),
|
|
66
65
|
trackColorOff: toColorString(trackColor?.false, '#E5E5EA'),
|
|
67
66
|
trackColorOn: toColorString(trackColor?.true, '#34C759'),
|
|
@@ -69,5 +68,11 @@ export const BlurSwitch = ({
|
|
|
69
68
|
...props
|
|
70
69
|
});
|
|
71
70
|
};
|
|
71
|
+
const styles = StyleSheet.create({
|
|
72
|
+
switch: {
|
|
73
|
+
width: 65,
|
|
74
|
+
height: 36
|
|
75
|
+
}
|
|
76
|
+
});
|
|
72
77
|
export default BlurSwitch;
|
|
73
78
|
//# sourceMappingURL=BlurSwitch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","Switch","ReactNativeBlurSwitch","jsx","_jsx","toColorString","color","fallback","BlurSwitch","value","
|
|
1
|
+
{"version":3,"names":["React","Platform","StyleSheet","Switch","ReactNativeBlurSwitch","jsx","_jsx","toColorString","color","fallback","BlurSwitch","value","blurAmount","blurRounds","onValueChange","thumbColor","trackColor","false","true","disabled","style","props","OS","styles","switch","event","nativeEvent","trackColorOff","trackColorOn","create","width","height"],"sourceRoot":"../../src","sources":["BlurSwitch.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,UAAU,EAAEC,MAAM,QAAQ,cAAc;AAE3D,OAAOC,qBAAqB,MAAM,wCAAwC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3E,MAAMC,aAAa,GAAGA,CACpBC,KAA6B,EAC7BC,QAAgB,KACL;EACX,IAAI,OAAOD,KAAK,KAAK,QAAQ,EAAE,OAAOA,KAAK;EAC3C,OAAOC,QAAQ;AACjB,CAAC;AAyED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,U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AC;AAEF,eAAerB,UAAU","ignoreList":[]}
|
package/lib/module/BlurView.js
CHANGED
|
@@ -29,6 +29,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
29
29
|
export const BlurView = ({
|
|
30
30
|
blurType = 'xlight',
|
|
31
31
|
blurAmount = 10,
|
|
32
|
+
blurRounds = 5,
|
|
32
33
|
reducedTransparencyFallbackColor = '#FFFFFF',
|
|
33
34
|
overlayColor,
|
|
34
35
|
style,
|
|
@@ -42,6 +43,7 @@ export const BlurView = ({
|
|
|
42
43
|
const commonProps = {
|
|
43
44
|
blurType,
|
|
44
45
|
blurAmount,
|
|
46
|
+
blurRounds,
|
|
45
47
|
ignoreSafeArea,
|
|
46
48
|
reducedTransparencyFallbackColor
|
|
47
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Children","Platform","StyleSheet","View","ReactNativeBlurView","jsx","_jsx","jsxs","_jsxs","BlurView","blurType","blurAmount","reducedTransparencyFallbackColor","overlayColor","style","children","ignoreSafeArea","props","overlay","backgroundColor","commonProps","count","OS","absoluteFill","styles","container","create","position","overflow"],"sourceRoot":"../../src","sources":["BlurView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEzD,OAAOC,mBAAmB,MAEnB,sCAAsC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;
|
|
1
|
+
{"version":3,"names":["React","Children","Platform","StyleSheet","View","ReactNativeBlurView","jsx","_jsx","jsxs","_jsxs","BlurView","blurType","blurAmount","blurRounds","reducedTransparencyFallbackColor","overlayColor","style","children","ignoreSafeArea","props","overlay","backgroundColor","commonProps","count","OS","absoluteFill","styles","container","create","position","overflow"],"sourceRoot":"../../src","sources":["BlurView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ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KAAK,EAAE,CAACU,MAAM,CAACC,SAAS,EAAEX,KAAK,EAAEI,OAAO,CAAE;IAAAH,QAAA,gBAE9CV,IAAA,CAACF,mBAAmB;MAClBW,KAAK,EAAEb,UAAU,CAACsB,YAAa;MAAA,GAC3BH,WAAW;MAAA,GACXH;IAAK,CACV,CAAC,EACDF,QAAQ;EAAA,CACL,CAAC;AAEX,CAAC;AAED,eAAeP,QAAQ;AAEvB,MAAMgB,MAAM,GAAGvB,UAAU,CAACyB,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,QAAQ,EAAE,UAAU;IACpBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","View","ReactNativeLiquidGlassContainer","jsx","_jsx","LiquidGlassContainer","spacing","style","children","rest","isCompatibleIOS","OS","parseInt","Version"],"sourceRoot":"../../src","sources":["LiquidGlassContainer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,QAAwB,cAAc;AAC7D,OAAOC,+BAA+B,MAAM,kDAAkD;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["React","Platform","View","ReactNativeLiquidGlassContainer","jsx","_jsx","LiquidGlassContainer","spacing","style","children","rest","isCompatibleIOS","OS","parseInt","Version"],"sourceRoot":"../../src","sources":["LiquidGlassContainer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,QAAwB,cAAc;AAC7D,OAAOC,+BAA+B,MAAM,kDAAkD;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAa/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAyD,GAAGA,CAAC;EACxEC,OAAO,GAAG,CAAC;EACXC,KAAK;EACLC,QAAQ;EACR,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,eAAe,GACnBV,QAAQ,CAACW,EAAE,KAAK,KAAK,IAAIC,QAAQ,CAACZ,QAAQ,CAACa,OAAO,EAAY,EAAE,CAAC,IAAI,EAAE;EAEzE,IAAI,CAACH,eAAe,EAAE;IACpB;IACA,oBACEN,IAAA,CAACH,IAAI;MAACM,KAAK,EAAEA,KAAM;MAAA,GAAKE,IAAI;MAAAD,QAAA,EACzBA;IAAQ,CACL,CAAC;EAEX;EAEA,oBACEJ,IAAA,CAACF,+BAA+B;IAACI,OAAO,EAAEA,OAAQ;IAACC,KAAK,EAAEA,KAAM;IAAA,GAAKE,IAAI;IAAAD,QAAA,EACtEA;EAAQ,CACsB,CAAC;AAEtC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","ReactNativeLiquidGlassView","BlurView","jsx","_jsx","LiquidGlassView","glassType","glassTintColor","glassOpacity","reducedTransparencyFallbackColor","isInteractive","ignoreSafeArea","style","children","props","isIos","OS","Number","parseInt","String","Version","console","warn","overlayColorWithAlpha","Math","floor","toString","padStart","blurAmount","overlayColor"],"sourceRoot":"../../src","sources":["LiquidGlassView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,cAAc;AAEvC,OAAOC,0BAA0B,MAE1B,6CAA6C;AACpD,OAAOC,QAAQ,MAAM,eAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["React","Platform","ReactNativeLiquidGlassView","BlurView","jsx","_jsx","LiquidGlassView","glassType","glassTintColor","glassOpacity","reducedTransparencyFallbackColor","isInteractive","ignoreSafeArea","style","children","props","isIos","OS","Number","parseInt","String","Version","console","warn","overlayColorWithAlpha","Math","floor","toString","padStart","blurAmount","overlayColor"],"sourceRoot":"../../src","sources":["LiquidGlassView.tsx"],"mappings":";;AAAA,OAAOA,KAAK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H,0BAA0B;IACzBK,SAAS,EAAEA,SAAU;IACrBC,cAAc,EAAEA,cAAe;IAC/BC,YAAY,EAAEA,YAAa;IAC3BC,gCAAgC,EAAEA,gCAAiC;IACnEC,aAAa,EAAEA,aAAc;IAC7BC,cAAc,EAAEA,cAAe;IAC/BC,KAAK,EAAEA,KAAM;IAAA,GACTE,KAAK;IAAAD,QAAA,EAERA;EAAQ,CACiB,CAAC;AAEjC,CAAC;AAED,eAAeR,eAAe","ignoreList":[]}
|
|
@@ -47,6 +47,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
47
47
|
export const ProgressiveBlurView = ({
|
|
48
48
|
blurType = 'regular',
|
|
49
49
|
blurAmount = 20,
|
|
50
|
+
blurRounds = 5,
|
|
50
51
|
direction = 'blurredTopClearBottom',
|
|
51
52
|
startOffset = 0.0,
|
|
52
53
|
reducedTransparencyFallbackColor = '#FFFFFF',
|
|
@@ -64,6 +65,7 @@ export const ProgressiveBlurView = ({
|
|
|
64
65
|
return /*#__PURE__*/_jsx(ReactNativeProgressiveBlurView, {
|
|
65
66
|
blurType: blurType,
|
|
66
67
|
blurAmount: blurAmount,
|
|
68
|
+
blurRounds: blurRounds,
|
|
67
69
|
direction: direction,
|
|
68
70
|
startOffset: startOffset,
|
|
69
71
|
reducedTransparencyFallbackColor: reducedTransparencyFallbackColor,
|
|
@@ -78,6 +80,7 @@ export const ProgressiveBlurView = ({
|
|
|
78
80
|
children: [/*#__PURE__*/_jsx(ReactNativeProgressiveBlurView, {
|
|
79
81
|
blurType: blurType,
|
|
80
82
|
blurAmount: blurAmount,
|
|
83
|
+
blurRounds: blurRounds,
|
|
81
84
|
direction: direction,
|
|
82
85
|
startOffset: startOffset,
|
|
83
86
|
reducedTransparencyFallbackColor: reducedTransparencyFallbackColor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Children","StyleSheet","View","ReactNativeProgressiveBlurView","jsx","_jsx","jsxs","_jsxs","ProgressiveBlurView","blurType","blurAmount","direction","startOffset","reducedTransparencyFallbackColor","overlayColor","style","children","props","overlay","backgroundColor","count","styles","container","absoluteFill","create","position","overflow"],"sourceRoot":"../../src","sources":["ProgressiveBlurView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,OAAOC,8BAA8B,MAG9B,iDAAiD;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;
|
|
1
|
+
{"version":3,"names":["React","Children","StyleSheet","View","ReactNativeProgressiveBlurView","jsx","_jsx","jsxs","_jsxs","ProgressiveBlurView","blurType","blurAmount","blurRounds","direction","startOffset","reducedTransparencyFallbackColor","overlayColor","style","children","props","overlay","backgroundColor","count","styles","container","absoluteFill","create","position","overflow"],"sourceRoot":"../../src","sources":["ProgressiveBlurView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,OAAOC,8BAA8B,MAG9B,iDAAiD;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA8EzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAuD,GAAGA,CAAC;EACtEC,QAAQ,GAAG,SAAS;EACpBC,UAAU,GAAG,EAAE;EACfC,UAAU,GAAG,CAAC;EACdC,SAAS,GAAG,uBAAuB;EACnCC,WAAW,GAAG,GAAG;EACjBC,gCAAgC,GAAG,SAAS;EAC5CC,YAAY;EACZC,KAAK;EACLC,QAAQ;EACR,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,OAAO,GAAG;IAAEC,eAAe,EAAEL;EAAa,CAAC;;EAEjD;EACA,IAAI,CAACf,QAAQ,CAACqB,KAAK,CAACJ,QAAQ,CAAC,EAAE;IAC7B,oBACEZ,IAAA,CAACF,8BAA8B;MAC7BM,QAAQ,EAAEA,QAAS;MACnBC,UAAU,EAAEA,UAAW;MACvBC,UAAU,EAAEA,UAAW;MACvBC,SAAS,EAAEA,SAAU;MACrBC,WAAW,EAAEA,WAAY;MACzBC,gCAAgC,EAAEA,gCAAiC;MACnEE,KAAK,EAAE,CAACA,KAAK,EAAEG,OAAO,CAAE;MAAA,GACpBD;IAAK,CACV,CAAC;EAEN;;EAEA;EACA,oBACEX,KAAA,CAACL,IAAI;IAACc,KAAK,EAAE,CAACM,MAAM,CAACC,SAAS,EAAEP,KAAK,EAAEG,OAAO,CAAE;IAAAF,QAAA,gBAE9CZ,IAAA,CAACF,8BAA8B;MAC7BM,QAAQ,EAAEA,QAAS;MACnBC,UAAU,EAAEA,UAAW;MACvBC,UAAU,EAAEA,UAAW;MACvBC,SAAS,EAAEA,SAAU;MACrBC,WAAW,EAAEA,WAAY;MACzBC,gCAAgC,EAAEA,gCAAiC;MACnEE,KAAK,EAAEf,UAAU,CAACuB,YAAa;MAAA,GAC3BN;IAAK,CACV,CAAC,EAEDD,QAAQ;EAAA,CACL,CAAC;AAEX,CAAC;AAED,eAAeT,mBAAmB;AAElC,MAAMc,MAAM,GAAGrB,UAAU,CAACwB,MAAM,CAAC;EAC/BF,SAAS,EAAE;IACTG,QAAQ,EAAE,UAAU;IACpBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
WithDefault,
|
|
5
5
|
Double,
|
|
6
6
|
DirectEventHandler,
|
|
7
|
+
Int32,
|
|
7
8
|
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
8
9
|
|
|
9
10
|
export interface ValueChangeEvent {
|
|
@@ -11,49 +12,13 @@ export interface ValueChangeEvent {
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
interface NativeProps extends ViewProps {
|
|
14
|
-
/**
|
|
15
|
-
* The current value of the switch
|
|
16
|
-
* @default false
|
|
17
|
-
*/
|
|
18
15
|
value?: WithDefault<boolean, false>;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The intensity of the blur effect (0-100)
|
|
22
|
-
* @default 10.0
|
|
23
|
-
*/
|
|
24
16
|
blurAmount?: WithDefault<Double, 10.0>;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* The color of the switch thumb
|
|
28
|
-
* Note: Not supported by the Android implementation (no-op).
|
|
29
|
-
* Use the native iOS Switch for platform-specific thumb colors.
|
|
30
|
-
* @default '#FFFFFF'
|
|
31
|
-
*/
|
|
17
|
+
blurRounds?: WithDefault<Int32, 5>;
|
|
32
18
|
thumbColor?: WithDefault<string, '#FFFFFF'>;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* The track color when switch is off
|
|
36
|
-
* Note: Not supported by the Android implementation (no-op).
|
|
37
|
-
* Use the native iOS Switch for platform-specific off-state colors.
|
|
38
|
-
* @default '#E5E5EA'
|
|
39
|
-
*/
|
|
40
19
|
trackColorOff?: WithDefault<string, '#E5E5EA'>;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* The track color when switch is on
|
|
44
|
-
* @default '#34C759'
|
|
45
|
-
*/
|
|
46
20
|
trackColorOn?: WithDefault<string, '#34C759'>;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Whether the switch is disabled
|
|
50
|
-
* @default false
|
|
51
|
-
*/
|
|
52
21
|
disabled?: WithDefault<boolean, false>;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Callback invoked when the switch value changes
|
|
56
|
-
*/
|
|
57
22
|
onValueChange?: DirectEventHandler<Readonly<ValueChangeEvent>>;
|
|
58
23
|
}
|
|
59
24
|
|
|
@@ -3,6 +3,7 @@ import type { ViewProps } from 'react-native';
|
|
|
3
3
|
import type {
|
|
4
4
|
WithDefault,
|
|
5
5
|
Double,
|
|
6
|
+
Int32,
|
|
6
7
|
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
7
8
|
|
|
8
9
|
export type BlurType =
|
|
@@ -31,6 +32,7 @@ export type BlurType =
|
|
|
31
32
|
interface NativeProps extends ViewProps {
|
|
32
33
|
blurAmount?: WithDefault<Double, 10.0>;
|
|
33
34
|
blurType?: WithDefault<BlurType, 'xlight'>;
|
|
35
|
+
blurRounds?: WithDefault<Int32, 5>;
|
|
34
36
|
reducedTransparencyFallbackColor?: WithDefault<string, '#FFFFFF'>;
|
|
35
37
|
ignoreSafeArea?: WithDefault<boolean, true>;
|
|
36
38
|
}
|
|
@@ -3,11 +3,6 @@ import type { ViewProps } from 'react-native';
|
|
|
3
3
|
import type { Double } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
4
|
|
|
5
5
|
interface NativeProps extends ViewProps {
|
|
6
|
-
/**
|
|
7
|
-
* The spacing value for the glass container effect
|
|
8
|
-
* Platform: iOS only (iOS 26+)
|
|
9
|
-
* @default 0
|
|
10
|
-
*/
|
|
11
6
|
spacing?: Double;
|
|
12
7
|
}
|
|
13
8
|
|