Animate ProgressBar update in Android

后端 未结 13 1393
悲哀的现实
悲哀的现实 2020-11-28 04:04

I am using a ProgressBar in my application which I update in onProgressUpdate of an AsyncTask. So far so good.

What I want to do is to animate the prog

13条回答
  •  北荒
    北荒 (楼主)
    2020-11-28 04:19

    Similar with Kotlin on the UI thread

    activity?.runOnUiThread {
            ObjectAnimator.ofInt(binding.progressAudio, "progress", currentPosition)
                .setDuration(100)
                .start();
        }
    

提交回复
热议问题