Practical usage of ContentLoadingProgressBar

后端 未结 4 1519
死守一世寂寞
死守一世寂寞 2021-02-01 01:34

I was going through developer site of android and I found a class named ContentLoadingProgressBar. By seeing this class I come up with some questions in my mind

4条回答
  •  难免孤独
    2021-02-01 01:50

    Let's say you want to show a ProgressBar for some background operation that may take less than 500ms or more than 5 seconds.

    1. You call progressBar.show() Then you start your background operation.

    2. If your background operation is over within 500ms. Then you call progressBar.hide()

      Now the user will see a flicker of the progress bar appearing and disappearing within a fraction of a second.

    Introducing ContentLoadingProgressBar:

    When you use this progressbar, then it will wait for a minimum time before showing the progress dialog. Which means if the time between show() call and hide() call is less than that minimum time, then there wont be any dialog to be shown to the user.

提交回复
热议问题