Full Code of pedant/sweet-alert-dialog for AI

master 770bb183fb4f cached
45 files
85.7 KB
21.7k tokens
81 symbols
1 requests
Download .txt
Repository: pedant/sweet-alert-dialog
Branch: master
Commit: 770bb183fb4f
Files: 45
Total size: 85.7 KB

Directory structure:
gitextract_j7agdo7h/

├── README.md
├── README.zh.md
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── library/
│   ├── build.gradle
│   ├── gradle.properties
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── cn/
│           │       └── pedant/
│           │           └── SweetAlert/
│           │               ├── OptAnimationLoader.java
│           │               ├── ProgressHelper.java
│           │               ├── Rotate3dAnimation.java
│           │               ├── SuccessTickView.java
│           │               └── SweetAlertDialog.java
│           └── res/
│               ├── anim/
│               │   ├── error_frame_in.xml
│               │   ├── error_x_in.xml
│               │   ├── modal_in.xml
│               │   ├── modal_out.xml
│               │   ├── success_bow_roate.xml
│               │   └── success_mask_layout.xml
│               ├── drawable/
│               │   ├── blue_button_background.xml
│               │   ├── dialog_background.xml
│               │   ├── error_center_x.xml
│               │   ├── error_circle.xml
│               │   ├── gray_button_background.xml
│               │   ├── red_button_background.xml
│               │   ├── success_bow.xml
│               │   ├── success_circle.xml
│               │   ├── warning_circle.xml
│               │   └── warning_sigh.xml
│               ├── layout/
│               │   └── alert_dialog.xml
│               └── values/
│                   ├── attrs.xml
│                   ├── colors.xml
│                   ├── dimen.xml
│                   ├── strings.xml
│                   └── styles.xml
├── sample/
│   ├── build.gradle
│   ├── proguard-android.txt
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── cn/
│           │       └── pedant/
│           │           └── SweetAlert/
│           │               └── sample/
│           │                   └── SampleActivity.java
│           └── res/
│               ├── layout/
│               │   └── sample_activity.xml
│               └── values/
│                   └── strings.xml
└── settings.gradle

================================================
FILE CONTENTS
================================================

================================================
FILE: README.md
================================================
Sweet Alert Dialog
===================
SweetAlert for Android, a beautiful and clever alert dialog

