Posts

Showing posts with the label runnable

How to update textviews when seekbar is dragged

Image
Clash Royale CLAN TAG #URR8PPP How to update textviews when seekbar is dragged Here you can see what im trying to achieve https://imgur.com/a/zEpWI The first gif is what i have now, and the second on is what i want to get. The code works but the textview which displays song current position is only updating when i stop dragging, but i want it to update when im dragging it. Check out the gifs i posted in the link so you understand what i want to achieve. Thanks in advance, Vince updateProgressBar(); called when i change a song My code private Runnable mUpdateTime = new Runnable() { @Override public void run() { long songCurrentTime = mediaPlayer.getCurrentPosition(); long songTotalTime = mediaPlayer.getDuration(); tvSongCurrentTime.setText(""+utilities.msToTimer(songCurrentTime)); tvSongTotalTime.setText(""+utilities.msToTimer(songTotalTime)); int progress = (int)(utilities.getProgressPercentage(songCurrentTime, songTotalTime)); seekBar.setPro...