|
| 1 | +# Spots progress dialog |
| 2 | + |
| 3 | +[](http://search.maven.org/#artifactdetails%7Ccom.github.d-max%7Cspots-dialog%7C0.7%7Caar) |
| 4 | + |
| 5 | +[](http://dybarsky.blogspot.com/2015/01/spots-progress-dialog.html) |
| 6 | + |
| 7 | +[](https://play.google.com/store/apps/details?id=dmax.dialog.sample) |
| 8 | + |
| 9 | +[](http://android-arsenal.com/details/1/1743) |
| 10 | + |
| 11 | +Android AlertDialog with mowing spots progress indicator packed as android library. |
| 12 | + |
| 13 | +![Example Image1][1] |
| 14 | + |
| 15 | +=========== |
| 16 | + |
| 17 | +###Usage |
| 18 | + |
| 19 | +The library available in maven central repository. You can get it using: |
| 20 | +```groovy |
| 21 | +dependencies { |
| 22 | + compile 'com.github.d-max:spots-dialog:0.4@aar' |
| 23 | +} |
| 24 | +``` |
| 25 | +Javadoc and sources package [classifiers][3] available too. |
| 26 | + |
| 27 | +**Note:** The library requires minimum API level 15. |
| 28 | + |
| 29 | +[SpotsDialog][4] class is an inheritor of a AlertDialog class. You can use it just like simple [AlertDialog][5]. For example: |
| 30 | +```java |
| 31 | +AlertDialog dialog = new SpotsDialog(context); |
| 32 | +dialog.show(); |
| 33 | +... |
| 34 | +dialog.dismiss(); |
| 35 | +``` |
| 36 | +=========== |
| 37 | + |
| 38 | +###Customization |
| 39 | + |
| 40 | +Use android styles to customize the dialog. |
| 41 | +Next custom attributes provided: |
| 42 | +* DialogTitleAppearance : style reference |
| 43 | +* DialogTitleText : string |
| 44 | +* DialogSpotColor : color |
| 45 | +* DialogSpotCount : integer |
| 46 | + |
| 47 | +**For example:** |
| 48 | + |
| 49 | +Provide you own style resource: |
| 50 | +```xml |
| 51 | +<?xml version="1.0" encoding="utf-8"?> |
| 52 | +<resources> |
| 53 | + <style name="Custom" parent="android:Theme.DeviceDefault.Dialog"> |
| 54 | + <item name="DialogTitleAppearance">@android:style/TextAppearance.Medium</item> |
| 55 | + <item name="DialogTitleText">Updating…</item> |
| 56 | + <item name="DialogSpotColor">@android:color/holo_orange_dark</item> |
| 57 | + <item name="DialogSpotCount">4</item> |
| 58 | + </style> |
| 59 | +</resources> |
| 60 | +``` |
| 61 | + |
| 62 | +Pass it into constuctor: |
| 63 | +```java |
| 64 | +new SpotsDialog(context, R.style.Custom).show(); |
| 65 | +``` |
| 66 | + |
| 67 | +Result: |
| 68 | + |
| 69 | +![Example Image1][2] |
| 70 | + |
| 71 | +If you need to change just a dialogs message, use constructor: |
| 72 | +```java |
| 73 | +new SpotsDialog(context, "Завантаження").show(); |
| 74 | +``` |
| 75 | + |
| 76 | + |
| 77 | +**Note:** |
| 78 | +On the pre-lollipop devices _DialogSpotColor_ item won't work. As workaround just override color in your resources. |
| 79 | +```xml |
| 80 | +<?xml version="1.0" encoding="utf-8"?> |
| 81 | +<resources> |
| 82 | + <color name="spots_dialog_color">@color/your_color_value</color> |
| 83 | +</resources> |
| 84 | +``` |
| 85 | + |
| 86 | +=========== |
| 87 | + |
| 88 | +###Release notes |
| 89 | + |
| 90 | +**[v0.7, November 23th 2015][10]** |
| 91 | +* Override message setter |
| 92 | + |
| 93 | +**[v0.4, July 23th 2015][9]** |
| 94 | +* Add custom message constructor |
| 95 | + |
| 96 | +**[v0.3, May 5th 2015][8]** |
| 97 | +* Stop animation when dismiss dialog |
| 98 | + |
| 99 | + |
| 100 | +**[v0.2, Feb 10th 2015][7]** |
| 101 | +* Fix issue on pre-lollipop |
| 102 | + |
| 103 | +**[v0.1, Jan 15th 2015][6]** |
| 104 | +* Style customization |
| 105 | + |
| 106 | +=========== |
| 107 | + |
| 108 | +###Developed By |
| 109 | + |
| 110 | +Maksym Dybarskyi - http://d-max.info |
| 111 | + |
| 112 | +=========== |
| 113 | + |
| 114 | +###License |
| 115 | + |
| 116 | + The MIT License (MIT) |
| 117 | + Copyright © 2015 Maxim Dybarsky |
| 118 | + |
| 119 | + Permission is hereby granted, free of charge, to any person obtaining a copy |
| 120 | + of this software and associated documentation files (the “Software”), to deal |
| 121 | + in the Software without restriction, including without limitation the rights |
| 122 | + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 123 | + copies of the Software, and to permit persons to whom the Software is |
| 124 | + furnished to do so, subject to the following conditions: |
| 125 | + |
| 126 | + The above copyright notice and this permission notice shall be included in |
| 127 | + all copies or substantial portions of the Software. |
| 128 | + |
| 129 | + THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 130 | + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 131 | + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 132 | + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 133 | + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 134 | + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 135 | + THE SOFTWARE. |
| 136 | + |
| 137 | + |
| 138 | +[1]: http://3.bp.blogspot.com/-l1UvVWiMSAg/VLa5ZfW4dDI/AAAAAAAANTc/rsWou_qb0Bc/s320/Y6HaTSw.gif |
| 139 | +[2]: http://1.bp.blogspot.com/-GVktyphQy4U/VLa5jqIF2MI/AAAAAAAANTk/SCtC58KAYHI/s320/plYat1p.gif |
| 140 | +[3]: http://www.gradle.org/docs/current/userguide/dependency_management.html#sub:classifiers |
| 141 | +[4]: library/src/main/java/dmax/dialog/SpotsDialog.java |
| 142 | +[5]: http://developer.android.com/reference/android/app/AlertDialog.html |
| 143 | +[6]: https://github.com/d-max/spots-dialog/releases/tag/v0.1 |
| 144 | +[7]: https://github.com/d-max/spots-dialog/releases/tag/v0.2 |
| 145 | +[8]: https://github.com/d-max/spots-dialog/releases/tag/v0.3 |
| 146 | +[9]: https://github.com/d-max/spots-dialog/releases/tag/v0.4 |
| 147 | +[10]: https://github.com/d-max/spots-dialog/releases/tag/v0.7 |
0 commit comments