faradaj / blurbehind Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] Easily have blurred and transparent background effect on your Android views.
[DEPRECATED] Easily have blurred and transparent background effect on your Android views.
The blur effect disappears when activity change orientation. Can you help me ? Thanks.
If I have a main activity called A and I put .execute code inside it to go to another activity B where blurring happens, how can I have the same blurred background if I create activity B from a notification?
Thanks,
Can you explain, why it's deprecated? Provide something info how to implement same behavior with another libraries/default SDK, please
Do you know "FLAG_BLUR_BEHIND"? You know???? You're just implementing a simple demo.However,you made a lib to show your blur! It must not work well on SurfaceView or WebView! Do you dare to have a try?Don't publish an article with a big face!!Don't publish an article with a big face!!Don't publish an article with a big face!!Don't publish an article with a big face!!Don't publish an article with a big face!!
Hi, your library is awesome but i got problem.
the bitmap is not update after first time new activity launched.
eg. First time activity launched, background image set correctly. But after that (2nd, 3rd and so on... ) background image is the same as first one.
I've look into library and try to play with your decorView
decorView = activity.getWindow().getDecorView();
decorView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_LOW);
decorView.setDrawingCacheEnabled(true);
decorView.buildDrawingCache();
image = Bitmap.createBitmap(decorView.getDrawingCache());
decorView.destroyDrawingCache();
decorView.setDrawingCacheEnabled(false);
no luck...
Do you know how to fix this?
By the way, I forgot to mention that the i use recyclerview for the original activity. Is this related? Is it a problem with recyclerview?
Rather than complete activity I just want to blur particular layout?That way the layout underneath appear to be out of focus.How can i do that?
Have anybody achieved this?
Gradle features great dependency management that is intended to work with remote repositories.
Distributing your library via JCenter will make the consumption of your library much easier and will increase the adoption.
Currently developers don't know how to consume your library (see example).
Publishing to JCenter is very simple and can be fully automated using the Gradle Bintray plugin.
When I try to add this library like this,
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
compile 'com.faradaj:blur-behind:1.1.0'
}
"Dependency 'com.faradaj:blur-behind:1.1.0' not found"
How can i solve it? 😟
p.s Run 'gradle install' on 'blur-behind' library project. <= What does it mean
I tried the library, everything works great except I see that image visible in the background also has navigation bar on it which creates the effect of background moving a little bit up
Why not to use RenderScript compatibility library instead of an algorithm for API's lower than 16 and the regular RenderScript for 16 and up? It's not only more performant for older devices but also reduces the complexity of the Blur class since you don't have to have different blur methods for different API's.
Enable the RenderScript compat by adding the below to gradle.build file
defaultConfig {
renderscriptTargetApi 19
renderscriptSupportMode true
}
I've tested the library with an Activity that has a Relative Layout and some more elements and it works just fine and it blurs well and just like the demo on the main page.
However when I try the exact same code for another Activity that has a Google Maps map fragment and some other elements on the top and bottom of that Activity, all those elements get blurred except for the map. Here is the screenshot of this issue and I find it very strange, I even just tried to put the map inside another Relative Layout just to see, it didn't make any difference.
Wrong blurring activity: http://i.imgur.com/LyXNGTU.png?1
Correctly blurring Activity: http://i.imgur.com/1ohw0RS.png?1
How can i achieve the following when the navigationDrawer is opened? I want to blur out the background when the drawer opened.
I used your blurbehind to my fragment class but it is not showing any thing
Code:
BlurBehind.getInstance()
.withAlpha(80)
.withFilterColor(Color.parseColor("#0075c0"))
.setBackground(getActivity());
plz help me out
Hi there ,
This is cool work and i just copy blur and blurBehind 2 class is work well but i got this issue when i test it .
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:848)
Caused by: java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@432c02b8
at android.graphics.Canvas.throwIfCannotDraw(Canvas.java:1084)
at android.graphics.Canvas.drawBitmap(Canvas.java:1170)
at android.graphics.Bitmap.createBitmap(Bitmap.java:745)
at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:602)
at com.xxx.utils.v.doInBackground(BlurBehind.java:71)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:848)
look like cause by bitmap recycle .Do you have any idea ? Thanks .
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.