【开源】BlurBehind
BlurBehind
- https://github.com/faradaj/BlurBehind
介绍:
在api 14之前,有一个叫做FLAG_BLUR_BEHIND的Window flag ,用于模糊window后面所有的元素。但是现在已经不支持了,BlurBehind 提供了实现此功能的简便方法。不受api限制。运行效果:
使用说明:
触发BlurBehind.getInstance().execute()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
dummyButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Runnable runnable = new Runnable() { @Override public void run() { Intent intent = new Intent(MainActivity. this , BlurredActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); startActivity(intent); } }; BlurBehind.getInstance().execute(MainActivity. this , runnable); } }); |
在activity中使用BlurBehind.getInstance().setBackground(Activity a)
1
|
BlurBehind.getInstance().setBackground( this ); |
参数设置
1
2
3
4
|
BlurBehind.getInstance() .withAlpha(80) .withFilterColor(Color.parseColor( "#0075c0" )) //or Color.RED .setBackground( this ); |
按照此设置运行出来的效果如下
posted on 2015-04-10 09:32 wasdchenhao 阅读(272) 评论(0) 收藏 举报