field public static final int port = 16842793; // 0x1010029
field public static final int positiveButtonText = 16843253; // 0x10101f5
field public static final int preferenceCategoryStyle = 16842892; // 0x101008c
+ field public static final int preferenceFragmentStyle = 16844039; // 0x1010507
field public static final int preferenceInformationStyle = 16842893; // 0x101008d
field public static final int preferenceLayoutChild = 16842900; // 0x1010094
field public static final int preferenceScreenStyle = 16842891; // 0x101008b
field public static final int icon = 16908294; // 0x1020006
field public static final int icon1 = 16908295; // 0x1020007
field public static final int icon2 = 16908296; // 0x1020008
+ field public static final int icon_frame = 16908350; // 0x102003e
field public static final int input = 16908297; // 0x1020009
field public static final int inputArea = 16908318; // 0x102001e
field public static final int inputExtractEditText = 16908325; // 0x1020025
field public static final int keyboardView = 16908326; // 0x1020026
field public static final int list = 16908298; // 0x102000a
+ field public static final int list_container = 16908351; // 0x102003f
field public static final int mask = 16908334; // 0x102002e
field public static final int message = 16908299; // 0x102000b
field public static final int navigationBarBackground = 16908336; // 0x1020030
field public static final int stopSelectingText = 16908329; // 0x1020029
field public static final int summary = 16908304; // 0x1020010
field public static final int switchInputMethod = 16908324; // 0x1020024
+ field public static final int switch_widget = 16908352; // 0x1020040
field public static final int tabcontent = 16908305; // 0x1020011
field public static final int tabhost = 16908306; // 0x1020012
field public static final int tabs = 16908307; // 0x1020013
field public static final int port = 16842793; // 0x1010029
field public static final int positiveButtonText = 16843253; // 0x10101f5
field public static final int preferenceCategoryStyle = 16842892; // 0x101008c
+ field public static final int preferenceFragmentStyle = 16844039; // 0x1010507
field public static final int preferenceInformationStyle = 16842893; // 0x101008d
field public static final int preferenceLayoutChild = 16842900; // 0x1010094
field public static final int preferenceScreenStyle = 16842891; // 0x101008b
field public static final int icon = 16908294; // 0x1020006
field public static final int icon1 = 16908295; // 0x1020007
field public static final int icon2 = 16908296; // 0x1020008
+ field public static final int icon_frame = 16908350; // 0x102003e
field public static final int input = 16908297; // 0x1020009
field public static final int inputArea = 16908318; // 0x102001e
field public static final int inputExtractEditText = 16908325; // 0x1020025
field public static final int keyboardView = 16908326; // 0x1020026
field public static final int list = 16908298; // 0x102000a
+ field public static final int list_container = 16908351; // 0x102003f
field public static final int mask = 16908334; // 0x102002e
field public static final int message = 16908299; // 0x102000b
field public static final int navigationBarBackground = 16908336; // 0x1020030
field public static final int stopSelectingText = 16908329; // 0x1020029
field public static final int summary = 16908304; // 0x1020010
field public static final int switchInputMethod = 16908324; // 0x1020024
+ field public static final int switch_widget = 16908352; // 0x1020040
field public static final int tabcontent = 16908305; // 0x1020011
field public static final int tabhost = 16908306; // 0x1020012
field public static final int tabs = 16908307; // 0x1020013
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
-import android.view.ViewGroup;
import android.view.View.OnKeyListener;
+import android.view.ViewGroup;
import android.widget.ListView;
/**
}
@Override
+ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+
+ TypedArray a = getActivity().obtainStyledAttributes(null,
+ com.android.internal.R.styleable.PreferenceFragment,
+ com.android.internal.R.attr.preferenceFragmentStyle,
+ 0);
+
+ ListView lv = (ListView) view.findViewById(android.R.id.list);
+ if (lv != null) {
+ Drawable divider =
+ a.getDrawable(com.android.internal.R.styleable.PreferenceFragment_divider);
+ if (divider != null) {
+ lv.setDivider(divider);
+ }
+ }
+
+ a.recycle();
+ }
+
+ @Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
protected void onBindView(View view) {
super.onBindView(view);
- View checkableView = view.findViewById(com.android.internal.R.id.switchWidget);
+ View checkableView = view.findViewById(com.android.internal.R.id.switch_widget);
if (checkableView != null && checkableView instanceof Checkable) {
if (checkableView instanceof Switch) {
final Switch switchView = (Switch) checkableView;
android:background="@android:color/transparent"
android:layout_removeBorders="true">
- <ListView android:id="@android:id/list"
- style="?attr/preferenceFragmentListStyle"
+ <FrameLayout
+ android:id="@android:id/list_container"
android:layout_width="match_parent"
android:layout_height="0px"
- android:layout_weight="1"
- android:paddingTop="0dip"
- android:paddingBottom="@dimen/preference_fragment_padding_bottom"
- android:scrollbarStyle="@integer/preference_fragment_scrollbarStyle"
- android:clipToPadding="false"
- android:drawSelectorOnTop="false"
- android:cacheColorHint="@android:color/transparent"
- android:scrollbarAlwaysDrawVerticalTrack="true" />
+ android:layout_weight="1">
+ <ListView android:id="@android:id/list"
+ style="?attr/preferenceFragmentListStyle"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingTop="0dip"
+ android:paddingBottom="@dimen/preference_fragment_padding_bottom"
+ android:scrollbarStyle="@integer/preference_fragment_scrollbarStyle"
+ android:clipToPadding="false"
+ android:drawSelectorOnTop="false"
+ android:cacheColorHint="@android:color/transparent"
+ android:scrollbarAlwaysDrawVerticalTrack="true" />
+ </FrameLayout>
<TextView android:id="@android:id/empty"
android:layout_width="match_parent"
android:background="@android:color/transparent"
android:layout_removeBorders="true">
- <ListView android:id="@android:id/list"
- style="?attr/preferenceFragmentListStyle"
+ <FrameLayout
+ android:id="@android:id/list_container"
android:layout_width="match_parent"
android:layout_height="0px"
- android:layout_weight="1"
- android:paddingTop="0dip"
- android:paddingBottom="@dimen/preference_fragment_padding_bottom"
- android:scrollbarStyle="@integer/preference_fragment_scrollbarStyle"
- android:clipToPadding="false"
- android:drawSelectorOnTop="false"
- android:cacheColorHint="@android:color/transparent"
- android:scrollbarAlwaysDrawVerticalTrack="true" />
+ android:layout_weight="1">
+ <ListView android:id="@android:id/list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingTop="0dip"
+ android:paddingBottom="@dimen/preference_fragment_padding_bottom"
+ style="?attr/preferenceFragmentListStyle"
+ android:scrollbarStyle="@integer/preference_fragment_scrollbarStyle"
+ android:clipToPadding="false"
+ android:drawSelectorOnTop="false"
+ android:cacheColorHint="@android:color/transparent"
+ android:scrollbarAlwaysDrawVerticalTrack="true" />
+ </FrameLayout>
<TextView android:id="@android:id/empty"
android:layout_width="match_parent"
<!-- Layout used by SwitchPreference for the switch widget style. This is inflated
inside android.R.layout.preference. -->
<Switch xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+android:id/switchWidget"
+ android:id="@+android:id/switch_widget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
<declare-styleable name="PreferenceFragment">
<!-- The layout for the PreferenceFragment. This should rarely need to be changed. -->
<attr name="layout" />
+ <attr name="divider" />
</declare-styleable>
<!-- Base attributes available to PreferenceActivity. -->
<item type="id" name="empty" />
<item type="id" name="hint" />
<item type="id" name="icon" />
+ <item type="id" name="icon_frame" />
<item type="id" name="icon_badge" />
<item type="id" name="icon1" />
<item type="id" name="icon2" />
<item type="id" name="input" />
<item type="id" name="left_icon" />
<item type="id" name="list" />
+ <item type="id" name="list_container" />
<item type="id" name="menu" />
<item type="id" name="message" />
<item type="id" name="primary" />
<item type="id" name="lock_screen" />
<item type="id" name="edit" />
<item type="id" name="widget_frame" />
+ <item type="id" name="switch_widget" />
<item type="id" name="button1" />
<item type="id" name="button2" />
<item type="id" name="button3" />
<public type="attr" name="windowBackgroundFallback" />
<public type="attr" name="forceDeviceEncrypted" />
<public type="attr" name="encryptionAware" />
+ <public type="attr" name="preferenceFragmentStyle" />
<public type="style" name="Theme.Material.DayNight" />
<public type="style" name="Theme.Material.DayNight.DarkActionBar" />
<public type="style" name="Theme.Material.DayNight.DialogWhenLarge.DarkActionBar" />
<public type="id" name="accessibilityActionSetProgress" />
+ <public type="id" name="icon_frame" />
+ <public type="id" name="list_container" />
+ <public type="id" name="switch_widget" />
</resources>
<item name="layout">@layout/preference_list_fragment_material</item>
<item name="paddingStart">@dimen/preference_fragment_padding_side_material</item>
<item name="paddingEnd">@dimen/preference_fragment_padding_side_material</item>
+ <item name="divider">?attr/listDivider</item>
</style>
<style name="PreferenceActivity.Material">
<java-symbol type="id" name="submit_area" />
<java-symbol type="id" name="switch_new" />
<java-symbol type="id" name="switch_old" />
- <java-symbol type="id" name="switchWidget" />
+ <java-symbol type="id" name="switch_widget" />
<java-symbol type="id" name="text" />
<java-symbol type="id" name="time" />
<java-symbol type="id" name="time_current" />