Fix 3419077: Allow subclasses to change SeekBarPreference action buttons.
Change-Id: I2c624c3693fe06d9d3db3c203c7d4fc7a80b79d9
diff --git a/core/java/android/preference/SeekBarPreference.java b/core/java/android/preference/SeekBarPreference.java
index 658c2a7..037fb41 100644
--- a/core/java/android/preference/SeekBarPreference.java
+++ b/core/java/android/preference/SeekBarPreference.java
@@ -29,25 +29,30 @@
*/
public class SeekBarPreference extends DialogPreference {
private static final String TAG = "SeekBarPreference";
-
+
private Drawable mMyIcon;
public SeekBarPreference(Context context, AttributeSet attrs) {
super(context, attrs);
setDialogLayoutResource(com.android.internal.R.layout.seekbar_dialog);
- setPositiveButtonText(android.R.string.ok);
- setNegativeButtonText(android.R.string.cancel);
-
+ createActionButtons();
+
// Steal the XML dialogIcon attribute's value
mMyIcon = getDialogIcon();
setDialogIcon(null);
}
+ // Allow subclasses to override the action buttons
+ public void createActionButtons() {
+ setPositiveButtonText(android.R.string.ok);
+ setNegativeButtonText(android.R.string.cancel);
+ }
+
@Override
protected void onBindDialogView(View view) {
super.onBindDialogView(view);
-
+
final ImageView iconView = (ImageView) view.findViewById(android.R.id.icon);
if (mMyIcon != null) {
iconView.setImageDrawable(mMyIcon);