diff options
author | Jeff Sharkey <jsharkey@android.com> | 2012-11-30 17:44:52 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-11-30 17:44:53 -0800 |
commit | 5e337eda4ff40673e1498603134b6731b8e50da1 (patch) | |
tree | 0377e769c7c9b7c5e196f288862d07e0ee3d9f11 | |
parent | c3f76cf130a93fff5fefd7ccaa8de947bee99665 (diff) | |
parent | 97d07fa3aedde44368818551dc789eaff7bfb047 (diff) | |
download | packages_apps_settings-5e337eda4ff40673e1498603134b6731b8e50da1.zip packages_apps_settings-5e337eda4ff40673e1498603134b6731b8e50da1.tar.gz packages_apps_settings-5e337eda4ff40673e1498603134b6731b8e50da1.tar.bz2 |
Merge "Push scrollbars to screen edges." into jb-mr1.1-dev
18 files changed, 221 insertions, 161 deletions
diff --git a/res/layout/account_sync_screen.xml b/res/layout/account_sync_screen.xml index aa080cf..4c1bf7e 100644 --- a/res/layout/account_sync_screen.xml +++ b/res/layout/account_sync_screen.xml @@ -22,23 +22,23 @@ android:layout_height="match_parent" android:orientation="vertical"> - <include layout="@layout/title" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> + <include layout="@layout/title" /> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginStart="@*android:dimen/preference_fragment_padding_side" + android:layout_marginEnd="@*android:dimen/preference_fragment_padding_side" android:scaleType="fitXY" android:src="?android:attr/listDivider" /> - <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/list" + <ListView + android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="0dip" android:layout_weight="1" - android:drawSelectorOnTop="false" - android:scrollbarAlwaysDrawVerticalTrack="true" - /> + android:clipToPadding="false" + android:scrollbarStyle="@*android:integer/preference_fragment_scrollbarStyle" /> <TextView android:id="@+id/sync_settings_error_info" android:layout_width="match_parent" @@ -48,32 +48,6 @@ android:drawablePadding="8dip" android:drawableLeft="@drawable/ic_sync_error_holo" /> - <!-- - <LinearLayout android:id="@+id/remove_account_area" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:background="@android:drawable/bottom_bar"> - - <View - android:layout_width="0dip" - android:layout_height="match_parent" - android:layout_weight="1"/> - - <Button android:id="@+id/remove_account_button" - android:layout_width="0dip" - android:layout_height="wrap_content" - android:layout_weight="2" - android:layout_marginTop="5dip" - android:text="@string/remove_account_label" /> - - <View - android:layout_width="0dip" - android:layout_height="match_parent" - android:layout_weight="1"/> - </LinearLayout> - --> - <RelativeLayout android:id="@+id/finish_button_area" android:layout_height="wrap_content" android:layout_width="match_parent" diff --git a/res/layout/installed_app_details.xml b/res/layout/installed_app_details.xml index 7829596..b7f8f15 100644 --- a/res/layout/installed_app_details.xml +++ b/res/layout/installed_app_details.xml @@ -19,12 +19,14 @@ <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:clipToPadding="false" + android:scrollbarStyle="@*android:integer/preference_fragment_scrollbarStyle"> + <LinearLayout android:id="@+id/all_details" android:layout_width="match_parent" android:layout_height="match_parent" - android:paddingEnd="6dip" android:paddingBottom="5dip" android:orientation="vertical"> @@ -33,16 +35,14 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:orientation="vertical" - android:paddingEnd="6dip" - android:paddingStart="6dip" - android:paddingTop="5dip" - android:paddingBottom="5dip" > + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:orientation="vertical"> <!-- Application snippet label, version and icon --> <include layout="@layout/manage_applications_item" - android:id="@+id/app_snippet"/> + android:id="@+id/app_snippet" /> <!-- Force stop and uninstall buttons --> <include @@ -58,8 +58,8 @@ <CheckBox android:id="@+id/notification_switch" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginStart="12dip" android:layout_gravity="start" + android:layout_marginTop="4dip" android:text="@string/app_notifications_switch_label" /> </LinearLayout> @@ -72,8 +72,9 @@ <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingStart="6dip" - android:orientation="vertical"> + android:orientation="vertical" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" @@ -87,9 +88,7 @@ android:layout_height="wrap_content" android:layout_width="wrap_content" android:maxLines="1" - android:paddingTop="6dip" - android:paddingStart="6dip"/> - + android:paddingTop="6dip" /> <ImageView android:id="@+id/info_size_dots" android:src="@drawable/dotted_line_480px" @@ -105,13 +104,12 @@ <TextView android:id="@+id/total_size_text" android:paddingTop="6dip" - android:paddingEnd="6dip" android:textAppearance="?android:attr/textAppearanceMedium" android:layout_height="wrap_content" android:layout_width="wrap_content" android:maxLines="1" /> - </LinearLayout> + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" @@ -125,8 +123,7 @@ android:layout_height="wrap_content" android:layout_width="wrap_content" android:maxLines="1" - android:paddingTop="6dip" - android:paddingStart="6dip"/> + android:paddingTop="6dip" /> <ImageView android:id="@+id/info_size_dots" android:src="@drawable/dotted_line_480px" @@ -143,11 +140,9 @@ android:id="@+id/application_size_text" android:textAppearance="?android:attr/textAppearanceMedium" android:paddingTop="6dip" - android:paddingEnd="6dip" android:layout_height="wrap_content" android:layout_width="wrap_content" android:maxLines="1" /> - </LinearLayout> <LinearLayout @@ -163,8 +158,7 @@ android:layout_height="wrap_content" android:layout_width="wrap_content" android:maxLines="1" - android:paddingTop="6dip" - android:paddingStart="6dip"/> + android:paddingTop="6dip" /> <ImageView android:id="@+id/info_size_dots" android:src="@drawable/dotted_line_480px" @@ -181,11 +175,9 @@ android:id="@+id/external_code_size_text" android:textAppearance="?android:attr/textAppearanceMedium" android:paddingTop="6dip" - android:paddingEnd="6dip" android:layout_height="wrap_content" android:layout_width="wrap_content" android:maxLines="1" /> - </LinearLayout> <LinearLayout @@ -202,8 +194,7 @@ android:layout_height="wrap_content" android:layout_width="wrap_content" android:maxLines="1" - android:paddingTop="6dip" - android:paddingStart="6dip"/> + android:paddingTop="6dip" /> <ImageView android:id="@+id/info_size_dots" android:src="@drawable/dotted_line_480px" @@ -220,11 +211,9 @@ android:id="@+id/data_size_text" android:textAppearance="?android:attr/textAppearanceMedium" android:paddingTop="6dip" - android:paddingEnd="6dip" android:layout_height="wrap_content" android:layout_width="wrap_content" android:maxLines="1" /> - </LinearLayout> <LinearLayout @@ -240,8 +229,7 @@ android:layout_height="wrap_content" android:layout_width="wrap_content" android:maxLines="1" - android:paddingTop="6dip" - android:paddingStart="6dip"/> + android:paddingTop="6dip" /> <ImageView android:id="@+id/info_size_dots" android:src="@drawable/dotted_line_480px" @@ -258,11 +246,9 @@ android:id="@+id/external_data_size_text" android:textAppearance="?android:attr/textAppearanceMedium" android:paddingTop="6dip" - android:paddingEnd="6dip" android:layout_height="wrap_content" android:layout_width="wrap_content" android:maxLines="1" /> - </LinearLayout> <!-- Clear data and install location buttons --> @@ -289,6 +275,8 @@ android:orientation="horizontal" android:baselineAligned="true" android:layout_below="@id/cache_header" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:paddingTop="-1dip"> <TextView android:text="@string/cache_size_label" @@ -297,8 +285,7 @@ android:maxLines="1" android:textAppearance="?android:attr/textAppearanceMedium" android:paddingTop="6dip" - android:gravity="center_vertical" - android:paddingStart="6dip"/> + android:gravity="center_vertical" /> <ImageView android:src="@drawable/dotted_line_480px" android:layout_width="0dip" @@ -314,19 +301,36 @@ android:id="@+id/cache_size_text" android:textAppearance="?android:attr/textAppearanceMedium" android:paddingTop="6dip" - android:paddingEnd="6dip" android:layout_height="wrap_content" android:layout_width="wrap_content" android:maxLines="1" /> </LinearLayout> - <Button android:id="@+id/clear_cache_button" - android:layout_alignParentEnd="true" + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" android:layout_below="@id/cache_size" - android:layout_centerHorizontal="true" - android:layout_width="200dip" - android:text="@string/clear_cache_btn_text" - android:layout_height="wrap_content" /> + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingTop="4dip" + android:orientation="horizontal"> + <View + android:layout_width="120dip" + android:layout_height="0dip" + android:layout_weight="0.4" /> + <View + android:layout_width="0dip" + android:layout_height="0dip" + android:visibility="invisible" + android:layout_weight="0.2" /> + <Button + android:id="@+id/clear_cache_button" + android:layout_width="120dip" + android:layout_height="wrap_content" + android:layout_weight="0.4" + android:text="@string/clear_cache_btn_text" /> + </LinearLayout> + </RelativeLayout> <!-- Prefered activities section --> @@ -338,22 +342,38 @@ <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_gravity="center_vertical"> + android:layout_gravity="center_vertical" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"> <TextView android:id="@+id/auto_launch" android:textAppearance="?android:attr/textAppearanceSmall" android:layout_alignParentStart="true" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingTop="6dip" - android:paddingEnd="6dip" - android:paddingStart="6dip" /> - <Button android:id="@+id/clear_activities_button" - android:layout_alignParentEnd="true" + android:paddingTop="6dip" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" android:layout_below="@id/auto_launch" - android:layout_centerHorizontal="true" - android:layout_width="200dip" - android:text="@string/clear_activities" - android:layout_height="wrap_content" /> + android:paddingTop="4dip" + android:orientation="horizontal"> + <View + android:layout_width="120dip" + android:layout_height="0dip" + android:layout_weight="0.4" /> + <View + android:layout_width="0dip" + android:layout_height="0dip" + android:visibility="invisible" + android:layout_weight="0.2" /> + <Button + android:id="@+id/clear_activities_button" + android:layout_width="120dip" + android:layout_height="wrap_content" + android:layout_weight="0.4" + android:text="@string/clear_activities" /> + </LinearLayout> </RelativeLayout> <!-- Screen compatibility section --> @@ -371,8 +391,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="6dip" - android:paddingEnd="6dip" - android:paddingStart="6dip" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:text="@string/screen_compatibility_text"/> <CheckBox android:id="@+id/ask_compatibility_cb" android:layout_width="wrap_content" @@ -403,8 +423,9 @@ android:textColor="#ffffb060" android:textAppearance="?android:attr/textAppearanceSmall" android:paddingTop="6dip" - android:paddingStart="6dip" android:paddingBottom="6dip" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:layout_width="match_parent" android:layout_height="wrap_content" /> <LinearLayout @@ -426,8 +447,9 @@ android:text="@string/security_settings_desc" android:textAppearance="?android:attr/textAppearanceSmall" android:paddingTop="6dip" - android:paddingStart="6dip" android:paddingBottom="6dip" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:layout_width="match_parent" android:layout_height="wrap_content" /> <LinearLayout diff --git a/res/layout/manage_accounts_screen.xml b/res/layout/manage_accounts_screen.xml index 2717805..3a2aa6a 100644 --- a/res/layout/manage_accounts_screen.xml +++ b/res/layout/manage_accounts_screen.xml @@ -27,9 +27,8 @@ android:layout_width="match_parent" android:layout_height="0dip" android:layout_weight="1" - android:drawSelectorOnTop="false" - android:scrollbarAlwaysDrawVerticalTrack="true" - /> + android:clipToPadding="false" + android:scrollbarStyle="@*android:integer/preference_fragment_scrollbarStyle" /> <TextView android:id="@+id/sync_settings_error_info" android:layout_width="match_parent" diff --git a/res/layout/manage_applications_apps.xml b/res/layout/manage_applications_apps.xml index 394382e..8a8ba0b 100644 --- a/res/layout/manage_applications_apps.xml +++ b/res/layout/manage_applications_apps.xml @@ -30,6 +30,7 @@ android:drawSelectorOnTop="false" android:layout_width="match_parent" android:layout_height="match_parent" + android:clipToPadding="false" android:scrollbarStyle="@*android:integer/preference_fragment_scrollbarStyle" /> <TextView android:id="@android:id/empty" android:layout_width="match_parent" diff --git a/res/layout/power_usage_details.xml b/res/layout/power_usage_details.xml index 001ffec..05036da 100644 --- a/res/layout/power_usage_details.xml +++ b/res/layout/power_usage_details.xml @@ -17,7 +17,10 @@ <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:clipToPadding="false" + android:scrollbarStyle="@*android:integer/preference_fragment_scrollbarStyle"> + <LinearLayout android:id="@+id/all_details" android:layout_width="match_parent" diff --git a/res/layout/running_service_details.xml b/res/layout/running_service_details.xml index 98c144c..92ce07b 100644 --- a/res/layout/running_service_details.xml +++ b/res/layout/running_service_details.xml @@ -19,7 +19,10 @@ <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:clipToPadding="false" + android:scrollbarStyle="@*android:integer/preference_fragment_scrollbarStyle"> + <LinearLayout android:id="@+id/all_details" android:layout_width="match_parent" @@ -29,8 +32,8 @@ <!-- Summary information as per previous screen --> <include layout="@layout/running_processes_item" - android:id="@+id/snippet"/> + android:id="@+id/snippet" /> </LinearLayout> -</ScrollView> +</ScrollView> diff --git a/res/layout/running_service_details_process.xml b/res/layout/running_service_details_process.xml index caf5664..68ec482 100644 --- a/res/layout/running_service_details_process.xml +++ b/res/layout/running_service_details_process.xml @@ -29,9 +29,9 @@ <TextView android:id="@+id/comp_description" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingTop="8dp" android:paddingBottom="8dp" - android:paddingStart="14dip" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:textAppearance="?android:attr/textAppearanceMedium" /> </LinearLayout> diff --git a/res/layout/running_service_details_service.xml b/res/layout/running_service_details_service.xml index 56cd971..706d1cf 100644 --- a/res/layout/running_service_details_service.xml +++ b/res/layout/running_service_details_service.xml @@ -33,16 +33,23 @@ layout="@layout/running_processes_item" android:id="@+id/service"/> - <TextView android:id="@+id/comp_description" - android:layout_width="wrap_content" + <LinearLayout + android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingTop="8dp" - android:paddingBottom="8dp" - android:paddingStart="14dip" - android:textAppearance="?android:attr/textAppearanceMedium" /> + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:orientation="vertical"> - <include - layout="@layout/two_buttons_panel" - android:id="@+id/control_buttons_panel"/> + <TextView android:id="@+id/comp_description" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingBottom="8dp" + android:textAppearance="?android:attr/textAppearanceMedium" /> + + <include + layout="@layout/two_buttons_panel" + android:id="@+id/control_buttons_panel" /> + + </LinearLayout> </LinearLayout> diff --git a/res/layout/title.xml b/res/layout/title.xml index eb2222b..0c2084b 100644 --- a/res/layout/title.xml +++ b/res/layout/title.xml @@ -19,46 +19,45 @@ <!-- The title area at the top of the settings pane --> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<GridLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/title_area" - android:orientation="horizontal"> - - <ImageView android:id="@+id/provider_icon" - android:layout_width="48dip" - android:layout_height="48dip" - android:layout_margin="5dip" - android:layout_gravity="center_vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="@*android:dimen/preference_fragment_padding_side" + android:layout_marginEnd="@*android:dimen/preference_fragment_padding_side" + android:minHeight="?android:attr/listPreferredItemHeight" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingTop="8dip" + android:paddingBottom="8dip" + android:columnCount="2"> + + <ImageView + android:id="@+id/provider_icon" + android:layout_width="@android:dimen/app_icon_size" + android:layout_height="@android:dimen/app_icon_size" + android:layout_rowSpan="2" + android:layout_marginEnd="8dip" + android:scaleType="centerInside" android:contentDescription="@null" /> - <LinearLayout + <TextView + android:id="@+id/user_id" android:layout_width="0dip" - android:layout_weight="1" - android:layout_height="wrap_content" - android:orientation="vertical"> - - <TextView - android:id="@+id/user_id" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textColor="?android:attr/textColorTertiary" - android:textStyle="bold" - android:singleLine="true" - android:ellipsize="end" - android:gravity="center_vertical" - android:layout_marginTop="5dip"/> - - <TextView - android:id="@+id/provider_id" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textColor="?android:attr/textColorTertiary" - android:singleLine="true" - android:ellipsize="end" - android:layout_gravity="bottom" - android:layout_marginBottom="5dip"/> - - </LinearLayout> + android:layout_gravity="fill_horizontal" + android:layout_marginTop="2dip" + android:singleLine="true" + android:ellipsize="marquee" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textAlignment="viewStart" /> + + <TextView + android:id="@+id/provider_id" + android:layout_width="0dip" + android:layout_gravity="fill_horizontal" + android:singleLine="true" + android:ellipsize="marquee" + android:textAppearance="?android:attr/textAppearanceSmall" + android:textAlignment="viewStart" /> -</LinearLayout> +</GridLayout> diff --git a/res/layout/two_buttons_panel.xml b/res/layout/two_buttons_panel.xml index 1a5975a..2acf6f6 100755 --- a/res/layout/two_buttons_panel.xml +++ b/res/layout/two_buttons_panel.xml @@ -24,8 +24,6 @@ android:layout_height="wrap_content" android:gravity="bottom" android:paddingTop="4dip" - android:paddingStart="2dip" - android:paddingEnd="2dip" android:orientation="horizontal"> <Button android:id="@+id/left_button" diff --git a/src/com/android/settings/LocalePicker.java b/src/com/android/settings/LocalePicker.java index 9bfa07e..8ea99a1 100644 --- a/src/com/android/settings/LocalePicker.java +++ b/src/com/android/settings/LocalePicker.java @@ -19,6 +19,10 @@ package com.android.settings; import android.app.Dialog; import android.os.Bundle; import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ListView; import com.android.settings.SettingsPreferenceFragment.SettingsDialogFragment; @@ -50,6 +54,15 @@ public class LocalePicker extends com.android.internal.app.LocalePicker } @Override + public View onCreateView( + LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + final View view = super.onCreateView(inflater, container, savedInstanceState); + final ListView list = (ListView) view.findViewById(android.R.id.list); + Utils.forcePrepareCustomPreferencesList(container, view, list, false); + return view; + } + + @Override public void onLocaleSelected(final Locale locale) { if (Utils.hasMultipleUsers(getActivity())) { mTargetLocale = locale; diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java index 2ce77b5..e6d63bd 100644 --- a/src/com/android/settings/Utils.java +++ b/src/com/android/settings/Utils.java @@ -419,13 +419,20 @@ public class Utils { return statusString; } + public static void forcePrepareCustomPreferencesList( + ViewGroup parent, View child, ListView list, boolean ignoreSidePadding) { + list.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY); + list.setClipToPadding(false); + prepareCustomPreferencesList(parent, child, list, ignoreSidePadding); + } + /** * Prepare a custom preferences layout, moving padding to {@link ListView} * when outside scrollbars are requested. Usually used to display * {@link ListView} and {@link TabWidget} with correct padding. */ public static void prepareCustomPreferencesList( - ViewGroup parent, View child, ListView list, boolean ignoreSidePadding) { + ViewGroup parent, View child, View list, boolean ignoreSidePadding) { final boolean movePadding = list.getScrollBarStyle() == View.SCROLLBARS_OUTSIDE_OVERLAY; if (movePadding && parent instanceof PreferenceFrameLayout) { ((PreferenceFrameLayout.LayoutParams) child.getLayoutParams()).removeBorders = true; diff --git a/src/com/android/settings/ZonePicker.java b/src/com/android/settings/ZonePicker.java index f1da593..1502ad1 100644 --- a/src/com/android/settings/ZonePicker.java +++ b/src/com/android/settings/ZonePicker.java @@ -23,10 +23,12 @@ import android.content.Context; import android.content.res.XmlResourceParser; import android.os.Bundle; import android.util.Log; +import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; +import android.view.ViewGroup; import android.widget.ListView; import android.widget.SimpleAdapter; @@ -155,6 +157,15 @@ public class ZonePicker extends ListFragment { } @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + final View view = super.onCreateView(inflater, container, savedInstanceState); + final ListView list = (ListView) view.findViewById(android.R.id.list); + Utils.forcePrepareCustomPreferencesList(container, view, list, false); + return view; + } + + @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { menu.add(0, MENU_ALPHABETICAL, 0, R.string.zone_list_menu_sort_alphabetically) .setIcon(android.R.drawable.ic_menu_sort_alphabetically); diff --git a/src/com/android/settings/accounts/AccountSyncSettings.java b/src/com/android/settings/accounts/AccountSyncSettings.java index 196908e..c346017 100644 --- a/src/com/android/settings/accounts/AccountSyncSettings.java +++ b/src/com/android/settings/accounts/AccountSyncSettings.java @@ -47,9 +47,11 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; +import android.widget.ListView; import android.widget.TextView; import com.android.settings.R; +import com.android.settings.Utils; import com.google.android.collect.Lists; import com.google.android.collect.Maps; @@ -149,7 +151,10 @@ public class AccountSyncSettings extends AccountPreferenceBase { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View view = inflater.inflate(R.layout.account_sync_screen, container, false); - + + final ListView list = (ListView) view.findViewById(android.R.id.list); + Utils.prepareCustomPreferencesList(container, view, list, false); + initializeUi(view); return view; diff --git a/src/com/android/settings/accounts/ManageAccountsSettings.java b/src/com/android/settings/accounts/ManageAccountsSettings.java index a27fbbd..46aa566 100644 --- a/src/com/android/settings/accounts/ManageAccountsSettings.java +++ b/src/com/android/settings/accounts/ManageAccountsSettings.java @@ -46,12 +46,14 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.CompoundButton; +import android.widget.ListView; import android.widget.Switch; import android.widget.TextView; import com.android.settings.AccountPreference; import com.android.settings.R; import com.android.settings.Settings; +import com.android.settings.Utils; import java.util.ArrayList; import java.util.Date; @@ -101,6 +103,8 @@ public class ManageAccountsSettings extends AccountPreferenceBase public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View view = inflater.inflate(R.layout.manage_accounts_screen, container, false); + final ListView list = (ListView) view.findViewById(android.R.id.list); + Utils.prepareCustomPreferencesList(container, view, list, false); return view; } diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java index 7241fdc..75c9485 100644 --- a/src/com/android/settings/applications/InstalledAppDetails.java +++ b/src/com/android/settings/applications/InstalledAppDetails.java @@ -424,9 +424,12 @@ public class InstalledAppDetails extends Fragment } @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View view = mRootView = inflater.inflate(R.layout.installed_app_details, null); - + public View onCreateView( + LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + final View view = inflater.inflate(R.layout.installed_app_details, container, false); + Utils.prepareCustomPreferencesList(container, view, view, false); + + mRootView = view; mComputingStr = getActivity().getText(R.string.computing_size); // Set default values on sizes @@ -536,7 +539,9 @@ public class InstalledAppDetails extends Fragment // Utility method to set applicaiton label and icon. private void setAppLabelAndIcon(PackageInfo pkgInfo) { - View appSnippet = mRootView.findViewById(R.id.app_snippet); + final View appSnippet = mRootView.findViewById(R.id.app_snippet); + appSnippet.setPadding(0, appSnippet.getPaddingTop(), 0, appSnippet.getPaddingBottom()); + ImageView icon = (ImageView) appSnippet.findViewById(R.id.app_icon); mState.ensureIcon(mAppEntry); icon.setImageDrawable(mAppEntry.icon); diff --git a/src/com/android/settings/applications/RunningServiceDetails.java b/src/com/android/settings/applications/RunningServiceDetails.java index 02fbecc..73547f1 100644 --- a/src/com/android/settings/applications/RunningServiceDetails.java +++ b/src/com/android/settings/applications/RunningServiceDetails.java @@ -1,7 +1,5 @@ package com.android.settings.applications; -import com.android.settings.R; - import android.app.Activity; import android.app.ActivityManager; import android.app.AlertDialog; @@ -18,9 +16,9 @@ import android.content.Intent; import android.content.IntentSender; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; +import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ProviderInfo; import android.content.pm.ServiceInfo; -import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; import android.os.Bundle; import android.os.Debug; @@ -35,6 +33,9 @@ import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; +import com.android.settings.R; +import com.android.settings.Utils; + import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -507,12 +508,14 @@ public class RunningServiceDetails extends Fragment } @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View view = mRootView = inflater.inflate(R.layout.running_service_details, null); - + public View onCreateView( + LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + final View view = inflater.inflate(R.layout.running_service_details, container, false); + Utils.prepareCustomPreferencesList(container, view, view, false); + + mRootView = view; mAllDetails = (ViewGroup)view.findViewById(R.id.all_details); mSnippet = (ViewGroup)view.findViewById(R.id.snippet); - mSnippet.setPadding(0, mSnippet.getPaddingTop(), 0, mSnippet.getPaddingBottom()); mSnippetViewHolder = new RunningProcessesView.ViewHolder(mSnippet); // We want to retrieve the data right now, so any active managed diff --git a/src/com/android/settings/fuelgauge/PowerUsageDetail.java b/src/com/android/settings/fuelgauge/PowerUsageDetail.java index 753bf82..8ecc659 100644 --- a/src/com/android/settings/fuelgauge/PowerUsageDetail.java +++ b/src/com/android/settings/fuelgauge/PowerUsageDetail.java @@ -16,6 +16,8 @@ package com.android.settings.fuelgauge; +import static com.android.settings.Utils.prepareCustomPreferencesList; + import android.app.Activity; import android.app.ActivityManager; import android.app.ApplicationErrorReport; @@ -141,8 +143,12 @@ public class PowerUsageDetail extends Fragment implements Button.OnClickListener } @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View view = mRootView = inflater.inflate(R.layout.power_usage_details, null); + public View onCreateView( + LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + final View view = inflater.inflate(R.layout.power_usage_details, container, false); + prepareCustomPreferencesList(container, view, view, false); + + mRootView = view; createDetails(); return view; } |