Merge "Holo: vertical dividers, group button states, default window backgrounds."

This commit is contained in:
Adam Powell
2010-10-25 17:44:35 -07:00
committed by Android (Google) Code Review
29 changed files with 133 additions and 23 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 B

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 B

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 B

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -19,10 +19,10 @@
<item android:state_window_focused="false" android:drawable="@color/transparent" />
<!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@color/group_button_background_pressed_holo_dark" />
<item android:state_focused="true" android:state_enabled="false" android:drawable="@color/group_button_background_focused_holo_dark" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@color/group_button_background_pressed_holo_dark" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@color/group_button_background_pressed_holo_dark" />
<item android:state_focused="true" android:drawable="@color/group_button_background_focused_holo_dark" />
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/btn_group_disabled_holo_dark" />
<item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/btn_group_disabled_holo_dark" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/btn_group_pressed_holo_dark" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/btn_group_pressed_holo_dark" />
<item android:state_focused="true" android:drawable="@drawable/btn_group_focused_holo_dark" />
<item android:drawable="@color/transparent" />
</selector>

View File

@@ -19,10 +19,10 @@
<item android:state_window_focused="false" android:drawable="@color/transparent" />
<!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@color/group_button_background_pressed_holo_light" />
<item android:state_focused="true" android:state_enabled="false" android:drawable="@color/group_button_background_focused_holo_light" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@color/group_button_background_pressed_holo_light" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@color/group_button_background_pressed_holo_light" />
<item android:state_focused="true" android:drawable="@color/group_button_background_focused_holo_light" />
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/btn_group_disabled_holo_light" />
<item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/btn_group_disabled_holo_light" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/btn_group_pressed_holo_light" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/btn_group_pressed_holo_light" />
<item android:state_focused="true" android:drawable="@drawable/btn_group_focused_holo_light" />
<item android:drawable="@color/transparent" />
</selector>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:drawable="@color/transparent" />
<!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/list_selector_background_disabled" />
<item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/list_selector_background_disabled" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition" />
<item android:state_focused="true" android:drawable="@drawable/list_selector_background_focused" />
<item android:drawable="@color/transparent" />
</selector>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:drawable="@color/transparent" />
<!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/list_selector_disabled_holo_dark" />
<item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/list_selector_disabled_holo_dark" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition_holo_dark" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition_holo_dark" />
<item android:state_focused="true" android:drawable="@drawable/list_focused_holo" />
<item android:drawable="@color/transparent" />
</selector>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:drawable="@color/transparent" />
<!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/list_selector_disabled_holo_light" />
<item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/list_selector_disabled_holo_light" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition_holo_light" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition_holo_light" />
<item android:state_focused="true" android:drawable="@drawable/list_focused_holo" />
<item android:drawable="@color/transparent" />
</selector>

View File

@@ -18,6 +18,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:addStatesFromChildren="true"
android:background="?attr/selectableItemBackground"
android:minWidth="64dip"
android:minHeight="?attr/actionBarSize"
android:paddingLeft="12dip"
@@ -33,9 +35,9 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone"
android:background="?attr/groupButtonBackground"
android:textAppearance="?attr/textAppearanceMedium"
style="?attr/buttonStyleSmall"
android:background="@null"
android:paddingLeft="4dip"
android:paddingRight="4dip" />
</com.android.internal.view.menu.ActionMenuItemView>

View File

@@ -20,7 +20,8 @@
android:layout_marginTop="12dip"
android:layout_marginBottom="12dip"
android:gravity="center"
android:showDividers="end">
android:showDividers="end"
android:background="?android:attr/selectableItemBackground">
<Button android:id="@+id/action_mode_close_button"
android:text="@string/action_mode_done"
android:paddingLeft="16dip"

View File

@@ -571,6 +571,9 @@
<!-- Drawable for group button backgrounds -->
<attr name="groupButtonBackground" format="reference" />
<!-- Background drawable for standalone items that need focus/pressed states. -->
<attr name="selectableItemBackground" format="reference" />
<!-- SearchView dropdown background -->
<attr name="searchDropdownBackground" format="reference" />
</declare-styleable>

