500px / 500px-android-blur

Android Blurring View
http://developers.500px.com/2015/03/17/a-blurring-view-for-android.html
MIT License
2.7k stars 325 forks source link

Allow BlurredView to be used in the Android Studio layout editor #11

Closed orrc closed 4 years ago

orrc commented 9 years ago

The layout preview UI can't handle code with Renderscript (among other things), so now we avoid those code paths if BlurringView is being rendered by the IDE.

This shouldn't affect runtime performance on a device in any way, as the onDraw() method only checks if it's running in an IDE — via the isInEditMode() method — when no view-to-blur has been attached.

Without this, it's quite annoying to work with a layout that incorporates a BlurringView, as an error message continually pops up, obscuring part of the preview.

See the before / after screenshots:

blur_comparison (click to see larger error screenshot)

orrc commented 4 years ago

Closing since this project is unmaintained, and so that this no longer appears on my list of open PRs! 😄