Fixed Accessibility Preference for Android API Level 16

- Accessibility preference screen was not getting refreshed when
text scaling was modified. This was due to incompatibilites of
PreferenceScreen API between API level 16 and above. Modified
the code to use compatible scheme.

- Options menu was not showing padding at start and end of menu
items on API level 16. This was due to incompatibilites of API.
Added options to resource file to fix the problem.

Change-Id: I31d46962adf2aa9fa8dbbff1b1161092a55676f4
diff --git a/res/layout/menu_item.xml b/res/layout/menu_item.xml
index cdee2fd..ebd39ef 100644
--- a/res/layout/menu_item.xml
+++ b/res/layout/menu_item.xml
@@ -9,7 +9,9 @@
     android:layout_width="match_parent"
     android:layout_height="?android:attr/listPreferredItemHeightSmall"
     android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+    android:paddingLeft="?android:attr/listPreferredItemPaddingStart"
     android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+    android:paddingRight="?android:attr/listPreferredItemPaddingEnd"
     android:background="?android:attr/listChoiceBackgroundIndicator">
     <TextView
         android:id="@+id/menu_item_text"
diff --git a/res/xml/accessibility_preferences.xml b/res/xml/accessibility_preferences.xml
index 05403eb..8e1d8f2 100644
--- a/res/xml/accessibility_preferences.xml
+++ b/res/xml/accessibility_preferences.xml
@@ -17,32 +17,34 @@
 <PreferenceScreen
     xmlns:android="http://schemas.android.com/apk/res/android">
 
-    <CheckBoxPreference android:key="force_userscalable"
-        android:title="@string/pref_force_userscalable"
-        android:summary="@string/pref_force_userscalable_summary"
-        android:defaultValue="false" />
-
     <PreferenceCategory android:title="@string/pref_font_size_category">
-        <com.android.browser.preferences.FontSizePreview
-            android:title="@string/preview" />
+        <com.android.browser.preferences.FontSizePreview android:title="@string/preview" />
         <com.android.browser.preferences.SeekBarSummaryPreference
-            android:key="text_zoom"
-            android:title="@string/pref_text_zoom"
             android:defaultValue="10"
-            android:max="30" />
+            android:key="text_zoom"
+            android:max="30"
+            android:title="@string/pref_text_zoom" />
 
-        <!-- SWE - remove double tap zoom from settings.
         <com.android.browser.preferences.SeekBarSummaryPreference
-            android:key="double_tap_zoom"
-            android:title="@string/pref_zoom_on_double_tap"
-            android:defaultValue="5"
-            android:max="10" />
-        -->
-        <com.android.browser.preferences.SeekBarSummaryPreference
-            android:key="min_font_size"
-            android:title="@string/pref_min_font_size"
             android:defaultValue="0"
-            android:max="20" />
+            android:key="min_font_size"
+            android:max="20"
+            android:title="@string/pref_min_font_size" />
+
+        <CheckBoxPreference
+            android:defaultValue="false"
+            android:key="force_userscalable"
+            android:summary="@string/pref_force_userscalable_summary"
+            android:title="@string/pref_force_userscalable" />
+
+        <ListPreference
+            android:defaultValue="MEDIUM"
+            android:dialogTitle="@string/pref_default_zoom_dialogtitle"
+            android:entries="@array/pref_default_zoom_choices"
+            android:entryValues="@array/pref_default_zoom_values"
+            android:key="default_zoom"
+            android:title="@string/pref_default_zoom" />
+
     </PreferenceCategory>
 
     <!-- // SWE_TODO: Commenting out inverted rendering settings
diff --git a/res/xml/general_preferences.xml b/res/xml/general_preferences.xml
index b7caa37..7c21b3a 100644
--- a/res/xml/general_preferences.xml
+++ b/res/xml/general_preferences.xml
@@ -137,60 +137,9 @@
 
         </PreferenceScreen>
 
-        <PreferenceScreen android:title="@string/pref_accessibility_title">
-
-            <PreferenceCategory android:title="@string/pref_font_size_category">
-                <com.android.browser.preferences.FontSizePreview android:title="@string/preview" />
-                <com.android.browser.preferences.SeekBarSummaryPreference
-                    android:defaultValue="10"
-                    android:key="text_zoom"
-                    android:max="30"
-                    android:title="@string/pref_text_zoom" />
-
-                <com.android.browser.preferences.SeekBarSummaryPreference
-                    android:defaultValue="0"
-                    android:key="min_font_size"
-                    android:max="20"
-                    android:title="@string/pref_min_font_size" />
-
-                <CheckBoxPreference
-                    android:defaultValue="false"
-                    android:key="force_userscalable"
-                    android:summary="@string/pref_force_userscalable_summary"
-                    android:title="@string/pref_force_userscalable" />
-
-                <ListPreference
-                    android:defaultValue="MEDIUM"
-                    android:dialogTitle="@string/pref_default_zoom_dialogtitle"
-                    android:entries="@array/pref_default_zoom_choices"
-                    android:entryValues="@array/pref_default_zoom_values"
-                    android:key="default_zoom"
-                    android:title="@string/pref_default_zoom" />
-
-            </PreferenceCategory>
-
-            <!-- // SWE_TODO: Commenting out inverted rendering settings
-            <PreferenceCategory android:title="@string/pref_inverted_category">
-
-                <com.android.browser.preferences.InvertedContrastPreview
-                    android:title="@string/preview" />
-
-                <CheckBoxPreference
-                    android:key="inverted"
-                    android:defaultValue="false"
-                    android:title="@string/pref_inverted"
-                    android:summary="@string/pref_inverted_summary" />
-
-                <com.android.browser.preferences.SeekBarSummaryPreference
-                    android:key="inverted_contrast"
-                    android:title="@string/pref_inverted_contrast"
-                    android:dependency="inverted"
-                    android:defaultValue="0"
-                    android:max="20" />
-            </PreferenceCategory>
-            -->
-
-        </PreferenceScreen>
+        <PreferenceScreen
+            android:key="accessibility_menu"
+            android:title="@string/pref_accessibility_title" />
 
 
         <PreferenceScreen android:title="@string/pref_content_title">