[![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/pedant/sweet-alert-dialog/blob/master/README.zh.md)

Inspired by JavaScript [SweetAlert](http://tristanedwards.me/sweetalert)

[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.

**Maven**

    <dependency>
      <groupId>cn.pedant.sweetalert</groupId>
      <artifactId>library</artifactId>
      <version>1.3</version>
      <type>aar</type>
    </dependency>

**Gradle**

    repositories {
        mavenCentral()
    }

    dependencies {
        compile 'cn.pedant.sweetalert:library:1.3'
    }

## 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 [@croccio](https://github.com/croccio) participation.

more usages about progress, please see the sample.

A basic message:

    new SweetAlertDialog(this)
        .setTitleText("Here's a message!")
        .show();

A title with a text under:

    new SweetAlertDialog(this)
        .setTitleText("Here's a message!")
        .setContentText("It's pretty, isn't it?")
        .show();

A error message:

    new SweetAlertDialog(this, SweetAlertDialog.ERROR_TYPE)
        .setTitleText("Oops...")
        .setContentText("Something went wrong!")
        .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: pedant.cn](http://www.pedant.cn)

## License

    The MIT License (MIT)

    Copyright (c) 2014 Pedant(http://pedant.cn)

    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.




================================================
FILE: README.zh.md
================================================
Sweet Alert Dialog
===================
Android版的SweetAlert,清新文艺,快意灵动的甜心弹框

[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Sweet%20Alert%20Dialog-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1065)

[English Version](https://github.com/pedant/sweet-alert-dialog/blob/master/README.md)

灵感来源于JS版[SweetAlert](http://tristanedwards.me/sweetalert)

[Demo下载](https://github.com/pedant/sweet-alert-dialog/releases/download/v1.1/sweet-alert-sample-v1.1.apk)

## 运行示意图
![image](https://github.com/pedant/sweet-alert-dialog/raw/master/change_type.gif)

## 安装
使用SweetAlertDialog最简单的办法就是像下面这样添加项目依赖。

**Maven**

    <dependency>
      <groupId>cn.pedant.sweetalert</groupId>
      <artifactId>library</artifactId>
      <version>1.3</version>
      <type>aar</type>
    </dependency>

**Gradle**

    repositories {
        mavenCentral()
    }

    dependencies {
        compile 'cn.pedant.sweetalert:library:1.3'
    }

## 如何开始
显示Material进度样式

    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)

你可以通过**SweetAlertDialog.getProgressHelper()**调用materialish-progress中下面这些方法,来动态改变进度条的样式
- 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)

感谢[materialish-progress](https://github.com/pnikosis/materialish-progress)项目以及[@croccio](https://github.com/croccio)的参与。

更多关于进度条的用法,请参见样例代码。

只显示标题:

    new SweetAlertDialog(this)
        .setTitleText("Here's a message!")
        .show();

显示标题和内容:

    new SweetAlertDialog(this)
        .setTitleText("Here's a message!")
        .setContentText("It's pretty, isn't it?")
        .show();

显示异常样式:

    new SweetAlertDialog(this, SweetAlertDialog.ERROR_TYPE)
        .setTitleText("Oops...")
        .setContentText("Something went wrong!")
        .show();

显示警告样式:

    new SweetAlertDialog(this, SweetAlertDialog.WARNING_TYPE)
        .setTitleText("Are you sure?")
        .setContentText("Won't be able to recover this file!")
        .setConfirmText("Yes,delete it!")
        .show();

显示成功完成样式:

    new SweetAlertDialog(this, SweetAlertDialog.SUCCESS_TYPE)
        .setTitleText("Good job!")
        .setContentText("You clicked the button!")
        .show();

自定义头部图像:

    new SweetAlertDialog(this, SweetAlertDialog.CUSTOM_IMAGE_TYPE)
        .setTitleText("Sweet!")
        .setContentText("Here's a custom image.")
        .setCustomImage(R.drawable.custom_img)
        .show();

确认事件绑定:

    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();

显示取消按钮及事件绑定:

    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();

确认后**切换**对话框样式:

    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();

[更多Android原创技术分享见: pedant.cn](http://www.pedant.cn)

## License

    The MIT License (MIT)

    Copyright (c) 2014 Pedant(http://pedant.cn)

    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.




================================================
FILE: build.gradle
================================================
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.14.1'
    }
}

ext {
    compileSdkVersion = 21
    buildToolsVersion = "19.1.0"
}

allprojects {
    repositories {
        mavenCentral()
    }
}


================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Tue Dec 02 17:43:17 CET 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip

================================================
FILE: gradle.properties
================================================
VERSION_NAME=1.3
VERSION_CODE=4
GROUP=cn.pedant.sweetalert

POM_DESCRIPTION=SweetAlert for Android, a beautiful and clever alert dialog.
POM_URL=https://github.com/pedant/sweet-alert-dialog
POM_SCM_URL=https://github.com/pedant/sweet-alert-dialog
POM_SCM_CONNECTION=scm:git@github.com:pedant/sweet-alert-dialog.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:pedant/sweet-alert-dialog.git
POM_LICENCE_NAME=The MIT License
POM_LICENCE_URL=http://opensource.org/licenses/MIT
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=pedant
POM_DEVELOPER_NAME=Pedant


================================================
FILE: gradlew
================================================
#!/usr/bin/env bash

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
    echo "$*"
}

die ( ) {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
    [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option

        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=$((i+1))
    done
    case $i in
        (0) set -- ;;
        (1) set -- "$args0" ;;
        (2) set -- "$args0" "$args1" ;;
        (3) set -- "$args0" "$args1" "$args2" ;;
        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
    esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
    JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"


================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega


================================================
FILE: library/build.gradle
================================================
apply plugin: 'com.android.library'

version = VERSION_NAME
group = GROUP

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        minSdkVersion 9
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    compile 'com.pnikosis:materialish-progress:1.0'
}

apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'

================================================
FILE: library/gradle.properties
================================================
POM_NAME=SweetAlertDialog-Library
POM_ARTIFACT_ID=library
POM_PACKAGING=aar

================================================
FILE: library/src/main/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cn.pedant.SweetAlert"
android:versionCode="2"
android:versionName="1.1">

<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="17"/>

<application />

</manifest>

================================================
FILE: library/src/main/java/cn/pedant/SweetAlert/OptAnimationLoader.java
================================================
package cn.pedant.SweetAlert;

import android.content.Context;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.util.AttributeSet;
import android.util.Xml;
import android.view.animation.*;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import java.io.IOException;

public class OptAnimationLoader {

    public static Animation loadAnimation(Context context, int id)
            throws Resources.NotFoundException {

        XmlResourceParser parser = null;
        try {
            parser = context.getResources().getAnimation(id);
            return createAnimationFromXml(context, parser);
        } catch (XmlPullParserException ex) {
            Resources.NotFoundException rnf = new Resources.NotFoundException("Can't load animation resource ID #0x" +
                    Integer.toHexString(id));
            rnf.initCause(ex);
            throw rnf;
        } catch (IOException ex) {
            Resources.NotFoundException rnf = new Resources.NotFoundException("Can't load animation resource ID #0x" +
                    Integer.toHexString(id));
            rnf.initCause(ex);
            throw rnf;
        } finally {
            if (parser != null) parser.close();
        }
    }

    private static Animation createAnimationFromXml(Context c, XmlPullParser parser)
            throws XmlPullParserException, IOException {

        return createAnimationFromXml(c, parser, null, Xml.asAttributeSet(parser));
    }

    private static Animation createAnimationFromXml(Context c, XmlPullParser parser,
                                                    AnimationSet parent, AttributeSet attrs) throws XmlPullParserException, IOException {

        Animation anim = null;

        // Make sure we are on a start tag.
        int type;
        int depth = parser.getDepth();

        while (((type=parser.next()) != XmlPullParser.END_TAG || parser.getDepth() > depth)
                && type != XmlPullParser.END_DOCUMENT) {

            if (type != XmlPullParser.START_TAG) {
                continue;
            }

            String  name = parser.getName();

            if (name.equals("set")) {
                anim = new AnimationSet(c, attrs);
                createAnimationFromXml(c, parser, (AnimationSet)anim, attrs);
            } else if (name.equals("alpha")) {
                anim = new AlphaAnimation(c, attrs);
            } else if (name.equals("scale")) {
                anim = new ScaleAnimation(c, attrs);
            }  else if (name.equals("rotate")) {
                anim = new RotateAnimation(c, attrs);
            }  else if (name.equals("translate")) {
                anim = new TranslateAnimation(c, attrs);
            } else {
                try {
                    anim = (Animation) Class.forName(name).getConstructor(Context.class, AttributeSet.class).newInstance(c, attrs);
                } catch (Exception te) {
                    throw new RuntimeException("Unknown animation name: " + parser.getName() + " error:" + te.getMessage());
                }
            }

            if (parent != null) {
                parent.addAnimation(anim);
            }
        }

        return anim;

    }
}


================================================
FILE: library/src/main/java/cn/pedant/SweetAlert/ProgressHelper.java
================================================
package cn.pedant.SweetAlert;

import android.content.Context;

import com.pnikosis.materialishprogress.ProgressWheel;

public class ProgressHelper {
    private ProgressWheel mProgressWheel;
    private boolean mToSpin;
    private float mSpinSpeed;
    private int mBarWidth;
    private int mBarColor;
    private int mRimWidth;
    private int mRimColor;
    private boolean mIsInstantProgress;
    private float mProgressVal;
    private int mCircleRadius;

    public ProgressHelper(Context ctx) {
        mToSpin = true;
        mSpinSpeed = 0.75f;
        mBarWidth = ctx.getResources().getDimensionPixelSize(R.dimen.common_circle_width) + 1;
        mBarColor = ctx.getResources().getColor(R.color.success_stroke_color);
        mRimWidth = 0;
        mRimColor = 0x00000000;
        mIsInstantProgress = false;
        mProgressVal = -1;
        mCircleRadius = ctx.getResources().getDimensionPixelOffset(R.dimen.progress_circle_radius);
    }

    public ProgressWheel getProgressWheel () {
        return mProgressWheel;
    }

    public void setProgressWheel (ProgressWheel progressWheel) {
        mProgressWheel = progressWheel;
        updatePropsIfNeed();
    }

    private void updatePropsIfNeed () {
        if (mProgressWheel != null) {
            if (!mToSpin && mProgressWheel.isSpinning()) {
                mProgressWheel.stopSpinning();
            } else if (mToSpin && !mProgressWheel.isSpinning()) {
                mProgressWheel.spin();
            }
            if (mSpinSpeed != mProgressWheel.getSpinSpeed()) {
                mProgressWheel.setSpinSpeed(mSpinSpeed);
            }
            if (mBarWidth != mProgressWheel.getBarWidth()) {
                mProgressWheel.setBarWidth(mBarWidth);
            }
            if (mBarColor != mProgressWheel.getBarColor()) {
                mProgressWheel.setBarColor(mBarColor);
            }
            if (mRimWidth != mProgressWheel.getRimWidth()) {
                mProgressWheel.setRimWidth(mRimWidth);
            }
            if (mRimColor != mProgressWheel.getRimColor()) {
                mProgressWheel.setRimColor(mRimColor);
            }
            if (mProgressVal != mProgressWheel.getProgress()) {
                if (mIsInstantProgress) {
                    mProgressWheel.setInstantProgress(mProgressVal);
                } else {
                    mProgressWheel.setProgress(mProgressVal);
                }
            }
            if (mCircleRadius != mProgressWheel.getCircleRadius()) {
                mProgressWheel.setCircleRadius(mCircleRadius);
            }
        }
    }

    public void resetCount() {
        if (mProgressWheel != null) {
            mProgressWheel.resetCount();
        }
    }

    public boolean isSpinning() {
        return mToSpin;
    }

    public void spin() {
        mToSpin = true;
        updatePropsIfNeed();
    }

    public void stopSpinning() {
        mToSpin = false;
        updatePropsIfNeed();
    }

    public float getProgress() {
        return mProgressVal;
    }

    public void setProgress(float progress) {
        mIsInstantProgress = false;
        mProgressVal = progress;
        updatePropsIfNeed();
    }

    public void setInstantProgress(float progress) {
        mProgressVal = progress;
        mIsInstantProgress = true;
        updatePropsIfNeed();
    }

    public int getCircleRadius() {
        return mCircleRadius;
    }

    /**
     * @param circleRadius units using pixel
     * **/
    public void setCircleRadius(int circleRadius) {
        mCircleRadius = circleRadius;
        updatePropsIfNeed();
    }

    public int getBarWidth() {
        return mBarWidth;
    }

    public void setBarWidth(int barWidth) {
        mBarWidth = barWidth;
        updatePropsIfNeed();
    }

    public int getBarColor() {
        return mBarColor;
    }

    public void setBarColor(int barColor) {
        mBarColor = barColor;
        updatePropsIfNeed();
    }

    public int getRimWidth() {
        return mRimWidth;
    }

    public void setRimWidth(int rimWidth) {
        mRimWidth = rimWidth;
        updatePropsIfNeed();
    }

    public int getRimColor() {
        return mRimColor;
    }

    public void setRimColor(int rimColor) {
        mRimColor = rimColor;
        updatePropsIfNeed();
    }

    public float getSpinSpeed() {
        return mSpinSpeed;
    }

    public void setSpinSpeed(float spinSpeed) {
        mSpinSpeed = spinSpeed;
        updatePropsIfNeed();
    }
}


================================================
FILE: library/src/main/java/cn/pedant/SweetAlert/Rotate3dAnimation.java
================================================
package cn.pedant.SweetAlert;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Camera;
import android.graphics.Matrix;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.animation.Animation;
import android.view.animation.Transformation;

public class Rotate3dAnimation extends Animation {
    private int mPivotXType = ABSOLUTE;
    private int mPivotYType = ABSOLUTE;
    private float mPivotXValue = 0.0f;
    private float mPivotYValue = 0.0f;

    private float mFromDegrees;
    private float mToDegrees;
    private float mPivotX;
    private float mPivotY;
    private Camera mCamera;
    private int mRollType;

    public static final int ROLL_BY_X = 0;
    public static final int ROLL_BY_Y = 1;
    public static final int ROLL_BY_Z = 2;

    protected static class Description {
        public int type;
        public float value;
    }

    Description parseValue(TypedValue value) {
        Description d = new Description();
        if (value == null) {
            d.type = ABSOLUTE;
            d.value = 0;
        } else {
            if (value.type == TypedValue.TYPE_FRACTION) {
                d.type = (value.data & TypedValue.COMPLEX_UNIT_MASK) ==
                        TypedValue.COMPLEX_UNIT_FRACTION_PARENT ?
                        RELATIVE_TO_PARENT : RELATIVE_TO_SELF;
                d.value = TypedValue.complexToFloat(value.data);
                return d;
            } else if (value.type == TypedValue.TYPE_FLOAT) {
                d.type = ABSOLUTE;
                d.value = value.getFloat();
                return d;
            } else if (value.type >= TypedValue.TYPE_FIRST_INT &&
                    value.type <= TypedValue.TYPE_LAST_INT) {
                d.type = ABSOLUTE;
                d.value = value.data;
                return d;
            }
        }

        d.type = ABSOLUTE;
        d.value = 0.0f;

        return d;
    }

    public Rotate3dAnimation (Context context, AttributeSet attrs) {
        super(context, attrs);

        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Rotate3dAnimation);

        mFromDegrees = a.getFloat(R.styleable.Rotate3dAnimation_fromDeg, 0.0f);
        mToDegrees = a.getFloat(R.styleable.Rotate3dAnimation_toDeg, 0.0f);
        mRollType = a.getInt(R.styleable.Rotate3dAnimation_rollType, ROLL_BY_X);
        Description d = parseValue(a.peekValue(R.styleable.Rotate3dAnimation_pivotX));
        mPivotXType = d.type;
        mPivotXValue = d.value;

        d = parseValue(a.peekValue(R.styleable.Rotate3dAnimation_pivotY));
        mPivotYType = d.type;
        mPivotYValue = d.value;

        a.recycle();

        initializePivotPoint();
    }

    public Rotate3dAnimation (int rollType, float fromDegrees, float toDegrees) {
        mRollType = rollType;
        mFromDegrees = fromDegrees;
        mToDegrees = toDegrees;
        mPivotX = 0.0f;
        mPivotY = 0.0f;
    }

    public Rotate3dAnimation (int rollType, float fromDegrees, float toDegrees, float pivotX, float pivotY) {
        mRollType = rollType;
        mFromDegrees = fromDegrees;
        mToDegrees = toDegrees;

        mPivotXType = ABSOLUTE;
        mPivotYType = ABSOLUTE;
        mPivotXValue = pivotX;
        mPivotYValue = pivotY;
        initializePivotPoint();
    }

    public Rotate3dAnimation (int rollType, float fromDegrees, float toDegrees, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue) {
        mRollType = rollType;
        mFromDegrees = fromDegrees;
        mToDegrees = toDegrees;

        mPivotXValue = pivotXValue;
        mPivotXType = pivotXType;
        mPivotYValue = pivotYValue;
        mPivotYType = pivotYType;
        initializePivotPoint();
    }

    private void initializePivotPoint() {
        if (mPivotXType == ABSOLUTE) {
            mPivotX = mPivotXValue;
        }
        if (mPivotYType == ABSOLUTE) {
            mPivotY = mPivotYValue;
        }
    }

    @Override
    public void initialize(int width, int height, int parentWidth, int parentHeight) {
        super.initialize(width, height, parentWidth, parentHeight);
        mCamera = new Camera();
        mPivotX = resolveSize(mPivotXType, mPivotXValue, width, parentWidth);
        mPivotY = resolveSize(mPivotYType, mPivotYValue, height, parentHeight);
    }

    @Override
    protected void applyTransformation(float interpolatedTime, Transformation t) {
        final float fromDegrees = mFromDegrees;
        float degrees = fromDegrees + ((mToDegrees - fromDegrees) * interpolatedTime);

        final Matrix matrix = t.getMatrix();

        mCamera.save();
        switch (mRollType) {
            case ROLL_BY_X:
                mCamera.rotateX(degrees);
                break;
            case ROLL_BY_Y:
                mCamera.rotateY(degrees);
                break;
            case ROLL_BY_Z:
                mCamera.rotateZ(degrees);
                break;
        }
        mCamera.getMatrix(matrix);
        mCamera.restore();

        matrix.preTranslate(-mPivotX, -mPivotY);
        matrix.postTranslate(mPivotX, mPivotY);
    }
}

================================================
FILE: library/src/main/java/cn/pedant/SweetAlert/SuccessTickView.java
================================================
package cn.pedant.SweetAlert;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Transformation;

public class SuccessTickView extends View {
    private float mDensity = -1;
    private Paint mPaint;
    private final float CONST_RADIUS = dip2px(1.2f);
    private final float CONST_RECT_WEIGHT = dip2px(3);
    private final float CONST_LEFT_RECT_W = dip2px(15);
    private final float CONST_RIGHT_RECT_W = dip2px(25);
    private final float MIN_LEFT_RECT_W = dip2px(3.3f);
    private final float MAX_RIGHT_RECT_W = CONST_RIGHT_RECT_W + dip2px(6.7f);

    private float mMaxLeftRectWidth;
    private float mLeftRectWidth;
    private float mRightRectWidth;
    private boolean mLeftRectGrowMode;

    public SuccessTickView(Context context) {
        super(context);
        init();
    }

    public SuccessTickView(Context context, AttributeSet attrs){
        super(context,attrs);
        init();
    }

    private void init () {
        mPaint = new Paint();
        mPaint.setColor(getResources().getColor(R.color.success_stroke_color));
        mLeftRectWidth = CONST_LEFT_RECT_W;
        mRightRectWidth = CONST_RIGHT_RECT_W;
        mLeftRectGrowMode = false;
    }

    @Override
    public void draw(Canvas canvas) {
        super.draw(canvas);
        int totalW = getWidth();
        int totalH = getHeight();
        // rotate canvas first
        canvas.rotate(45, totalW / 2, totalH / 2);

        totalW /= 1.2;
        totalH /= 1.4;
        mMaxLeftRectWidth = (totalW + CONST_LEFT_RECT_W) / 2 + CONST_RECT_WEIGHT - 1;

        RectF leftRect = new RectF();
        if (mLeftRectGrowMode) {
            leftRect.left = 0;
            leftRect.right = leftRect.left + mLeftRectWidth;
            leftRect.top = (totalH + CONST_RIGHT_RECT_W) / 2;
            leftRect.bottom = leftRect.top + CONST_RECT_WEIGHT;
        } else {
            leftRect.right = (totalW + CONST_LEFT_RECT_W) / 2 + CONST_RECT_WEIGHT - 1;
            leftRect.left = leftRect.right - mLeftRectWidth;
            leftRect.top = (totalH + CONST_RIGHT_RECT_W) / 2;
            leftRect.bottom = leftRect.top + CONST_RECT_WEIGHT;
        }

        canvas.drawRoundRect(leftRect, CONST_RADIUS, CONST_RADIUS, mPaint);

        RectF rightRect = new RectF();
        rightRect.bottom = (totalH + CONST_RIGHT_RECT_W) / 2 + CONST_RECT_WEIGHT - 1;
        rightRect.left = (totalW + CONST_LEFT_RECT_W) / 2;
        rightRect.right = rightRect.left + CONST_RECT_WEIGHT;
        rightRect.top = rightRect.bottom - mRightRectWidth;
        canvas.drawRoundRect(rightRect, CONST_RADIUS, CONST_RADIUS, mPaint);
    }

    public float dip2px(float dpValue) {
        if(mDensity == -1) {
            mDensity = getResources().getDisplayMetrics().density;
        }
        return dpValue * mDensity + 0.5f;
    }

    public void startTickAnim () {
        // hide tick
        mLeftRectWidth = 0;
        mRightRectWidth = 0;
        invalidate();
        Animation tickAnim = new Animation() {
            @Override
            protected void applyTransformation(float interpolatedTime, Transformation t) {
                super.applyTransformation(interpolatedTime, t);
                if (0.54 < interpolatedTime && 0.7 >= interpolatedTime) {  // grow left and right rect to right
                    mLeftRectGrowMode = true;
                    mLeftRectWidth = mMaxLeftRectWidth * ((interpolatedTime - 0.54f) / 0.16f);
                    if (0.65 < interpolatedTime) {
                        mRightRectWidth = MAX_RIGHT_RECT_W * ((interpolatedTime - 0.65f) / 0.19f);
                    }
                    invalidate();
                } else if (0.7 < interpolatedTime && 0.84 >= interpolatedTime) { // shorten left rect from right, still grow right rect
                    mLeftRectGrowMode = false;
                    mLeftRectWidth = mMaxLeftRectWidth * (1 - ((interpolatedTime - 0.7f) / 0.14f));
                    mLeftRectWidth = mLeftRectWidth < MIN_LEFT_RECT_W ? MIN_LEFT_RECT_W : mLeftRectWidth;
                    mRightRectWidth = MAX_RIGHT_RECT_W * ((interpolatedTime - 0.65f) / 0.19f);
                    invalidate();
                } else if (0.84 < interpolatedTime && 1 >= interpolatedTime) { // restore left rect width, shorten right rect to const
                    mLeftRectGrowMode = false;
                    mLeftRectWidth = MIN_LEFT_RECT_W + (CONST_LEFT_RECT_W - MIN_LEFT_RECT_W) * ((interpolatedTime - 0.84f) / 0.16f);
                    mRightRectWidth = CONST_RIGHT_RECT_W + (MAX_RIGHT_RECT_W - CONST_RIGHT_RECT_W) * (1 - ((interpolatedTime - 0.84f) / 0.16f));
                    invalidate();
                }
            }
        };
        tickAnim.setDuration(750);
        tickAnim.setStartOffset(100);
        startAnimation(tickAnim);
    }
}

================================================
FILE: library/src/main/java/cn/pedant/SweetAlert/SweetAlertDialog.java
================================================
package cn.pedant.SweetAlert;


import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.Transformation;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import com.pnikosis.materialishprogress.ProgressWheel;

import java.util.List;

public class SweetAlertDialog extends Dialog implements View.OnClickListener {
    private View mDialogView;
    private AnimationSet mModalInAnim;
    private AnimationSet mModalOutAnim;
    private Animation mOverlayOutAnim;
    private Animation mErrorInAnim;
    private AnimationSet mErrorXInAnim;
    private AnimationSet mSuccessLayoutAnimSet;
    private Animation mSuccessBowAnim;
    private TextView mTitleTextView;
    private TextView mContentTextView;
    private String mTitleText;
    private String mContentText;
    private boolean mShowCancel;
    private boolean mShowContent;
    private String mCancelText;
    private String mConfirmText;
    private int mAlertType;
    private FrameLayout mErrorFrame;
    private FrameLayout mSuccessFrame;
    private FrameLayout mProgressFrame;
    private SuccessTickView mSuccessTick;
    private ImageView mErrorX;
    private View mSuccessLeftMask;
    private View mSuccessRightMask;
    private Drawable mCustomImgDrawable;
    private ImageView mCustomImage;
    private Button mConfirmButton;
    private Button mCancelButton;
    private ProgressHelper mProgressHelper;
    private FrameLayout mWarningFrame;
    private OnSweetClickListener mCancelClickListener;
    private OnSweetClickListener mConfirmClickListener;
    private boolean mCloseFromCancel;

    public static final int NORMAL_TYPE = 0;
    public static final int ERROR_TYPE = 1;
    public static final int SUCCESS_TYPE = 2;
    public static final int WARNING_TYPE = 3;
    public static final int CUSTOM_IMAGE_TYPE = 4;
    public static final int PROGRESS_TYPE = 5;

    public static interface OnSweetClickListener {
        public void onClick (SweetAlertDialog sweetAlertDialog);
    }

    public SweetAlertDialog(Context context) {
        this(context, NORMAL_TYPE);
    }

    public SweetAlertDialog(Context context, int alertType) {
        super(context, R.style.alert_dialog);
        setCancelable(true);
        setCanceledOnTouchOutside(false);
        mProgressHelper = new ProgressHelper(context);
        mAlertType = alertType;
        mErrorInAnim = OptAnimationLoader.loadAnimation(getContext(), R.anim.error_frame_in);
        mErrorXInAnim = (AnimationSet)OptAnimationLoader.loadAnimation(getContext(), R.anim.error_x_in);
        // 2.3.x system don't support alpha-animation on layer-list drawable
        // remove it from animation set
        if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) {
            List<Animation> childAnims = mErrorXInAnim.getAnimations();
            int idx = 0;
            for (;idx < childAnims.size();idx++) {
                if (childAnims.get(idx) instanceof AlphaAnimation) {
                    break;
                }
            }
            if (idx < childAnims.size()) {
                childAnims.remove(idx);
            }
        }
        mSuccessBowAnim = OptAnimationLoader.loadAnimation(getContext(), R.anim.success_bow_roate);
        mSuccessLayoutAnimSet = (AnimationSet)OptAnimationLoader.loadAnimation(getContext(), R.anim.success_mask_layout);
        mModalInAnim = (AnimationSet) OptAnimationLoader.loadAnimation(getContext(), R.anim.modal_in);
        mModalOutAnim = (AnimationSet) OptAnimationLoader.loadAnimation(getContext(), R.anim.modal_out);
        mModalOutAnim.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                mDialogView.setVisibility(View.GONE);
                mDialogView.post(new Runnable() {
                    @Override
                    public void run() {
                        if (mCloseFromCancel) {
                            SweetAlertDialog.super.cancel();
                        } else {
                            SweetAlertDialog.super.dismiss();
                        }
                    }
                });
            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }
        });
        // dialog overlay fade out
        mOverlayOutAnim = new Animation() {
            @Override
            protected void applyTransformation(float interpolatedTime, Transformation t) {
                WindowManager.LayoutParams wlp = getWindow().getAttributes();
                wlp.alpha = 1 - interpolatedTime;
                getWindow().setAttributes(wlp);
            }
        };
        mOverlayOutAnim.setDuration(120);
    }

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.alert_dialog);

        mDialogView = getWindow().getDecorView().findViewById(android.R.id.content);
        mTitleTextView = (TextView)findViewById(R.id.title_text);
        mContentTextView = (TextView)findViewById(R.id.content_text);
        mErrorFrame = (FrameLayout)findViewById(R.id.error_frame);
        mErrorX = (ImageView)mErrorFrame.findViewById(R.id.error_x);
        mSuccessFrame = (FrameLayout)findViewById(R.id.success_frame);
        mProgressFrame = (FrameLayout)findViewById(R.id.progress_dialog);
        mSuccessTick = (SuccessTickView)mSuccessFrame.findViewById(R.id.success_tick);
        mSuccessLeftMask = mSuccessFrame.findViewById(R.id.mask_left);
        mSuccessRightMask = mSuccessFrame.findViewById(R.id.mask_right);
        mCustomImage = (ImageView)findViewById(R.id.custom_image);
        mWarningFrame = (FrameLayout)findViewById(R.id.warning_frame);
        mConfirmButton = (Button)findViewById(R.id.confirm_button);
        mCancelButton = (Button)findViewById(R.id.cancel_button);
        mProgressHelper.setProgressWheel((ProgressWheel)findViewById(R.id.progressWheel));
        mConfirmButton.setOnClickListener(this);
        mCancelButton.setOnClickListener(this);

        setTitleText(mTitleText);
        setContentText(mContentText);
        setCancelText(mCancelText);
        setConfirmText(mConfirmText);
        changeAlertType(mAlertType, true);

    }

    private void restore () {
        mCustomImage.setVisibility(View.GONE);
        mErrorFrame.setVisibility(View.GONE);
        mSuccessFrame.setVisibility(View.GONE);
        mWarningFrame.setVisibility(View.GONE);
        mProgressFrame.setVisibility(View.GONE);
        mConfirmButton.setVisibility(View.VISIBLE);

        mConfirmButton.setBackgroundResource(R.drawable.blue_button_background);
        mErrorFrame.clearAnimation();
        mErrorX.clearAnimation();
        mSuccessTick.clearAnimation();
        mSuccessLeftMask.clearAnimation();
        mSuccessRightMask.clearAnimation();
    }

    private void playAnimation () {
        if (mAlertType == ERROR_TYPE) {
            mErrorFrame.startAnimation(mErrorInAnim);
            mErrorX.startAnimation(mErrorXInAnim);
        } else if (mAlertType == SUCCESS_TYPE) {
            mSuccessTick.startTickAnim();
            mSuccessRightMask.startAnimation(mSuccessBowAnim);
        }
    }

    private void changeAlertType(int alertType, boolean fromCreate) {
        mAlertType = alertType;
        // call after created views
        if (mDialogView != null) {
            if (!fromCreate) {
                // restore all of views state before switching alert type
                restore();
            }
            switch (mAlertType) {
                case ERROR_TYPE:
                    mErrorFrame.setVisibility(View.VISIBLE);
                    break;
                case SUCCESS_TYPE:
                    mSuccessFrame.setVisibility(View.VISIBLE);
                    // initial rotate layout of success mask
                    mSuccessLeftMask.startAnimation(mSuccessLayoutAnimSet.getAnimations().get(0));
                    mSuccessRightMask.startAnimation(mSuccessLayoutAnimSet.getAnimations().get(1));
                    break;
                case WARNING_TYPE:
                    mConfirmButton.setBackgroundResource(R.drawable.red_button_background);
                    mWarningFrame.setVisibility(View.VISIBLE);
                    break;
                case CUSTOM_IMAGE_TYPE:
                    setCustomImage(mCustomImgDrawable);
                    break;
                case PROGRESS_TYPE:
                    mProgressFrame.setVisibility(View.VISIBLE);
                    mConfirmButton.setVisibility(View.GONE);
                    break;
            }
            if (!fromCreate) {
                playAnimation();
            }
        }
    }

    public int getAlerType () {
        return mAlertType;
    }

    public void changeAlertType(int alertType) {
        changeAlertType(alertType, false);
    }


    public String getTitleText () {
        return mTitleText;
    }

    public SweetAlertDialog setTitleText (String text) {
        mTitleText = text;
        if (mTitleTextView != null && mTitleText != null) {
            mTitleTextView.setText(mTitleText);
        }
        return this;
    }

    public SweetAlertDialog setCustomImage (Drawable drawable) {
        mCustomImgDrawable = drawable;
        if (mCustomImage != null && mCustomImgDrawable != null) {
            mCustomImage.setVisibility(View.VISIBLE);
            mCustomImage.setImageDrawable(mCustomImgDrawable);
        }
        return this;
    }

    public SweetAlertDialog setCustomImage (int resourceId) {
        return setCustomImage(getContext().getResources().getDrawable(resourceId));
    }

    public String getContentText () {
        return mContentText;
    }

    public SweetAlertDialog setContentText (String text) {
        mContentText = text;
        if (mContentTextView != null && mContentText != null) {
            showContentText(true);
            mContentTextView.setText(mContentText);
        }
        return this;
    }

    public boolean isShowCancelButton () {
        return mShowCancel;
    }

    public SweetAlertDialog showCancelButton (boolean isShow) {
        mShowCancel = isShow;
        if (mCancelButton != null) {
            mCancelButton.setVisibility(mShowCancel ? View.VISIBLE : View.GONE);
        }
        return this;
    }

    public boolean isShowContentText () {
        return mShowContent;
    }

    public SweetAlertDialog showContentText (boolean isShow) {
        mShowContent = isShow;
        if (mContentTextView != null) {
            mContentTextView.setVisibility(mShowContent ? View.VISIBLE : View.GONE);
        }
        return this;
    }

    public String getCancelText () {
        return mCancelText;
    }

    public SweetAlertDialog setCancelText (String text) {
        mCancelText = text;
        if (mCancelButton != null && mCancelText != null) {
            showCancelButton(true);
            mCancelButton.setText(mCancelText);
        }
        return this;
    }

    public String getConfirmText () {
        return mConfirmText;
    }

    public SweetAlertDialog setConfirmText (String text) {
        mConfirmText = text;
        if (mConfirmButton != null && mConfirmText != null) {
            mConfirmButton.setText(mConfirmText);
        }
        return this;
    }

    public SweetAlertDialog setCancelClickListener (OnSweetClickListener listener) {
        mCancelClickListener = listener;
        return this;
    }

    public SweetAlertDialog setConfirmClickListener (OnSweetClickListener listener) {
        mConfirmClickListener = listener;
        return this;
    }

    protected void onStart() {
        mDialogView.startAnimation(mModalInAnim);
        playAnimation();
    }

    /**
     * The real Dialog.cancel() will be invoked async-ly after the animation finishes.
     */
    @Override
    public void cancel() {
        dismissWithAnimation(true);
    }

    /**
     * The real Dialog.dismiss() will be invoked async-ly after the animation finishes.
     */
    public void dismissWithAnimation() {
        dismissWithAnimation(false);
    }

    private void dismissWithAnimation(boolean fromCancel) {
        mCloseFromCancel = fromCancel;
        mConfirmButton.startAnimation(mOverlayOutAnim);
        mDialogView.startAnimation(mModalOutAnim);
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.cancel_button) {
            if (mCancelClickListener != null) {
                mCancelClickListener.onClick(SweetAlertDialog.this);
            } else {
                dismissWithAnimation();
            }
        } else if (v.getId() == R.id.confirm_button) {
            if (mConfirmClickListener != null) {
                mConfirmClickListener.onClick(SweetAlertDialog.this);
            } else {
                dismissWithAnimation();
            }
        }
    }

    public ProgressHelper getProgressHelper () {
        return mProgressHelper;
    }
}

