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 /src | |
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
Diffstat (limited to 'src')
8 files changed, 69 insertions, 15 deletions
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; } |