[英]Android, how to blur/glass/frost current activity
Basically 基本上
In an activity, I have a ListView. 在一个活动中,我有一个ListView。 When I select an item, an transparent activity opens as a small box.
当我选择一个项目时,透明活动将作为一个小框打开。 When this box appears, you can still view the previous activities screen,
出现此框时,您仍然可以查看以前的活动屏幕,
What I am trying to figure out is how to blur the previous screen like the image linked here (Ignore the UI, just look at the blurred grass area). 我想弄清楚的是如何模糊前一个屏幕,就像这里链接的图像一样(忽略用户界面,只看模糊的草地区域)。
How is this possible? 这怎么可能?
Thank you for any advice. 谢谢你的任何建议。
For API < 14, you could use the flag WindowManager.LayoutParams.FLAG_BLUR_BEHIND
, but it's been deprecated and built-in blurring is no longer supported on higher APIs 对于API <14,您可以使用标志
WindowManager.LayoutParams.FLAG_BLUR_BEHIND
,但它已被弃用,更高版本的API不再支持内置模糊
However, you could do this with a regular view or overlay. 但是,您可以使用常规视图或叠加层执行此操作。 What you want to do is:
你想要做的是:
Bitmap
from your activity's overall layout ( see here for example ) Bitmap
( 例如,请参见此处 ) View
in your layout that covers everything. View
。 Set bkg to blurred Bitmap View
, or setVisibility(GONE)
if you'll be using it again. View
或setVisibility(GONE)
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.