diff --git a/core/java/android/preference/SeekBarPreference.java b/core/java/android/preference/SeekBarPreference.java index e32890deadd87..67f64090db160 100644 --- a/core/java/android/preference/SeekBarPreference.java +++ b/core/java/android/preference/SeekBarPreference.java @@ -40,11 +40,19 @@ public class SeekBarPreference extends Preference Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); - final TypedArray a = context.obtainStyledAttributes( + TypedArray a = context.obtainStyledAttributes( attrs, com.android.internal.R.styleable.ProgressBar, defStyleAttr, defStyleRes); setMax(a.getInt(com.android.internal.R.styleable.ProgressBar_max, mMax)); a.recycle(); - setLayoutResource(com.android.internal.R.layout.preference_widget_seekbar); + + a = context.obtainStyledAttributes(attrs, + com.android.internal.R.styleable.SeekBarPreference, defStyleAttr, defStyleRes); + final int layoutResId = a.getResourceId( + com.android.internal.R.styleable.SeekBarPreference_layout, + com.android.internal.R.layout.preference_widget_seekbar); + a.recycle(); + + setLayoutResource(layoutResId); } public SeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr) { @@ -52,7 +60,7 @@ public class SeekBarPreference extends Preference } public SeekBarPreference(Context context, AttributeSet attrs) { - this(context, attrs, 0); + this(context, attrs, com.android.internal.R.attr.seekBarPreferenceStyle); } public SeekBarPreference(Context context) { diff --git a/core/res/res/layout/preference_widget_seekbar.xml b/core/res/res/layout/preference_widget_seekbar.xml index c427965876836..05daa1a42011a 100644 --- a/core/res/res/layout/preference_widget_seekbar.xml +++ b/core/res/res/layout/preference_widget_seekbar.xml @@ -14,9 +14,7 @@ limitations under the License. --> - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 52138968cab6b..e807d69289696 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -834,6 +834,8 @@ + + @@ -6607,6 +6609,10 @@ + + + + + +