# The original project(sweet-alert-dialog) is updated
Original project address:[https://github.com/pedant/sweet-alert-dialog](https://github.com/pedant/sweet-alert-dialog)
Sweet Alert Dialog
===================
SweetAlert for Android, a beautiful and clever alert dialog
[![996.icu](https://img.shields.io/badge/link-996.icu-red.svg)](https://996.icu)
[![LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg)](https://github.com/996icu/996.ICU/blob/master/LICENSE)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Sweet%20Alert%20Dialog-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1065)
[中文版](https://github.com/cazaea/SweetAlertDialog/blob/master/README.zh.md)
[Demo Download](https://github.com/pedant/sweet-alert-dialog/releases/download/v1.1/sweet-alert-sample-v1.1.apk)
## ScreenShot
![image](https://github.com/pedant/sweet-alert-dialog/raw/master/change_type.gif)
## Setup
The simplest way to use SweetAlertDialog is to add the library as aar dependency to your build.
**Gradle**(Module)
```
dependencies {
compile 'com.github.cazaea:sweet-alert-dialog:1.0.0'
}
```
**Gradle**(Project)
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
...
}
}
```
## Usage
show material progress
```
SweetAlertDialog pDialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
pDialog.setTitleText("Loading");
pDialog.setCancelable(false);
pDialog.show();
```
![image](https://github.com/pedant/sweet-alert-dialog/raw/master/play_progress.gif)
You can customize progress bar dynamically with materialish-progress methods via **SweetAlertDialog.getProgressHelper()**:
- resetCount()
- isSpinning()
- spin()
- stopSpinning()
- getProgress()
- setProgress(float progress)
- setInstantProgress(float progress)
- getCircleRadius()
- setCircleRadius(int circleRadius)
- getBarWidth()
- setBarWidth(int barWidth)
- getBarColor()
- setBarColor(int barColor)
- getRimWidth()
- setRimWidth(int rimWidth)
- getRimColor()
- setRimColor(int rimColor)
- getSpinSpeed()
- setSpinSpeed(float spinSpeed)
thanks to the project [materialish-progress](https://github.com/pnikosis/materialish-progress) and [@pedant](https://github.com/pedant) participation.
more usages about progress, please see the sample.
A basic message:
new SweetAlertDialog(this)
.setTitleText("Here's a message!")
.setConfirmText("OK") // Do not set the property, do not show the button
.show();
A title with a text under:
new SweetAlertDialog(this)
.setTitleText("Here's a message!")
.setContentText("It's pretty, isn't it?")
.setConfirmText("OK")
.show();
A error message:
new SweetAlertDialog(this, SweetAlertDialog.ERROR_TYPE)
.setTitleText("Oops...")
.setContentText("Something went wrong!")
.setConfirmText("OK")
.show();
A warning message:
new SweetAlertDialog(this, SweetAlertDialog.WARNING_TYPE)
.setTitleText("Are you sure?")
.setContentText("Won't be able to recover this file!")
.setConfirmText("Yes,delete it!")
.show();
A success message:
new SweetAlertDialog(this, SweetAlertDialog.SUCCESS_TYPE)
.setTitleText("Good job!")
.setContentText("You clicked the button!")
.show();
A message with a custom icon:
new SweetAlertDialog(this, SweetAlertDialog.CUSTOM_IMAGE_TYPE)
.setTitleText("Sweet!")
.setContentText("Here's a custom image.")
.setCustomImage(R.drawable.custom_img)
.show();
Bind the listener to confirm button:
new SweetAlertDialog(this, SweetAlertDialog.WARNING_TYPE)
.setTitleText("Are you sure?")
.setContentText("Won't be able to recover this file!")
.setConfirmText("Yes,delete it!")
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
@Override
public void onClick(SweetAlertDialog sDialog) {
sDialog.dismissWithAnimation();
}
})
.show();
Show the cancel button and bind listener to it:
new SweetAlertDialog(this, SweetAlertDialog.WARNING_TYPE)
.setTitleText("Are you sure?")
.setContentText("Won't be able to recover this file!")
.setCancelText("No,cancel plx!")
.setConfirmText("Yes,delete it!")
.showCancelButton(true)
.setCancelClickListener(new SweetAlertDialog.OnSweetClickListener() {
@Override
public void onClick(SweetAlertDialog sDialog) {
sDialog.cancel();
}
})
.show();
**Change** the dialog style upon confirming:
new SweetAlertDialog(this, SweetAlertDialog.WARNING_TYPE)
.setTitleText("Are you sure?")
.setContentText("Won't be able to recover this file!")
.setConfirmText("Yes,delete it!")
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
@Override
public void onClick(SweetAlertDialog sDialog) {
sDialog
.setTitleText("Deleted!")
.setContentText("Your imaginary file has been deleted!")
.setConfirmText("OK")
.setConfirmClickListener(null)
.changeAlertType(SweetAlertDialog.SUCCESS_TYPE);
}
})
.show();
[more android tech shares: cazaea.com](http://www.cazaea.com)
## License
Anti 996 License Version 1.0 (Draft)
Copyright (c) 2017 Cazaea(http://cazaea.com)
Permission is hereby granted to any individual or legal entity
obtaining a copy of this licensed work (including the source code,
documentation and/or related items, hereinafter collectively referred
to as the "licensed work"), free of charge, to deal with the licensed
work for any purpose, including without limitation, the rights to use,
reproduce, modify, prepare derivative works of, distribute, publish
and sublicense the licensed work, subject to the following conditions:
1. The individual or the legal entity must conspicuously display,
without modification, this License and the notice on each redistributed
or derivative copy of the Licensed Work.
2. The individual or the legal entity must strictly comply with all
applicable laws, regulations, rules and standards of the jurisdiction
relating to labor and employment where the individual is physically
located or where the individual was born or naturalized; or where the
legal entity is registered or is operating (whichever is stricter). In
case that the jurisdiction has no such laws, regulations, rules and
standards or its laws, regulations, rules and standards are
unenforceable, the individual or the legal entity are required to
comply with Core International Labor Standards.
3. The individual or the legal entity shall not induce or force its
employee(s), whether full-time or part-time, or its independent
contractor(s), in any methods, to agree in oral or written form, to
directly or indirectly restrict, weaken or relinquish his or her
rights or remedies under such laws, regulations, rules and standards
relating to labor and employment as mentioned above, no matter whether
such written or oral agreement are enforceable under the laws of the
said jurisdiction, nor shall such individual or the legal entity
limit, in any methods, the rights of its employee(s) or independent
contractor(s) from reporting or complaining to the copyright holder or
relevant authorities monitoring the compliance of the license about
its violation(s) of the said license.
THE LICENSED WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRES
没有合适的资源?快使用搜索试试~ 我知道了~
原项目sweet-alert-dialog在AS3.0,gradle4.1环境下报错.zip
共71个文件
xml:37个
png:11个
java:6个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 36 浏览量
2023-04-05
13:03:41
上传
评论
收藏 209KB ZIP 举报
温馨提示
原项目sweet-alert-dialog在AS3.0,gradle4.1环境下报错.zip
资源推荐
资源详情
资源评论
收起资源包目录
原项目sweet-alert-dialog在AS3.0,gradle4.1环境下报错.zip (71个子文件)
SweetAlertDialog-master
gradle.properties 866B
gradle
wrapper
gradle-wrapper.jar 52KB
gradle-wrapper.properties 230B
library
src
main
java
com
cazaea
sweetalert
ProgressHelper.java 4KB
SuccessTickView.java 5KB
OptAnimationLoader.java 3KB
Rotate3dAnimation.java 5KB
SweetAlertDialog.java 13KB
res
anim
success_mask_layout.xml 508B
modal_in.xml 1KB
modal_out.xml 550B
success_bow_roate.xml 367B
error_x_in.xml 878B
error_frame_in.xml 590B
values
colors.xml 1KB
dimen.xml 211B
strings.xml 275B
attrs.xml 508B
styles.xml 1KB
layout
alert_dialog.xml 5KB
drawable
success_bow.xml 316B
success_circle.xml 322B
error_center_x.xml 1KB
warning_circle.xml 316B
warning_sigh.xml 753B
error_circle.xml 314B
gray_button_background.xml 537B
red_button_background.xml 535B
dialog_background.xml 213B
blue_button_background.xml 537B
AndroidManifest.xml 108B
proguard-rules.pro 751B
build.gradle 1KB
.gitignore 481B
app
src
main
java
com
cazaea
sweetalert
sample
SampleActivity.java 9KB
res
mipmap-xxhdpi
ic_launcher_round.png 10KB
ic_launcher.png 6KB
mipmap-hdpi
ic_launcher_round.png 5KB
ic_launcher.png 3KB
drawable-v24
ic_launcher_foreground.xml 2KB
mipmap-anydpi-v26
ic_launcher.xml 272B
ic_launcher_round.xml 272B
mipmap-mdpi
ic_launcher_round.png 3KB
ic_launcher.png 2KB
mipmap-xxxhdpi
ic_launcher_round.png 15KB
ic_launcher.png 9KB
mipmap-xhdpi
ic_launcher_round.png 7KB
ic_launcher.png 4KB
values
colors.xml 208B
strings.xml 81B
styles.xml 383B
layout
sample_activity.xml 7KB
drawable
ic_launcher_background.xml 5KB
custom_img.jpg 29KB
logo_big.png 17KB
AndroidManifest.xml 859B
proguard-rules.pro 751B
build.gradle 1000B
.gitignore 481B
gradlew.bat 2KB
build.gradle 672B
.idea
runConfigurations.xml 564B
vcs.xml 180B
misc.xml 2KB
modules.xml 486B
gradle.xml 679B
settings.gradle 27B
gradlew 5KB
.gitignore 481B
README.zh.md 8KB
README.md 8KB
共 71 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功