One way to do this is to use ValueAnimator:
final SeekBar seekBar = findViewById(R.id.seekBar); ValueAnimator anim = ValueAnimator.ofInt(0,seekBar.getMax()); anim.setDuration(1000); anim.addUpdateListener(new AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { int animProgress = (Integer) animation.getAnimatedValue(); seekBar.setProgress(animProgress); } });
Another way could be (havent test this):
final SeekBar seekBar = findViewById(R.id.seekBar); ObjectAnimator anim = ObjectAnimator.ofFloat(seekBar, "progress", 0,seekBar.getMax()); anim.setDuration(10000); anim.start();
source share