how to use the viewRef in Android
In your Description you didn't put an example of how to include the viewRef with the rendered component that we want to blur!
I implement the Example of the refView but I always get this error "com.fivehundredpx.android.blur.BluringView cannot be cast to android.view.ViewGroup"
cc @cmcewen
@AnisDerbel running the example in the examples folder gives you that error? Can you post the stacktrace?
I have the same issue:
E/unknown:React: Exception in native call from JS
java.lang.ClassCastException: com.fivehundredpx.android.blur.BlurringView cannot be cast to android.view.ViewGroup
at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:298)
at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:175)
at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:766)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:830)
at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:125)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:798)
at android.view.Choreographer.doCallbacks(Choreographer.java:603)
at android.view.Choreographer.doFrame(Choreographer.java:571)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:786)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5631)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
I ran the example on android and nothing is blurred. However it doesn't crash.
Yeah the same case here , nothing happens!
I have the same problem, someone can tell me?
expecting
What devices/version are you running on? This is what I see from a fresh clone/npm install from the repo.

I'm running on a physical device running android 5.1. The demo doesn't crash with the ClassCastException error as reported above, but there's no blurring.
I'm experiencing the same issue. Running on android 5.1 API 22 and nothing is blurred.
I'm also using Device with Android 5.1 API 22 and nothing is blurred.
Sorry, I forgot to add the new BlurViewPackage() in MainActivity. Now, It is working perfectly in Nexus 5! Thanks for your library.
I've just noticed that in the examples the code for android is quite different to the iOS code.
The android code uses the viewRef, but the iOS one doesn't.
The instructions don't mention this - is this difference required?
Same issue here - not seeing blur on Genymotion Nexus 5 6.0.0. In my own app, I get the casting error.
I think the casting error might come from the different in the android code to the iOS code, maybe? the instructions on the README are iOS specific, but that's not mentioned. If you look at the android example its quite different. I ran the demo and it didn't crash, but even then, it doesn't blur anything at all.
It would be great if someone could figure out a nice way to abstract away the differences... and to get it to blur on android!
@npomfret change the demo as blow, see if blurred?
imageLoaded() { let h = findNodeHandle(this.refs.backgroundImage); console.log(h); setTimeout( ()=>this.setState({viewRef: h}), 500 ) }
@cmcewen Im running on Android 5.0 Asus Zenfone 2. If i use
<BlurView
blurRadius={10}
downsampleFactor={5}
overlayColor={'rgba(255, 255, 255, 0.1)'}
style={styles.blurView}
viewRef={this.state.viewRef}
/>
I don't see the error but nothing gets blurred. And When I use
<BlurView blurType="light" style={styles.blur}>
<Text>Hi, I am a tiny menu item</Text>
</BlurView>
I see the ClassCastException. So what going on ?
Ok, the demo also fails an Android if you put something inside the blur view (as @cmcewen said):
<BlurView
blurRadius={10}
downsampleFactor={5}
overlayColor={'rgba(255, 255, 255, 0.1)'}
style={styles.blurView}
viewRef={this.state.viewRef}
>
<Text style={styles.welcome}>Blur component</Text>
</BlurView>
Also, I notice the style blurView is missing from the demo. But not matter what I've tried I can't make it blur anything.
@cmcewen what virtual device is that screen shot from?