fixes
This commit is contained in:
@@ -137,8 +137,9 @@ public abstract class AbstractDialogPreference<T> extends DialogPreference {
|
||||
private void persist(@Nullable T value) {
|
||||
final String toBePersistedString = getMapper().formatValue(value);
|
||||
if (toBePersistedString != null) {
|
||||
persistString(toBePersistedString);
|
||||
callChangeListener(value);
|
||||
if ( callChangeListener(value) ) {
|
||||
persistString(toBePersistedString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -24,18 +24,26 @@ public abstract class RangeSeekBarPreference<T extends Number> extends AbstractD
|
||||
@NotNull
|
||||
private final Interval<T> boundaries;
|
||||
|
||||
private Integer steps;
|
||||
|
||||
public RangeSeekBarPreference(@NotNull Context context, AttributeSet attrs) {
|
||||
super(context, attrs, null);
|
||||
|
||||
//noinspection ConstantConditions
|
||||
boundaries = getMapper().parseValue(attrs.getAttributeValue(localNameSpace, "boundaries"));
|
||||
|
||||
assert boundaries != null;
|
||||
steps = attrs.getAttributeIntValue(localNameSpace, "steps", -1);
|
||||
if ( steps.equals(-1) ) {
|
||||
steps = null;
|
||||
}
|
||||
|
||||
assert steps == null || steps >= 2;
|
||||
|
||||
createPreferenceView();
|
||||
}
|
||||
|
||||
private void createPreferenceView() {
|
||||
this.rangeSeekBar = new NumberRangeSeekBar<T>(boundaries, null, context);
|
||||
this.rangeSeekBar = new NumberRangeSeekBar<T>(boundaries, steps, context);
|
||||
this.rangeSeekBar.setNotifyWhileDragging(true);
|
||||
this.rangeSeekBar.setOnRangeSeekBarChangeListener(this);
|
||||
|
||||
|
Reference in New Issue
Block a user