Android custom ProgressDialog loading effect

Used to record the knowledge they use

When I was working on the project two days ago, I found that sometimes when accessing network data, due to a lot of work to be done in the background, it took us a long time to return data, so the boss asked me to add a loaded logo diagram to improve the user experience

So I found many cases written by the great God on the Internet and completed a loading tool class in combination with my own situation

effect:

OK, now let's talk about how to do it

First customize a class to inherit ProgressDialog

Setting the loading layout file

Background color (self adjustable)

Loading circle style (self adjustable)

OK, you can use it

Why? I don't understand. Then I went to Baidu and Google and found it in a great God's article, but when I wrote this article, I found that I didn't save the great God's address and couldn't find it anymore

You need to pass in new loading when creating custom loading_ view(this,R.style.CustomDialog); style

OK, do it again

OK, success!

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>