Larger touch targets, snap to persisted value.

Extend ListView content to screen edges, and use InsetBoundsDrawable
to draw separator and divider with expected padding.  Sweep touch
targets are now much larger.

Snap sweep to persisted value, and fix NFE when parsing label value.

Bug: 5274249
Bug: 5262865
Bug: 5242857
Change-Id: Ifa0f3e622767d5b4dc85a73d6340207e6038a429
This commit is contained in:
Jeff Sharkey
2011-09-08 18:57:17 -07:00
parent 9b9db3f966
commit 5d70679c02
12 changed files with 305 additions and 35 deletions

View File

@@ -377,7 +377,8 @@ public class Utils {
* 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) {
public static void prepareCustomPreferencesList(
ViewGroup parent, View child, ListView list, boolean ignoreSidePadding) {
final boolean movePadding = list.getScrollBarStyle() == View.SCROLLBARS_OUTSIDE_OVERLAY;
if (movePadding && parent instanceof PreferenceFrameLayout) {
((PreferenceFrameLayout.LayoutParams) child.getLayoutParams()).removeBorders = true;
@@ -387,7 +388,9 @@ public class Utils {
com.android.internal.R.dimen.preference_fragment_padding_side);
final int paddingBottom = res.getDimensionPixelSize(
com.android.internal.R.dimen.preference_fragment_padding_bottom);
list.setPadding(paddingSide, 0, paddingSide, paddingBottom);
final int effectivePaddingSide = ignoreSidePadding ? 0 : paddingBottom;
list.setPadding(effectivePaddingSide, 0, effectivePaddingSide, paddingBottom);
}
}
}