================================================
FILE: library/src/main/res/anim/error_frame_in.xml
================================================
<?xml version="1.0" encoding="utf-8"?>

<set xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:sweet="http://schemas.android.com/apk/res-auto"
     android:interpolator="@android:anim/linear_interpolator"
     android:shareInterpolator="true">

    <alpha
        android:fromAlpha="0"
        android:toAlpha="1"
        android:duration="400"/>

    <sweet:cn.pedant.SweetAlert.Rotate3dAnimation
        sweet:rollType="x"
        sweet:fromDeg="100"
        sweet:toDeg="0"
        sweet:pivotX="50%"
        sweet:pivotY="50%"
        android:duration="400"/>
</set>

================================================
FILE: library/src/main/res/anim/error_x_in.xml
================================================
<?xml version="1.0" encoding="utf-8"?>

<set xmlns:android="http://schemas.android.com/apk/res/android"
     android:interpolator="@android:anim/linear_interpolator"
     android:shareInterpolator="true">

    <alpha
        android:fromAlpha="0"
        android:toAlpha="1"
        android:duration="200"
        android:startOffset="200"/>

    <scale
        android:fromXScale="0.4"
        android:toXScale="1.15"
        android:fromYScale="0.4"
        android:toYScale="1.15"
        android:pivotX="50%"
        android:pivotY="50%"
        android:duration="120"
        android:startOffset="250"/>

    <scale
        android:fromXScale="1.15"
        android:toXScale="1"
        android:fromYScale="1.15"
        android:toYScale="1"
        android:pivotX="50%"
        android:pivotY="50%"
        android:duration="80"
        android:startOffset="370"/>
