@sbaiahmed1/react-native-blur 4.5.5-beta.3 → 4.5.5-beta.4
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/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeProgressiveBlurView.kt
CHANGED
|
@@ -160,7 +160,9 @@ class ReactNativeProgressiveBlurView : FrameLayout {
|
|
|
160
160
|
* Redirects the internal BlurView's blur capture root from the activity decor view
|
|
161
161
|
* to the nearest react-native-screens Screen ancestor.
|
|
162
162
|
*
|
|
163
|
-
* BaseBlurView
|
|
163
|
+
* BaseBlurView (QmBlurView 1.1.4) field visibility:
|
|
164
|
+
* public — mDecorView, mDifferentRoot, preDrawListener (direct access)
|
|
165
|
+
* private — mForceRedraw (requires reflection)
|
|
164
166
|
*/
|
|
165
167
|
private fun swapBlurRootToScreenAncestor() {
|
|
166
168
|
val bv = blurView ?: return
|
|
@@ -178,15 +180,24 @@ class ReactNativeProgressiveBlurView : FrameLayout {
|
|
|
178
180
|
logDebug("Could not remove old pre-draw listener: ${e.message}")
|
|
179
181
|
}
|
|
180
182
|
|
|
181
|
-
// Set new root
|
|
183
|
+
// Set new root (public field)
|
|
182
184
|
bv.mDecorView = newRoot
|
|
183
185
|
|
|
184
186
|
// Add listener to new root
|
|
185
187
|
newRoot.viewTreeObserver.addOnPreDrawListener(listener)
|
|
186
188
|
|
|
187
|
-
// Update mDifferentRoot flag
|
|
189
|
+
// Update mDifferentRoot flag (public field)
|
|
188
190
|
bv.mDifferentRoot = newRoot.rootView != bv.rootView
|
|
189
191
|
|
|
192
|
+
// Force a redraw (private field — requires reflection)
|
|
193
|
+
try {
|
|
194
|
+
val forceRedrawField = bv.javaClass.superclass.getDeclaredField("mForceRedraw")
|
|
195
|
+
forceRedrawField.isAccessible = true
|
|
196
|
+
forceRedrawField.setBoolean(bv, true)
|
|
197
|
+
} catch (e: NoSuchFieldException) {
|
|
198
|
+
logWarning("Could not set mForceRedraw via reflection: ${e.message}")
|
|
199
|
+
}
|
|
200
|
+
|
|
190
201
|
logDebug("Progressive blur: swapped root to ${newRoot.javaClass.simpleName}")
|
|
191
202
|
}
|
|
192
203
|
} catch (e: Exception) {
|