am 0d47ac11: Merge "Fix 3419077: Allow subclasses to change SeekBarPreference action buttons." into honeycomb
* commit '0d47ac11764b89431777c3a84efd5fa9c17130dc': Fix 3419077: Allow subclasses to change SeekBarPreference action buttons.
This commit is contained in:
@@ -29,25 +29,30 @@ import android.widget.SeekBar;
|
||||
*/
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user