Merge changes from topic "preferences-v14"
* changes:
[automerger] Merge preference-v14 with preference-v7. am: d2965aa084
Merge preference-v14 with preference-v7.
diff --git a/v14/preference/Android.mk b/v14/preference/Android.mk
index 5228624..3d2394f 100644
--- a/v14/preference/Android.mk
+++ b/v14/preference/Android.mk
@@ -29,15 +29,15 @@
LOCAL_USE_AAPT2 := true
LOCAL_MODULE := android-support-v14-preference
LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
-LOCAL_SRC_FILES := $(call all-java-files-under,src/main/java)
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_JAVA_LIBRARIES := \
android-support-annotations
LOCAL_SHARED_ANDROID_LIBRARIES := \
- android-support-v7-preference \
android-support-v7-appcompat \
android-support-v7-recyclerview \
android-support-v4
+LOCAL_STATIC_ANDROID_LIBRARIES := \
+ android-support-v7-preference
+LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_JAR_EXCLUDE_FILES := none
LOCAL_JAVA_LANGUAGE_VERSION := 1.7
LOCAL_AAPT_FLAGS := --add-javadoc-annotation doconly
diff --git a/v14/preference/lint-baseline.xml b/v14/preference/lint-baseline.xml
deleted file mode 100644
index 2785493..0000000
--- a/v14/preference/lint-baseline.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<issues format="4" by="lint 3.0.0-alpha9">
-
- <issue
- id="Suspicious0dp"
- message="Suspicious size: this will make the view invisible, should be used with `layout_weight`"
- errorLine1=" android:layout_width="0dp""
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="res/layout-v17/preference_dropdown_material.xml"
- line="32"
- column="9"/>
- </issue>
-
- <issue
- id="Suspicious0dp"
- message="Suspicious size: this will make the view invisible, should be used with `layout_weight`"
- errorLine1=" android:layout_width="0dp""
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="res/layout-v21/preference_dropdown_material.xml"
- line="32"
- column="9"/>
- </issue>
-
- <issue
- id="Suspicious0dp"
- message="Suspicious size: this will make the view invisible, should be used with `layout_weight`"
- errorLine1=" android:layout_width="0dp""
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="res/layout/preference_dropdown_material.xml"
- line="32"
- column="9"/>
- </issue>
-
-</issues>
diff --git a/v14/preference/res/values-v17/styles.xml b/v14/preference/res/values-v17/styles.xml
deleted file mode 100644
index e0b478f..0000000
--- a/v14/preference/res/values-v17/styles.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2015 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License
- -->
-
-<resources>
- <style name="PreferenceFragmentList.Material">
- <item name="android:paddingStart">0dp</item>
- <item name="android:paddingEnd">0dp</item>
- </style>
-
-</resources>
diff --git a/v14/preference/res/values/attrs.xml b/v14/preference/res/values/attrs.xml
deleted file mode 100644
index 7a3cd51..0000000
--- a/v14/preference/res/values/attrs.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2015 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License
- -->
-
-<resources>
- <declare-styleable name="SwitchPreference">
- <!-- The summary for the Preference in a PreferenceActivity screen when the
- SwitchPreference is checked. If separate on/off summaries are not
- needed, the summary attribute can be used instead. -->
- <attr name="summaryOn" />
- <attr name="android:summaryOn" />
- <!-- The summary for the Preference in a PreferenceActivity screen when the
- SwitchPreference is unchecked. If separate on/off summaries are not
- needed, the summary attribute can be used instead. -->
- <attr name="summaryOff" />
- <attr name="android:summaryOff" />
- <!-- The text used on the switch itself when in the "on" state.
- This should be a very SHORT string, as it appears in a small space. -->
- <attr name="switchTextOn"/>
- <attr name="android:switchTextOn"/>
- <!-- The text used on the switch itself when in the "off" state.
- This should be a very SHORT string, as it appears in a small space. -->
- <attr name="switchTextOff" />
- <attr name="android:switchTextOff" />
- <!-- The state (true for on, or false for off) that causes dependents to be disabled. By default,
- dependents will be disabled when this is unchecked, so the value of this preference is false. -->
- <attr name="disableDependentsState" />
- <attr name="android:disableDependentsState" />
- </declare-styleable>
-
- <!-- Base attributes available to PreferenceFragment. -->
- <declare-styleable name="PreferenceFragment">
- <!-- The layout for the PreferenceFragment. This should rarely need to be changed. -->
- <attr name="android:layout" />
- <!-- List separator to draw between preference views -->
- <attr name="android:divider" />
- <!-- List separator height -->
- <attr name="android:dividerHeight" />
- <!-- Whether a divider is allowed to draw after the last item -->
- <attr name="allowDividerAfterLastItem" />
- </declare-styleable>
-
-</resources>
diff --git a/v14/preference/res/values/styles.xml b/v14/preference/res/values/styles.xml
deleted file mode 100644
index 26b1544..0000000
--- a/v14/preference/res/values/styles.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2015 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License
- -->
-
-<resources xmlns:tools="http://schemas.android.com/tools">
- <style name="Preference.SwitchPreference">
- <item name="android:widgetLayout">@layout/preference_widget_switch</item>
- <item name="android:switchTextOn">@string/v7_preference_on</item>
- <item name="android:switchTextOff">@string/v7_preference_off</item>
- </style>
-
- <style name="Preference.Material">
- <item name="android:layout">@layout/preference_material</item>
- </style>
-
- <style name="Preference.Information.Material">
- <item name="android:layout">@layout/preference_information_material</item>
- <item name="android:enabled">false</item>
- <item name="android:shouldDisableView">false</item>
- </style>
-
- <style name="Preference.Category.Material">
- <item name="android:layout">@layout/preference_category_material</item>
- </style>
-
- <style name="Preference.CheckBoxPreference.Material">
- <item name="android:layout">@layout/preference_material</item>
- </style>
-
- <style name="Preference.SwitchPreferenceCompat.Material">
- <item name="android:layout">@layout/preference_material</item>
- </style>
-
- <style name="Preference.SwitchPreference.Material">
- <item name="android:layout">@layout/preference_material</item>
- </style>
-
- <style name="Preference.SeekBarPreference.Material">
- <item name="android:layout">@layout/preference_widget_seekbar_material</item>
- <item name="adjustable">true</item>
- <item name="showSeekBarValue">true</item>
- </style>
-
- <style name="Preference.PreferenceScreen.Material">
- <item name="android:layout">@layout/preference_material</item>
- </style>
-
- <style name="Preference.DialogPreference.Material">
- <item name="android:layout">@layout/preference_material</item>
- </style>
-
- <style name="Preference.DialogPreference.EditTextPreference.Material">
- <item name="android:layout">@layout/preference_material</item>
- </style>
-
- <style name="Preference.DropDown.Material">
- <item name="android:layout">@layout/preference_dropdown_material</item>
- </style>
-
- <style name="Preference_TextAppearanceMaterialBody2">
- <item name="android:textSize">14sp</item>
- <item tools:ignore="NewApi" name="android:fontFamily">sans-serif</item>
- <item name="android:textColor">?android:attr/textColorPrimary</item>
- <item name="android:textStyle">normal</item>
- </style>
-
- <style name="Preference_TextAppearanceMaterialSubhead">
- <item name="android:textSize">16sp</item>
- <item tools:ignore="NewApi" name="android:fontFamily">sans-serif</item>
- <item name="android:textColor">?android:attr/textColorPrimary</item>
- <item name="android:textStyle">normal</item>
- </style>
-
- <style name="PreferenceFragment.Material">
- <item name="android:divider">@drawable/preference_list_divider_material</item>
- </style>
-
- <style name="PreferenceFragmentList.Material">
- <item name="android:paddingLeft">0dp</item>
- <item name="android:paddingRight">0dp</item>
- </style>
-
-</resources>
diff --git a/v14/preference/res/values/themes.xml b/v14/preference/res/values/themes.xml
deleted file mode 100644
index a69126f..0000000
--- a/v14/preference/res/values/themes.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2015 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License
- -->
-
-<resources>
- <style name="PreferenceThemeOverlay.v14">
- <item name="switchPreferenceStyle">@style/Preference.SwitchPreference</item>
- <item name="preferenceFragmentStyle">@style/PreferenceFragment</item>
- </style>
-
- <style name="PreferenceThemeOverlay.v14.Material">
- <item name="preferenceScreenStyle">@style/Preference.PreferenceScreen.Material</item>
- <item name="preferenceFragmentCompatStyle">@style/PreferenceFragment.Material</item>
- <item name="preferenceFragmentStyle">@style/PreferenceFragment.Material</item>
- <item name="preferenceCategoryStyle">@style/Preference.Category.Material</item>
- <item name="preferenceStyle">@style/Preference.Material</item>
- <item name="preferenceInformationStyle">@style/Preference.Information.Material</item>
- <item name="checkBoxPreferenceStyle">@style/Preference.CheckBoxPreference.Material</item>
- <item name="switchPreferenceCompatStyle">@style/Preference.SwitchPreferenceCompat.Material</item>
- <item name="switchPreferenceStyle">@style/Preference.SwitchPreference.Material</item>
- <item name="seekBarPreferenceStyle">@style/Preference.SeekBarPreference.Material</item>
- <item name="dialogPreferenceStyle">@style/Preference.DialogPreference.Material</item>
- <item name="editTextPreferenceStyle">@style/Preference.DialogPreference.EditTextPreference.Material</item>
- <item name="dropdownPreferenceStyle">@style/Preference.DropDown.Material</item>
- <item name="preferenceFragmentListStyle">@style/PreferenceFragmentList.Material</item>
- </style>
-</resources>
diff --git a/v7/preference/api/current.txt b/v7/preference/api/current.txt
index 1b2a746..ad64841 100644
--- a/v7/preference/api/current.txt
+++ b/v7/preference/api/current.txt
@@ -1,3 +1,101 @@
+package android.support.v14.preference {
+
+ public class EditTextPreferenceDialogFragment extends android.support.v14.preference.PreferenceDialogFragment {
+ ctor public EditTextPreferenceDialogFragment();
+ method public static android.support.v14.preference.EditTextPreferenceDialogFragment newInstance(java.lang.String);
+ method public void onDialogClosed(boolean);
+ }
+
+ public class ListPreferenceDialogFragment extends android.support.v14.preference.PreferenceDialogFragment {
+ ctor public ListPreferenceDialogFragment();
+ method public static android.support.v14.preference.ListPreferenceDialogFragment newInstance(java.lang.String);
+ method public void onDialogClosed(boolean);
+ }
+
+ public class MultiSelectListPreference extends android.support.v7.preference.DialogPreference {
+ ctor public MultiSelectListPreference(android.content.Context, android.util.AttributeSet, int, int);
+ ctor public MultiSelectListPreference(android.content.Context, android.util.AttributeSet, int);
+ ctor public MultiSelectListPreference(android.content.Context, android.util.AttributeSet);
+ ctor public MultiSelectListPreference(android.content.Context);
+ method public int findIndexOfValue(java.lang.String);
+ method public java.lang.CharSequence[] getEntries();
+ method public java.lang.CharSequence[] getEntryValues();
+ method protected boolean[] getSelectedItems();
+ method public java.util.Set<java.lang.String> getValues();
+ method public void setEntries(java.lang.CharSequence[]);
+ method public void setEntries(int);
+ method public void setEntryValues(java.lang.CharSequence[]);
+ method public void setEntryValues(int);
+ method public void setValues(java.util.Set<java.lang.String>);
+ }
+
+ public class MultiSelectListPreferenceDialogFragment extends android.support.v14.preference.PreferenceDialogFragment {
+ ctor public MultiSelectListPreferenceDialogFragment();
+ method public static android.support.v14.preference.MultiSelectListPreferenceDialogFragment newInstance(java.lang.String);
+ method public void onDialogClosed(boolean);
+ }
+
+ public abstract class PreferenceDialogFragment extends android.app.DialogFragment implements android.content.DialogInterface.OnClickListener {
+ ctor public PreferenceDialogFragment();
+ method public android.support.v7.preference.DialogPreference getPreference();
+ method protected void onBindDialogView(android.view.View);
+ method public void onClick(android.content.DialogInterface, int);
+ method protected android.view.View onCreateDialogView(android.content.Context);
+ method public abstract void onDialogClosed(boolean);
+ method protected void onPrepareDialogBuilder(android.app.AlertDialog.Builder);
+ field protected static final java.lang.String ARG_KEY = "key";
+ }
+
+ public abstract class PreferenceFragment extends android.app.Fragment implements android.support.v7.preference.DialogPreference.TargetFragment android.support.v7.preference.PreferenceManager.OnDisplayPreferenceDialogListener android.support.v7.preference.PreferenceManager.OnNavigateToScreenListener android.support.v7.preference.PreferenceManager.OnPreferenceTreeClickListener {
+ ctor public PreferenceFragment();
+ method public void addPreferencesFromResource(int);
+ method public android.support.v7.preference.Preference findPreference(java.lang.CharSequence);
+ method public final android.support.v7.widget.RecyclerView getListView();
+ method public android.support.v7.preference.PreferenceManager getPreferenceManager();
+ method public android.support.v7.preference.PreferenceScreen getPreferenceScreen();
+ method protected android.support.v7.widget.RecyclerView.Adapter onCreateAdapter(android.support.v7.preference.PreferenceScreen);
+ method public android.support.v7.widget.RecyclerView.LayoutManager onCreateLayoutManager();
+ method public abstract void onCreatePreferences(android.os.Bundle, java.lang.String);
+ method public android.support.v7.widget.RecyclerView onCreateRecyclerView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle);
+ method public void onDisplayPreferenceDialog(android.support.v7.preference.Preference);
+ method public void onNavigateToScreen(android.support.v7.preference.PreferenceScreen);
+ method public boolean onPreferenceTreeClick(android.support.v7.preference.Preference);
+ method public void scrollToPreference(java.lang.String);
+ method public void scrollToPreference(android.support.v7.preference.Preference);
+ method public void setDivider(android.graphics.drawable.Drawable);
+ method public void setDividerHeight(int);
+ method public void setPreferenceScreen(android.support.v7.preference.PreferenceScreen);
+ method public void setPreferencesFromResource(int, java.lang.String);
+ field public static final java.lang.String ARG_PREFERENCE_ROOT = "android.support.v7.preference.PreferenceFragmentCompat.PREFERENCE_ROOT";
+ }
+
+ public static abstract interface PreferenceFragment.OnPreferenceDisplayDialogCallback {
+ method public abstract boolean onPreferenceDisplayDialog(android.support.v14.preference.PreferenceFragment, android.support.v7.preference.Preference);
+ }
+
+ public static abstract interface PreferenceFragment.OnPreferenceStartFragmentCallback {
+ method public abstract boolean onPreferenceStartFragment(android.support.v14.preference.PreferenceFragment, android.support.v7.preference.Preference);
+ }
+
+ public static abstract interface PreferenceFragment.OnPreferenceStartScreenCallback {
+ method public abstract boolean onPreferenceStartScreen(android.support.v14.preference.PreferenceFragment, android.support.v7.preference.PreferenceScreen);
+ }
+
+ public class SwitchPreference extends android.support.v7.preference.TwoStatePreference {
+ ctor public SwitchPreference(android.content.Context, android.util.AttributeSet, int, int);
+ ctor public SwitchPreference(android.content.Context, android.util.AttributeSet, int);
+ ctor public SwitchPreference(android.content.Context, android.util.AttributeSet);
+ ctor public SwitchPreference(android.content.Context);
+ method public java.lang.CharSequence getSwitchTextOff();
+ method public java.lang.CharSequence getSwitchTextOn();
+ method public void setSwitchTextOff(java.lang.CharSequence);
+ method public void setSwitchTextOff(int);
+ method public void setSwitchTextOn(java.lang.CharSequence);
+ method public void setSwitchTextOn(int);
+ }
+
+}
+
package android.support.v7.preference {
public class CheckBoxPreference extends android.support.v7.preference.TwoStatePreference {
diff --git a/v7/preference/build.gradle b/v7/preference/build.gradle
index 2000ddd..860679c 100644
--- a/v7/preference/build.gradle
+++ b/v7/preference/build.gradle
@@ -41,11 +41,6 @@
]
}
- lintOptions {
- // Remove this once all NewApi breakages have been fixed.
- disable "NewApi"
- }
-
buildTypes.all {
consumerProguardFiles 'proguard-rules.pro'
}
diff --git a/v7/preference/lint-baseline.xml b/v7/preference/lint-baseline.xml
index 1f3ddab..a069f13 100644
--- a/v7/preference/lint-baseline.xml
+++ b/v7/preference/lint-baseline.xml
@@ -67,4 +67,37 @@
column="9"/>
</issue>
+ <issue
+ id="Suspicious0dp"
+ message="Suspicious size: this will make the view invisible, should be used with `layout_weight`"
+ errorLine1=" android:layout_width="0dp""
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="res/layout-v17/preference_dropdown_material.xml"
+ line="32"
+ column="9"/>
+ </issue>
+
+ <issue
+ id="Suspicious0dp"
+ message="Suspicious size: this will make the view invisible, should be used with `layout_weight`"
+ errorLine1=" android:layout_width="0dp""
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="res/layout-v21/preference_dropdown_material.xml"
+ line="32"
+ column="9"/>
+ </issue>
+
+ <issue
+ id="Suspicious0dp"
+ message="Suspicious size: this will make the view invisible, should be used with `layout_weight`"
+ errorLine1=" android:layout_width="0dp""
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="res/layout/preference_dropdown_material.xml"
+ line="32"
+ column="9"/>
+ </issue>
+
</issues>
diff --git a/v14/preference/res/drawable-v21/preference_list_divider_material.xml b/v7/preference/res/drawable-v21/preference_list_divider_material.xml
similarity index 100%
rename from v14/preference/res/drawable-v21/preference_list_divider_material.xml
rename to v7/preference/res/drawable-v21/preference_list_divider_material.xml
diff --git a/v14/preference/res/drawable/preference_list_divider_material.xml b/v7/preference/res/drawable/preference_list_divider_material.xml
similarity index 100%
rename from v14/preference/res/drawable/preference_list_divider_material.xml
rename to v7/preference/res/drawable/preference_list_divider_material.xml
diff --git a/v14/preference/res/layout-v17/preference_category_material.xml b/v7/preference/res/layout-v17/preference_category_material.xml
similarity index 100%
rename from v14/preference/res/layout-v17/preference_category_material.xml
rename to v7/preference/res/layout-v17/preference_category_material.xml
diff --git a/v14/preference/res/layout-v17/preference_dropdown_material.xml b/v7/preference/res/layout-v17/preference_dropdown_material.xml
similarity index 100%
rename from v14/preference/res/layout-v17/preference_dropdown_material.xml
rename to v7/preference/res/layout-v17/preference_dropdown_material.xml
diff --git a/v14/preference/res/layout-v17/preference_information_material.xml b/v7/preference/res/layout-v17/preference_information_material.xml
similarity index 100%
rename from v14/preference/res/layout-v17/preference_information_material.xml
rename to v7/preference/res/layout-v17/preference_information_material.xml
diff --git a/v14/preference/res/layout-v17/preference_material.xml b/v7/preference/res/layout-v17/preference_material.xml
similarity index 100%
rename from v14/preference/res/layout-v17/preference_material.xml
rename to v7/preference/res/layout-v17/preference_material.xml
diff --git a/v14/preference/res/layout-v21/preference_category_material.xml b/v7/preference/res/layout-v21/preference_category_material.xml
similarity index 100%
rename from v14/preference/res/layout-v21/preference_category_material.xml
rename to v7/preference/res/layout-v21/preference_category_material.xml
diff --git a/v14/preference/res/layout-v21/preference_dropdown_material.xml b/v7/preference/res/layout-v21/preference_dropdown_material.xml
similarity index 100%
rename from v14/preference/res/layout-v21/preference_dropdown_material.xml
rename to v7/preference/res/layout-v21/preference_dropdown_material.xml
diff --git a/v14/preference/res/layout-v21/preference_information_material.xml b/v7/preference/res/layout-v21/preference_information_material.xml
similarity index 100%
rename from v14/preference/res/layout-v21/preference_information_material.xml
rename to v7/preference/res/layout-v21/preference_information_material.xml
diff --git a/v14/preference/res/layout-v21/preference_material.xml b/v7/preference/res/layout-v21/preference_material.xml
similarity index 100%
rename from v14/preference/res/layout-v21/preference_material.xml
rename to v7/preference/res/layout-v21/preference_material.xml
diff --git a/v14/preference/res/layout/preference_category_material.xml b/v7/preference/res/layout/preference_category_material.xml
similarity index 100%
rename from v14/preference/res/layout/preference_category_material.xml
rename to v7/preference/res/layout/preference_category_material.xml
diff --git a/v14/preference/res/layout/preference_dropdown_material.xml b/v7/preference/res/layout/preference_dropdown_material.xml
similarity index 100%
rename from v14/preference/res/layout/preference_dropdown_material.xml
rename to v7/preference/res/layout/preference_dropdown_material.xml
diff --git a/v14/preference/res/layout/preference_information_material.xml b/v7/preference/res/layout/preference_information_material.xml
similarity index 100%
rename from v14/preference/res/layout/preference_information_material.xml
rename to v7/preference/res/layout/preference_information_material.xml
diff --git a/v14/preference/res/layout/preference_material.xml b/v7/preference/res/layout/preference_material.xml
similarity index 100%
rename from v14/preference/res/layout/preference_material.xml
rename to v7/preference/res/layout/preference_material.xml
diff --git a/v14/preference/res/layout/preference_widget_seekbar_material.xml b/v7/preference/res/layout/preference_widget_seekbar_material.xml
similarity index 100%
rename from v14/preference/res/layout/preference_widget_seekbar_material.xml
rename to v7/preference/res/layout/preference_widget_seekbar_material.xml
diff --git a/v14/preference/res/layout/preference_widget_switch.xml b/v7/preference/res/layout/preference_widget_switch.xml
similarity index 100%
rename from v14/preference/res/layout/preference_widget_switch.xml
rename to v7/preference/res/layout/preference_widget_switch.xml
diff --git a/v7/preference/res/values-v17/styles.xml b/v7/preference/res/values-v17/styles.xml
index 2184354..a94cf14 100644
--- a/v7/preference/res/values-v17/styles.xml
+++ b/v7/preference/res/values-v17/styles.xml
@@ -27,4 +27,8 @@
<item name="android:paddingEnd">16dp</item>
</style>
+ <style name="PreferenceFragmentList.Material">
+ <item name="android:paddingStart">0dp</item>
+ <item name="android:paddingEnd">0dp</item>
+ </style>
</resources>
diff --git a/v7/preference/res/values/attrs.xml b/v7/preference/res/values/attrs.xml
index 8ab8de1..bb52593 100644
--- a/v7/preference/res/values/attrs.xml
+++ b/v7/preference/res/values/attrs.xml
@@ -303,5 +303,40 @@
<attr name="showSeekBarValue" format="boolean" />
</declare-styleable>
+ <declare-styleable name="SwitchPreference">
+ <!-- The summary for the Preference in a PreferenceActivity screen when the
+ SwitchPreference is checked. If separate on/off summaries are not
+ needed, the summary attribute can be used instead. -->
+ <attr name="summaryOn" />
+ <attr name="android:summaryOn" />
+ <!-- The summary for the Preference in a PreferenceActivity screen when the
+ SwitchPreference is unchecked. If separate on/off summaries are not
+ needed, the summary attribute can be used instead. -->
+ <attr name="summaryOff" />
+ <attr name="android:summaryOff" />
+ <!-- The text used on the switch itself when in the "on" state.
+ This should be a very SHORT string, as it appears in a small space. -->
+ <attr name="switchTextOn"/>
+ <attr name="android:switchTextOn"/>
+ <!-- The text used on the switch itself when in the "off" state.
+ This should be a very SHORT string, as it appears in a small space. -->
+ <attr name="switchTextOff" />
+ <attr name="android:switchTextOff" />
+ <!-- The state (true for on, or false for off) that causes dependents to be disabled. By default,
+ dependents will be disabled when this is unchecked, so the value of this preference is false. -->
+ <attr name="disableDependentsState" />
+ <attr name="android:disableDependentsState" />
+ </declare-styleable>
+ <!-- Base attributes available to PreferenceFragment. -->
+ <declare-styleable name="PreferenceFragment">
+ <!-- The layout for the PreferenceFragment. This should rarely need to be changed. -->
+ <attr name="android:layout" />
+ <!-- List separator to draw between preference views -->
+ <attr name="android:divider" />
+ <!-- List separator height -->
+ <attr name="android:dividerHeight" />
+ <!-- Whether a divider is allowed to draw after the last item -->
+ <attr name="allowDividerAfterLastItem" />
+ </declare-styleable>
</resources>
diff --git a/v14/preference/res/values/colors.xml b/v7/preference/res/values/colors.xml
similarity index 100%
rename from v14/preference/res/values/colors.xml
rename to v7/preference/res/values/colors.xml
diff --git a/v7/preference/res/values/styles.xml b/v7/preference/res/values/styles.xml
index e61a361..46351e1 100644
--- a/v7/preference/res/values/styles.xml
+++ b/v7/preference/res/values/styles.xml
@@ -15,7 +15,7 @@
~ limitations under the License
-->
-<resources>
+<resources xmlns:tools="http://schemas.android.com/tools">
<style name="Preference">
<item name="android:layout">@layout/preference</item>
</style>
@@ -75,4 +75,109 @@
<style name="Preference.DropDown">
<item name="android:layout">@layout/preference_dropdown</item>
</style>
+
+ <style name="Preference.SwitchPreference">
+ <item name="android:widgetLayout">@layout/preference_widget_switch</item>
+ <item name="android:switchTextOn">@string/v7_preference_on</item>
+ <item name="android:switchTextOff">@string/v7_preference_off</item>
+ </style>
+
+ <style name="Preference.Material">
+ <item name="android:layout">@layout/preference_material</item>
+ <item name="allowDividerAbove">false</item>
+ <item name="allowDividerBelow">true</item>
+ <item name="singleLineTitle">false</item>
+ <item name="iconSpaceReserved">true</item>
+ </style>
+
+ <style name="Preference.Information.Material">
+ <item name="android:layout">@layout/preference_information_material</item>
+ <item name="android:enabled">false</item>
+ <item name="android:shouldDisableView">false</item>
+ </style>
+
+ <style name="Preference.Category.Material">
+ <item name="android:layout">@layout/preference_category_material</item>
+ <item name="allowDividerAbove">true</item>
+ <item name="allowDividerBelow">true</item>
+ <item name="iconSpaceReserved">true</item>
+ </style>
+
+ <style name="Preference.CheckBoxPreference.Material">
+ <item name="android:layout">@layout/preference_material</item>
+ <item name="allowDividerAbove">false</item>
+ <item name="allowDividerBelow">true</item>
+ <item name="iconSpaceReserved">true</item>
+ </style>
+
+ <style name="Preference.SwitchPreferenceCompat.Material">
+ <item name="android:layout">@layout/preference_material</item>
+ </style>
+
+ <style name="Preference.SwitchPreference.Material">
+ <item name="android:layout">@layout/preference_material</item>
+ <item name="allowDividerAbove">false</item>
+ <item name="allowDividerBelow">true</item>
+ <item name="singleLineTitle">false</item>
+ <item name="iconSpaceReserved">true</item>
+ </style>
+
+ <style name="Preference.SeekBarPreference.Material">
+ <item name="android:layout">@layout/preference_widget_seekbar_material</item>
+ <item name="adjustable">true</item>
+ <item name="showSeekBarValue">true</item>
+ </style>
+
+ <style name="Preference.PreferenceScreen.Material">
+ <item name="android:layout">@layout/preference_material</item>
+ <item name="allowDividerAbove">false</item>
+ <item name="allowDividerBelow">true</item>
+ <item name="iconSpaceReserved">true</item>
+ </style>
+
+ <style name="Preference.DialogPreference.Material">
+ <item name="android:layout">@layout/preference_material</item>
+ <item name="allowDividerAbove">false</item>
+ <item name="allowDividerBelow">true</item>
+ <item name="iconSpaceReserved">true</item>
+ </style>
+
+ <style name="Preference.DialogPreference.EditTextPreference.Material">
+ <item name="android:layout">@layout/preference_material</item>
+ <item name="allowDividerAbove">false</item>
+ <item name="allowDividerBelow">true</item>
+ <item name="singleLineTitle">false</item>
+ <item name="iconSpaceReserved">true</item>
+ </style>
+
+ <style name="Preference.DropDown.Material">
+ <item name="android:layout">@layout/preference_dropdown_material</item>
+ <item name="allowDividerAbove">false</item>
+ <item name="allowDividerBelow">true</item>
+ <item name="iconSpaceReserved">true</item>
+ </style>
+
+ <style name="Preference_TextAppearanceMaterialBody2">
+ <item name="android:textSize">14sp</item>
+ <item tools:ignore="NewApi" name="android:fontFamily">sans-serif</item>
+ <item name="android:textColor">?android:attr/textColorPrimary</item>
+ <item name="android:textStyle">normal</item>
+ </style>
+
+ <style name="Preference_TextAppearanceMaterialSubhead">
+ <item name="android:textSize">16sp</item>
+ <item tools:ignore="NewApi" name="android:fontFamily">sans-serif</item>
+ <item name="android:textColor">?android:attr/textColorPrimary</item>
+ <item name="android:textStyle">normal</item>
+ </style>
+
+ <style name="PreferenceFragment.Material">
+ <item name="android:divider">@drawable/preference_list_divider_material</item>
+ <item name="allowDividerAfterLastItem">false</item>
+ </style>
+
+ <style name="PreferenceFragmentList.Material">
+ <item name="android:paddingLeft">0dp</item>
+ <item name="android:paddingRight">0dp</item>
+ </style>
</resources>
diff --git a/v7/preference/res/values/themes.xml b/v7/preference/res/values/themes.xml
index af5f469..598c24f 100644
--- a/v7/preference/res/values/themes.xml
+++ b/v7/preference/res/values/themes.xml
@@ -30,4 +30,27 @@
<item name="preferenceFragmentListStyle">@style/PreferenceFragmentList</item>
<item name="dropdownPreferenceStyle">@style/Preference.DropDown</item>
</style>
+
+ <style name="PreferenceThemeOverlay.v14">
+ <item name="switchPreferenceStyle">@style/Preference.SwitchPreference</item>
+ <item name="preferenceFragmentStyle">@style/PreferenceFragment</item>
+ </style>
+
+ <style name="PreferenceThemeOverlay.v14.Material">
+ <item name="preferenceScreenStyle">@style/Preference.PreferenceScreen.Material</item>
+ <item name="preferenceFragmentCompatStyle">@style/PreferenceFragment.Material</item>
+ <item name="preferenceFragmentStyle">@style/PreferenceFragment.Material</item>
+ <item name="preferenceCategoryStyle">@style/Preference.Category.Material</item>
+ <item name="preferenceStyle">@style/Preference.Material</item>
+ <item name="preferenceInformationStyle">@style/Preference.Information.Material</item>
+ <item name="checkBoxPreferenceStyle">@style/Preference.CheckBoxPreference.Material</item>
+ <item name="switchPreferenceCompatStyle">@style/Preference.SwitchPreferenceCompat.Material</item>
+ <item name="switchPreferenceStyle">@style/Preference.SwitchPreference.Material</item>
+ <item name="seekBarPreferenceStyle">@style/Preference.SeekBarPreference.Material</item>
+ <item name="dialogPreferenceStyle">@style/Preference.DialogPreference.Material</item>
+ <item name="editTextPreferenceStyle">@style/Preference.DialogPreference.EditTextPreference.Material</item>
+ <item name="dropdownPreferenceStyle">@style/Preference.DropDown.Material</item>
+ <item name="preferenceFragmentListStyle">@style/PreferenceFragmentList.Material</item>
+ <item name="android:scrollbars">vertical</item>
+ </style>
</resources>
diff --git a/v14/preference/src/main/java/android/support/v14/preference/EditTextPreferenceDialogFragment.java b/v7/preference/src/main/java/android/support/v14/preference/EditTextPreferenceDialogFragment.java
similarity index 96%
rename from v14/preference/src/main/java/android/support/v14/preference/EditTextPreferenceDialogFragment.java
rename to v7/preference/src/main/java/android/support/v14/preference/EditTextPreferenceDialogFragment.java
index 3ee5872..23b8828 100644
--- a/v14/preference/src/main/java/android/support/v14/preference/EditTextPreferenceDialogFragment.java
+++ b/v7/preference/src/main/java/android/support/v14/preference/EditTextPreferenceDialogFragment.java
@@ -11,7 +11,7 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License
+ * limitations under the License.
*/
package android.support.v14.preference;
@@ -65,8 +65,8 @@
mEditText = (EditText) view.findViewById(android.R.id.edit);
if (mEditText == null) {
- throw new IllegalStateException("Dialog view must contain an EditText with id" +
- " @android:id/edit");
+ throw new IllegalStateException("Dialog view must contain an EditText with id"
+ + " @android:id/edit");
}
mEditText.setText(mText);
diff --git a/v14/preference/src/main/java/android/support/v14/preference/ListPreferenceDialogFragment.java b/v7/preference/src/main/java/android/support/v14/preference/ListPreferenceDialogFragment.java
similarity index 98%
rename from v14/preference/src/main/java/android/support/v14/preference/ListPreferenceDialogFragment.java
rename to v7/preference/src/main/java/android/support/v14/preference/ListPreferenceDialogFragment.java
index 6119071..5374cd5 100644
--- a/v14/preference/src/main/java/android/support/v14/preference/ListPreferenceDialogFragment.java
+++ b/v7/preference/src/main/java/android/support/v14/preference/ListPreferenceDialogFragment.java
@@ -11,7 +11,7 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License
+ * limitations under the License.
*/
package android.support.v14.preference;
diff --git a/v14/preference/src/main/java/android/support/v14/preference/MultiSelectListPreference.java b/v7/preference/src/main/java/android/support/v14/preference/MultiSelectListPreference.java
similarity index 83%
rename from v14/preference/src/main/java/android/support/v14/preference/MultiSelectListPreference.java
rename to v7/preference/src/main/java/android/support/v14/preference/MultiSelectListPreference.java
index f34b7dc..16351fe 100644
--- a/v14/preference/src/main/java/android/support/v14/preference/MultiSelectListPreference.java
+++ b/v7/preference/src/main/java/android/support/v14/preference/MultiSelectListPreference.java
@@ -11,7 +11,7 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License
+ * limitations under the License.
*/
package android.support.v14.preference;
@@ -23,6 +23,7 @@
import android.support.annotation.ArrayRes;
import android.support.annotation.NonNull;
import android.support.v4.content.res.TypedArrayUtils;
+import android.support.v7.preference.R;
import android.support.v7.preference.internal.AbstractMultiSelectListPreference;
import android.util.AttributeSet;
@@ -35,7 +36,7 @@
* a dialog.
* <p>
* This preference will store a set of strings into the SharedPreferences.
- * This set will contain one or more values from the
+ * This set will contain one or more mValues from the
* {@link #setEntryValues(CharSequence[])} array.
*
* @attr name android:entries
@@ -51,16 +52,16 @@
super(context, attrs, defStyleAttr, defStyleRes);
final TypedArray a = context.obtainStyledAttributes(attrs,
- android.support.v7.preference.R.styleable.MultiSelectListPreference, defStyleAttr,
+ R.styleable.MultiSelectListPreference, defStyleAttr,
defStyleRes);
mEntries = TypedArrayUtils.getTextArray(a,
- android.support.v7.preference.R.styleable.MultiSelectListPreference_entries,
- android.support.v7.preference.R.styleable.MultiSelectListPreference_android_entries);
+ R.styleable.MultiSelectListPreference_entries,
+ R.styleable.MultiSelectListPreference_android_entries);
mEntryValues = TypedArrayUtils.getTextArray(a,
- android.support.v7.preference.R.styleable.MultiSelectListPreference_entryValues,
- android.support.v7.preference.R.styleable.MultiSelectListPreference_android_entryValues);
+ R.styleable.MultiSelectListPreference_entryValues,
+ R.styleable.MultiSelectListPreference_android_entryValues);
a.recycle();
}
@@ -71,7 +72,7 @@
public MultiSelectListPreference(Context context, AttributeSet attrs) {
this(context, attrs, TypedArrayUtils.getAttr(context,
- android.support.v7.preference.R.attr.dialogPreferenceStyle,
+ R.attr.dialogPreferenceStyle,
android.R.attr.dialogPreferenceStyle));
}
@@ -116,7 +117,7 @@
* entries is selected. If a user clicks on the second item in entries, the
* second item in this array will be saved to the preference.
*
- * @param entryValues The array to be used as values to save for the preference.
+ * @param entryValues The array to be used as mValues to save for the preference.
*/
public void setEntryValues(CharSequence[] entryValues) {
mEntryValues = entryValues;
@@ -124,16 +125,16 @@
/**
* @see #setEntryValues(CharSequence[])
- * @param entryValuesResId The entry values array as a resource.
+ * @param entryValuesResId The entry mValues array as a resource.
*/
public void setEntryValues(@ArrayRes int entryValuesResId) {
setEntryValues(getContext().getResources().getTextArray(entryValuesResId));
}
/**
- * Returns the array of values to be saved for the preference.
+ * Returns the array of mValues to be saved for the preference.
*
- * @return The array of values.
+ * @return The array of mValues.
*/
@Override
public CharSequence[] getEntryValues() {
@@ -144,7 +145,7 @@
* Sets the value of the key. This should contain entries in
* {@link #getEntryValues()}.
*
- * @param values The values to set for the key.
+ * @param values The mValues to set for the key.
*/
@Override
public void setValues(Set<String> values) {
@@ -163,7 +164,7 @@
}
/**
- * Returns the index of the given value (in the entry values array).
+ * Returns the index of the given value (in the entry mValues array).
*
* @param value The value whose index should be returned.
* @return The index of the value, or -1 if not found.
@@ -219,7 +220,7 @@
}
final SavedState myState = new SavedState(superState);
- myState.values = getValues();
+ myState.mValues = getValues();
return myState;
}
@@ -233,31 +234,31 @@
SavedState myState = (SavedState) state;
super.onRestoreInstanceState(myState.getSuperState());
- setValues(myState.values);
+ setValues(myState.mValues);
}
private static class SavedState extends BaseSavedState {
- Set<String> values;
+ Set<String> mValues;
- public SavedState(Parcel source) {
+ SavedState(Parcel source) {
super(source);
final int size = source.readInt();
- values = new HashSet<>();
+ mValues = new HashSet<>();
String[] strings = new String[size];
source.readStringArray(strings);
- Collections.addAll(values, strings);
+ Collections.addAll(mValues, strings);
}
- public SavedState(Parcelable superState) {
+ SavedState(Parcelable superState) {
super(superState);
}
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
- dest.writeInt(values.size());
- dest.writeStringArray(values.toArray(new String[values.size()]));
+ dest.writeInt(mValues.size());
+ dest.writeStringArray(mValues.toArray(new String[mValues.size()]));
}
public static final Parcelable.Creator<SavedState> CREATOR =
diff --git a/v14/preference/src/main/java/android/support/v14/preference/MultiSelectListPreferenceDialogFragment.java b/v7/preference/src/main/java/android/support/v14/preference/MultiSelectListPreferenceDialogFragment.java
similarity index 97%
rename from v14/preference/src/main/java/android/support/v14/preference/MultiSelectListPreferenceDialogFragment.java
rename to v7/preference/src/main/java/android/support/v14/preference/MultiSelectListPreferenceDialogFragment.java
index 8192583..db81644 100644
--- a/v14/preference/src/main/java/android/support/v14/preference/MultiSelectListPreferenceDialogFragment.java
+++ b/v7/preference/src/main/java/android/support/v14/preference/MultiSelectListPreferenceDialogFragment.java
@@ -11,7 +11,7 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License
+ * limitations under the License.
*/
package android.support.v14.preference;
@@ -60,8 +60,8 @@
if (preference.getEntries() == null || preference.getEntryValues() == null) {
throw new IllegalStateException(
- "MultiSelectListPreference requires an entries array and " +
- "an entryValues array.");
+ "MultiSelectListPreference requires an entries array and "
+ + "an entryValues array.");
}
mNewValues.clear();
diff --git a/v14/preference/src/main/java/android/support/v14/preference/PreferenceDialogFragment.java b/v7/preference/src/main/java/android/support/v14/preference/PreferenceDialogFragment.java
similarity index 98%
rename from v14/preference/src/main/java/android/support/v14/preference/PreferenceDialogFragment.java
rename to v7/preference/src/main/java/android/support/v14/preference/PreferenceDialogFragment.java
index e7b9f40..a4ae4a9 100644
--- a/v14/preference/src/main/java/android/support/v14/preference/PreferenceDialogFragment.java
+++ b/v7/preference/src/main/java/android/support/v14/preference/PreferenceDialogFragment.java
@@ -11,7 +11,7 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License
+ * limitations under the License.
*/
package android.support.v14.preference;
@@ -78,8 +78,8 @@
final Fragment rawFragment = getTargetFragment();
if (!(rawFragment instanceof DialogPreference.TargetFragment)) {
- throw new IllegalStateException("Target fragment must implement TargetFragment" +
- " interface");
+ throw new IllegalStateException("Target fragment must implement TargetFragment"
+ + " interface");
}
final DialogPreference.TargetFragment fragment =
@@ -132,9 +132,9 @@
}
}
+ @NonNull
@Override
- public @NonNull
- Dialog onCreateDialog(Bundle savedInstanceState) {
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
final Context context = getActivity();
mWhichButtonClicked = DialogInterface.BUTTON_NEGATIVE;
diff --git a/v14/preference/src/main/java/android/support/v14/preference/PreferenceFragment.java b/v7/preference/src/main/java/android/support/v14/preference/PreferenceFragment.java
similarity index 98%
rename from v14/preference/src/main/java/android/support/v14/preference/PreferenceFragment.java
rename to v7/preference/src/main/java/android/support/v14/preference/PreferenceFragment.java
index 2421050..406465f 100644
--- a/v14/preference/src/main/java/android/support/v14/preference/PreferenceFragment.java
+++ b/v7/preference/src/main/java/android/support/v14/preference/PreferenceFragment.java
@@ -11,7 +11,7 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License
+ * limitations under the License.
*/
package android.support.v14.preference;
@@ -44,6 +44,7 @@
import android.support.v7.preference.PreferenceRecyclerViewAccessibilityDelegate;
import android.support.v7.preference.PreferenceScreen;
import android.support.v7.preference.PreferenceViewHolder;
+import android.support.v7.preference.R;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.TypedValue;
@@ -145,7 +146,7 @@
private final DividerDecoration mDividerDecoration = new DividerDecoration();
private static final int MSG_BIND_PREFERENCES = 1;
- private Handler mHandler = new Handler() {
+ private final Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
@@ -157,7 +158,7 @@
}
};
- final private Runnable mRequestFocus = new Runnable() {
+ private final Runnable mRequestFocus = new Runnable() {
@Override
public void run() {
mList.focusableViewAvailable(mList);
@@ -484,7 +485,7 @@
handled = ((OnPreferenceStartFragmentCallback) getCallbackFragment())
.onPreferenceStartFragment(this, preference);
}
- if (!handled && getActivity() instanceof OnPreferenceStartFragmentCallback){
+ if (!handled && getActivity() instanceof OnPreferenceStartFragmentCallback) {
handled = ((OnPreferenceStartFragmentCallback) getActivity())
.onPreferenceStartFragment(this, preference);
}
@@ -656,8 +657,8 @@
} else if (preference instanceof MultiSelectListPreference) {
f = MultiSelectListPreferenceDialogFragment.newInstance(preference.getKey());
} else {
- throw new IllegalArgumentException("Tried to display dialog for unknown " +
- "preference type. Did you forget to override onDisplayPreferenceDialog()?");
+ throw new IllegalArgumentException("Tried to display dialog for unknown "
+ + "preference type. Did you forget to override onDisplayPreferenceDialog()?");
}
f.setTargetFragment(this, 0);
f.show(getFragmentManager(), DIALOG_FRAGMENT_TAG);
@@ -686,8 +687,7 @@
@Override
public void run() {
final RecyclerView.Adapter adapter = mList.getAdapter();
- if (!(adapter instanceof
- PreferenceGroup.PreferencePositionCallback)) {
+ if (!(adapter instanceof PreferenceGroup.PreferencePositionCallback)) {
if (adapter != null) {
throw new IllegalStateException("Adapter must implement "
+ "PreferencePositionCallback");
@@ -726,7 +726,7 @@
private final Preference mPreference;
private final String mKey;
- public ScrollToPreferenceObserver(RecyclerView.Adapter adapter, RecyclerView list,
+ ScrollToPreferenceObserver(RecyclerView.Adapter adapter, RecyclerView list,
Preference preference, String key) {
mAdapter = adapter;
mList = list;
diff --git a/v14/preference/src/main/java/android/support/v14/preference/SwitchPreference.java b/v7/preference/src/main/java/android/support/v14/preference/SwitchPreference.java
similarity index 92%
rename from v14/preference/src/main/java/android/support/v14/preference/SwitchPreference.java
rename to v7/preference/src/main/java/android/support/v14/preference/SwitchPreference.java
index eae20b8..197de4e 100644
--- a/v14/preference/src/main/java/android/support/v14/preference/SwitchPreference.java
+++ b/v7/preference/src/main/java/android/support/v14/preference/SwitchPreference.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package android.support.v14.preference;
@@ -24,6 +24,7 @@
import android.support.v4.content.res.TypedArrayUtils;
import android.support.v7.preference.AndroidResources;
import android.support.v7.preference.PreferenceViewHolder;
+import android.support.v7.preference.R;
import android.support.v7.preference.TwoStatePreference;
import android.util.AttributeSet;
import android.view.View;