Answer the question
In order to leave comments, you need to log in
Gradual decrease in progressBar by timer?
Hello everyone, there is a progress bar, you need to reduce it, 8 seconds.
I did this:
the maximum value of progressBar 800 every 10 milliseconds, the timer reduces its value by 1.
Is this generally normal?
The timer will run 800 times, is that normal?
MB start 1 timer for 8 seconds, and make the decrease somehow an animation?
Please tell me, it seems to me that this is a very difficult device ..
Answer the question
In order to leave comments, you need to log in
Look towards Property Animation: https://developer.android.com/guide/topics/graphic...
Something like this:
layout:
<ProgressBar
android:id="@+id/progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="8000"
android:progress="8000"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
/>
ProgressBar progress = (ProgressBar) findViewById(R.id.progress);
ObjectAnimator anim = ObjectAnimator.ofInt(progress, "progress", 8000, 0);
anim.setDuration(8000);
anim.start();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question