AnderWeb / discreteSeekBar

Apache License 2.0
2.11k stars 401 forks source link

Show decimal values in the indicator bubble? #82

Open NightSkyDev opened 8 years ago

NightSkyDev commented 8 years ago

Is there a way to show decimal values? It looks like the NumericTransformer only allows int?

khiem2794 commented 7 years ago

You can try this, i use this for number range from 0.00 - 1.00

histScoreSeekbar.setProgress((int) (MatcherService.histogramStandardScore * 100));

histScoreSeekbar.setOnProgressChangeListener(new DiscreteSeekBar.OnProgressChangeListener() {

@Override public void onProgressChanged(DiscreteSeekBar seekBar, int value, boolean fromUser) { String format = String.valueOf((double) seekBar.getProgress()/100); seekBar.setIndicatorFormatter(format); }

@Override public void onStartTrackingTouch(DiscreteSeekBar seekBar) { String format = String.valueOf((double) seekBar.getProgress()/100); seekBar.setIndicatorFormatter(format); }

@Override public void onStopTrackingTouch(DiscreteSeekBar seekBar) { MatcherService.histogramStandardScore = (double) seekBar.getProgress()/100; } });

NightSkyDev commented 7 years ago

Thanks @ngockhiem27

hamdache202 commented 7 years ago

thank you @ngockhiem27