question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Blur not working

See original GitHub issue

I have been trying to get the blur effect to work on Android for a long time now, after finally getting rid of compile and ViewGroup issues, the blur view will not blur anything.

It worked right off the bat in iOS, and continues to work. I am blurring a Google map view under a popup window of sorts. Here’s an excerpt:

        <View key={id} style={styles.placeItem}>
          <BlurView blurType="light" blurAmount={5} style={styles.placeItemBlur}/>
          <ScrollView contentContainerStyle={styles.placeItemContainer}>
            <Text style={styles.placeTitleText}>{placeProps.name}</Text>
            [...]
          </ScrollView>
        </View> 

This view is itself a child of the map view, which is a child of a scrollable tab view. As others have suggested, I tried setting backgroundColor: 'transparent' on the ‘thing I want to blur’ (the map, and various other views), with no effect.

Am I missing something obvious? Thanks!

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:21 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
ABleascommented, Mar 17, 2017

Thanks guys, thats really helpful. I was working off the readme, which doesn’t include Android usage, nor does it specify being a purely iOS demonstration… I guess I should refer to examples instead.

So are we to understand that you can only blur a single view on Android, and not everything above the blur view, as with iOS? That’s kind of a bummer.

I still can’t get my map view to blur, even after adding the appropriate props and a viewRef. So I don’t know if this is a limitation of the Android lib or I should try something else? Here is my updated (cross platform) call:

<BlurView
  blurType="light"
  blurAmount={5}
  blurRadius={15}
  downsampleFactor={5}
  overlayColor={'rgba(255, 255, 255, .25)'}
  viewRef={this.state.blurViewRef}
  style={styles.placeItemBlur}/>

and somewhere outside the render() stack, setting state:

blurViewRef: findNodeHandle(this.mapView),

Still no blur 😞

I briefly looked around for Android blur views and there are numerous others besides 500px-android-blur… maybe one of them would have features more similar to iOS blur? Android Arsenal link

2reactions
booboothefoolcommented, Mar 16, 2017

The obvious thing you’re missing is that you’re using the iOS props, however Android uses different ones.

iOS

      blurType="light"
      blurAmount={5}

Android

          blurRadius={15}
          downsampleFactor={5}
          overlayColor={'rgba(255, 255, 255, .25)'}
          viewRef={this.state.viewRef}

I’m having trouble doing this with anything besides blurring an Image however.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android library Blurry not working for me,blurring effects do not ...
i want to blur the background of the relative layout but instead it blurs the whole screen.How to blur just the bckground? –...
Read more >
Blur not working android · Issue #322 · Kureev/react-native-blur
Try to add some background-color to view that you need to blur. I've spent so much time to figure out why it's not...
Read more >
Window blurs | Android Open Source Project
Turn window blur on and off; Troubleshooting ... Window blurs, or cross-window blurs, are used to blur the screen behind the given window....
Read more >
BlurView - Expo Documentation
A React component that blurs everything underneath the view. On iOS, it renders a native blur view. On Android, it falls back to...
Read more >
Expo blur view not working on android any alternative ... - Reddit
Blur on Android isn't really common, most available libs are either buggy or have performance issues. I haven't seen a good blur library ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found