I have a multiple SeekBar
s. I want to detect details about change in every SeekBar
's progress
value in order to calculate/update totalVal
.
More specifically, I want to detect whether the selected SeekBar
value was moved to the right or to the left (in respect of its previous progress
level), and by how many steps it was moved.
mySeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progressVal, boolean fromUser) {
// perform calculations here
}
// ...
}
For example:
- initialize totalVal to some value, i.e. totalval = 10
- One of the
SeekBar
s was moved to the right by 1 step. - totalVal = 11
- Different
Seekbar
was moved to the left by 5 steps. - totalVal = 6
Can someone please tell me how to detect the direction of SeekBar
movement, as well as the number of steps
it was moved? If it is possible at all.