android - Progress bar not showing progress swiftly -
my progress bar not going swiftly. below code:
_progressbar.setmax(30); new countdowntimer(30000, 100) { public void ontick(long millisuntilfinished) { _progressbar.setprogress((int)millisuntilfinished/1000); time.settext(string.valueof((int) millisuntilfinished / 1000)); } public void onfinish() { } }.start();
this progress bar:
i'd try using value animator ease 0 30.
//ease 0 30 valueanimator valueanimator = valueanimator.ofint(0, 30); //set time length valueanimator.setduration(30000); //control easing type valueanimator.setinterpolator(new linearinterpolator()); valueanimator.addupdatelistener(new animatorupdatelistener() { integer valueanimatorvalue = null; @override public void onanimationupdate(valueanimator animation) { valueanimatorvalue = (integer) animation.getanimatedvalue(); _progressbar.setprogress(valueanimatorvalue); time.settext(string.valueof(valueanimatorvalue); } }); valueanimator.start();
Comments
Post a Comment