Fixes PreferenceScreen padding and scrollbar position.
Bug: 6399996
Changed the scrollbarStyle for tablets
Bug: 6405440
Inflate the listview from a layout with padding.
Change-Id: I838bb073ee2f0e23ac7163cc632679278dbccf05
diff --git a/core/java/android/preference/PreferenceScreen.java b/core/java/android/preference/PreferenceScreen.java
index 8b99459..c17111a 100644
--- a/core/java/android/preference/PreferenceScreen.java
+++ b/core/java/android/preference/PreferenceScreen.java
@@ -24,6 +24,7 @@
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.AttributeSet;
+import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.widget.AbsListView;
@@ -153,7 +154,12 @@
if (mListView != null) {
mListView.setAdapter(null);
}
- mListView = new ListView(context);
+
+ LayoutInflater inflater = (LayoutInflater)
+ context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ View childPrefScreen = inflater.inflate(
+ com.android.internal.R.layout.preference_list_fragment, null);
+ mListView = (ListView) childPrefScreen.findViewById(android.R.id.list);
bind(mListView);
// Set the title bar if title is available, else no title bar
@@ -164,7 +170,7 @@
} else {
dialog.setTitle(title);
}
- dialog.setContentView(mListView);
+ dialog.setContentView(childPrefScreen);
dialog.setOnDismissListener(this);
if (state != null) {
dialog.onRestoreInstanceState(state);