@sbaiahmed1/react-native-blur 4.1.0 → 4.1.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/android/build.gradle
CHANGED
|
@@ -74,7 +74,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
|
74
74
|
dependencies {
|
|
75
75
|
implementation "com.facebook.react:react-android"
|
|
76
76
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
77
|
-
implementation 'com.qmdeve:QmBlurView:1.0.4.5
|
|
77
|
+
implementation 'com.qmdeve:QmBlurView:1.0.4.5'
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
react {
|
|
@@ -173,10 +173,8 @@ using namespace facebook::react;
|
|
|
173
173
|
|
|
174
174
|
// Update blurType if it has changed
|
|
175
175
|
if (oldViewProps.blurType != newViewProps.blurType) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
[ReactNativeBlurViewHelper updateBlurView:_advancedBlurView withBlurType:blurTypeString];
|
|
179
|
-
}
|
|
176
|
+
NSString *blurTypeString = [[NSString alloc] initWithUTF8String:toString(newViewProps.blurType).c_str()];
|
|
177
|
+
[ReactNativeBlurViewHelper updateBlurView:_advancedBlurView withBlurType:blurTypeString];
|
|
180
178
|
}
|
|
181
179
|
|
|
182
180
|
// Update reducedTransparencyFallbackColor if it has changed
|
|
@@ -43,14 +43,19 @@ class BlurEffectView: UIVisualEffectView {
|
|
|
43
43
|
self?.effect = UIBlurEffect(style: self?.blurStyle ?? .systemMaterial)
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
// Set intensity
|
|
46
|
+
// Set intensity
|
|
47
47
|
animator?.fractionComplete = intensity
|
|
48
|
-
|
|
48
|
+
// Stop the animation at the current state
|
|
49
|
+
DispatchQueue.main.async { [weak self] in
|
|
50
|
+
self?.animator?.stopAnimation(true)
|
|
51
|
+
self?.animator?.finishAnimation(at: .current)
|
|
52
|
+
}
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
deinit {
|
|
52
|
-
animator
|
|
53
|
-
animator
|
|
56
|
+
guard let animator = animator, animator.state == .active else { return }
|
|
57
|
+
animator.stopAnimation(true)
|
|
58
|
+
animator.finishAnimation(at: .current)
|
|
54
59
|
}
|
|
55
60
|
}
|
|
56
61
|
|
|
@@ -69,4 +74,4 @@ struct Blur: UIViewRepresentable {
|
|
|
69
74
|
func updateUIView(_ uiView: BlurEffectView, context: Context) {
|
|
70
75
|
uiView.updateBlur(style: style, intensity: intensity)
|
|
71
76
|
}
|
|
72
|
-
}
|
|
77
|
+
}
|