diff --git a/README.md b/README.md index 6d716ea..0568d3c 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,30 @@ -# Spots progress dialog +# 一行代码实现加载对话框 -[![Maven](https://img.shields.io/badge/maven-0.7-brightgreen.svg)](http://search.maven.org/#artifactdetails%7Ccom.github.d-max%7Cspots-dialog%7C0.7%7Caar) - -[![Blog Post](https://img.shields.io/badge/blogger-post-yellow.svg)](http://dybarsky.blogspot.com/2015/01/spots-progress-dialog.html) - -[![PlayStore](https://img.shields.io/badge/Play%20Store-demo-blue.svg)](https://play.google.com/store/apps/details?id=dmax.dialog.sample) - -[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Spots%20progress%20dialog-lightgrey.svg?style=flat)](http://android-arsenal.com/details/1/1743) -Android AlertDialog with mowing spots progress indicator packed as android library. -![Example Image1][1] +![](http://upload-images.jianshu.io/upload_images/4037105-09a79c822c569bed.gif?imageMogr2/auto-orient/strip) =========== -###Usage - -The library available in maven central repository. You can get it using: +开始 +=== +在project的build.gradle添加如下代码(如下图) ```groovy -dependencies { - compile 'com.github.d-max:spots-dialog:0.4@aar' +allprojects { + repositories { + jcenter() + maven { url "https://jitpack.io" } + } } ``` -Javadoc and sources package [classifiers][3] available too. - -**Note:** The library requires minimum API level 15. +![](http://oi5nqn6ce.bkt.clouddn.com/itheima/booster/code/jitpack.png) + +在build.gradle添加依赖 +```groovy + compile 'com.github.open-android:Loading:1.0' +``` -[SpotsDialog][4] class is an inheritor of a AlertDialog class. You can use it just like simple [AlertDialog][5]. For example: +For example: ```java AlertDialog dialog = new SpotsDialog(context); dialog.show(); @@ -35,18 +33,11 @@ dialog.dismiss(); ``` =========== -###Customization -Use android styles to customize the dialog. -Next custom attributes provided: -* DialogTitleAppearance : style reference -* DialogTitleText : string -* DialogSpotColor : color -* DialogSpotCount : integer **For example:** -Provide you own style resource: +默认是白色,想修改样式直接修改style,代码如下: ```xml @@ -59,23 +50,23 @@ Provide you own style resource: ``` -Pass it into constuctor: +如果自定义样式代码如下: ```java new SpotsDialog(context, R.style.Custom).show(); ``` Result: -![Example Image1][2] +![](http://upload-images.jianshu.io/upload_images/4037105-5533538ec1519967.gif?imageMogr2/auto-orient/strip) -If you need to change just a dialogs message, use constructor: +如果想改变加载的文字,代码如下,默认是loading,英文的,想改成中文,代码如下: ```java new SpotsDialog(context, "Завантаження").show(); ``` **Note:** -On the pre-lollipop devices _DialogSpotColor_ item won't work. As workaround just override color in your resources. +设置颜色代码如下. ```xml @@ -83,65 +74,6 @@ On the pre-lollipop devices _DialogSpotColor_ item won't work. As workaround jus ``` -=========== - -###Release notes - -**[v0.7, November 23th 2015][10]** -* Override message setter - -**[v0.4, July 23th 2015][9]** -* Add custom message constructor - -**[v0.3, May 5th 2015][8]** -* Stop animation when dismiss dialog - - -**[v0.2, Feb 10th 2015][7]** -* Fix issue on pre-lollipop - -**[v0.1, Jan 15th 2015][6]** -* Style customization - -=========== - -###Developed By - -Maksym Dybarskyi - http://d-max.info - -=========== +* 欢迎关注微信公众号、长期为您推荐优秀博文、开源项目、视频 -###License - - The MIT License (MIT) - Copyright © 2015 Maxim Dybarsky - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - - -[1]: http://3.bp.blogspot.com/-l1UvVWiMSAg/VLa5ZfW4dDI/AAAAAAAANTc/rsWou_qb0Bc/s320/Y6HaTSw.gif -[2]: http://1.bp.blogspot.com/-GVktyphQy4U/VLa5jqIF2MI/AAAAAAAANTk/SCtC58KAYHI/s320/plYat1p.gif -[3]: http://www.gradle.org/docs/current/userguide/dependency_management.html#sub:classifiers -[4]: library/src/main/java/dmax/dialog/SpotsDialog.java -[5]: http://developer.android.com/reference/android/app/AlertDialog.html -[6]: https://github.com/d-max/spots-dialog/releases/tag/v0.1 -[7]: https://github.com/d-max/spots-dialog/releases/tag/v0.2 -[8]: https://github.com/d-max/spots-dialog/releases/tag/v0.3 -[9]: https://github.com/d-max/spots-dialog/releases/tag/v0.4 -[10]: https://github.com/d-max/spots-dialog/releases/tag/v0.7 +![](http://upload-images.jianshu.io/upload_images/4037105-8f737b5104dd0b5d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

AltStyle によって変換されたページ (->オリジナル) /