View File

@@ -132,10 +132,10 @@
<color name="link_text_holo_light">#0000ee</color>
<!-- Group buttons -->
<color name="group_button_background_pressed_holo_dark">#46c5c1ff</color>
<color name="group_button_background_focused_holo_dark">#2699cc00</color>
<color name="group_button_dialog_pressed_holo_dark">#46c5c1ff</color>
<color name="group_button_dialog_focused_holo_dark">#2699cc00</color>
<color name="group_button_background_pressed_holo_light">#ffffffff</color>
<color name="group_button_background_focused_holo_light">#4699cc00</color>
<color name="group_button_dialog_pressed_holo_light">#ffffffff</color>
<color name="group_button_dialog_focused_holo_light">#4699cc00</color>
</resources>

View File

@@ -1250,15 +1250,19 @@
<item name="android:minHeight">48dip</item>
<item name="android:paddingLeft">32dip</item>
<item name="android:paddingRight">32dip</item>
<item name="android:paddingTop">4dip</item>
<item name="android:paddingBottom">4dip</item>
</style>
<style name="Widget.Holo.Button.Small">
<item name="android:background">@android:drawable/btn_default_holo_dark</item>
<item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
<item name="android:textColor">@android:color/primary_text_holo_dark</item>
<item name="android:minHeight">40dip</item>
<item name="android:minHeight">48dip</item>
<item name="android:paddingLeft">24dip</item>
<item name="android:paddingRight">24dip</item>
<item name="android:paddingTop">4dip</item>
<item name="android:paddingBottom">4dip</item>
</style>
<style name="Widget.Holo.Button.Inset">
@@ -1279,6 +1283,7 @@
<style name="Widget.Holo.ButtonGroup" parent="Widget.ButtonGroup">
<item name="divider">?android:attr/dividerVertical</item>
<item name="showDividers">middle</item>
<item name="android:background">@android:drawable/btn_default_holo_dark</item>
</style>
<style name="Widget.Holo.ButtonGroup.AlertDialog">
@@ -1483,6 +1488,7 @@
<style name="Widget.Holo.ActionButton.Overflow">
<item name="android:src">@android:drawable/ic_menu_moreoverflow_holo_dark</item>
<item name="android:background">?android:attr/selectableItemBackground</item>
</style>
<style name="Widget.Holo.ActionButton.TextButton" parent="Widget.Holo.ButtonBar.Button">
@@ -1529,14 +1535,18 @@
<item name="android:minHeight">48dip</item>
<item name="android:paddingLeft">32dip</item>
<item name="android:paddingRight">32dip</item>
<item name="android:paddingTop">4dip</item>
<item name="android:paddingBottom">4dip</item>
</style>
<style name="Widget.Holo.Light.Button.Small">
<item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
<item name="android:textColor">@android:color/primary_text_holo_light</item>
<item name="android:minHeight">40dip</item>
<item name="android:minHeight">48dip</item>
<item name="android:paddingLeft">24dip</item>
<item name="android:paddingRight">24dip</item>
<item name="android:paddingTop">4dip</item>
<item name="android:paddingBottom">4dip</item>
</style>
<style name="Widget.Holo.Light.Button.Inset">
@@ -1554,6 +1564,7 @@
</style>
<style name="Widget.Holo.Light.ButtonGroup" parent="Widget.Holo.ButtonGroup">
<item name="android:background">@android:drawable/btn_default_holo_light</item>
</style>
<style name="Widget.Holo.Light.ButtonGroup.AlertDialog">
@@ -1737,6 +1748,7 @@
<style name="Widget.Holo.Light.ActionButton.Overflow">
<item name="android:src">@android:drawable/ic_menu_moreoverflow_holo_light</item>
<item name="android:background">?android:attr/selectableItemBackground</item>
</style>
<style name="Widget.Holo.Light.ActionBarView_TabView" parent="Widget.ActionBarView_TabView">

View File

