1. 修改ActionBar的背景色,本例爲修改成紅色#ffff0000,也能夠指定到/res/drawable/xx.png
1). 在Gallery2/res/values/ 增長本身的資源文件theme.xml
- <?xml version="1.0" encoding="utf-8"?>
- <resources>
- <style name="TestAppTheme" parent="android:Theme.Holo.Light">
- <item name="android:actionBarStyle">@style/WindCustomActionbar</item>
- </style>
-
- <style name="WindCustomActionbar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">
- <item name="android:background">#ffff0000</item>
- </style>
- </resources>
2). 在AndroidManifest.xml裏指定使用這個Style
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/TestAppTheme">
- ...
- </application>
2. 修改ActionBar上字體顏色,相似上面的,本例修改成白色
1). 在Gallery2/res/values/ 增長本身的資源文件theme.xml
- <?xml version="1.0" encoding="utf-8"?>
- <resources>
- <style name="TestAppTheme" parent="android:Theme.Holo.Light">
- <item name="android:actionBarStyle">@style/WindCustomActionbar</item>
- </style>
-
- <style name="WindCustomActionbar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">
- <item name="android:titleTextStyle">@style/WindCustomTitleTextColor</item>
- </style>
-
- <style name="WindCustomTitleTextColor" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
- <item name="android:textColor">@*android:color/white</item>
- </style>
- </resources>
2). 在AndroidManifest.xml裏指定使用這個Style
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/TestAppTheme">
- ...
- </application>
3. 修改選中模式下的ActionBar的背景色,即View.startActionMode後的ActionBar背景色
1). 在Gallery2/res/values/ 增長本身的資源文件theme.xml
- <?xml version="1.0" encoding="utf-8"?>
- <resources>
- <style name="TestAppTheme" parent="android:Theme.Holo.Light">
- <item name="android:actionModeBackground">@drawable/ic_launcher</item>
- </style>
- </resources>
2). 在AndroidManifest.xml裏指定使用這個Style
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/TestAppTheme">
- ...
- </application>
4. 將畫布背景從黑色改成白色
修改文件Gallery2/src/com/android/gallery3d/ui/StaticBackground.java
- protected void render(GLCanvas canvas) {
-
- canvas.fillRect(0, 0, getWidth(), getHeight(), 0xFFFFFFFF);
- }
5. 將縮略圖的左邊距,上邊距,右邊距,下邊距設定爲20dp的空隙
Gallery2/src/com/android/gallery3d/app/AlbumSetPage.java
- private final GLView mRootPane = new GLView() {
- private final float mMatrix[] = new float[16];
-
-
- @Override
- protected void onLayout(
- boolean changed, int left, int top, int right, int bottom) {
- ...
-
-
-
-
- mAlbumSetView.layout(20, slotViewTop + 20, slotViewRight - 20, slotViewBottom - 20);
- PositionRepository.getInstance(mActivity).setOffset(
- 0, slotViewTop);
- }
- ...
- }
6.將原來的豎屏模式下4行顯示改成3行顯示,修改縮略圖相冊間的間隔
Gallery2/res/values/dimensions.xml
- <integer name="albumset_rows_land">2</integer>
- <integer name="albumset_rows_port">4</integer>
- <dimen name="albumset_slot_gap">1dp</dimen>
html