【开源】spots-dialog

spots-dialog

使用说明:

和AlertDialog的使用方法一样:

1
2
3
4
AlertDialog dialog = new SpotsDialog(context);
dialog.show();
...
dialog.dismiss();

Use android styles to customize the dialog. Next custom attributes provided:

使用样式来自定义dialog:

  • DialogTitleAppearance : style reference

  • DialogTitleText : string

  • DialogSpotColor : color

  • DialogSpotCount : integer

比如:

1
2
3
4
5
6
7
8
9
<?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>

应用此样式

1
new SpotsDialog(context, R.style.Custom).show();
 

 

 

在5.0之前的设备上DialogSpotColor无效果,因为没有@android:color/holo_orange_dark颜色,可以在你的资源文件中自己定义一个

1
2
3
4
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="spots_dialog_color">@color/your_color_value</color>
</resources>

posted on 2015-05-08 12:09  wasdchenhao  阅读(465)  评论(0)    收藏  举报

导航