Bug 793197 - Use a custom list item style in our custom listViews. r=sriram

This commit is contained in:
Wes Johnston 2012-10-02 18:58:01 -07:00
parent d1cd4155c7
commit b8c4b2a287
6 changed files with 56 additions and 2 deletions

View File

@ -359,6 +359,7 @@ RES_LAYOUT = \
res/layout/tabs_tray.xml \
res/layout/list_item_header.xml \
res/layout/select_dialog_list.xml \
res/layout/select_dialog_multichoice.xml \
res/layout/abouthome_addon_row.xml \
res/layout/abouthome_last_tabs_row.xml \
res/layout/abouthome_promo_box.xml \
@ -889,6 +890,7 @@ RES_DRAWABLE_XLARGE_XHDPI_V11 = \
RES_COLOR = \
res/color/menu_item_title.xml \
res/color/select_item_multichoice.xml \
$(NULL)
RES_MENU = \

View File

@ -292,7 +292,7 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
int resourceId = android.R.layout.select_dialog_item;
if (mSelected != null && mSelected.length > 0) {
if (aMultipleSelection) {
resourceId = android.R.layout.select_dialog_multichoice;
resourceId = R.layout.select_dialog_multichoice;
} else {
resourceId = android.R.layout.select_dialog_singlechoice;
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:color="#999" />
<item android:color="#000"/>
</selector>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 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.
-->
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/GeckoList.ListItem"/>

View File

@ -3,7 +3,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!--
Only overriden styles for Honeycomb/Ice cream sandwich are specified here.
@ -22,6 +22,17 @@
<item name="android:listSelector">@drawable/action_bar_button</item>
</style>
<style name="GeckoList.ListItem">
<item name="android:textColor">@color/select_item_multichoice</item>
<item name="android:minHeight">?android:attr/listPreferredItemHeight</item>
<item name="android:textAppearance">?android:attr/textAppearanceLarge</item>
<item name="android:gravity">center_vertical</item>
<item name="android:paddingLeft">12dip</item>
<item name="android:paddingRight">7dip</item>
<item name="android:checkMark">?android:attr/listChoiceIndicatorMultiple</item>
<item name="android:ellipsize">marquee</item>
</style>
<!-- AwesomeBar -->
<style name="AwesomeBar">
<item name="android:layout_width">fill_parent</item>

View File

@ -11,6 +11,19 @@
<item name="android:layout_height">fill_parent</item>
</style>
<style name="GeckoList" parent="android:style/Widget.ListView">
</style>
<style name="GeckoList.ListItem">
<item name="android:minHeight">?android:attr/listPreferredItemHeight</item>
<item name="android:textAppearance">?android:attr/textAppearanceLargeInverse</item>
<item name="android:gravity">center_vertical</item>
<item name="android:paddingLeft">12dip</item>
<item name="android:paddingRight">7dip</item>
<item name="android:checkMark">?android:attr/listChoiceIndicatorMultiple</item>
<item name="android:ellipsize">marquee</item>
</style>
<!-- Horizontal Layout -->
<style name="Layout.Horizontal">
<item name="android:orientation">horizontal</item>