Spots progress dialog
Android AlertDialog with moving spots progress indicator packed as android library.
Usage
The library available in maven central repository. You can get it using:
dependencies {
compile 'com.github.d-max:spots-dialog:0.7@aar'
}
Javadoc and sources package [classifiers][3] available too.
Note: The library requires minimum API level 15.
[SpotsDialog][4] class is an inheritor of a AlertDialog class. You can use it just like simple [AlertDialog][5]. For example:
AlertDialog dialog = new SpotsDialog(context);
dialog.show();
...
dialog.dismiss();
Attention!
If you're using proguard, add this code to your rules file:
-keep class dmax.dialog.** {
*;
}
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:
<?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>
Pass it into constuctor:
new SpotsDialog(context, R.style.Custom).show();
Result:
![Example Image1][2]
If you need to change just a dialogs message, use constructor:
new SpotsDialog(context, "Завантаження").show();