Example usage for ContentLoadingProgressBar

后端 未结 2 1496
慢半拍i
慢半拍i 2021-02-07 04:53

I just jumped and found this class ContentLoadingProgressBar from the developer site in android. I searched couldn\'t find any usage or explanation for the class. I

2条回答
  •  广开言路
    2021-02-07 05:43

    I was able to make this thing work for me but it required some modifications to the source code which I grabbed from grepcode.

    I removed the onAttachedToWindow() override, because I felt that it was unnecessary to remove the callbacks in this case. The overridden method caused calling show() in onResume() to not work because the callbacks were removed right after that.

    I also had to figure out why the view apparently wasn't being drawn at all, I think the cause was the third argument passed to ProgressBar constructors so I changed the constructors to call the ProgressBar constructors directly without modifying the arguments.

    My version of this class can be found here

    My answers:

    1. It doesn't show at all if hide() is called less than 0.5s after show(), and it shows for at least 0.5s, this prevents very fast flickering stuff that you might see with "naive" implementations.
    2. Yes
    3. I think this is just a regular case of styling a ProgressBar

提交回复
热议问题