用 Kotlin
编写的Andrroid 小的 Demo
,相信一个个的小知识点,终究会发挥无穷力量!
这个是默认的,什么也没有
以前我一直在用 ProgressDialog ,没在意 已弃用
,今天突发奇想,点进去了,看到类上有这样一段注释:
* @deprecated <code>ProgressDialog</code> is a modal dialog, which prevents the
* user from interacting with the app. Instead of using this class, you should
* use a progress indicator like {@link android.widget.ProgressBar}, which can
* be embedded in your app's UI. Alternatively, you can use a
* <a href="/guide/topics/ui/notifiers/notifications.html">notification</a>
* to inform the user of the task's progress.
我又继续点android.widget.ProgressBar
,然后上网搜一下,看到有很多教程,效果也还不错,虽然用ProgressDialog也能达到效果及目的,但有删除线,终归是不好看的,索性就尝试下吧!于是有了这个 Loading
。
但我想,应该还会有跟多的 Demo
吧!做个系列如何?
闲话少说,Loading正式开始
从目录可以看到 ProgressBar
已经为我们提供了很多很好的功能了,足以满足我们的项目求了吧!
这里值得一说的是,如果 API >= 21
那么支持这种样式,否则为 黑白
。
这是一个动画,不能演示效果,遗憾!