Hi!
I have a SeekBar(seekBar1) on my layout with a small height (3dp). Because of it's small height is hard to select that view and I want to implement an other way to update the progress for my seek view. For to do that I think at something like that: I have to put an other bigger and invisible(android:background = "#00000000"
) seekBar(seekBar2) under my small seekBar1, I set the onSeekBarChangeListener
for seekBar2, and everytime when I touch the seekBar2 and onSeekBarChange()
is called I will update the progress for seekBar1.
I want to ask if is posible to do that in a better way?
This is my code:
seekBarSecond.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) { try {
musicService.seekTo(seekBar.getProgress());
seekBar.setProgress(seekBarSecond.getProgress());
} catch (RemoteException e) {
e.printStackTrace();
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
// TODO Auto-generated method stub
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
}
});
seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
public void onStopTrackingTouch(SeekBar seekBar) {
try {
musicService.seekTo(seekBar.getProgress());
} catch (RemoteException e) {
e.printStackTrace();
}
}
public void onStartTrackingTouch(SeekBar seekBar){
}
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser){
}
});
Thank you!