【起航计划 016】2015 起航计划 Android APIDemo的魔鬼步伐 15 App->Activity->Wallpaper 系统壁纸作为当前Activity的背景
2015-03-05 17:43
916 查看
Wallpaper介绍一个Activity如何通过Style把系统Wallpaper作为当前Activity的背景。
这是WallpaperActivity在AndroidManifest.xml中的定义:
@style/Theme.Wallpaper定义如下:继承系统android:style/Theme.Wallpaper,并将前景色设为白色(这里是文字的颜色)
这是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>
相关文章推荐
- 【起航计划 016】2015 起航计划 Android APIDemo的魔鬼步伐 15 App-&gt;Activity-&gt;Wallpaper 系统壁纸作为当前Activity的背景
- 【起航计划 015】2015 起航计划 Android APIDemo的魔鬼步伐 14 App-&gt;Activity-&gt;Translucent Blur 模糊背景
- 【起航计划 015】2015 起航计划 Android APIDemo的魔鬼步伐 14 App->Activity->Translucent Blur 模糊背景
- 【起航计划 004】2015 起航计划 Android APIDemo的魔鬼步伐 03 App->Activity->Animation Activity跳转动画 R.anim.×× overridePendingTransition ActivityOptions类
- 【起航计划 010】2015 起航计划 Android APIDemo的魔鬼步伐 09 App->Activity->Redirection 根据shared preferences是否有值决定是否redirect
- 【起航计划 013】2015 起航计划 Android APIDemo的魔鬼步伐 12 App->Activity->SetWallpaper 设置壁纸 WallpaperManager getDrawingCache使用
- 【起航计划 004】2015 起航计划 Android APIDemo的魔鬼步伐 03 App-&gt;Activity-&gt;Animation Activity跳转动画 R.anim.&#215;&#215; overridePendingTran
- 【起航计划 009】2015 起航计划 Android APIDemo的魔鬼步伐 08 App->Activity->QuickContactsDemo 联系人 ResourceCursorAdapter使用 QuickContactBadge使用
- 【起航计划 005】2015 起航计划 Android APIDemo的魔鬼步伐 04 App-&gt;Activity-&gt;Custom Dialog Dialog形式的Activity,Theme的使用,Shape的使用
- 【起航计划 028】2015 起航计划 Android APIDemo的魔鬼步伐 27 App->Preferences->Launching preferences 其他activity获取Preference中的值
- 【起航计划 006】2015 起航计划 Android APIDemo的魔鬼步伐 05 App-&gt;Activity-&gt;Custom Title 自定义标题栏
- 【起航计划 007】2015 起航计划 Android APIDemo的魔鬼步伐 06 App-&gt;Activity-&gt;Forwarding Activity启动另外一个Activity finish()方法
- 【起航计划 022】2015 起航计划 Android APIDemo的魔鬼步伐 21 App-&gt;Launcher Shortcuts 为某个非主Activity在Home Screen上建立一个快捷方式
- 【起航计划 005】2015 起航计划 Android APIDemo的魔鬼步伐 04 App->Activity->Custom Dialog Dialog形式的Activity,Theme的使用,Shape的使用
- 【起航计划 008】2015 起航计划 Android APIDemo的魔鬼步伐 07 App-&gt;Activity-&gt;Persistent State 保存状态 SharedPreferences onPause onResume
- 【起航计划 011】2015 起航计划 Android APIDemo的魔鬼步伐 10 App->Activity->Reorder Activities 后退栈 Intent FLAG
- 【起航计划 009】2015 起航计划 Android APIDemo的魔鬼步伐 08 App-&gt;Activity-&gt;QuickContactsDemo 联系人 ResourceCursorAdapter使用 QuickContactBad
- 【起航计划 010】2015 起航计划 Android APIDemo的魔鬼步伐 09 App-&gt;Activity-&gt;Redirection 根据shared preferences是否有值决定是否redirect
- 【起航计划 012】2015 起航计划 Android APIDemo的魔鬼步伐 11 App->Activity->Save & Restore State onSaveInstanceState onRestoreInstanceState
- 【起航计划 014】2015 起航计划 Android APIDemo的魔鬼步伐 13 App->Activity->Translucent 半透明Activity Theme.Translucent