Você está na página 1de 8

Spots progress dialog (/details/1/1743)

 822 (https://github.com/d-max/spots-dialog/stargazers?utm_source=android-

arsenal.com&utm_medium=referral&utm_campaign=1743)  30 (https://github.com/d-max/spots-

dialog/watchers?utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=1743)  205

(https://github.com/d-max/spots-dialog/network?utm_source=android-

arsenal.com&utm_medium=referral&utm_campaign=1743)  0 (https://github.com/d-max/spots-dialog/issues?

utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=1743)

 (https://facebook.com/sharer.php?
General u=https://android-
Category
arsenal.com/details/1/1743)
Free (/free)

Tag
 (https://twitter.com/intent/twe
arsenal.com/details/1/1743&text=The%20An
Dialogs (/tag/30)

License

%20Spots%20progress%20dialog
MIT License (http://opensource.org/licenses/MIT?utm_source=android-arsenal.com&utm_medium=referr
al&utm_campaign=1743)

 (http://news.ycombinator.com/submitlink
Min SDK
15 (Android 4.0.3–4.0.4 Ice Cream Sandwich) (/api?level=15)
arsenal.com/details/1/1743&t=The%20Andro
Registered
May 4, 2015 %20Dialogs%20-%20Spots%20p
Favorites
8  (https://plus.google.com/share?
Link url=https://android-
arsenal.com/details/1/1743)
https://github.com/d-max/spots-dialog (https://github.com/d-max/spots-dialog?utm_source=android-arsen
al.com&utm_medium=referral&utm_campaign=1743)

See also
 (https://reddit.com/subm
NiftyDialogEffects (/details/1/772)
arsenal.com/details/1/1743&title=The%20An
Place Search Dialog (/details/1/4370)

%20Dialogs%20-%20Spots%
PerfectDialog (/details/1/6486)
Selection Dialogs (/details/1/3651)
FancyDialog (/details/1/5437)
Additional

Language
Java

Version
v0.7 (Nov 23, 2015) (https://github.com/d-max/spots-dialog/releases/tag/v0.7?utm_source=android-arsen
al.com&utm_medium=referral&utm_campaign=1743)

Created
Jan 13, 2015

Updated
Jun 11, 2018

Owner
Maksym Dybarskyi (d-max) (/user/d-max)

Contributors
4 (https://github.com/d-max/spots-dialog/graphs/contributors?utm_source=android-arsenal.com&utm_me
dium=referral&utm_campaign=1743)

Activity

Badge
 Generate

Download
 Source code

Advertising

    
A Free stand-alone desktop
application designed to be
CodePilot.ai the best search experience
possible.

Spots progress dialog

bintray 1.1 (https://bintray.com/d-max/spots-dialog/d-max.spots-dialog/1.1?utm_source=android-


arsenal.com&utm_medium=referral&utm_campaign=1743) medium post
(https://medium.com/@dybarsky/spots-progress-dialog-490bd2c737b1?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=1743) Play Store demo

(https://play.google.com/store/apps/details?id=dmax.dialog.sample&utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=1743) Android Arsenal Spots progress dialog
(http://android-arsenal.com/details/1/1743)

Android AlertDialog with moving spots progress indicator packed as android library.

(https://camo.githubusercontent.com/d8108413298d70047f52cff9ac05603a5fd51988/687474703a
2f2f332e62702e626c6f6773706f742e636f6d2f2d6c3155765657694d5341672f564c61355a665734
6444492f41414141414141414e54632f7273576f755f71623042632f733332302f593648615453772
e676966?utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=1743)

===========

Usage
The library available in maven jcenter repository. You can get it using:
repositories {
jcenter()
}
dependencies {
implementation 'com.github.d-max:spots-dialog:1.1@aar'
}

Javadoc and sources package classifiers


(http://www.gradle.org/docs/current/userguide/dependency_management.html#sub:classifiers)
available too.

Note: The library requires minimum API level 15.

SpotsDialog (https://github.com/d-max/spots-
dialog/blob/master/library/src/main/java/dmax/dialog/SpotsDialog.java?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=1743) class is an inheritor of a AlertDialog
class. You can use it just like simple AlertDialog
(http://developer.android.com/reference/android/app/AlertDialog.html?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=1743). For example:

val dialog: AlertDialog = SpotsDialog.Builder().setContext(context).build()


...
dialog.show()
...
dialog.dismiss()

Customization
For dialog customization of dialog, like message and cancel listener, use SpotsDialog.Builder
methods.

val dialog: AlertDialog = SpotsDialog.Builder()


.setContext(this)
.setMessage(R.string.custom_title)
.setCancelable(false)
...
.build()
.apply {
show()
}
...
dialog.dismiss()

For changing dialogs look and feel, create style and pass it ot dialog builder:
val dialog: AlertDialog = SpotsDialog.Builder()
.Builder()
.setContext(context)
.setTheme(R.style.Cusom)
.build()
.apply {
show()
}

For styling the next custom attributes provided:

DialogTitleAppearance : style reference


DialogTitleText : string
DialogSpotColor : color
DialogSpotCount : integer

For example:

Provide you own style resource:

<?xml version="1.0" encoding="utf-8"?>


<resources>
<style name="Custom" parent="android:Theme.DeviceDefault.Dialog">
<item name="DialogTitleAppearance">@android:style/TextAppearance.Medium</item>
<item name="DialogTitleText">Updating…</item>
<item name="DialogSpotColor">@android:color/holo_orange_dark</item>
<item name="DialogSpotCount">4</item>
</style>
</resources>

Result:

(https://camo.githubusercontent.com/2a89a0a294117351faa188b18a1333f9ec53d618/687474703
a2f2f312e62702e626c6f6773706f742e636f6d2f2d47566b74797068517934552f564c61356a71494
6324d492f41414141414141414e546b2f5343744335384b415948492f733332302f706c596174317
02e676966?utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=1743)

Note: On the pre-lollipop devices DialogSpotColor item won't work. As workaround just override
color in your resources.

<?xml version="1.0" encoding="utf-8"?>


<resources>
<color name="spots_dialog_color">@color/your_color_value</color>
</resources>

Proguard
If you're using proguard, add this code to your rules file:

-keep class dmax.dialog.** {


*;
}

===========

Release notes
v1.1, June 5th 2018 (https://github.com/d-max/spots-dialog/releases/tag/v1.1?
utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=1743)

Builder provided
Small fixes

v0.7, November 23th 2015 (https://github.com/d-max/spots-dialog/releases/tag/v0.7?


utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=1743)

Override message setter

v0.4, July 23th 2015 (https://github.com/d-max/spots-dialog/releases/tag/v0.4?


utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=1743)

Add custom message constructor

v0.3, May 5th 2015 (https://github.com/d-max/spots-dialog/releases/tag/v0.3?


utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=1743)

Stop animation when dismiss dialog

v0.2, Feb 10th 2015 (https://github.com/d-max/spots-dialog/releases/tag/v0.2?


utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=1743)

Fix issue on pre-lollipop


v0.1, Jan 15th 2015 (https://github.com/d-max/spots-dialog/releases/tag/v0.1?
utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=1743)

Style customization

===========

Developed By
Maksym Dybarskyi - http://d-max.info (http://d-max.info?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=1743)

===========

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.

Follow us on Twitter (https://twitter.com/Android_Arsenal?utm_source=android-


arsenal.com&utm_medium=referral&utm_campaign=1743)

Read us in Telegram (https://telegram.me/AndroidArsenal?utm_source=android-


arsenal.com&utm_medium=referral&utm_campaign=1743)

Get Android app on Google Play (https://play.google.com/store/apps/details?


id=com.android_arsenal.androidarsenal&utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=1743)

Stay informed with Pushbullet (https://www.pushbullet.com/channel?tag=android_arsenal&utm_source=android-


arsenal.com&utm_medium=referral&utm_campaign=1743)

Created by Vladislav Bauer (https://github.com/vbauer?utm_source=android-


arsenal.com&utm_medium=referral&utm_campaign=1743)
 (https://twitter.com/BauerVlad?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=1743)
 (https://www.linkedin.com/in/vladislavbauer?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=1743)
 (https://www.paypal.me/VladislavBauer?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=1743)
© 2014-2018 - Android Arsenal (/) | Privacy (/privacy)

Você também pode gostar