[Android Samples视频系列之ApiDemos] App-Activity-TranslucentBlur和Wallpaper

[b]1.Demo说明与演示[/b]
TranslucentBulr :这个例子和Translucent不同的一点是Blur,也就是显示在当前Activity背后的其它Activity以模糊方式显示。这是通过window对象Flag来设置的
Wallpaper:Wallpaper介绍一个Activity如何通过Style把系统Wallpaper作为当前Activity的背景
[b]Demo演示[/b]

[img]http://dl.iteye.com/upload/attachment/0077/6332/0abb5894-9256-3641-8057-b1d5bea7152a.png[/img]

[b]2.视频讲解[/b]
[url]http://www.eyeandroid.com/thread-11139-1-1.html[/url]

[b]3.Demo分析[/b]
这个例子和Translucent不同的一点是Blur,也就是显示在当前Activit背后的其它Activity以模糊方式显示。
这是通过window对象Flag来设置的。
getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);

其它设置Theme和Translucent示例一样。

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Wallpaper介绍一个Activity如何通过Style把系统Wallpaper作为当前Activity的背景。
这是WallpaperActivity在AndroidManifest.xml中的定义:
<activity android:name=”.app.WallpaperActivity”
android:label=”@string/activity_wallpaper”
android:theme=”@style/Theme.Wallpaper”>
<intent-filter>
< action android:name=”android.intent.action.MAIN” />
<category android:name=”android.intent.category.SAMPLE_CODE” />
< /intent-filter>
< /activity>
@style/Theme.Wallpaper定义如下:继承系统android:style/Theme.Wallpaper,并将前景色设为白色(这里是文字的颜色)
<!– A theme that has a wallpaper background. Here we explicitly specify
that this theme is to inherit from the system’s wallpaper theme,
which sets up various attributes correctly. –>
<style name=”Theme.Wallpaper” parent=”android:style/Theme.Wallpaper”>
<item name=”android:colorForeground”>#fff</item>
< /style>


[b]4.这个Demo我们学会了[/b]
Android应用开发——系统自带样式Android:theme
[url]http://www.eyeandroid.com/thread-8106-1-1.html[/url]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值