</set>

================================================
FILE: library/src/main/res/anim/modal_in.xml
================================================
<?xml version="1.0" encoding="utf-8"?>

<set xmlns:android="http://schemas.android.com/apk/res/android"
     android:interpolator="@android:anim/linear_interpolator"
     android:shareInterpolator="true">
    <alpha
        android:fromAlpha="0.2"
        android:toAlpha="1"
        android:duration="90"/>

    <scale
        android:fromXScale="0.7"
        android:toXScale="1.05"
        android:fromYScale="0.7"
        android:toYScale="1.05"
        android:pivotX="50%"
        android:pivotY="50%"
        android:duration="135"/>

    <scale
        android:fromXScale="1.05"
        android:toXScale="0.95"
        android:fromYScale="1.05"
        android:toYScale="0.95"
        android:pivotX="50%"
        android:pivotY="50%"
        android:duration="105"
        android:startOffset="135"/>

    <scale
        android:fromXScale="0.95"
        android:toXScale="1"
        android:fromYScale="0.95"
        android:toYScale="1"
        android:pivotX="50%"
        android:pivotY="50%"
        android:duration="60"
        android:startOffset="240"/>
</set>

================================================
FILE: library/src/main/res/anim/modal_out.xml
================================================
<?xml version="1.0" encoding="utf-8"?>

