1.Demo說明與示範
- TranslucentBulr :這個例子和Translucent不同的一點是Blur,也就是顯示在當前Activity背後的其它Activity以模糊方式顯示。這是通過window對象Flag來設定的
- Wallpaper:Wallpaper介紹一個Activity如何通過Style把系統Wallpaper作為當前Activity的背景
Demo示範
2.視頻講解
http://www.eyeandroid.com/thread-11139-1-1.html
3.Demo分析
這個例子和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> |
4.這個Demo我們學會了
Android應用開發——系統內建樣式Android:theme
http://www.eyeandroid.com/thread-8106-1-1.html