diff options
author | Amith Yamasani <yamasani@google.com> | 2010-10-25 09:25:38 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2010-10-27 11:03:22 -0700 |
commit | 27da0bf0a38231111cbf6bb7df6c4a0d53b144d8 (patch) | |
tree | cb08bcad02f7b5ce4e69a33bf26d5a5a366f83d4 /core | |
parent | 73b1089d9e626d53eb1a20cea800cfde65eb4299 (diff) | |
download | frameworks_base-27da0bf0a38231111cbf6bb7df6c4a0d53b144d8.zip frameworks_base-27da0bf0a38231111cbf6bb7df6c4a0d53b144d8.tar.gz frameworks_base-27da0bf0a38231111cbf6bb7df6c4a0d53b144d8.tar.bz2 |
Fix sub-header height to follow drawable. Floating panels for Preference screens.
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/preference/PreferenceFragment.java | 2 | ||||
-rw-r--r-- | core/res/res/layout-port/preference_header_item.xml | 62 | ||||
-rw-r--r-- | core/res/res/layout/preference_header_item.xml | 2 | ||||
-rw-r--r-- | core/res/res/layout/preference_list_content.xml | 17 | ||||
-rw-r--r-- | core/res/res/layout/preference_list_fragment.xml | 74 | ||||
-rw-r--r-- | core/res/res/values/styles.xml | 2 |
6 files changed, 92 insertions, 67 deletions
diff --git a/core/java/android/preference/PreferenceFragment.java b/core/java/android/preference/PreferenceFragment.java index 7629c31..33f37f8 100644 --- a/core/java/android/preference/PreferenceFragment.java +++ b/core/java/android/preference/PreferenceFragment.java @@ -151,7 +151,7 @@ public abstract class PreferenceFragment extends Fragment implements @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - return inflater.inflate(com.android.internal.R.layout.preference_list_content, + return inflater.inflate(com.android.internal.R.layout.preference_list_fragment, container, false); } diff --git a/core/res/res/layout-port/preference_header_item.xml b/core/res/res/layout-port/preference_header_item.xml deleted file mode 100644 index cc76c8e..0000000 --- a/core/res/res/layout-port/preference_header_item.xml +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2006 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. ---> - -<!-- Layout of a header item in PreferenceActivity. --> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:minHeight="96dp" - android:background="?android:attr/activatedBackgroundIndicator" - android:paddingRight="?android:attr/scrollbarSize"> - - <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - android:layout_gravity="center" - android:paddingLeft="4dip" - android:paddingRight="4dip" - android:paddingTop="4dip" - android:paddingBottom="4dip"> - - <ImageView - android:id="@+id/icon" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:layout_marginBottom="2dip" /> - - <TextView android:id="@+android:id/title" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:layout_marginBottom="2dip" - android:singleLine="true" - android:textAppearance="?android:attr/textAppearanceLarge" - android:ellipsize="marquee" - android:fadingEdge="horizontal" /> - - <TextView android:id="@+android:id/summary" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:gravity="center" - android:textAppearance="?android:attr/textAppearanceSmall" - android:ellipsize="end" - android:maxLines="2" /> - - </LinearLayout> -</FrameLayout> diff --git a/core/res/res/layout/preference_header_item.xml b/core/res/res/layout/preference_header_item.xml index aba7b2a..f00e7aa 100644 --- a/core/res/res/layout/preference_header_item.xml +++ b/core/res/res/layout/preference_header_item.xml @@ -18,7 +18,7 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:minHeight="?android:attr/listPreferredItemHeight" + android:minHeight="48dp" android:background="?android:attr/activatedBackgroundIndicator" android:gravity="center_vertical" android:paddingRight="?android:attr/scrollbarSize"> diff --git a/core/res/res/layout/preference_list_content.xml b/core/res/res/layout/preference_list_content.xml index 7c0b791..5b42407 100644 --- a/core/res/res/layout/preference_list_content.xml +++ b/core/res/res/layout/preference_list_content.xml @@ -21,7 +21,8 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_height="match_parent" - android:layout_width="match_parent"> + android:layout_width="match_parent" + android:background="@android:color/transparent"> <LinearLayout android:orientation="horizontal" @@ -34,6 +35,10 @@ android:orientation="vertical" android:layout_width="0px" android:layout_height="match_parent" + android:layout_marginLeft="32dp" + android:layout_marginTop="32dp" + android:layout_marginRight="16dp" + android:layout_marginBottom="32dp" android:layout_weight="10"> <ListView android:id="@android:id/list" @@ -41,6 +46,9 @@ android:layout_height="0px" android:layout_weight="1" android:drawSelectorOnTop="false" + android:background="#40404040" + android:cacheColorHint="@android:color/transparent" + android:listPreferredItemHeight="48dp" android:scrollbarAlwaysDrawVerticalTrack="true" /> <FrameLayout android:id="@+id/list_footer" @@ -53,7 +61,12 @@ <FrameLayout android:id="@+id/prefs" android:layout_width="0px" android:layout_height="match_parent" - android:layout_weight="33" + android:layout_weight="25" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginTop="16dp" + android:layout_marginBottom="16dp" + android:background="#60202040" android:visibility="gone" /> </LinearLayout> diff --git a/core/res/res/layout/preference_list_fragment.xml b/core/res/res/layout/preference_list_fragment.xml new file mode 100644 index 0000000..c499b8a --- /dev/null +++ b/core/res/res/layout/preference_list_fragment.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 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. +*/ +--> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_height="match_parent" + android:layout_width="match_parent" + android:background="@android:color/transparent"> + + <ListView android:id="@android:id/list" + android:layout_width="match_parent" + android:layout_height="0px" + android:layout_weight="1" + android:drawSelectorOnTop="false" + android:cacheColorHint="@android:color/transparent" + android:scrollbarAlwaysDrawVerticalTrack="true" /> + + <RelativeLayout android:id="@+id/button_bar" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:layout_weight="0" + android:background="@android:drawable/bottom_bar" + android:visibility="gone"> + + <Button android:id="@+id/back_button" + android:layout_width="150dip" + android:layout_height="wrap_content" + android:layout_margin="5dip" + android:layout_alignParentLeft="true" + android:drawableLeft="@drawable/ic_btn_back" + android:drawablePadding="3dip" + android:text="@string/back_button_label" + /> + <LinearLayout + android:orientation="horizontal" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true"> + + <Button android:id="@+id/skip_button" + android:layout_width="150dip" + android:layout_height="wrap_content" + android:layout_margin="5dip" + android:text="@string/skip_button_label" + android:visibility="gone" + /> + + <Button android:id="@+id/next_button" + android:layout_width="150dip" + android:layout_height="wrap_content" + android:layout_margin="5dip" + android:drawableRight="@drawable/ic_btn_next" + android:drawablePadding="3dip" + android:text="@string/next_button_label" + /> + </LinearLayout> + </RelativeLayout> +</LinearLayout> diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 76a3c34..61167b5 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -408,7 +408,7 @@ <style name="Widget.TextView.ListSeparator"> <item name="android:background">@android:drawable/dark_header_dither</item> <item name="android:layout_width">match_parent</item> - <item name="android:layout_height">25dip</item> + <item name="android:layout_height">wrap_content</item> <item name="android:textStyle">bold</item> <item name="android:textColor">?textColorSecondary</item> <item name="android:textSize">14sp</item> |