<set xmlns:android="http://schemas.android.com/apk/res/android"
     android:interpolator="@android:anim/linear_interpolator"
     android:shareInterpolator="true">
    <scale
        android:fromXScale="1"
        android:toXScale="0.6"
        android:fromYScale="1"
        android:toYScale="0.6"
        android:pivotX="50%"
        android:pivotY="50%"
        android:duration="150"/>
   <!-- <alpha
        android:fromAlpha="1"
        android:toAlpha="0"
        android:duration="150"/> -->
</set>

================================================
FILE: library/src/main/res/anim/success_bow_roate.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<rotate
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/accelerate_interpolator"
    android:fromDegrees="-45"
    android:toDegrees="-405"
    android:pivotX="0%"
    android:pivotY="50%"
    android:duration="300"
    android:fillAfter="true"
    android:startOffset="215">
</rotate>

================================================
FILE: library/src/main/res/anim/success_mask_layout.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <rotate
        android:fromDegrees="0"
        android:toDegrees="-45"
        android:pivotX="110%"
        android:pivotY="42%"
        android:duration="0"
        android:fillAfter="true">
    </rotate>

    <rotate
        android:fromDegrees="0"
        android:toDegrees="-45"
        android:pivotX="10%"
        android:pivotY="42%"
        android:duration="0"
        android:fillAfter="true">
    </rotate>
</set>

================================================
FILE: library/src/main/res/drawable/blue_button_background.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true">
        <shape android:shape="rectangle">
            <solid android:color="@color/blue_btn_bg_pressed_color" />
            <corners android:radius="6dp"/>
        </shape>
    </item>
    <item>
        <shape android:shape="rectangle">
            <solid android:color="@color/blue_btn_bg_color" />
            <corners android:radius="6dp"/>
        </shape>
    </item>
</selector>

================================================
FILE: library/src/main/res/drawable/dialog_background.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@color/sweet_dialog_bg_color" />
    <corners android:radius="6dp"/>
</shape>   

================================================
FILE: library/src/main/res/drawable/error_center_x.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <rotate android:fromDegrees="45" android:toDegrees="45" android:pivotX="50%" android:pivotY="50%">
            <shape android:shape="rectangle">
                <solid android:color="@color/error_stroke_color"/>
                <corners android:radius="4dp"/>
                <size android:height="3dp" android:width="28dp"/>
            </shape>
        </rotate>
    </item>

    <item>
        <rotate android:fromDegrees="315" android:toDegrees="315" android:pivotX="50%" android:pivotY="50%">
            <shape android:shape="rectangle">
                <solid android:color="@color/error_stroke_color"/>
                <corners android:radius="4dp"/>
                <size android:height="3dp" android:width="28dp"/>
            </shape>
        </rotate>
    </item>
</layer-list>

================================================
FILE: library/src/main/res/drawable/error_circle.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@android:color/transparent" />
    <stroke android:color="@color/error_stroke_color" android:width="@dimen/common_circle_width" />
</shape>



================================================
FILE: library/src/main/res/drawable/gray_button_background.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true">
        <shape android:shape="rectangle">
            <solid android:color="@color/gray_btn_bg_pressed_color" />
            <corners android:radius="6dp"/>
        </shape>
    </item>
    <item>
        <shape android:shape="rectangle">
            <solid android:color="@color/gray_btn_bg_color" />
            <corners android:radius="6dp"/>
        </shape>
    </item>
</selector>

================================================
FILE: library/src/main/res/drawable/red_button_background.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true">
        <shape android:shape="rectangle">
            <solid android:color="@color/red_btn_bg_pressed_color" />
            <corners android:radius="6dp"/>
        </shape>
    </item>
    <item>
        <shape android:shape="rectangle">
            <solid android:color="@color/red_btn_bg_color" />
            <corners android:radius="6dp"/>
        </shape>
    </item>
</selector>

================================================
FILE: library/src/main/res/drawable/success_bow.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@android:color/transparent" />
    <stroke android:color="@color/success_stroke_color" android:width="@dimen/common_circle_width" />
</shape>



================================================
FILE: library/src/main/res/drawable/success_circle.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@android:color/transparent" />
    <stroke android:color="@color/trans_success_stroke_color" android:width="@dimen/common_circle_width" />
</shape>



================================================
FILE: library/src/main/res/drawable/warning_circle.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@android:color/transparent" />
    <stroke android:color="@color/warning_stroke_color" android:width="@dimen/common_circle_width" />
</shape>



================================================
FILE: library/src/main/res/drawable/warning_sigh.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:bottom="8dp" android:left="1dp" android:right="1dp">
        <shape android:shape="rectangle">
            <solid android:color="@color/warning_stroke_color"/>
            <corners android:radius="4dp"/>
            <size android:height="22dp" android:width="3dp"/>
        </shape>
    </item>

    <item android:top="30dp">
        <shape android:shape="oval">
            <solid android:color="@color/warning_stroke_color"/>
            <size android:height="5dp" android:width="4dp"/>
        </shape>
    </item>
</layer-list>

================================================
FILE: library/src/main/res/layout/alert_dialog.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:wheel="http://schemas.android.com/apk/res-auto"
    android:id="@+id/loading"
    android:layout_width="@dimen/alert_width"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:layout_gravity="center"
    android:orientation="vertical"
    android:background="@drawable/dialog_background"
    android:padding="10dp">

    <ImageView
        android:id="@+id/custom_image"
        android:layout_width="53dp"
        android:layout_height="53dp"
        android:layout_marginTop="5dp"
        android:contentDescription="@string/app_name"
        android:visibility="gone"
        android:scaleType="fitCenter" />

    <FrameLayout
        android:id="@+id/error_frame"
        android:layout_width="53dp"
        android:layout_height="53dp"
        android:layout_marginTop="5dp"
        android:visibility="gone">
        <View
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/error_circle" />

        <ImageView
            android:id="@+id/error_x"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:contentDescription="@string/app_name"
            android:src="@drawable/error_center_x"
            android:scaleType="center" />

    </FrameLayout>

    <FrameLayout
        android:id="@+id/success_frame"
        android:layout_width="53dp"
        android:layout_height="53dp"
        android:layout_marginTop="5dp"
        android:visibility="gone">

        <View
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/success_bow" />

        <View
            android:id="@+id/mask_right"
            android:layout_width="35dp"
            android:layout_height="80dp"
            android:layout_marginTop="-13dp"
            android:layout_gravity="right"
            android:background="@android:color/white" />

        <View
            android:id="@+id/mask_left"
            android:layout_width="21dp"
            android:layout_height="60dp"
            android:layout_marginLeft="-3dp"
            android:layout_gravity="left"
            android:background="@android:color/white" />

        <View
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/success_circle" />

        <cn.pedant.SweetAlert.SuccessTickView
            android:id="@+id/success_tick"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    </FrameLayout>

    <FrameLayout
        android:id="@+id/warning_frame"
        android:layout_width="53dp"
        android:layout_height="53dp"
        android:layout_marginTop="5dp"
        android:visibility="gone">

        <View
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/warning_circle" />

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:contentDescription="@string/app_name"
            android:src="@drawable/warning_sigh"
            android:scaleType="center" />
    </FrameLayout>

    <FrameLayout
        android:id="@+id/progress_dialog"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="9dp"
        android:layout_gravity="center"
        android:orientation="vertical"
        android:visibility="gone">

        <com.pnikosis.materialishprogress.ProgressWheel
            android:id="@+id/progressWheel"
            android:layout_width="80dp"
            android:layout_height="80dp"
            wheel:progressIndeterminate="true"
            android:layout_gravity="center" />
    </FrameLayout>

    <TextView
        android:id="@+id/title_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="19sp"
        android:textColor="#575757"
        android:layout_marginTop="10dp"
        android:singleLine="true"
        android:text="@string/dialog_default_title" />

    <TextView
        android:id="@+id/content_text"
        android:layout_marginTop="10dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="14sp"
        android:textAlignment="center"
        android:gravity="center"
        android:textColor="#797979"
        android:visibility="gone" />

    <LinearLayout
        android:layout_marginTop="10dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center">

        <Button
            android:id="@+id/cancel_button"
            style="@style/dialog_blue_button"
            android:background="@drawable/gray_button_background"
            android:layout_marginRight="10dp"
            android:visibility="gone"
            android:text="@string/dialog_cancel" />

        <Button
            android:id="@+id/confirm_button"
            style="@style/dialog_blue_button"
            android:text="@string/dialog_ok" />
    </LinearLayout>
</LinearLayout>

================================================
FILE: library/src/main/res/values/attrs.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <declare-styleable name="Rotate3dAnimation">
        <attr name="rollType" format="enum">
            <enum name="x" value="0"/>
            <enum name="y" value="1"/>
            <enum name="z" value="2"/>
        </attr>
        <attr name="fromDeg" format="float" />
        <attr name="toDeg" format="float" />
        <attr name="pivotX" format="fraction"/>
        <attr name="pivotY" format="fraction" />
    </declare-styleable>
</resources>

