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
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index 2d2b654..20a34a3 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -377,7 +377,8 @@
      * 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 @@
                     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);
         }
     }
 }