Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

dialog - Alternative to "FLAG_BLUR_BEHIND" in Android?

I can see that when I use the same flag as shown on the API-demos for blurring the background, I get a warning that it's deprecated:

"The field WindowManager.LayoutParams.FLAG_BLUR_BEHIND is deprecated".

I've read about it, and I've found that "Blurring is no longer supported".

Does it mean that it won't work on future versions? Why did they deprecate it? Is there an alternative? I really like this feature.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

ok , there is probably no alternative that uses the API , unless maybe i've forgetting anything.

i can however use dimming , which is cool too, as written here:

WindowManager.LayoutParams lp = dialog.getWindow().getAttributes();  
lp.dimAmount=0.0f;  
dialog.getWindow().setAttributes(lp);  
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);  

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...