================================================
FILE: library/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="float_transparent">#00000000</color>
    <color name="sweet_dialog_bg_color">#FFFFFF</color>
    <color name="button_text_color">#FFFFFF</color>
    <color name="gray_btn_bg_color">#D0D0D0</color>
    <color name="gray_btn_bg_pressed_color">#B6B6B6</color>
    <color name="blue_btn_bg_color">#AEDEF4</color>
    <color name="blue_btn_bg_pressed_color">#96BFD2</color>
    <color name="red_btn_bg_color">#DD6B55</color>
    <color name="red_btn_bg_pressed_color">#CD5B55</color>
    <color name="error_stroke_color">#F27474</color>
    <color name="success_stroke_color">#A5DC86</color>
    <color name="trans_success_stroke_color">#33A5DC86</color>
    <color name="warning_stroke_color">#F8BB86</color>
    <color name="text_color">#575757</color>
    <color name="material_blue_grey_80">#ff37474f</color>
    <color name="material_blue_grey_90">#ff263238</color>
    <color name="material_blue_grey_95">#ff21272b</color>
    <color name="material_deep_teal_20">#ff80cbc4</color>
    <color name="material_deep_teal_50">#ff009688</color>
</resources>

================================================
FILE: library/src/main/res/values/dimen.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <dimen name="alert_width">290dp</dimen>
    <dimen name="common_circle_width">3dp</dimen>
    <dimen name="progress_circle_radius">34dp</dimen>
</resources>

================================================
FILE: library/src/main/res/values/strings.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">SweetAlertDialog</string>
    <string name="dialog_default_title">Here\'s a message!</string>
    <string name="dialog_ok">OK</string>
    <string name="dialog_cancel">Cancel</string>
    <string name="LOADING">Loading...</string>
</resources>


================================================
FILE: library/src/main/res/values/styles.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="alert_dialog" parent="android:Theme.Dialog">
        <item name="android:windowIsFloating">true</item>
        <item name="android:windowIsTranslucent">false</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowFullscreen">false</item>
        <item name="android:windowBackground">@color/float_transparent</item>
        <item name="android:windowAnimationStyle">@null</item>
        <item name="android:backgroundDimEnabled">true</item>
        <item name="android:backgroundDimAmount">0.4</item>
    </style>

    <style name="dialog_blue_button" parent="android:Widget.Button">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">31dp</item>
        <item name="android:background">@drawable/blue_button_background</item>
        <item name="android:textSize">14sp</item>
        <item name="android:paddingLeft">21dp</item>
        <item name="android:paddingRight">21dp</item>
        <item name="android:textColor">@color/button_text_color</item>
    </style>
</resources>

================================================
FILE: sample/build.gradle
================================================
apply plugin: 'com.android.application'

version = VERSION_NAME
group = GROUP

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 21
    }

    lintOptions {
        abortOnError false
    }

    buildTypes {
        release {
            proguardFile 'proguard-android.txt'
            minifyEnabled true
            shrinkResources true
        }
    }
}

dependencies {
    //compile 'cn.pedant.sweetalert:library:1.3'
    compile project(':library')
}


================================================
FILE: sample/proguard-android.txt
================================================
 -keep class cn.pedant.SweetAlert.Rotate3dAnimation {
    public <init>(...);
 }

================================================
FILE: sample/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="cn.pedant.SweetAlert.sample"
          android:versionCode="1"
          android:versionName="1.0">
    <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="17"/>
    <application android:label="@string/app_name" android:icon="@drawable/ic_launcher" android:theme="@android:style/Theme.NoTitleBar">
        <activity android:name=".SampleActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>
</manifest>


================================================
FILE: sample/src/main/java/cn/pedant/SweetAlert/sample/SampleActivity.java
================================================
package cn.pedant.SweetAlert.sample;

import android.app.Activity;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;

import cn.pedant.SweetAlert.SweetAlertDialog;

public class SampleActivity extends Activity implements View.OnClickListener {

    private int i = -1;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sample_activity);
        findViewById(R.id.basic_test).setOnClickListener(this);
        findViewById(R.id.under_text_test).setOnClickListener(this);
        findViewById(R.id.error_text_test).setOnClickListener(this);
        findViewById(R.id.success_text_test).setOnClickListener(this);
        findViewById(R.id.warning_confirm_test).setOnClickListener(this);
        findViewById(R.id.warning_cancel_test).setOnClickListener(this);
        findViewById(R.id.custom_img_test).setOnClickListener(this);
        findViewById(R.id.progress_dialog).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.basic_test:
                // default title "Here's a message!"
                SweetAlertDialog sd = new SweetAlertDialog(this);
                sd.setCancelable(true);
                sd.setCanceledOnTouchOutside(true);
                sd.show();
                break;
            case R.id.under_text_test:
                new SweetAlertDialog(this)
                        .setContentText("It's pretty, isn't it?")
                        .show();
                break;
            case R.id.error_text_test:
                new SweetAlertDialog(this, SweetAlertDialog.ERROR_TYPE)
                        .setTitleText("Oops...")
                        .setContentText("Something went wrong!")
                        .show();
                break;
            case R.id.success_text_test:
                new SweetAlertDialog(this, SweetAlertDialog.SUCCESS_TYPE)
                        .setTitleText("Good job!")
                        .setContentText("You clicked the button!")
                        .show();
                break;
            case R.id.warning_confirm_test:
                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) {
                            // reuse previous dialog instance
                            sDialog.setTitleText("Deleted!")
                                    .setContentText("Your imaginary file has been deleted!")
                                    .setConfirmText("OK")
                                    .setConfirmClickListener(null)
                                    .changeAlertType(SweetAlertDialog.SUCCESS_TYPE);
                        }
                        })
                        .show();
                break;
            case R.id.warning_cancel_test:
                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) {
                                // reuse previous dialog instance, keep widget user state, reset them if you need
                                sDialog.setTitleText("Cancelled!")
                                        .setContentText("Your imaginary file is safe :)")
                                        .setConfirmText("OK")
                                        .showCancelButton(false)
                                        .setCancelClickListener(null)
                                        .setConfirmClickListener(null)
                                        .changeAlertType(SweetAlertDialog.ERROR_TYPE);

                                // or you can new a SweetAlertDialog to show
                               /* sDialog.dismiss();
                                new SweetAlertDialog(SampleActivity.this, SweetAlertDialog.ERROR_TYPE)
                                        .setTitleText("Cancelled!")
                                        .setContentText("Your imaginary file is safe :)")
                                        .setConfirmText("OK")
                                        .show();*/
                            }
                        })
                        .setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
                            @Override
                            public void onClick(SweetAlertDialog sDialog) {
                                sDialog.setTitleText("Deleted!")
                                        .setContentText("Your imaginary file has been deleted!")
                                        .setConfirmText("OK")
                                        .showCancelButton(false)
                                        .setCancelClickListener(null)
                                        .setConfirmClickListener(null)
                                        .changeAlertType(SweetAlertDialog.SUCCESS_TYPE);
                            }
                        })
                        .show();
                break;
            case R.id.custom_img_test:
                new SweetAlertDialog(this, SweetAlertDialog.CUSTOM_IMAGE_TYPE)
                        .setTitleText("Sweet!")
                        .setContentText("Here's a custom image.")
                        .setCustomImage(R.drawable.custom_img)
                        .show();
                break;
            case R.id.progress_dialog:
                final SweetAlertDialog pDialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE)
                        .setTitleText("Loading");
                pDialog.show();
                pDialog.setCancelable(false);
                new CountDownTimer(800 * 7, 800) {
                    public void onTick(long millisUntilFinished) {
                        // you can change the progress bar color by ProgressHelper every 800 millis
                        i++;
                        switch (i){
                            case 0:
                                pDialog.getProgressHelper().setBarColor(getResources().getColor(R.color.blue_btn_bg_color));
                                break;
                            case 1:
                                pDialog.getProgressHelper().setBarColor(getResources().getColor(R.color.material_deep_teal_50));
                                break;
                            case 2:
                                pDialog.getProgressHelper().setBarColor(getResources().getColor(R.color.success_stroke_color));
                                break;
                            case 3:
                                pDialog.getProgressHelper().setBarColor(getResources().getColor(R.color.material_deep_teal_20));
                                break;
                            case 4:
                                pDialog.getProgressHelper().setBarColor(getResources().getColor(R.color.material_blue_grey_80));
                                break;
                            case 5:
                                pDialog.getProgressHelper().setBarColor(getResources().getColor(R.color.warning_stroke_color));
                                break;
                            case 6:
                                pDialog.getProgressHelper().setBarColor(getResources().getColor(R.color.success_stroke_color));
                                break;
                        }
                    }

                    public void onFinish() {
                        i = -1;
                        pDialog.setTitleText("Success!")
                                .setConfirmText("OK")
                                .changeAlertType(SweetAlertDialog.SUCCESS_TYPE);
                    }
                }.start();
                break;
        }
    }
}


