SeeKBar in ListView thumb offset not working as expected

609 views Asked by At

I am modifying the UI of the openHAB android application.Sample image of what I was trying to achieve was given as image bellow.

enter image description here

Please note the width of the progress bar and the positioning of the thumb. The thumb will move only up to the edge of the progress bar. To achieve this work I used the setThubOffset() method in the SeekBar with the negative offset value and the offset works when the thumb moves.

enter image description here enter image description here

When the progress value is changed the progress value will send to the server and with the response from the server ListView is updated with notifyDataSetChanged() call, the progress of the SeekBar will get modified, this time the position of the thumb changes and it moves out of the range of progress bar. No idea why the thumb moves outside even though the offset is negative.

enter image description here

The source code is like this

public View getView(int position, View convertView, ViewGroup parent) {
....
sliderSeekBar.setThumbOffset(-15);
....
sliderSeekBar.setProgress(...);
....
}

Can somebody tell what could be wrong?

1

There are 1 answers

0
Sarath Babu On
sliderSeekBar.setProgress(0);     
sliderSeekBar.setProgress(...);

Solved the issue. got help from here