diff options
author | Amith Yamasani <yamasani@google.com> | 2011-05-27 10:24:59 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-05-27 10:24:59 -0700 |
commit | a4fa2cd1c007c2bd0f330f6a3ffde2949d9574c5 (patch) | |
tree | aae376a23c6aef524515d4b2921730162d8ea2dd | |
parent | eb2466b30362ef8374680a76a5e39a2ccdcdeedd (diff) | |
parent | 405c1af75607fafdb1d6faf34e13e032e4934787 (diff) | |
download | frameworks_base-a4fa2cd1c007c2bd0f330f6a3ffde2949d9574c5.zip frameworks_base-a4fa2cd1c007c2bd0f330f6a3ffde2949d9574c5.tar.gz frameworks_base-a4fa2cd1c007c2bd0f330f6a3ffde2949d9574c5.tar.bz2 |
Merge "Manual merge. Preference activity changes to work on smaller tablet screens and phones."
27 files changed, 284 insertions, 202 deletions
diff --git a/core/java/android/preference/Preference.java b/core/java/android/preference/Preference.java index 5e1be21..b6d1594 100644 --- a/core/java/android/preference/Preference.java +++ b/core/java/android/preference/Preference.java @@ -472,11 +472,15 @@ public class Preference implements Comparable<Preference>, OnDependencyChangeLis final View layout = layoutInflater.inflate(mLayoutResId, parent, false); - if (mWidgetLayoutResId != 0) { - final ViewGroup widgetFrame = (ViewGroup)layout.findViewById(com.android.internal.R.id.widget_frame); - layoutInflater.inflate(mWidgetLayoutResId, widgetFrame); + final ViewGroup widgetFrame = (ViewGroup) layout + .findViewById(com.android.internal.R.id.widget_frame); + if (widgetFrame != null) { + if (mWidgetLayoutResId != 0) { + layoutInflater.inflate(mWidgetLayoutResId, widgetFrame); + } else { + widgetFrame.setVisibility(View.GONE); + } } - return layout; } @@ -514,14 +518,18 @@ public class Preference implements Comparable<Preference>, OnDependencyChangeLis } ImageView imageView = (ImageView) view.findViewById(com.android.internal.R.id.icon); - if (imageView != null && (mIconResId != 0 || mIcon != null)) { - if (mIcon == null) { - mIcon = getContext().getResources().getDrawable(mIconResId); - } - if (mIcon != null) { - imageView.setImageDrawable(mIcon); + if (imageView != null) { + if (mIconResId != 0 || mIcon != null) { + if (mIcon == null) { + mIcon = getContext().getResources().getDrawable(mIconResId); + } + if (mIcon != null) { + imageView.setImageDrawable(mIcon); + } } + imageView.setVisibility(mIcon != null ? View.VISIBLE : View.GONE); } + if (mShouldDisableView) { setEnabledStateOnViews(view, isEnabled()); } @@ -633,6 +641,7 @@ public class Preference implements Comparable<Preference>, OnDependencyChangeLis public void setIcon(Drawable icon) { if ((icon == null && mIcon != null) || (icon != null && mIcon != icon)) { mIcon = icon; + notifyChanged(); } } diff --git a/core/java/android/preference/PreferenceActivity.java b/core/java/android/preference/PreferenceActivity.java index 15d5898..14e7bed 100644 --- a/core/java/android/preference/PreferenceActivity.java +++ b/core/java/android/preference/PreferenceActivity.java @@ -18,9 +18,6 @@ package android.preference; import com.android.internal.util.XmlUtils; -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; - import android.app.ActionBar; import android.app.Fragment; import android.app.FragmentBreadCrumbs; @@ -44,8 +41,8 @@ import android.util.TypedValue; import android.util.Xml; import android.view.LayoutInflater; import android.view.View; -import android.view.View.OnClickListener; import android.view.ViewGroup; +import android.view.View.OnClickListener; import android.widget.AbsListView; import android.widget.ArrayAdapter; import android.widget.Button; @@ -58,6 +55,9 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserException; + /** * This is the base class for an activity to show a hierarchy of preferences * to the user. Prior to {@link android.os.Build.VERSION_CODES#HONEYCOMB} @@ -503,12 +503,7 @@ public abstract class PreferenceActivity extends ListActivity implements protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - if (getResources().getConfiguration().isLayoutSizeAtLeast( - Configuration.SCREENLAYOUT_SIZE_LARGE)) { - setContentView(com.android.internal.R.layout.preference_list_content_large); - } else { - setContentView(com.android.internal.R.layout.preference_list_content); - } + setContentView(com.android.internal.R.layout.preference_list_content); mListFooter = (FrameLayout)findViewById(com.android.internal.R.id.list_footer); mPrefsContainer = (ViewGroup) findViewById(com.android.internal.R.id.prefs_frame); @@ -585,12 +580,7 @@ public abstract class PreferenceActivity extends ListActivity implements } else { // If there are no headers, we are in the old "just show a screen // of preferences" mode. - if (getResources().getConfiguration().isLayoutSizeAtLeast( - Configuration.SCREENLAYOUT_SIZE_LARGE)) { - setContentView(com.android.internal.R.layout.preference_list_content_single_large); - } else { - setContentView(com.android.internal.R.layout.preference_list_content_single); - } + setContentView(com.android.internal.R.layout.preference_list_content_single); mListFooter = (FrameLayout) findViewById(com.android.internal.R.id.list_footer); mPrefsContainer = (ViewGroup) findViewById(com.android.internal.R.id.prefs); mPreferenceManager = new PreferenceManager(this, FIRST_REQUEST_CODE); @@ -674,17 +664,9 @@ public abstract class PreferenceActivity extends ListActivity implements * enough. */ public boolean onIsMultiPane() { - Configuration config = getResources().getConfiguration(); - if ((config.screenLayout&Configuration.SCREENLAYOUT_SIZE_MASK) - == Configuration.SCREENLAYOUT_SIZE_XLARGE) { - return true; - } - if ((config.screenLayout&Configuration.SCREENLAYOUT_SIZE_MASK) - == Configuration.SCREENLAYOUT_SIZE_LARGE - && config.orientation == Configuration.ORIENTATION_LANDSCAPE) { - return true; - } - return false; + boolean preferMultiPane = getResources().getBoolean( + com.android.internal.R.bool.preferences_prefer_dual_pane); + return preferMultiPane; } /** diff --git a/core/java/android/preference/PreferenceFragment.java b/core/java/android/preference/PreferenceFragment.java index 7511e14..9d46b7a 100644 --- a/core/java/android/preference/PreferenceFragment.java +++ b/core/java/android/preference/PreferenceFragment.java @@ -152,14 +152,8 @@ public abstract class PreferenceFragment extends Fragment implements @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - if (getResources().getConfiguration().isLayoutSizeAtLeast( - Configuration.SCREENLAYOUT_SIZE_LARGE)) { - return inflater.inflate(com.android.internal.R.layout.preference_list_fragment_large, - container, false); - } else { - return inflater.inflate(com.android.internal.R.layout.preference_list_fragment, - container, false); - } + return inflater.inflate(com.android.internal.R.layout.preference_list_fragment, container, + false); } @Override diff --git a/core/res/res/layout/preference_list_content_large.xml b/core/res/res/layout-sw600dp/preference_list_content.xml index 14d188e..5a345c6 100644 --- a/core/res/res/layout/preference_list_content_large.xml +++ b/core/res/res/layout-sw600dp/preference_list_content.xml @@ -2,7 +2,7 @@ <!-- /* //device/apps/common/assets/res/layout/list_content.xml ** -** Copyright 2011, The Android Open Source Project +** Copyright 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. @@ -27,6 +27,8 @@ android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="0px" + android:layout_marginTop="@dimen/preference_screen_top_margin" + android:layout_marginBottom="@dimen/preference_screen_bottom_margin" android:layout_weight="1"> <LinearLayout @@ -36,14 +38,15 @@ android:layout_height="match_parent" android:layout_marginRight="@dimen/preference_screen_side_margin_negative" android:layout_marginLeft="@dimen/preference_screen_side_margin" - android:layout_marginTop="32dp" - android:layout_marginBottom="32dp" - android:layout_weight="10"> + android:layout_weight="@integer/preferences_left_pane_weight"> <ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="0px" android:layout_weight="1" + android:paddingTop="16dp" + android:paddingBottom="16dp" + android:drawSelectorOnTop="false" android:cacheColorHint="@android:color/transparent" android:listPreferredItemHeight="48dp" @@ -60,39 +63,22 @@ android:id="@+id/prefs_frame" android:layout_width="0px" android:layout_height="match_parent" - android:layout_weight="20" + android:layout_weight="@integer/preferences_right_pane_weight" android:layout_marginLeft="@dimen/preference_screen_side_margin" android:layout_marginRight="@dimen/preference_screen_side_margin" - android:layout_marginTop="16dp" - android:layout_marginBottom="16dp" android:background="?attr/detailsElementBackground" android:orientation="vertical" android:visibility="gone" > - <!-- Breadcrumb inserted here --> - <android.app.FragmentBreadCrumbs - android:id="@android:id/title" - android:layout_height="72dip" - android:layout_width="match_parent" - android:paddingTop="16dip" - android:paddingBottom="8dip" - android:gravity="center_vertical|left" - android:layout_marginLeft="48dip" - android:layout_marginRight="48dip" - /> + <!-- Breadcrumb inserted here, in certain screen sizes. In others, it will be an + empty layout or just padding, and PreferenceActivity will put the breadcrumbs in + the action bar. --> + <include layout="@layout/breadcrumbs_in_fragment" /> - <ImageView - android:layout_width="match_parent" - android:layout_height="1dip" - android:paddingLeft="32dip" - android:paddingRight="32dip" - android:src="#404040" - /> <android.preference.PreferenceFrameLayout android:id="@+id/prefs" android:layout_width="match_parent" android:layout_height="0dip" android:layout_weight="1" - android:layout_marginTop="-1dip" /> </LinearLayout> </LinearLayout> diff --git a/core/res/res/layout/preference_list_content_single_large.xml b/core/res/res/layout-w600dp/preference_list_content_single.xml index 6725996..6725996 100644 --- a/core/res/res/layout/preference_list_content_single_large.xml +++ b/core/res/res/layout-w600dp/preference_list_content_single.xml diff --git a/core/res/res/layout-xlarge/breadcrumbs_in_fragment.xml b/core/res/res/layout-xlarge/breadcrumbs_in_fragment.xml new file mode 100644 index 0000000..384c4fe --- /dev/null +++ b/core/res/res/layout-xlarge/breadcrumbs_in_fragment.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 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="wrap_content" + android:layout_width="match_parent" + android:layout_marginLeft="@dimen/preference_fragment_padding_side" + android:layout_marginRight="@dimen/preference_fragment_padding_side" + > + <android.app.FragmentBreadCrumbs + android:id="@android:id/title" + android:layout_height="72dip" + android:layout_width="match_parent" + android:paddingTop="16dip" + android:paddingBottom="8dip" + android:gravity="center_vertical|left" + /> + + <ImageView + android:layout_width="match_parent" + android:layout_height="1dip" + android:src="#404040" + /> +</LinearLayout>
\ No newline at end of file diff --git a/core/res/res/layout/breadcrumbs_in_fragment.xml b/core/res/res/layout/breadcrumbs_in_fragment.xml new file mode 100644 index 0000000..98fffb7 --- /dev/null +++ b/core/res/res/layout/breadcrumbs_in_fragment.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 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. +--> +<!-- This layout disables breadcrumbs in the fragment area and causes PreferenceActivity to + put the breadcrumbs in the action bar. --> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_height="@dimen/preference_fragment_padding_side" + android:layout_width="match_parent"> +</LinearLayout>
\ No newline at end of file diff --git a/core/res/res/layout/locale_picker_item.xml b/core/res/res/layout/locale_picker_item.xml index b63f5ab..19c0dee 100644 --- a/core/res/res/layout/locale_picker_item.xml +++ b/core/res/res/layout/locale_picker_item.xml @@ -20,11 +20,14 @@ android:layout_width="match_parent" android:gravity="center_vertical" android:minHeight="?android:attr/listPreferredItemHeight" - android:padding="5dip"> + android:paddingLeft="16dp" + android:paddingTop="8dp" + android:paddingBottom="8dp" + android:paddingRight="16dp"> <TextView android:id="@+id/locale" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceLarge" + android:textAppearance="?android:attr/textAppearanceMedium" /> </LinearLayout > diff --git a/core/res/res/layout/preference_category_holo.xml b/core/res/res/layout/preference_category_holo.xml index 5fe8b28..a4e20d2 100644 --- a/core/res/res/layout/preference_category_holo.xml +++ b/core/res/res/layout/preference_category_holo.xml @@ -18,5 +18,5 @@ <TextView xmlns:android="http://schemas.android.com/apk/res/android" style="?android:attr/listSeparatorTextViewStyle" android:id="@+android:id/title" - android:paddingLeft="32dp" + android:paddingLeft="16dp" /> diff --git a/core/res/res/layout/preference_child_holo.xml b/core/res/res/layout/preference_child_holo.xml index 2e70d77..06c846b 100644 --- a/core/res/res/layout/preference_child_holo.xml +++ b/core/res/res/layout/preference_child_holo.xml @@ -26,7 +26,7 @@ <LinearLayout android:layout_width="wrap_content" android:layout_height="match_parent" - android:minWidth="@dimen/preference_widget_width" + android:minWidth="@dimen/preference_icon_minWidth" android:gravity="center" android:orientation="horizontal"> <ImageView @@ -40,6 +40,7 @@ <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginLeft="32dip" android:layout_marginRight="6dip" android:layout_marginTop="6dip" android:layout_marginBottom="6dip" diff --git a/core/res/res/layout/preference_holo.xml b/core/res/res/layout/preference_holo.xml index c448f64..e5ed33c 100644 --- a/core/res/res/layout/preference_holo.xml +++ b/core/res/res/layout/preference_holo.xml @@ -27,21 +27,23 @@ <LinearLayout android:layout_width="wrap_content" android:layout_height="match_parent" - android:minWidth="@dimen/preference_widget_width" android:gravity="center" + android:minWidth="@dimen/preference_icon_minWidth" android:orientation="horizontal"> <ImageView android:id="@+android:id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" + android:minWidth="48dp" /> </LinearLayout> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginRight="6dip" + android:layout_marginLeft="16dip" + android:layout_marginRight="8dip" android:layout_marginTop="6dip" android:layout_marginBottom="6dip" android:layout_weight="1"> diff --git a/core/res/res/layout/preference_information_holo.xml b/core/res/res/layout/preference_information_holo.xml index d6cc063..d15cd7b 100644 --- a/core/res/res/layout/preference_information_holo.xml +++ b/core/res/res/layout/preference_information_holo.xml @@ -24,13 +24,24 @@ android:gravity="center_vertical" android:paddingRight="?android:attr/scrollbarSize"> - <View - android:layout_width="@dimen/preference_widget_width" - android:layout_height="match_parent" /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:minWidth="@dimen/preference_icon_minWidth" + android:gravity="center" + android:orientation="horizontal"> + <ImageView + android:id="@+android:id/icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + /> + </LinearLayout> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginLeft="16dip" android:layout_marginRight="6sp" android:layout_marginTop="6sp" android:layout_marginBottom="6sp" diff --git a/core/res/res/layout/preference_list_content.xml b/core/res/res/layout/preference_list_content.xml index 925b715..82b3a4c 100644 --- a/core/res/res/layout/preference_list_content.xml +++ b/core/res/res/layout/preference_list_content.xml @@ -27,6 +27,8 @@ android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="0px" + android:layout_marginTop="@dimen/preference_screen_top_margin" + android:layout_marginBottom="@dimen/preference_screen_bottom_margin" android:layout_weight="1"> <LinearLayout @@ -36,12 +38,14 @@ android:layout_height="match_parent" android:layout_marginRight="@dimen/preference_screen_side_margin_negative" android:layout_marginLeft="@dimen/preference_screen_side_margin" - android:layout_weight="10"> + android:layout_weight="@integer/preferences_left_pane_weight"> <ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="0px" android:layout_weight="1" + android:paddingTop="16dp" + android:paddingBottom="16dp" android:drawSelectorOnTop="false" android:cacheColorHint="@android:color/transparent" android:listPreferredItemHeight="48dp" @@ -58,15 +62,21 @@ android:id="@+id/prefs_frame" android:layout_width="0px" android:layout_height="match_parent" - android:layout_weight="20" + android:layout_weight="@integer/preferences_right_pane_weight" + android:layout_marginLeft="@dimen/preference_screen_side_margin" + android:layout_marginRight="@dimen/preference_screen_side_margin" android:orientation="vertical" android:visibility="gone" > + <!-- Breadcrumb inserted here, in certain screen sizes. In others, it will be an + empty layout or just padding, and PreferenceActivity will put the breadcrumbs in + the action bar. --> + <include layout="@layout/breadcrumbs_in_fragment" /> + <android.preference.PreferenceFrameLayout android:id="@+id/prefs" android:layout_width="match_parent" android:layout_height="0dip" android:layout_weight="1" - android:layout_marginTop="-1dip" /> </LinearLayout> </LinearLayout> diff --git a/core/res/res/layout/preference_list_fragment.xml b/core/res/res/layout/preference_list_fragment.xml index 4044371..986536e 100644 --- a/core/res/res/layout/preference_list_fragment.xml +++ b/core/res/res/layout/preference_list_fragment.xml @@ -28,6 +28,10 @@ android:layout_width="match_parent" android:layout_height="0px" android:layout_weight="1" + android:paddingTop="0dip" + android:paddingBottom="@dimen/preference_fragment_padding_bottom" + android:paddingLeft="@dimen/preference_fragment_padding_side" + android:paddingRight="@dimen/preference_fragment_padding_side" android:clipToPadding="false" android:drawSelectorOnTop="false" android:cacheColorHint="@android:color/transparent" diff --git a/core/res/res/layout/preference_list_fragment_large.xml b/core/res/res/layout/preference_list_fragment_large.xml deleted file mode 100644 index cde84ff..0000000 --- a/core/res/res/layout/preference_list_fragment_large.xml +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* -** Copyright 2011, 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" - android:layout_removeBorders="true"> - - <ListView android:id="@android:id/list" - android:layout_width="match_parent" - android:layout_height="0px" - android:layout_weight="1" - android:paddingTop="0dip" - android:paddingBottom="48dip" - android:paddingLeft="32dip" - android:paddingRight="32dip" - android:clipToPadding="false" - 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/layout/search_view.xml b/core/res/res/layout/search_view.xml index face8b2..99fdf5b 100644 --- a/core/res/res/layout/search_view.xml +++ b/core/res/res/layout/search_view.xml @@ -33,8 +33,8 @@ android:layout_gravity="center_vertical" android:layout_marginBottom="2dip" android:drawablePadding="0dip" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textColor="?android:attr/textColorPrimaryInverse" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textColor="?android:attr/textColorPrimary" android:visibility="gone" /> diff --git a/core/res/res/values-h720dp/dimens.xml b/core/res/res/values-h720dp/dimens.xml index 7f43946..c09cb5b 100644 --- a/core/res/res/values-h720dp/dimens.xml +++ b/core/res/res/values-h720dp/dimens.xml @@ -21,4 +21,10 @@ <dimen name="alert_dialog_title_height">54dip</dimen> <!-- Dialog button bar height --> <dimen name="alert_dialog_button_bar_height">54dip</dimen> + <!-- Preference fragment padding, bottom --> + <dimen name="preference_fragment_padding_bottom">16dp</dimen> + <!-- Preference activity top margin --> + <dimen name="preference_screen_top_margin">16dp</dimen> + <!-- Preference activity bottom margin --> + <dimen name="preference_screen_bottom_margin">16dp</dimen> </resources> diff --git a/core/res/res/values-land/dimens.xml b/core/res/res/values-land/dimens.xml index 8def578e..dbaad13 100644 --- a/core/res/res/values-land/dimens.xml +++ b/core/res/res/values-land/dimens.xml @@ -25,8 +25,8 @@ <dimen name="password_keyboard_key_height_numeric">60dip</dimen> <!-- Default correction for the space key in the password keyboard --> <dimen name="password_keyboard_spacebar_vertical_correction">2dip</dimen> - <dimen name="preference_screen_side_margin">96dp</dimen> - <dimen name="preference_screen_side_margin_negative">-100dp</dimen> + <dimen name="preference_screen_side_margin">16dp</dimen> + <dimen name="preference_screen_side_margin_negative">-20dp</dimen> <dimen name="preference_widget_width">72dp</dimen> <!-- Default height of an action bar. --> diff --git a/core/res/res/values-large/styles.xml b/core/res/res/values-large/styles.xml index 96a8c84..5206d7c 100644 --- a/core/res/res/values-large/styles.xml +++ b/core/res/res/values-large/styles.xml @@ -15,10 +15,11 @@ --> <resources> - <style name="Widget.Holo.PreferenceFrameLayout"> - <item name="android:borderTop">0dip</item> - <item name="android:borderBottom">48dip</item> - <item name="android:borderLeft">32dip</item> - <item name="android:borderRight">32dip</item> + <style name="PreferencePanel"> + <item name="android:layout_marginLeft">@dimen/preference_screen_side_margin</item> + <item name="android:layout_marginRight">@dimen/preference_screen_side_margin</item> + <item name="android:layout_marginTop">48dip</item> + <item name="android:layout_marginBottom">48dip</item> + <item name="android:background">?attr/detailsElementBackground</item> </style> </resources> diff --git a/core/res/res/values-sw600dp/bools.xml b/core/res/res/values-sw600dp/bools.xml new file mode 100644 index 0000000..734031f --- /dev/null +++ b/core/res/res/values-sw600dp/bools.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 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. +--> + +<resources> + <bool name="preferences_prefer_dual_pane">true</bool> +</resources> diff --git a/core/res/res/values-w1280dp/dimens.xml b/core/res/res/values-w1280dp/dimens.xml new file mode 100644 index 0000000..e67b3a9 --- /dev/null +++ b/core/res/res/values-w1280dp/dimens.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2011, 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. +*/ +--> +<resources> + <dimen name="preference_screen_side_margin">96dp</dimen> + <dimen name="preference_screen_side_margin_negative">-100dp</dimen> + <dimen name="preference_widget_width">64dp</dimen> + <!-- Preference fragment padding, bottom --> + <dimen name="preference_fragment_padding_bottom">48dp</dimen> + <!-- Preference fragment padding, sides --> + <dimen name="preference_fragment_padding_side">48dp</dimen> + <!-- Padding to the left of the preference panel breadcrumb --> + <dimen name="preference_breadcrumb_paddingLeft">48dp</dimen> + <!-- Padding to the right of the preference panel breadcrumb --> + <dimen name="preference_breadcrumb_paddingRight">48dp</dimen> +</resources> + diff --git a/core/res/res/values-w720dp/dimens.xml b/core/res/res/values-w720dp/dimens.xml new file mode 100644 index 0000000..ec1195e --- /dev/null +++ b/core/res/res/values-w720dp/dimens.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 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. +--> + +<resources> + <!-- Preference fragment padding, sides --> + <dimen name="preference_fragment_padding_side">32dp</dimen> + <!-- Padding to the left of the preference panel breadcrumb --> + <dimen name="preference_breadcrumb_paddingLeft">32dp</dimen> + <!-- Padding to the right of the preference panel breadcrumb --> + <dimen name="preference_breadcrumb_paddingRight">32dp</dimen> + <!-- Weight of the left pane in a multi-pane preference layout. --> + <integer name="preferences_left_pane_weight">1</integer> + <!-- Weight of the right pane in a multi-pane preference layout. So the split is 1:2 --> + <integer name="preferences_right_pane_weight">2</integer> + <!-- Minimum space to allocate to the left of a preference item for an icon. + This helps in aligning titles when some items have icons and some don't. When space is + at a premium, we don't pre-allocate any space. --> + <dimen name="preference_icon_minWidth">48dp</dimen> +</resources> diff --git a/core/res/res/values-xlarge/styles.xml b/core/res/res/values-xlarge/styles.xml index a39d9d6..7515c98 100644 --- a/core/res/res/values-xlarge/styles.xml +++ b/core/res/res/values-xlarge/styles.xml @@ -51,13 +51,5 @@ <item name="android:gravity">left|center_vertical</item> <item name="android:tabLayout">@android:layout/tab_indicator_holo_large</item> </style> - - <style name="PreferencePanel"> - <item name="android:layout_marginLeft">@dimen/preference_screen_side_margin</item> - <item name="android:layout_marginRight">@dimen/preference_screen_side_margin</item> - <item name="android:layout_marginTop">48dip</item> - <item name="android:layout_marginBottom">48dip</item> - <item name="android:background">?attr/detailsElementBackground</item> - </style> </resources> diff --git a/core/res/res/values/bools.xml b/core/res/res/values/bools.xml index 8e27be4..9d6309d 100644 --- a/core/res/res/values/bools.xml +++ b/core/res/res/values/bools.xml @@ -1,23 +1,22 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- -/* -** Copyright 2011, 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. -*/ +<!-- Copyright (C) 2011 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. --> + <resources> <bool name="allow_action_menu_item_text_with_icon">false</bool> <bool name="action_bar_embed_tabs">false</bool> <bool name="split_action_bar_is_narrow">true</bool> + <bool name="preferences_prefer_dual_pane">false</bool> </resources> diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index 3f4010b..f5de1d2 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -57,9 +57,28 @@ <dimen name="preference_screen_side_margin">0dp</dimen> <!-- Preference activity side margins negative--> <dimen name="preference_screen_side_margin_negative">0dp</dimen> + <!-- Preference activity top margin --> + <dimen name="preference_screen_top_margin">0dp</dimen> + <!-- Preference activity bottom margin --> + <dimen name="preference_screen_bottom_margin">0dp</dimen> <!-- Preference widget area width (to the left of the text) --> - <dimen name="preference_widget_width">8dp</dimen> - + <dimen name="preference_widget_width">48dp</dimen> + <!-- Preference fragment padding, bottom --> + <dimen name="preference_fragment_padding_bottom">0dp</dimen> + <!-- Preference fragment padding, sides --> + <dimen name="preference_fragment_padding_side">0dp</dimen> + <!-- Weight of the left pane in a multi-pane preference layout. --> + <integer name="preferences_left_pane_weight">4</integer> + <!-- Weight of the right pane in a multi-pane preference layout. So the split is 40:60 --> + <integer name="preferences_right_pane_weight">6</integer> + <!-- Padding to the left of the preference panel breadcrumb --> + <dimen name="preference_breadcrumb_paddingLeft">0dp</dimen> + <!-- Padding to the right of the preference panel breadcrumb --> + <dimen name="preference_breadcrumb_paddingRight">0dp</dimen> + <!-- Minimum space to allocate to the left of a preference item for an icon. + This helps in aligning titles when some items have icons and some don't. When space is + at a premium, we don't pre-allocate any space. --> + <dimen name="preference_icon_minWidth">0dp</dimen> <!-- The platform's desired minimum size for a dialog's width when it is along the major axis (that is the screen is landscape). This may be either a fraction or a dimension. --> diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index b08f201..0635528 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -2218,9 +2218,9 @@ <style name="Widget.Holo.PreferenceFrameLayout"> <item name="android:borderTop">0dip</item> - <item name="android:borderBottom">0dip</item> - <item name="android:borderLeft">0dip</item> - <item name="android:borderRight">0dip</item> + <item name="android:borderBottom">@dimen/preference_fragment_padding_side</item> + <item name="android:borderLeft">@dimen/preference_fragment_padding_side</item> + <item name="android:borderRight">@dimen/preference_fragment_padding_side</item> </style> <!-- Pointer styles --> diff --git a/tests/BiDiTests/res/layout/canvas.xml b/tests/BiDiTests/res/layout/canvas.xml index 371cc23..77007af 100644 --- a/tests/BiDiTests/res/layout/canvas.xml +++ b/tests/BiDiTests/res/layout/canvas.xml @@ -31,4 +31,4 @@ android:background="#FF0000" /> -</LinearLayout>
\ No newline at end of file +</LinearLayout> |