================================================
FILE: sample/src/main/res/layout/sample_activity.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<ScrollView android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#FFF"
            xmlns:android="http://schemas.android.com/apk/res/android">

    <RelativeLayout android:layout_width="match_parent"
                    android:paddingBottom="10dp"
                  android:layout_height="wrap_content">

        <ImageView
               android:id="@+id/logo_img"
               android:layout_width="180dp"
               android:layout_height="wrap_content"
               android:src="@drawable/logo_big"
               android:layout_marginTop="10dp"
               android:layout_marginBottom="15dp"
               android:layout_centerHorizontal="true"
               android:contentDescription="@string/app_name"/>

        <TextView
            android:id="@+id/txt_0"
            android:layout_alignLeft="@id/logo_img"
            android:layout_below="@id/logo_img"
            android:layout_marginLeft="15dp"
            android:text="show material progress"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="14sp"
            android:textColor="#797979"/>

        <Button
            android:layout_centerHorizontal="true"
            android:layout_below="@id/txt_0"
            android:id="@+id/progress_dialog"
            style="@style/dialog_blue_button"
            android:layout_margin="10dp"
            android:text="Try me!"/>

        <TextView
            android:id="@+id/txt_1"
            android:layout_alignLeft="@id/logo_img"
            android:layout_below="@id/progress_dialog"
            android:layout_marginLeft="15dp"
            android:text="A basic message"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="14sp"
            android:textColor="#797979"/>

        <Button
            android:layout_centerHorizontal="true"
            android:layout_below="@id/txt_1"
            android:id="@+id/basic_test"
            style="@style/dialog_blue_button"
            android:layout_margin="10dp"
            android:text="Try me!"/>

        <TextView
                android:id="@+id/txt_2"
                android:layout_alignLeft="@id/logo_img"
                android:layout_below="@id/basic_test"
                android:layout_marginLeft="15dp"
                android:text="A title with a text under"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="14sp"
                android:layout_marginTop="15dp"
                android:textColor="#797979"/>

        <Button
                android:layout_centerHorizontal="true"
                android:layout_below="@id/txt_2"
                android:id="@+id/under_text_test"
                style="@style/dialog_blue_button"
                android:layout_margin="10dp"
                android:text="Try me!"/>

        <TextView
                android:id="@+id/txt_3"
                android:layout_alignLeft="@id/logo_img"
                android:layout_below="@id/under_text_test"
                android:layout_marginLeft="15dp"
                android:text="show error message"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="14sp"
                android:layout_marginTop="15dp"
                android:textColor="#797979"/>

        <Button
                android:layout_centerHorizontal="true"
                android:layout_below="@id/txt_3"
                android:id="@+id/error_text_test"
                style="@style/dialog_blue_button"
                android:layout_margin="10dp"
                android:text="Try me!"/>

        <TextView
                android:id="@+id/txt_4"
                android:layout_alignLeft="@id/logo_img"
                android:layout_below="@id/error_text_test"
                android:layout_marginLeft="15dp"
                android:text="A success message"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="14sp"
                android:layout_marginTop="15dp"
                android:textColor="#797979"/>

        <Button
                android:layout_centerHorizontal="true"
                android:layout_below="@id/txt_4"
                android:id="@+id/success_text_test"
                style="@style/dialog_blue_button"
                android:layout_margin="10dp"
                android:text="Try me!"/>


        <TextView
                android:id="@+id/txt_5"
                android:layout_alignLeft="@id/logo_img"
                android:layout_below="@id/success_text_test"
                android:layout_marginLeft="15dp"
                android:text="A warning message, with a listener bind to the Confirm-button..."
                android:layout_width="200dp"
                android:layout_height="wrap_content"
                android:textSize="14sp"
                android:layout_marginTop="15dp"
                android:textColor="#797979"/>

        <Button
                android:layout_centerHorizontal="true"
                android:layout_below="@id/txt_5"
                android:id="@+id/warning_confirm_test"
                style="@style/dialog_blue_button"
                android:layout_margin="10dp"
                android:text="Try me!"/>

        <TextView
                android:id="@+id/txt_6"
                android:layout_alignLeft="@id/logo_img"
                android:layout_below="@id/warning_confirm_test"
                android:layout_marginLeft="15dp"
                android:text="A warning message, with listeners bind to Cancel and Confirm button..."
                android:layout_width="200dp"
                android:layout_height="wrap_content"
                android:textSize="14sp"
                android:layout_marginTop="15dp"
                android:textColor="#797979"/>

        <Button
                android:layout_centerHorizontal="true"
                android:layout_below="@id/txt_6"
                android:id="@+id/warning_cancel_test"
                style="@style/dialog_blue_button"
                android:layout_margin="10dp"
                android:text="Try me!"/>

        <TextView
                android:id="@+id/txt_7"
                android:layout_alignLeft="@id/logo_img"
                android:layout_below="@id/warning_cancel_test"
                android:layout_marginLeft="15dp"
                android:text="A message with a custom icon"
                android:layout_width="200dp"
                android:layout_height="wrap_content"
                android:textSize="14sp"
                android:layout_marginTop="15dp"
                android:textColor="#797979"/>

        <Button
                android:layout_centerHorizontal="true"
                android:layout_below="@id/txt_7"
                android:id="@+id/custom_img_test"
                style="@style/dialog_blue_button"
                android:layout_margin="10dp"
                android:text="Try me!"/>

    </RelativeLayout>
</ScrollView>



================================================
FILE: sample/src/main/res/values/strings.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">SweetAlertDialog</string>
</resources>


================================================
FILE: settings.gradle
================================================
include ':library', ':sample'
Download .txt
gitextract_j7agdo7h/

├── README.md
├── README.zh.md
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── library/
│   ├── build.gradle
│   ├── gradle.properties
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── cn/
│           │       └── pedant/
│           │           └── SweetAlert/
│           │               ├── OptAnimationLoader.java
│           │               ├── ProgressHelper.java
│           │               ├── Rotate3dAnimation.java
│           │               ├── SuccessTickView.java
│           │               └── SweetAlertDialog.java
│           └── res/
│               ├── anim/
│               │   ├── error_frame_in.xml
│               │   ├── error_x_in.xml
│               │   ├── modal_in.xml
│               │   ├── modal_out.xml
│               │   ├── success_bow_roate.xml
│               │   └── success_mask_layout.xml
│               ├── drawable/
│               │   ├── blue_button_background.xml
│               │   ├── dialog_background.xml
│               │   ├── error_center_x.xml
│               │   ├── error_circle.xml
│               │   ├── gray_button_background.xml
│               │   ├── red_button_background.xml
│               │   ├── success_bow.xml
│               │   ├── success_circle.xml
│               │   ├── warning_circle.xml
│               │   └── warning_sigh.xml
│               ├── layout/
│               │   └── alert_dialog.xml
│               └── values/
│                   ├── attrs.xml
│                   ├── colors.xml
│                   ├── dimen.xml
│                   ├── strings.xml
│                   └── styles.xml
├── sample/
│   ├── build.gradle
│   ├── proguard-android.txt
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── cn/
│           │       └── pedant/
│           │           └── SweetAlert/
│           │               └── sample/
│           │                   └── SampleActivity.java
│           └── res/
│               ├── layout/
│               │   └── sample_activity.xml
│               └── values/
│                   └── strings.xml
└── settings.gradle
Download .txt
SYMBOL INDEX (81 symbols across 6 files)

