11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Artwork/PhoneAndScreen.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/danielzeller/Blur-LIB-Android/20b685fa0d37285124bdb17b009024ec69751965/Artwork/PhoneAndScreen.gif
--------------------------------------------------------------------------------
/Artwork/Transition.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/danielzeller/Blur-LIB-Android/20b685fa0d37285124bdb17b009024ec69751965/Artwork/Transition.gif
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Authors:
2 | Daniel Zeller
3 |
4 | The MIT License (MIT)
5 | Copyright (c) 2016 Daniel Zeller AS (http://danielzeller.no)
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8 |
9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10 |
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Blur-LIB-Android
2 |
3 | A library for Blurring the background of a View.
4 |
5 | [](https://youtu.be/sYPqS0px61Q)
6 |
7 | [See demo on youtube](https://youtu.be/sYPqS0px61Q)
8 |
9 | ## How it works
10 | The blurring is really fast since everything is fully hardware accelerated. The background View that is to be blurred is rendered into a SurfaceTexture using Surface.lockHardwareCanvas().
11 | The SurfaceTexture is then blurred using a Guassian blur algorithm and rendered in a SurfaceView or TextureView using OpenGL.
12 |
13 |
14 | ## Download
15 | Via Gradle
16 |
17 | ```
18 | implementation 'no.danielzeller.blurbehindlib:blurbehindlib:1.0.0'
19 | ```
20 | or Maven
21 | ```
22 |
23 | no.danielzeller.blurbehindlib
24 | blurbehindlib
25 | 1.0.0
26 | pom
27 |
28 | ```
29 |
30 | ## Basics
31 | Create a BlurBehindLayout from XML
32 |
33 | ```xml
34 |
45 |
46 |
47 | ```
48 |
49 | Then you need to setup the View that is behind the BlurBehindLayout (the one that will be blurred).
50 |
51 | ```kotlin
52 | blurBehindLayout.viewBehind = viewToBlur
53 | ```
54 |
55 | [](https://youtu.be/sYPqS0px61Q)
56 |
57 | #### Blur radius
58 |
59 |
60 |
app:blurRadius = "100.0"
61 |
blurBehindLayout.blurRadius = 100.f
62 |
63 |
64 | Determines how strong the blur is. Should be a float value between 0f-200f. Default is 40f.
65 |
66 |
67 | #### Update mode
68 |