500px / 500px-android-blur

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

Blur Everything Beneath BlurringView #4

Closed redstonedev closed 9 years ago

redstonedev commented 9 years ago

Is it possible to make the BlurringView blur everything that's beneath it? (Not only its sibling views.)

-R

luojun commented 9 years ago

It's possible, so long as you organize the view hierarchy in a way such that "everything beneath the BlurringView" is contained in a single view (the blurred view).

luojun commented 9 years ago

Replied to your comment on GitHub.

If I understand it correctly, what you want is this: (1) the Sliding Up Panel will not hide the Main Content underneath it but will instead blur it; (2) you are also adding more content into the Sliding Up Panel.

Here's what you could try: put the BlurringView as the lowest subview (in z-order) among Sliding Up Panel's subviews and make it match parent so that it's always as big as the Sliding Up Panel. That way, you can still get the appropriate transformations. There may be more things to tweak here. You'll have to find out and figure it out.

In general, I don't think the solution should be making the BlurringView a ViewGroup. If you really want to do that, that's possible too. But you'll need to tweak the BlurringView's onDraw method so that it can appropriately combine blurring with drawing of other subviews of the ViewGroup. Note also that Android by default does not call the onDraw method of ViewGroup.

Best, Jun

On Sat, May 2, 2015 at 4:19 PM, redstonedev notifications@github.com wrote:

Is there any way to modify the BlurView,java class so the BlurView xml object can be used like a RelativeView or something similar? I want to be able to have the BlurView be the parent to other objects.

I need this, because I'm using the BlurView together with a SlidingUpPanelLayout (https://github.com/umano/AndroidSlidingUpPanel) and the SlidingUpPanelLayout only allows two children for it to function. Thus I can't just overlay items over the BlurView. I need the BlurView to be their parent.

Please let me know if you need clarification.

-R

— Reply to this email directly or view it on GitHub https://github.com/500px/500px-android-blur/issues/4.