FILE: library/src/main/java/cn/pedant/SweetAlert/OptAnimationLoader.java
  class OptAnimationLoader (line 14) | public class OptAnimationLoader {
    method loadAnimation (line 16) | public static Animation loadAnimation(Context context, int id)
    method createAnimationFromXml (line 38) | private static Animation createAnimationFromXml(Context c, XmlPullPars...
    method createAnimationFromXml (line 44) | private static Animation createAnimationFromXml(Context c, XmlPullPars...

FILE: library/src/main/java/cn/pedant/SweetAlert/ProgressHelper.java
  class ProgressHelper (line 7) | public class ProgressHelper {
    method ProgressHelper (line 19) | public ProgressHelper(Context ctx) {
    method getProgressWheel (line 31) | public ProgressWheel getProgressWheel () {
    method setProgressWheel (line 35) | public void setProgressWheel (ProgressWheel progressWheel) {
    method updatePropsIfNeed (line 40) | private void updatePropsIfNeed () {
    method resetCount (line 75) | public void resetCount() {
    method isSpinning (line 81) | public boolean isSpinning() {
    method spin (line 85) | public void spin() {
    method stopSpinning (line 90) | public void stopSpinning() {
    method getProgress (line 95) | public float getProgress() {
    method setProgress (line 99) | public void setProgress(float progress) {
    method setInstantProgress (line 105) | public void setInstantProgress(float progress) {
    method getCircleRadius (line 111) | public int getCircleRadius() {
    method setCircleRadius (line 118) | public void setCircleRadius(int circleRadius) {
    method getBarWidth (line 123) | public int getBarWidth() {
    method setBarWidth (line 127) | public void setBarWidth(int barWidth) {
    method getBarColor (line 132) | public int getBarColor() {
    method setBarColor (line 136) | public void setBarColor(int barColor) {
    method getRimWidth (line 141) | public int getRimWidth() {
    method setRimWidth (line 145) | public void setRimWidth(int rimWidth) {
    method getRimColor (line 150) | public int getRimColor() {
    method setRimColor (line 154) | public void setRimColor(int rimColor) {
    method getSpinSpeed (line 159) | public float getSpinSpeed() {
    method setSpinSpeed (line 163) | public void setSpinSpeed(float spinSpeed) {

FILE: library/src/main/java/cn/pedant/SweetAlert/Rotate3dAnimation.java
  class Rotate3dAnimation (line 12) | public class Rotate3dAnimation extends Animation {
    class Description (line 29) | protected static class Description {
    method parseValue (line 34) | Description parseValue(TypedValue value) {
    method Rotate3dAnimation (line 64) | public Rotate3dAnimation (Context context, AttributeSet attrs) {
    method Rotate3dAnimation (line 85) | public Rotate3dAnimation (int rollType, float fromDegrees, float toDeg...
    method Rotate3dAnimation (line 93) | public Rotate3dAnimation (int rollType, float fromDegrees, float toDeg...
    method Rotate3dAnimation (line 105) | public Rotate3dAnimation (int rollType, float fromDegrees, float toDeg...
    method initializePivotPoint (line 117) | private void initializePivotPoint() {
    method initialize (line 126) | @Override
    method applyTransformation (line 134) | @Override

FILE: library/src/main/java/cn/pedant/SweetAlert/SuccessTickView.java
  class SuccessTickView (line 12) | public class SuccessTickView extends View {
    method SuccessTickView (line 27) | public SuccessTickView(Context context) {
    method SuccessTickView (line 32) | public SuccessTickView(Context context, AttributeSet attrs){
    method init (line 37) | private void init () {
    method draw (line 45) | @Override
    method dip2px (line 80) | public float dip2px(float dpValue) {
    method startTickAnim (line 87) | public void startTickAnim () {

FILE: library/src/main/java/cn/pedant/SweetAlert/SweetAlertDialog.java
  class SweetAlertDialog (line 24) | public class SweetAlertDialog extends Dialog implements View.OnClickList...
    type OnSweetClickListener (line 66) | public static interface OnSweetClickListener {
      method onClick (line 67) | public void onClick (SweetAlertDialog sweetAlertDialog);
    method SweetAlertDialog (line 70) | public SweetAlertDialog(Context context) {
    method SweetAlertDialog (line 74) | public SweetAlertDialog(Context context, int alertType) {
    method onCreate (line 138) | protected void onCreate(Bundle savedInstanceState) {
    method restore (line 168) | private void restore () {
    method playAnimation (line 184) | private void playAnimation () {
    method changeAlertType (line 194) | private void changeAlertType(int alertType, boolean fromCreate) {
    method getAlerType (line 230) | public int getAlerType () {
    method changeAlertType (line 234) | public void changeAlertType(int alertType) {
    method getTitleText (line 239) | public String getTitleText () {
    method setTitleText (line 243) | public SweetAlertDialog setTitleText (String text) {
    method setCustomImage (line 251) | public SweetAlertDialog setCustomImage (Drawable drawable) {
    method setCustomImage (line 260) | public SweetAlertDialog setCustomImage (int resourceId) {
    method getContentText (line 264) | public String getContentText () {
    method setContentText (line 268) | public SweetAlertDialog setContentText (String text) {
    method isShowCancelButton (line 277) | public boolean isShowCancelButton () {
    method showCancelButton (line 281) | public SweetAlertDialog showCancelButton (boolean isShow) {
    method isShowContentText (line 289) | public boolean isShowContentText () {
    method showContentText (line 293) | public SweetAlertDialog showContentText (boolean isShow) {
    method getCancelText (line 301) | public String getCancelText () {
    method setCancelText (line 305) | public SweetAlertDialog setCancelText (String text) {
    method getConfirmText (line 314) | public String getConfirmText () {
    method setConfirmText (line 318) | public SweetAlertDialog setConfirmText (String text) {
    method setCancelClickListener (line 326) | public SweetAlertDialog setCancelClickListener (OnSweetClickListener l...
    method setConfirmClickListener (line 331) | public SweetAlertDialog setConfirmClickListener (OnSweetClickListener ...
    method onStart (line 336) | protected void onStart() {
    method cancel (line 344) | @Override
    method dismissWithAnimation (line 352) | public void dismissWithAnimation() {
    method dismissWithAnimation (line 356) | private void dismissWithAnimation(boolean fromCancel) {
    method onClick (line 362) | @Override
    method getProgressHelper (line 379) | public ProgressHelper getProgressHelper () {

FILE: sample/src/main/java/cn/pedant/SweetAlert/sample/SampleActivity.java
  class SampleActivity (line 10) | public class SampleActivity extends Activity implements View.OnClickList...
    method onCreate (line 14) | @Override
    method onClick (line 28) | @Override
Condensed preview — 45 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (95K chars).
[
  {
    "path": "README.md",
    "chars": 6374,
    "preview": "Sweet Alert Dialog\n===================\nSweetAlert for Android, a beautiful and clever alert dialog\n\n[![Android Arsenal]("
  },
  {
    "path": "README.zh.md",
    "chars": 5983,
    "preview": "Sweet Alert Dialog\n===================\nAndroid版的SweetAlert,清新文艺,快意灵动的甜心弹框\n\n[![Android Arsenal](https://img.shields.io/ba"
  },
  {
    "path": "build.gradle",
    "chars": 281,
    "preview": "buildscript {\n    repositories {\n        mavenCentral()\n    }\n    dependencies {\n        classpath 'com.android.tools.bu"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 231,
    "preview": "#Tue Dec 02 17:43:17 CET 2014\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "gradle.properties",
    "chars": 543,
    "preview": "VERSION_NAME=1.3\nVERSION_CODE=4\nGROUP=cn.pedant.sweetalert\n\nPOM_DESCRIPTION=SweetAlert for Android, a beautiful and clev"
  },
  {
    "path": "gradlew",
    "chars": 5080,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "gradlew.bat",
    "chars": 2314,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
  },
  {
    "path": "library/build.gradle",
    "chars": 466,
    "preview": "apply plugin: 'com.android.library'\n\nversion = VERSION_NAME\ngroup = GROUP\n\nandroid {\n    compileSdkVersion rootProject.e"
  },
  {
    "path": "library/gradle.properties",
    "chars": 75,
    "preview": "POM_NAME=SweetAlertDialog-Library\nPOM_ARTIFACT_ID=library\nPOM_PACKAGING=aar"
  },
  {
    "path": "library/src/main/AndroidManifest.xml",
    "chars": 249,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\npackage=\"cn.pedant.SweetAlert\"\nandroid:versionCode="
  },
  {
    "path": "library/src/main/java/cn/pedant/SweetAlert/OptAnimationLoader.java",
    "chars": 3250,
    "preview": "package cn.pedant.SweetAlert;\n\nimport android.content.Context;\nimport android.content.res.Resources;\nimport android.cont"
  },
  {
    "path": "library/src/main/java/cn/pedant/SweetAlert/ProgressHelper.java",
    "chars": 4486,
    "preview": "package cn.pedant.SweetAlert;\n\nimport android.content.Context;\n\nimport com.pnikosis.materialishprogress.ProgressWheel;\n\n"
  },
  {
    "path": "library/src/main/java/cn/pedant/SweetAlert/Rotate3dAnimation.java",
    "chars": 5164,
    "preview": "package cn.pedant.SweetAlert;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.gra"
  },
  {
    "path": "library/src/main/java/cn/pedant/SweetAlert/SuccessTickView.java",
    "chars": 4994,
    "preview": "package cn.pedant.SweetAlert;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.P"
  },
  {
    "path": "library/src/main/java/cn/pedant/SweetAlert/SweetAlertDialog.java",
    "chars": 13467,
    "preview": "package cn.pedant.SweetAlert;\n\n\nimport android.app.Dialog;\nimport android.content.Context;\nimport android.graphics.drawa"
  },
  {
    "path": "library/src/main/res/anim/error_frame_in.xml",
    "chars": 590,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\"\n     xmlns:sweet"
  },
  {
    "path": "library/src/main/res/anim/error_x_in.xml",
    "chars": 877,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\"\n     android:int"
  },
  {
    "path": "library/src/main/res/anim/modal_in.xml",
    "chars": 1078,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\"\n     android:int"
  },
  {
    "path": "library/src/main/res/anim/modal_out.xml",
    "chars": 547,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\"\n     android:int"
  },
  {
    "path": "library/src/main/res/anim/success_bow_roate.xml",
    "chars": 379,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rotate\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    androi"
  },
  {
    "path": "library/src/main/res/anim/success_mask_layout.xml",
    "chars": 534,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <rotate\n    "
  },
  {
    "path": "library/src/main/res/drawable/blue_button_background.xml",
    "chars": 535,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item a"
  },
  {
    "path": "library/src/main/res/drawable/dialog_background.xml",
    "chars": 212,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <solid and"
  },
  {
    "path": "library/src/main/res/drawable/error_center_x.xml",
    "chars": 919,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item"
  },
  {
    "path": "library/src/main/res/drawable/error_circle.xml",
    "chars": 294,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape android:shape=\"oval\" xmlns:android=\"http://schemas.android.com/apk/res/and"
  },
  {
    "path": "library/src/main/res/drawable/gray_button_background.xml",
    "chars": 535,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item a"
  },
  {
    "path": "library/src/main/res/drawable/red_button_background.xml",
    "chars": 533,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item a"
  },
  {
    "path": "library/src/main/res/drawable/success_bow.xml",
    "chars": 296,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape android:shape=\"oval\" xmlns:android=\"http://schemas.android.com/apk/res/and"
  },
  {
    "path": "library/src/main/res/drawable/success_circle.xml",
    "chars": 302,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape android:shape=\"oval\" xmlns:android=\"http://schemas.android.com/apk/res/and"
  },
  {
    "path": "library/src/main/res/drawable/warning_circle.xml",
    "chars": 296,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape android:shape=\"oval\" xmlns:android=\"http://schemas.android.com/apk/res/and"
  },
  {
    "path": "library/src/main/res/drawable/warning_sigh.xml",
    "chars": 660,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item"
  },
  {
    "path": "library/src/main/res/layout/alert_dialog.xml",
    "chars": 5423,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmln"
  },
  {
    "path": "library/src/main/res/values/attrs.xml",
    "chars": 504,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <declare-styleable name=\"Rotate3dAnimation\">\n        <attr name=\""
  },
  {
    "path": "library/src/main/res/values/colors.xml",
    "chars": 1120,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"float_transparent\">#00000000</color>\n    <color name"
  },
  {
    "path": "library/src/main/res/values/dimen.xml",
    "chars": 211,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <dimen name=\"alert_width\">290dp</dimen>\n    <dimen name=\"common_c"
  },
  {
    "path": "library/src/main/res/values/strings.xml",
    "chars": 323,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"app_name\">SweetAlertDialog</string>\n    <string nam"
  },
  {
    "path": "library/src/main/res/values/styles.xml",
    "chars": 1143,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <style name=\"alert_dialog\" parent=\"android:Theme.Dialog\">\n       "
  },
  {
    "path": "sample/build.gradle",
    "chars": 597,
    "preview": "apply plugin: 'com.android.application'\n\nversion = VERSION_NAME\ngroup = GROUP\n\nandroid {\n    compileSdkVersion rootProje"
  },
  {
    "path": "sample/proguard-android.txt",
    "chars": 80,
    "preview": " -keep class cn.pedant.SweetAlert.Rotate3dAnimation {\n    public <init>(...);\n }"
  },
  {
    "path": "sample/src/main/AndroidManifest.xml",
    "chars": 788,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n          pa"
  },
  {
    "path": "sample/src/main/java/cn/pedant/SweetAlert/sample/SampleActivity.java",
    "chars": 8614,
    "preview": "package cn.pedant.SweetAlert.sample;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.os.CountDown"
  },
  {
    "path": "sample/src/main/res/layout/sample_activity.xml",
    "chars": 7302,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ScrollView android:layout_width=\"match_parent\"\n            android:layout_height"
  },
  {
    "path": "sample/src/main/res/values/strings.xml",
    "chars": 118,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"app_name\">SweetAlertDialog</string>\n</resources>\n"
  },
  {
    "path": "settings.gradle",
    "chars": 29,
    "preview": "include ':library', ':sample'"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the pedant/sweet-alert-dialog GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 45 files (85.7 KB), approximately 21.7k tokens, and a symbol index with 81 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!