I am new to android and need help to use the search range that I found earlier in stackoverflow. The problem is that I cannot get text values ββin a textview when dragging two thumbs. Desired output image: enter the link here
URL for search range: enter the link here
1 :
Now I got the min and max value part. The next problem is creating custom values ββfor the slider in the search bar. How I want 10000,20000, .... 50,000, .... 100,000 .... etc. I provide code for my main class.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
RangeSeekBar<Integer> seekBar = new RangeSeekBar<Integer>(0, 100000,
getApplicationContext());
seekBar.setOnRangeSeekBarChangeListener(new OnRangeSeekBarChangeListener<Integer>() {
@Override
public void onRangeSeekBarValuesChanged(RangeSeekBar<?> bar,
Integer minValue, Integer maxValue) {
Log.i("TAG", "User selected new range values: MIN=" + minValue
+ ", MAX=" + maxValue);
}
});
final TextView tv = new TextView(this);
tv.setText("Val");
ll = (LinearLayout) findViewById(R.id.ll1);
ll.addView(seekBar);
ll.addView(tv);
seekBar.setNotifyWhileDragging(true);
seekBar.setOnRangeSeekBarChangeListener(new OnRangeSeekBarChangeListener<Integer>() {
@Override
public void onRangeSeekBarValuesChanged(RangeSeekBar<?> bar,
Integer minValue, Integer maxValue) {
tv.setText("Max:Min"+"\n"+minValue+" : "+maxValue);
}
});