fixes
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
|
||||
* For more information, please, contact se.solovyev@gmail.com
|
||||
* or visit http://se.solovyev.org
|
||||
*/
|
||||
|
||||
package org.solovyev.android.view.prefs;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.solovyev.common.FloatIntervalMapper;
|
||||
import org.solovyev.common.utils.Interval;
|
||||
import org.solovyev.common.utils.Mapper;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 9/21/11
|
||||
* Time: 11:41 PM
|
||||
*/
|
||||
public class FloatRangeSeekBarPreference extends RangeSeekBarPreference<Float> {
|
||||
|
||||
public FloatRangeSeekBarPreference(@NotNull Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Mapper<Interval<Float>> getMapper() {
|
||||
return new FloatIntervalMapper() ;
|
||||
}
|
||||
}
|
@@ -30,8 +30,16 @@ public abstract class RangeSeekBarPreference<T extends Number> extends AbstractD
|
||||
boundaries = getMapper().parseValue(attrs.getAttributeValue(localNameSpace, "boundaries"));
|
||||
|
||||
assert boundaries != null;
|
||||
|
||||
createPreferenceView();
|
||||
}
|
||||
|
||||
private void createPreferenceView() {
|
||||
this.rangeSeekBar = new NumberRangeSeekBar<T>(boundaries, null, context);
|
||||
rangeSeekBar.setOnRangeSeekBarChangeListener(this);
|
||||
this.rangeSeekBar.setNotifyWhileDragging(true);
|
||||
this.rangeSeekBar.setOnRangeSeekBarChangeListener(this);
|
||||
|
||||
initPreferenceView();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -39,9 +47,7 @@ public abstract class RangeSeekBarPreference<T extends Number> extends AbstractD
|
||||
protected LinearLayout onCreateDialogView() {
|
||||
final LinearLayout result = super.onCreateDialogView();
|
||||
|
||||
this.rangeSeekBar = new NumberRangeSeekBar<T>(boundaries, null, context);
|
||||
rangeSeekBar.setOnRangeSeekBarChangeListener(this);
|
||||
initPreferenceView();
|
||||
createPreferenceView();
|
||||
|
||||
result.addView(rangeSeekBar);
|
||||
|
||||
@@ -58,9 +64,12 @@ public abstract class RangeSeekBarPreference<T extends Number> extends AbstractD
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rangeSeekBarValuesChanged(T minValue, T maxValue) {
|
||||
public void rangeSeekBarValuesChanged(T minValue, T maxValue, boolean changeComplete) {
|
||||
final Interval<T> interval = new NumberInterval<T>(minValue, maxValue);
|
||||
persistValue(interval);
|
||||
|
||||
if (changeComplete) {
|
||||
persistValue(interval);
|
||||
}
|
||||
|
||||
setValueText(interval);
|
||||
}
|
||||
|
Reference in New Issue
Block a user