@@ -90,6 +90,7 @@
<item name="buttonStyleToggle">@android:style/Widget.Button.Toggle</item>
<item name="groupButtonBackground">@null</item>
<item name="selectableItemBackground">@android:drawable/item_background</item>
<!-- List attributes -->
<item name="listPreferredItemHeight">64dip</item>
@@ -569,7 +570,7 @@
<style name="Theme.IconMenu">
<!-- Menu/item attributes -->
<item name="android:itemTextAppearance">@android:style/TextAppearance.Widget.IconMenu.Item</item>
<item name="android:itemBackground">@android:drawable/menu_selector</item>
<item name="android:selectableItemBackground">@android:drawable/menu_selector</item>
<item name="android:itemIconDisabledAlpha">?android:attr/disabledAlpha</item>
<item name="android:horizontalDivider">@android:drawable/divider_horizontal_dark</item>
<item name="android:verticalDivider">@android:drawable/divider_vertical_dark</item>
@@ -638,7 +639,7 @@
<item name="colorForeground">@android:color/bright_foreground_holo_dark</item>
<item name="colorForegroundInverse">@android:color/bright_foreground_inverse_holo_dark</item>
<item name="colorBackground">@android:color/background_holo_dark</item>
<item name="colorBackgroundCacheHint">?android:attr/colorBackground</item>
<item name="colorBackgroundCacheHint">@android:color/transparent</item>
<item name="disabledAlpha">0.5</item>
<item name="backgroundDimAmount">0.6</item>
@@ -698,6 +699,7 @@
<item name="buttonStyleToggle">@android:style/Widget.Holo.Button.Toggle</item>
<item name="groupButtonBackground">@android:drawable/group_button_background_holo_dark</item>
<item name="selectableItemBackground">@android:drawable/item_background_holo_dark</item>
<!-- List attributes -->
<item name="listPreferredItemHeight">64dip</item>
@@ -730,7 +732,7 @@
<item name="galleryItemBackground">@android:drawable/gallery_item_background</item>
<!-- Window attributes -->
<item name="windowBackground">@android:drawable/screen_background_holo_dark</item>
<item name="windowBackground">@android:drawable/background_holo_dark</item>
<item name="windowFrame">@null</item>
<item name="windowNoTitle">false</item>
<item name="windowFullscreen">false</item>
@@ -871,7 +873,7 @@
<item name="colorForeground">@android:color/bright_foreground_holo_light</item>
<item name="colorForegroundInverse">@android:color/bright_foreground_inverse_holo_light</item>
<item name="colorBackground">@android:color/background_holo_light</item>
<item name="colorBackgroundCacheHint">?android:attr/colorBackground</item>
<item name="colorBackgroundCacheHint">@android:color/transparent</item>
<item name="disabledAlpha">0.5</item>
<item name="backgroundDimAmount">0.6</item>
@@ -931,6 +933,7 @@
<item name="buttonStyleToggle">@android:style/Widget.Holo.Light.Button.Toggle</item>
<item name="groupButtonBackground">@android:drawable/group_button_background_holo_light</item>
<item name="selectableItemBackground">@android:drawable/item_background_holo_light</item>
<!-- List attributes -->
<item name="listPreferredItemHeight">64dip</item>
@@ -963,7 +966,7 @@
<item name="galleryItemBackground">@android:drawable/gallery_item_background</item>
<!-- Window attributes -->
<item name="windowBackground">@android:drawable/screen_background_holo_light</item>
<item name="windowBackground">@android:drawable/background_holo_light</item>
<item name="windowFrame">@null</item>
<item name="windowNoTitle">false</item>
<item name="windowFullscreen">false</item>
@@ -1146,6 +1149,8 @@
<item name="android:windowActionModeOverlay">true</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:groupButtonBackground">?android:attr/selectableItemBackground</item>
<item name="textAppearance">@android:style/TextAppearance.Holo</item>
<item name="textAppearanceInverse">@android:style/TextAppearance.Holo.Inverse</item>
@@ -1196,6 +1201,8 @@
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:groupButtonBackground">?android:attr/selectableItemBackground</item>
<item name="textAppearance">@android:style/TextAppearance.Holo.Light</item>
<item name="textAppearanceInverse">@android:style/TextAppearance.Holo.Light.Inverse</item>
</style>