Full Code of YuanClouds/WaveView for AI

master 7bd89d2262d9 cached
45 files
71.7 KB
19.4k tokens
51 symbols
1 requests
Download .txt
Repository: YuanClouds/WaveView
Branch: master
Commit: 7bd89d2262d9
Files: 45
Total size: 71.7 KB

Directory structure:
gitextract_a4vqsdf9/

├── .idea/
│   ├── libraries/
│   │   ├── animated_vector_drawable_24_0_0_beta1.xml
│   │   ├── appcompat_v7_24_0_0_beta1.xml
│   │   ├── espresso_core_2_2_2.xml
│   │   ├── espresso_idling_resource_2_2_2.xml
│   │   ├── exposed_instrumentation_api_publish_0_5.xml
│   │   ├── rules_0_5.xml
│   │   ├── runner_0_5.xml
│   │   ├── support_annotations_24_0_0_beta1.xml
│   │   ├── support_v4_24_0_0_beta1.xml
│   │   └── support_vector_drawable_24_0_0_beta1.xml
│   └── vcs.xml
├── .travis.yml
├── README.md
├── app/
│   └── build/
│       ├── BUILD_README
│       └── sample-debug.apk
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── sample/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── wave/
│       │               └── sample/
│       │                   └── ExampleInstrumentedTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── wave/
│       │   │           └── sample/
│       │   │               └── MainActivity.java
│       │   └── res/
│       │       ├── layout/
│       │       │   └── activity_main.xml
│       │       ├── values/
│       │       │   ├── colors.xml
│       │       │   ├── dimens.xml
│       │       │   ├── strings.xml
│       │       │   └── styles.xml
│       │       └── values-w820dp/
│       │           └── dimens.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── wave/
│                       └── sample/
│                           └── ExampleUnitTest.java
├── settings.gradle
└── wavekit/
    ├── .gitignore
    ├── build.gradle
    ├── proguard-rules.pro
    └── src/
        ├── androidTest/
        │   └── java/
        │       └── com/
        │           └── yuan/
        │               └── waveview/
        │                   └── ExampleInstrumentedTest.java
        ├── main/
        │   ├── AndroidManifest.xml
        │   ├── java/
        │   │   └── com/
        │   │       └── yuan/
        │   │           └── waveview/
        │   │               ├── WaveView.java
        │   │               └── utils/
        │   │                   └── DensityUtil.java
        │   └── res/
        │       └── values/
        │           ├── attrs.xml
        │           ├── colors.xml
        │           └── strings.xml
        └── test/
            └── java/
                └── com/
                    └── yuan/
                        └── waveview/
                            └── ExampleUnitTest.java

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

================================================
FILE: .idea/libraries/animated_vector_drawable_24_0_0_beta1.xml
================================================
<component name="libraryTable">
  <library name="animated-vector-drawable-24.0.0-beta1">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.0.0-beta1/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.0.0-beta1/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/animated-vector-drawable/24.0.0-beta1/animated-vector-drawable-24.0.0-beta1-sources.jar!/" />
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/animated-vector-drawable/24.0.0-beta1/animated-vector-drawable-24.0.0-beta1-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/appcompat_v7_24_0_0_beta1.xml
================================================
<component name="libraryTable">
  <library name="appcompat-v7-24.0.0-beta1">
    <ANNOTATIONS>
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.0.0-beta1/annotations.zip!/" />
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.0.0-beta1/annotations.zip!/" />
    </ANNOTATIONS>
    <CLASSES>
      <root url="file://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.0.0-beta1/res" />
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.0.0-beta1/jars/classes.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/appcompat-v7/24.0.0-beta1/appcompat-v7-24.0.0-beta1-sources.jar!/" />
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/appcompat-v7/24.0.0-beta1/appcompat-v7-24.0.0-beta1-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/espresso_core_2_2_2.xml
================================================
<component name="libraryTable">
  <library name="espresso-core-2.2.2">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support.test.espresso/espresso-core/2.2.2/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support.test.espresso/espresso-core/2.2.2/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/test/espresso/espresso-core/2.2.2/espresso-core-2.2.2-sources.jar!/" />
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/test/espresso/espresso-core/2.2.2/espresso-core-2.2.2-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/espresso_idling_resource_2_2_2.xml
================================================
<component name="libraryTable">
  <library name="espresso-idling-resource-2.2.2">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support.test.espresso/espresso-idling-resource/2.2.2/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support.test.espresso/espresso-idling-resource/2.2.2/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/test/espresso/espresso-idling-resource/2.2.2/espresso-idling-resource-2.2.2-sources.jar!/" />
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/test/espresso/espresso-idling-resource/2.2.2/espresso-idling-resource-2.2.2-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/exposed_instrumentation_api_publish_0_5.xml
================================================
<component name="libraryTable">
  <library name="exposed-instrumentation-api-publish-0.5">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support.test/exposed-instrumentation-api-publish/0.5/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support.test/exposed-instrumentation-api-publish/0.5/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/test/exposed-instrumentation-api-publish/0.5/exposed-instrumentation-api-publish-0.5-sources.jar!/" />
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/test/exposed-instrumentation-api-publish/0.5/exposed-instrumentation-api-publish-0.5-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/rules_0_5.xml
================================================
<component name="libraryTable">
  <library name="rules-0.5">
    <ANNOTATIONS>
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support.test/rules/0.5/annotations.zip!/" />
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support.test/rules/0.5/annotations.zip!/" />
    </ANNOTATIONS>
    <CLASSES>
      <root url="file://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support.test/rules/0.5/res" />
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support.test/rules/0.5/jars/classes.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/test/rules/0.5/rules-0.5-sources.jar!/" />
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/test/rules/0.5/rules-0.5-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/runner_0_5.xml
================================================
<component name="libraryTable">
  <library name="runner-0.5">
    <ANNOTATIONS>
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support.test/runner/0.5/annotations.zip!/" />
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support.test/runner/0.5/annotations.zip!/" />
    </ANNOTATIONS>
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support.test/runner/0.5/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support.test/runner/0.5/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/test/runner/0.5/runner-0.5-sources.jar!/" />
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/test/runner/0.5/runner-0.5-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/support_annotations_24_0_0_beta1.xml
================================================
<component name="libraryTable">
  <library name="support-annotations-24.0.0-beta1">
    <CLASSES>
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/support-annotations/24.0.0-beta1/support-annotations-24.0.0-beta1.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/support-annotations/24.0.0-beta1/support-annotations-24.0.0-beta1-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/support_v4_24_0_0_beta1.xml
================================================
<component name="libraryTable">
  <library name="support-v4-24.0.0-beta1">
    <ANNOTATIONS>
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support/support-v4/24.0.0-beta1/annotations.zip!/" />
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support/support-v4/24.0.0-beta1/annotations.zip!/" />
    </ANNOTATIONS>
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support/support-v4/24.0.0-beta1/jars/libs/internal_impl-24.0.0-beta1.jar!/" />
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support/support-v4/24.0.0-beta1/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support/support-v4/24.0.0-beta1/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/support-v4/24.0.0-beta1/support-v4-24.0.0-beta1-sources.jar!/" />
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/support-v4/24.0.0-beta1/support-v4-24.0.0-beta1-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/support_vector_drawable_24_0_0_beta1.xml
================================================
<component name="libraryTable">
  <library name="support-vector-drawable-24.0.0-beta1">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/24.0.0-beta1/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/wavekit/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/24.0.0-beta1/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/support-vector-drawable/24.0.0-beta1/support-vector-drawable-24.0.0-beta1-sources.jar!/" />
      <root url="jar://E:/developmentTools/AndroidSDK/extras/android/m2repository/com/android/support/support-vector-drawable/24.0.0-beta1/support-vector-drawable-24.0.0-beta1-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/vcs.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="VcsDirectoryMappings">
    <mapping directory="$PROJECT_DIR$" vcs="Git" />
  </component>
</project>

================================================
FILE: .travis.yml
================================================
language: android
android:
  components:
  - tools
  - build-tools-24.0.1
  - android-24
  - extra-android-m2repository
jdk: oraclejdk8
sudo: false
cache:
  directories:
  - "$HOME/.gradle"
before_install:
- chmod +x gradlew
script:
- "./gradlew assembleRelease"

deploy:
  provider: releases
  api_key:
    secure: wLTt8G7RWQsF2KGMwmHlYoTBSSP/YkZxy+nyIc+yekwoRgZGhxHoI6pZbime2BhAJ0Ag7ZDEulpjYzJkjZ08OMlWoFa+eelykyzcR+S+o43frVnafYlWDR6XTrjGoKzPZ+KqyNVwrTU5csu1bJ16DqCCQqK+WC6LsRvRX0m0LREMNdgEJ5sVuoVbE/Do2wTZPRri9VBLVYwyFBsmNHLhW4xKhPUNwmHRU6zEhO1uVg8JCn4z3PJaRblcapdrp/JOFDFfOR/u4AW9ctzIRaTcSqV82mWvRyiWbFjilgw9tNlVCTykcLvNZKDa+Z8sWXpTpLlmgS43HxDZewdQ+NGIy8ihdKXz8x6EonGMM4mWeIkS1osm5EdpBlhfx+tt7mpHkp+r/FzZh7qrbT98JquZBYkqzEsOR8BXv6sw0Jai9KMPHDzkgAtDGS6Ir9FBIw3Kf+3r/iCe6wxdvnTzySPnPCffQ/fbENHVqvMAZqNRpolF7l3O40ZRhNPEpYG/9WekzDs37Udl8q2w80FTniDtgZWxnc1vIdbj5yHwRW1ipQLMNUBiQIgYx9Axiw96WzJMo0J6ezGWYQwrbdZ54TpluXGbCSQv5s3qChniKK+45FWWXPu4LXPSrqu+IT8swgeJR33f9aZ2jfp2Qbm2mhZPY5xXbSV/Cawh5F5eDQz+lEg=
  file: app/build/sample-debug.apk
  skip_cleanup: true
  on:
    tags: false
    all_branches: true




================================================
FILE: README.md
================================================
# WaveView

### Thank you for your support!

Imitate the Android progress of  method, At present support functions:

1. waveview to support the dynamic change of progress  

2. waveview to support the progress callback Activity or fragments, use mask effect and the property animation 

3. waveview to support custom change wave properties, including color wave, wave speed, wave shape of container (currently support circle, rectangular, and mask drawable) 

   ​

Details you can run the Demo and study the source code.



### My :

E-mail : sy.wu@foxmail.com

Blog : http://www.jianshu.com/users/d388bcf9c4d3/  

 **KeyWord**  rolling wave ,normal wave.waveview shapes,speed mode,shado...

### Demo :

 ![waveview.gif](http://upload-images.jianshu.io/upload_images/2516602-d582b82fe16e1189.gif?imageMogr2/auto-orient/strip)

### How to use it?

#### First

Add repositories and dependencies into your project
```java
    // repositories
    repositories {
      maven { url = 'https://dl.bintray.com/yuancloud/maven/' }
    }

    // dependencies
     compile 'cn.yuancloud.app:wavekit:1.0'
```

Add a WaveView into your XML

```java
   <com.yuan.waveview.WaveView
            android:id="@+id/waveview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="20dp"
            android:layout_margin="20dp"
            android:layout_below="@id/radio_view_speed"
            app:backgroundColor="@color/white"
            app:progressColor="@color/black"
            app:max="20"
            />
```

"backgroundColor" is the view color

"progressColor" is the wave color

"max" is the max progress



#### Second

You can be a series of operations in the Activity or Fragment.such as :

(1) set WaveView Shape

```
  waveView.setMode(WaveView.MODE_RECT);
```

(2) set WaveView Color

```
waveView.setWaveColor(Color.RED);
waveView.setbgColor(Color.WHITE);
```

(3) set WaveView flowing speed

```
waveView.setSpeed(WaveView.SPEED_FAST);
```

(4) set WaveView progress or max

```
   waveView.setProgress(progress);
   waveView.setMax(100);
```



#### Last

How to listen progress of waveView in Activity or Fragmenet?

```
   waveView.setProgressListener(new WaveView.waveProgressListener() {
            @Override
            public void onPorgress(boolean isDone, long progress, long max) { 
                if (isDone){
                    Toast.makeText(MainActivity.this,"Loading completed!!!",Toast.LENGTH_SHORT).show();
                }
            }
        });
```



### Thank you for your support!

### Enjoy ~





================================================
FILE: app/build/BUILD_README
================================================


================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip


================================================
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

# 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\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

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"`
    JAVACMD=`cygpath --unix "$JAVACMD"`

    # 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: sample/.gitignore
================================================
local.properties
.idea
*.iml
.gradle
build

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

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.wave.sample"
        minSdkVersion 18
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    maven { url = 'https://dl.bintray.com/yuancloud/maven/' }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:24.0.0-beta1'
    testCompile 'junit:junit:4.12'
    compile project(':wavekit')

//    compile 'cn.yuancloud.app:wavekit:1.0'

}


================================================
FILE: sample/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in D:\AndroidStudio_SDK/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}


================================================
FILE: sample/src/androidTest/java/com/wave/sample/ExampleInstrumentedTest.java
================================================
package com.wave.sample;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
 * Instrumentation test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() throws Exception {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();

        assertEquals("com.wave.sample", appContext.getPackageName());
    }
}


================================================
FILE: sample/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.wave.sample">

    <application android:allowBackup="true" android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <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/com/wave/sample/MainActivity.java
================================================
package com.wave.sample;

import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;

import com.yuan.waveview.WaveView;

import java.text.NumberFormat;
import java.util.Timer;
import java.util.TimerTask;

public class MainActivity extends AppCompatActivity {

    WaveView waveView;
    Button button,speedBtn;
    TextView progressTv;

    RadioGroup radioGroup;
    RadioGroup radioGroupColor;
    RadioGroup radioGroupSpeed;

    int count = 0;
    private static final int max = 10;
    int speed = 5;

    private Handler handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            if (msg.what == 100){
                if (max >= count) {
                    Log.d("demo",count + "");
                    waveView.setProgress(count);
                }else {
                    resetTimer();
                }
                count++;
            }
        }
    };

    private TimerTask timerTask = new TimerTask() {
        @Override
        public void run() {
            handler.sendEmptyMessage(100);
        }
    };

    private Timer timer = new Timer();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initView();
        initListener();
    }

    private void initView(){
        waveView = (WaveView) findViewById(R.id.waveview);
        button = (Button) findViewById(R.id.button);
        radioGroup = (RadioGroup) findViewById(R.id.radio_group);
        radioGroupColor = (RadioGroup) findViewById(R.id.radio_group_color);
        radioGroupSpeed = (RadioGroup) findViewById(R.id.radio_group_speed);
        progressTv = (TextView) findViewById(R.id.pb_show_tv);
        speedBtn = (Button) findViewById(R.id.speed);

        waveView.setMax(max);
        waveView.setWaveColor(ContextCompat.getColor(MainActivity.this,R.color.light_blue));
//        waveView.setProgress(10);

    }

    private void initListener(){
        final NumberFormat numberFormat =  NumberFormat.getInstance();
        numberFormat.setMaximumFractionDigits(2);
        waveView.setProgressListener(new WaveView.waveProgressListener() {
            @Override
            public void onPorgress(boolean isDone, long progress, long max) {
                Log.i("yuan","max " + max + "prgress "+progress);
                progressTv.setText(numberFormat.format(progress/(float)max * 100) + "%");
                if (isDone){
                    Toast.makeText(MainActivity.this,"Loading completed!!!",Toast.LENGTH_SHORT).show();
                }
            }
        });
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //先重置
                resetTimer();
                doing();
            }
        });

        speedBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                int p = (int) (waveView.getProgress()+3);
                waveView.setProgress(p);
            }
        });

        radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup radioGroup, int i) {
                switch (i){
                    case R.id.mode_circle:
                        waveView.setMode(WaveView.MODE_CIRCLE);
                        break;

                    case R.id.mode_rect:
                        waveView.setMode(WaveView.MODE_RECT);
                        break;

                    case R.id.mode_drawable:
                        waveView.setMode(WaveView.MODE_DRAWABLE);
                        break;
                }
            }

        });

        radioGroupColor.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup radioGroup, int i) {
                switch (i){
                    case R.id.color_black:
                        waveView.setWaveColor(ContextCompat.getColor(MainActivity.this,R.color.light_black));
                        break;

                    case R.id.color_red:
                        waveView.setWaveColor(ContextCompat.getColor(MainActivity.this,R.color.light_red));
                        break;

                    case R.id.color_blue:
                        waveView.setWaveColor(ContextCompat.getColor(MainActivity.this,R.color.light_blue));
                        break;
                    case R.id.color_green:
                        waveView.setWaveColor(ContextCompat.getColor(MainActivity.this,R.color.light_green));
                        break;
                }
            }
        });

        radioGroupSpeed.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup radioGroup, int i) {
                switch (i){
                    case R.id.speed_normal:
                        waveView.setSpeed(WaveView.SPEED_NORMAL);
                        break;

                    case R.id.speed_slow:
                        waveView.setSpeed(WaveView.SPEED_SLOW);
                        break;

                    case R.id.speed_fast:
                        waveView.setSpeed(WaveView.SPEED_FAST);
                        break;
                }
            }
        });
    }

    public void doing(){
        timerTask = new TimerTask() {
            @Override
            public void run() {
                handler.sendEmptyMessage(100);
            }
        };
        timer = new Timer();
        timer.schedule(timerTask,1000,1000);
    }

    private void resetTimer(){
        count = 0;
        if (timer != null)
        timer.cancel();
        timer = null;
        if (timerTask !=null)
        timerTask.cancel();
        timerTask = null;
    }
}


================================================
FILE: sample/src/main/res/layout/activity_main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#6C7B8B"
    tools:context="com.wave.sample.MainActivity">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="@dimen/activity_horizontal_margin"
        >

        <LinearLayout
            android:id="@+id/radio_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            >

            <TextView
                android:id="@+id/mode_txt"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Mode:"
                android:textColor="@color/white"
                android:layout_gravity="center"
                />

            <RadioGroup
                android:id="@+id/radio_group"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:weightSum="3"
                android:paddingLeft="20dp"
                android:paddingRight="20dp"
                android:layout_toRightOf="@id/mode_txt"
                android:orientation="horizontal"
                >

                <RadioButton
                    android:id="@+id/mode_circle"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:text="Circle"
                    android:checked="true"
                    android:gravity="center"
                    android:textColor="@color/white"
                    />
                <RadioButton
                    android:id="@+id/mode_rect"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:text="Rect"
                    android:gravity="center"
                    android:textColor="@color/white"
                    />
                <RadioButton
                    android:id="@+id/mode_drawable"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:text="Draw"
                    android:gravity="center"
                    android:textColor="@color/white"
                    />

            </RadioGroup>
        </LinearLayout>


        <LinearLayout
            android:id="@+id/radio_view_color"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_below="@id/radio_view"
            >

            <TextView
                android:id="@+id/mode_txt_color"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Color:"
                android:textColor="@color/white"
                android:layout_gravity="center"
                />

            <RadioGroup
                android:id="@+id/radio_group_color"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:weightSum="4"
                android:layout_toRightOf="@id/mode_txt"
                android:orientation="horizontal"
                >

                <RadioButton
                    android:id="@+id/color_black"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:text="BLCK"
                    android:gravity="center"
                    android:textColor="@color/white"
                    />
                <RadioButton
                    android:id="@+id/color_red"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:text="RED"
                    android:gravity="center"
                    android:textColor="@color/white"
                    />
                <RadioButton
                    android:id="@+id/color_blue"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:text="BLUE"
                    android:checked="true"
                    android:gravity="center"
                    android:textColor="@color/white"
                    />
                <RadioButton
                    android:id="@+id/color_green"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:text="GREEN"
                    android:gravity="center"
                    android:textColor="@color/white"
                    />
            </RadioGroup>
        </LinearLayout>

        <LinearLayout
            android:id="@+id/radio_view_speed"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_below="@id/radio_view_color"
            >

            <TextView
                android:id="@+id/mode_txt_speed"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Speed:"
                android:textColor="@color/white"
                android:layout_gravity="center"
                />

            <RadioGroup
                android:id="@+id/radio_group_speed"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:weightSum="3"
                android:paddingLeft="10dp"
                android:paddingRight="10dp"
                android:layout_toRightOf="@id/mode_txt"
                android:orientation="horizontal"
                >

                <RadioButton
                    android:id="@+id/speed_slow"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:text="SLOW"
                    android:gravity="center"
                    android:textColor="@color/white"
                    />
                <RadioButton
                    android:id="@+id/speed_normal"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:text="NORMAL"
                    android:checked="true"
                    android:gravity="center"
                    android:textColor="@color/white"
                    />
                <RadioButton
                    android:id="@+id/speed_fast"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:text="FAST"
                    android:gravity="center"
                    android:textColor="@color/white"
                    />
            </RadioGroup>
        </LinearLayout>

        <com.yuan.waveview.WaveView
            android:id="@+id/waveview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="20dp"
            android:layout_margin="20dp"
            android:layout_below="@id/radio_view_speed"
            app:backgroudColor="@color/white"
            app:progressColor="@color/black"
            />

        <TextView
            android:id="@+id/pb_show_tv"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/waveview"
            android:layout_centerHorizontal="true"
            android:text="0%"
            android:textColor="@color/white"
            android:textSize="20sp"
            />


        <Button
            android:id="@+id/button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="5dp"
            android:text="START"
            android:layout_below="@id/pb_show_tv"
            android:layout_alignParentLeft="true"
            android:layout_marginRight="20dp"
            />

        <Button
            android:id="@+id/speed"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="5dp"
            android:text="SPEED"
            android:layout_alignParentRight="true"
            android:layout_marginLeft="20dp"
            android:layout_below="@id/pb_show_tv"
            />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/my"
            android:gravity="center"
            android:layout_alignParentBottom="true"
            android:layout_below="@id/speed"
            android:layout_centerHorizontal="true"
            android:textColor="@color/white"
            android:textSize="12sp"
            />
    </RelativeLayout>
</ScrollView>


================================================
FILE: sample/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#6C7B8B</color>
    <color name="colorPrimaryDark">#00000000</color>
    <color name="colorAccent">#FF4081</color>
</resources>


================================================
FILE: sample/src/main/res/values/dimens.xml
================================================
<resources>
    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
</resources>


================================================
FILE: sample/src/main/res/values/strings.xml
================================================
<resources>
    <string name="app_name">WaveView</string>
    <string name="my">傻小孩b \n welcome to QQ group : 450302004</string>
</resources>


================================================
FILE: sample/src/main/res/values/styles.xml
================================================
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

</resources>


================================================
FILE: sample/src/main/res/values-w820dp/dimens.xml
================================================
<resources>
    <!-- Example customization of dimensions originally defined in res/values/dimens.xml
         (such as screen margins) for screens with more than 820dp of available width. This
         would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
    <dimen name="activity_horizontal_margin">64dp</dimen>
</resources>


================================================
FILE: sample/src/test/java/com/wave/sample/ExampleUnitTest.java
================================================
package com.wave.sample;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
public class ExampleUnitTest {
    @Test
    public void addition_isCorrect() throws Exception {
        assertEquals(4, 2 + 2);
    }
}

================================================
FILE: settings.gradle
================================================
include ':sample', ':wavekit'


================================================
FILE: wavekit/.gitignore
================================================
local.properties
.idea
*.iml
.gradle
build

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

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        minSdkVersion 18
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:24.0.0-beta1'
    testCompile 'junit:junit:4.12'
}


================================================
FILE: wavekit/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in D:\AndroidStudio_SDK/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}


================================================
FILE: wavekit/src/androidTest/java/com/yuan/waveview/ExampleInstrumentedTest.java
================================================
package com.yuan.waveview;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
 * Instrumentation test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() throws Exception {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();

        assertEquals("com.yuan.waveview.test", appContext.getPackageName());
    }
}


================================================
FILE: wavekit/src/main/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.yuan.waveview">

    <application
        android:allowBackup="true"
        android:label="@string/app_name"
        android:supportsRtl="true">

    </application>

</manifest>


================================================
FILE: wavekit/src/main/java/com/yuan/waveview/WaveView.java
================================================
package com.yuan.waveview;

import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.animation.LinearInterpolator;

import com.yuan.waveview.utils.DensityUtil;

import java.util.ArrayList;
import java.util.List;

import static android.view.animation.Animation.INFINITE;

/**
 * Created by Yuan on 2016/10/8.
 * Detail wave for view
 *        --
 *            Thank you for your support!
 *            Imitate the Android progress of  method, At present support functions:
 *
 *            1. waveview to support the dynamic change of progress,
 *            2. waveview to support the progress callback Activity or fragments, use mask effect and the property animation,
 *            3. waveview to support custom change wave properties, including color wave, wave speed, wave shape of container (currently support circle, rectangular, and mask drawable).
 *
 *           Details you can run the Demo and study the source code.
 *
 *           My :
 *           E-mail : sy.wu@foxmail.com
 *           Blog : http://www.jianshu.com/users/d388bcf9c4d3/
 *       --
 *
 * KeyWord  rolling wave ,normal wave.waveview shapes,speed mode,shadow...
 */

public class WaveView extends View {

    private final String TAG = "WaveView";
    private Context mContext;

    private Paint mPaint;
    private Paint wavePaint;

    /**
     * The wave of the normal grain
     */
    private Path wavePath;

    /**
     * The wave of the rolling grain
     */
    private Path shadPath;

    //mode
    private int WAVE_COLOR = Color.BLUE;// Color for wave
    private int BG_COLOR = Color.WHITE;// Color for view of background

    /**
     * the width and height for view  < width and height is 300 dpi  by default ></>
     */
    private float VIEW_WIDTH = 0f;
    private float VIEW_HEIGHT = 0f;
    private float VIEW_WIDTH_TMP = 0f;
    private float VIEW_HEIGHT_TMP = 0f;


    /**
     * the width and height for wave  < Width is half the width of view , Height is auto ></>
     */
    private float WAVE_WIDTH = 0f;
    private float WAVE_HEIGHT = 0f;

    /**
     * There are three kinds of waveview shapes(mode), including circle、rect and drawable
     * -- Drawable shape , you need to have default drawable
     */
    public final static String MODE_CIRCLE = "circle";
    public final static String MODE_RECT = "rect";
    public final static String MODE_DRAWABLE = "drawable";
    private String mode = MODE_CIRCLE; //default shape is circle

    /**
     * pointList : normal wave of  original collection point
     * shadpointList : rolling wave of  original collection point
     */
    private List<Point> pointList = new ArrayList<>();
    private List<Point> shadpointList = new ArrayList<>();

    /**
     * < Sign control variables ></>
     */
    private boolean isInitPoint = true; // Init original collection point
    private boolean isStartAnimation = false;// The first time for start the flowingAnimation
    private boolean isDone = false;// whether to end
    private boolean isMeasure = false;// The first time for measure view
    private boolean isCompleteLayout = false;//just action when drawing finish
    boolean isHasWindowFocus = false;// is hasWindowFocus

    /**
     * < value ></>
     */
    private float dy = 0;// height of the rise
    private float old_dy = 0; //height of the rise  ,often change
    private float sum_dy = 0;// defalut height
    private float beforDy = 0;//The last time the height of the rise

    private float dx = 0;// Distance for Horizontal-Moving < normal wave >
    private float shd_dx = 0;// Distance for Horizontal-Moving < rolling wave >
    private float runRatio = 1.5f;

    /**
     * There are three kinds of waveview mode of speed , including slow、normal and fast
     */
    public  static float SPEED_SLOW = 10f; // Slow speed
    public  static float SPEED_NORMAL = 30f;// normal speed
    public  static float SPEED_FAST = 40f;// fast speed
    private int  isSlow = 0x01;
    private int isNormal = 0x02;
    private int isFast = 0x03;
    private float speed = SPEED_NORMAL;// default speed
    private int curSpeedMode = isNormal;

    /**
     * < the progress for waveview ></>
     */
    private long progress = 0;// The current progress
    private long curProgress = 0;// The current progress , in order to deal with some logical work
    private long max = 0;// The max progress
    private float progressRatio = 0f;// ratio < result = progress / max >

    private waveProgressListener progressListener;

    private ValueAnimator reiseAnimator;
    private ObjectAnimator flowingAnimato;

    public WaveView(Context context) {
        super(context);
        init(context,null);
    }

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

    private void init(Context context, AttributeSet attrs){
        if (attrs != null){
            //attars
            TypedArray typedArray = context.obtainStyledAttributes(attrs,R.styleable.WaveView);

            int bgColor =  typedArray.getColor(R.styleable.WaveView_backgroudColor,BG_COLOR);
            int pColor = typedArray.getColor(R.styleable.WaveView_progressColor,WAVE_COLOR);
            int aMax = typedArray.getInt(R.styleable.WaveView_max, (int) max);
            int aP = typedArray.getInteger(R.styleable.WaveView_progress, (int) progress);

            BG_COLOR = bgColor;
            WAVE_COLOR = pColor;
            max = aMax;
            progress = aP;

            typedArray.recycle();
        }

        VIEW_WIDTH = DensityUtil.dip2px(context,300);
        VIEW_HEIGHT = DensityUtil.dip2px(context,300);

        wavePath = new Path();
        shadPath = new Path();
        wavePath.setFillType(Path.FillType.EVEN_ODD);
//        shadPath.setFillType(Path.FillType.EVEN_ODD);

        this.mContext = context;

        mPaint=  new Paint();
        mPaint.setColor(BG_COLOR);
        mPaint.setStrokeWidth(1);
        mPaint.setStyle(Paint.Style.FILL);
        mPaint.setAntiAlias(true);

        wavePaint = new Paint();
        wavePaint.setColor(BG_COLOR);
        wavePaint.setStrokeWidth(1);
        wavePaint.setStyle(Paint.Style.FILL);
        wavePaint.setAntiAlias(true);
//        wavePaint.setAlpha(50);

        this.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                // TODO Auto-generated method stub
                Log.i(TAG,"绘制完成");
                setSpeed(speed);
                if (isHasWindowFocus){

                    isCompleteLayout = true;

                    long cP = max - progress;
                    if (max >= progress) {
                        progressRatio = progress / (float) max;
                        dy = updateDyData();
//                        Log.i(TAG,"update dy " + dy);
                        getViewTreeObserver().removeOnGlobalLayoutListener(this);
                        isMeasure = true;
                    }
                }
                if (isHasWindowFocus){

                }

                VIEW_HEIGHT_TMP = VIEW_HEIGHT;
                VIEW_WIDTH_TMP = VIEW_WIDTH;
                Log.i(TAG,"tmp of width and tmp of hight is init ! "+VIEW_WIDTH_TMP +" "+VIEW_WIDTH_TMP);
            }
        });

    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
//        Log.d(TAG,"onMeasure " +isHasWindowFocus);
        if (!isMeasure) {
            // 修正 高度 宽度必须一致,以较大的作为标准
            getRealWidthMeasureSpec(widthMeasureSpec);
            getRealHeightMeasureSpec(heightMeasureSpec);
            if (VIEW_HEIGHT > VIEW_WIDTH){
                VIEW_WIDTH = VIEW_HEIGHT;
            }else{
                VIEW_HEIGHT = VIEW_WIDTH;
            }
            setMeasuredDimension((int)VIEW_WIDTH,(int)VIEW_HEIGHT);
        }
        initPoint();
    }



    /**
     * Initialize the original wave arts collection point , including normal wave ,rolling wave
     */
    private void initPoint(){
        if (isInitPoint){
            isInitPoint = false;
            pointList.clear();
            shadpointList.clear();

            WAVE_WIDTH = (float) (VIEW_WIDTH / 2.5);
//            WAVE_HEIGHT = (float) (VIEW_HEIGHT / 50);
            WAVE_HEIGHT = VIEW_HEIGHT/getWaveHeight();

            dy = VIEW_HEIGHT;//Started from the bottom, when the height is rise, dy gradually reduce
            //How many points calculated maximum support
            int n = Math.round(VIEW_WIDTH / WAVE_WIDTH);
            //start point for normal wave
            int startX = 0;
            Log.i(TAG,"begin point ("+DensityUtil.px2dip(mContext,startX)+" , "+DensityUtil.px2dip(mContext,dy)+")");
            for (int i = 0; i < 4*n+1; i++) {
                Point point = new Point();
                point.y = (int) dy;
                if (i == 0) {
                    point.x = startX;
                } else {
                    startX += WAVE_WIDTH;
                    point.x = startX;
                }
                pointList.add(point);
            }
            // start point for rolling wave
            startX = (int) VIEW_WIDTH;
            for (int i = 0; i < 4*n+1; i++) {
                Point point = new Point();
                point.y = (int) dy;
                if (i == 0) {
                    point.x = startX;
                } else {
                    startX -= WAVE_WIDTH;
                    point.x = startX;
                }
                shadpointList.add(point);
            }

            //change speed base on view_width
            SPEED_NORMAL =  (DensityUtil.px2dip(mContext,VIEW_WIDTH)/20);
            SPEED_SLOW = SPEED_NORMAL/2;
            SPEED_FAST = SPEED_NORMAL * 2;

            SPEED_NORMAL = SPEED_NORMAL ==0?1:SPEED_NORMAL;
            SPEED_SLOW = SPEED_SLOW ==0?0.5f:SPEED_SLOW;
            SPEED_FAST = SPEED_FAST ==0?2:SPEED_FAST;

            if (curSpeedMode == isSlow){
                speed = SPEED_SLOW;
            }else if (curSpeedMode == isFast){
                speed = SPEED_FAST;
            }else{
                speed = SPEED_NORMAL;
            }

            Log.i(TAG,"init speed ( normal : " + SPEED_NORMAL +" slow : "+SPEED_SLOW +" fast : "+SPEED_FAST +" )");
        }
    }

    /**
     *  set waveProgressListener
     * @param progressListener
     */
    public void setProgressListener(waveProgressListener progressListener) {
        this.progressListener = progressListener;
        isDone = false;
    }

    private int getWaveHeight(){
        if (speed == SPEED_FAST){
            return 30;
        }else if (speed == SPEED_SLOW){
            return 70;
        }else{
            return 50;
        }
    }

    /**
     * set speed
     * @param speed including slow、normal and fast
     */
    public void setSpeed(float speed) {
        if (speed == SPEED_FAST || speed == SPEED_NORMAL || speed == SPEED_SLOW) {

            if (speed == SPEED_FAST){
                curSpeedMode = isFast;
            }else if (speed == SPEED_SLOW){
                curSpeedMode = isSlow;
            }else{
                curSpeedMode = isNormal;
            }
            this.speed = speed;
            dx = 0;
            shd_dx = 0;
//            rerefreshPoints();
        }
    }

    /**
     * set shape (mode)
     * @param mode including circle、rect and drawable
     */
    public void setMode(String mode) {
        this.mode = mode;
    }

    /**
     * set max progress
     * @param max
     */
    public void setMax(long max) {
        this.max = max;
        isDone = false;
    }

    /**
     * set color for  view of background
     * @param color
     */
    public void setbgColor(int color) {
        this.BG_COLOR = color;
    }

    /**
     * set color for  wave of background
     * @param color
     */
    public void setWaveColor(int color) {
        this.WAVE_COLOR = color;
    }

    /**
     * set progress
     * @param progress
     */
    public void setProgress(long progress) {
        mPaint.setColor(BG_COLOR);
        mPaint.setAlpha(255);

        isDone = false;
        if (progress > max) {
            if (this.progress < max) progress  = max;
            else return;
        }

        if (flowingAnimato == null) flowingAnimation();

        if (reiseAnimator!=null && reiseAnimator.isRunning()){
//            reiseAnimator.cancel();//不应该取消,应该让其直接结束
            reiseAnimator.end();
        }

        this.progress = progress;
        if (progress == 0){ resetWave();}
        if (!isCompleteLayout){return ;}

        long cP = max - progress;
        if (max >= progress) {
            progressRatio = cP / (float)max;
            updateProgress();
        }
    }

    public long getProgress() {
        return progress;
    }

    public long getMax() {
        return max;
    }

    /**
     * reset point set
     * < When in onDraw need to measure the initialization point set></>
     */
    private void rerefreshPoints(){
        pointList.clear();
        shadpointList.clear();

        WAVE_HEIGHT = VIEW_HEIGHT/getWaveHeight();

        //计算最多能支持多少点 非控制点
        int n = Math.round(VIEW_WIDTH / WAVE_WIDTH);
        //起始点
        int startX = (int) -dx;
        for (int i = 0; i < 4*n+1; i++) {
            Point point = new Point();
            point.y = (int) dy;
            if (i == 0) {
                point.x = startX;
            } else {
                startX += WAVE_WIDTH;
                point.x = startX;
            }
            pointList.add(point);
        }

        startX = (int) VIEW_WIDTH;
        for (int i = 0; i < 4*n+1; i++) {
            Point point = new Point();
            point.y = (int) dy;
            if (i == 0) {
                point.x = startX;
            } else {
                startX -= WAVE_WIDTH;
                point.x = startX;
            }
            shadpointList.add(point);
        }

//        Log.i("wusy","test v : y " +shadpointList.get(0).y);
    }

    public void resetWave(){
        isDone = false;
        dy = VIEW_HEIGHT;
        beforDy = 0;
    }

    private int updateDyData(){

        // TODO: 2017/4/18 解决不能自定义大小
        if (sum_dy == 0 && isHasWindowFocus){sum_dy = VIEW_HEIGHT;}

        old_dy = dy;
        int offsetDy = (int) (sum_dy - sum_dy * progressRatio - beforDy);
        beforDy = sum_dy - sum_dy * progressRatio;
        return  offsetDy;
    }

    /**
     * In a second riseAnimation when set the progress !!
     * <second by second execution of progress  ></>
     */
    private void updateProgress(){
        riseAnimation();
    }

    /**
     * for measure width
     * @param widthMeasureSpec
     * @return
     */
    private int  getRealWidthMeasureSpec(int widthMeasureSpec){
        int mode = MeasureSpec.getMode(widthMeasureSpec);
        int widthSize = MeasureSpec.getSize(widthMeasureSpec);

        if (mode == MeasureSpec.AT_MOST){
            Log.i(TAG,"AT_MOST width :"+ DensityUtil.px2dip(mContext,widthSize));//warp
//            VIEW_WIDTH = widthSize;
        }else if (mode == MeasureSpec.EXACTLY){
            Log.i(TAG,"EXACTLY width :"+ DensityUtil.px2dip(mContext,widthSize));
            VIEW_WIDTH = widthSize;
        }else if (mode == MeasureSpec.UNSPECIFIED){
            Log.i(TAG,"UNSPECIFIED width :"+ DensityUtil.px2dip(mContext,widthSize));
//            VIEW_WIDTH = VIEW_WIDTH_TMP;
        }
        return (int) VIEW_WIDTH;
    }

    /**
     * for measure height
     * @param heightMeasureSpec
     * @return
     */
    private int  getRealHeightMeasureSpec(int heightMeasureSpec){

        int mode = MeasureSpec.getMode(heightMeasureSpec);
        int heightSize = MeasureSpec.getSize(heightMeasureSpec);

        if (mode == MeasureSpec.AT_MOST){
            Log.i(TAG,"AT_MOST heitht :"+ DensityUtil.px2dip(mContext,heightSize));
//            VIEW_HEIGHT = heightSize;
        }else if (mode == MeasureSpec.EXACTLY){
            Log.i(TAG,"EXACTLY heitht :"+ DensityUtil.px2dip(mContext,heightSize));
            VIEW_HEIGHT = heightSize;
        }else if (mode == MeasureSpec.UNSPECIFIED){
            Log.i(TAG,"UNSPECIFIED heitht :"+ DensityUtil.px2dip(mContext,heightSize));
//            VIEW_HEIGHT = VIEW_HEIGHT_TMP;
        }
        if (!isHasWindowFocus){updateDyData();}else {
            dy = VIEW_HEIGHT;//为了防止多次测量,必须重新更新初始高度
            old_dy = dy;
            sum_dy = dy;
        }

        return (int) VIEW_HEIGHT;
    }

    @Override
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        super.onLayout(changed, left, top, right, bottom);
//        Log.i(TAG,"onLayout");
    }

    @Override
    protected void onDraw(Canvas canvas) {
        //To prevent repeated drawing
        wavePath.reset();
        shadPath.reset();

        float radius = VIEW_WIDTH / 2f;

        int saveFlags = Canvas.MATRIX_SAVE_FLAG | Canvas.CLIP_SAVE_FLAG | Canvas.HAS_ALPHA_LAYER_SAVE_FLAG | Canvas.FULL_COLOR_LAYER_SAVE_FLAG | Canvas.CLIP_TO_LAYER_SAVE_FLAG;
        canvas.saveLayer(0, 0, VIEW_WIDTH, VIEW_HEIGHT, null, saveFlags);

        // set shape
        if (mode.equals(MODE_DRAWABLE)){
            drawableToBitamp(ContextCompat.getDrawable(mContext,R.drawable.wave_icon),canvas);
        } else if (mode.equals(MODE_RECT)){
            canvas.drawRect(0,0,VIEW_WIDTH,VIEW_HEIGHT,mPaint);
        } else{
            canvas.drawCircle(VIEW_WIDTH / 2f, VIEW_HEIGHT / 2f, radius, mPaint);
        }

        wavePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_ATOP));

        if (!isDone) {
            // drawing normal wave
            wavePaint.setColor(WAVE_COLOR);
            wavePaint.setAlpha(100);

            float end1 = 0;
            for (int i = 0; i < pointList.size(); i++) {
                int j = i + 1;
                if (pointList.size() > i) {
                    float start1 = pointList.get(i).x;
                    wavePath.moveTo(start1, dy);//+dy
                    if (j % 2 == 0 && j >= 2) {
                        end1 = start1;
                        wavePath.quadTo(start1 + WAVE_WIDTH / 2, dy + WAVE_HEIGHT, start1 + WAVE_WIDTH, dy);//+dy
                    } else {
                        end1 = start1;
                        wavePath.quadTo(start1 + WAVE_WIDTH / 2, dy - WAVE_HEIGHT, start1 + WAVE_WIDTH, dy);
                    }
                }
            }

            if (end1 >= VIEW_WIDTH) {
                wavePath.lineTo(VIEW_WIDTH, VIEW_HEIGHT);
                wavePath.lineTo(0, VIEW_HEIGHT);
                wavePath.lineTo(0, dy);
                wavePath.close();
                canvas.drawPath(wavePath, wavePaint);
            }

            // drawing rolling wave
            wavePaint.setAlpha(200);
            for (int i = 0; i < shadpointList.size(); i++) {
                int j = i + 1;
                if (shadpointList.size() > i) {
                    float start1 = shadpointList.get(i).x + shd_dx;
                    shadPath.moveTo(start1, dy);//+dy
                    if (j % 2 == 0 && j >= 2) {
                        end1 = start1;
                        shadPath.quadTo(start1 - WAVE_WIDTH / 2, (float) (dy + WAVE_HEIGHT * runRatio), start1 - WAVE_WIDTH, dy);//+dy
                    } else {
                        end1 = start1;
                        shadPath.quadTo(start1 - WAVE_WIDTH / 2, (float) (dy - WAVE_HEIGHT * runRatio), start1 - WAVE_WIDTH, dy);
                    }
                }
            }
            if (end1 <= -VIEW_WIDTH) {
                shadPath.lineTo(0, VIEW_HEIGHT);
                shadPath.lineTo(VIEW_WIDTH, VIEW_HEIGHT);
                shadPath.lineTo(VIEW_WIDTH, dy);
                shadPath.close();
                canvas.drawPath(shadPath, wavePaint);
            }

            // xfer
            wavePaint.setXfermode(null);
            canvas.restore();
//        super.onDraw(canvas);

            // display listener for activity or fragment
            if (this.progressListener != null) {
                if (!isDone && curProgress != this.progress) {
                    this.progressListener.onPorgress(this.progress == this.max, this.progress, this.max);
                    curProgress = this.progress;
                }
                if (this.progress == this.max) {
                    isDone = true;
//                dy = -10;//In order to complete fill finally effect
//                resetWave();
                }
            }

            if (isDone) doneAnimation();

        }

    }

    @Override
    public void onWindowFocusChanged(boolean hasWindowFocus) {
        super.onWindowFocusChanged(hasWindowFocus);
        isHasWindowFocus = hasWindowFocus;
//        Log.d("yuan"," onWindowFocusChanged " + hasWindowFocus);
        if (!isDone){
        if (!isStartAnimation) {
            isStartAnimation = true;
            flowingAnimation();
        }
        // TODO: 2016/10/26  屏幕重新点亮的时候 一定要重新测量!!!
        if (!hasWindowFocus) {
            if (flowingAnimato != null)
                flowingAnimato.cancel();
            if (reiseAnimator != null)
                reiseAnimator.end();
            isMeasure = false;
        } else {
            if (flowingAnimato != null && !flowingAnimato.isRunning()) {
                flowingAnimation();
            }
            if (reiseAnimator != null && !reiseAnimator.isRunning()) {
                setProgress(this.progress);
            }
        }
    }else{
//        Log.d("yuan"," onWindowFocusChanged " + isDone);
        if (isHasWindowFocus) {
            doneAnimation();
        }
    }

}

    private void flowingAnimation(){
        flowingAnimato = ObjectAnimator.ofFloat(this,"wave",0,100)
                .setDuration(100);
        flowingAnimato.setRepeatCount(INFINITE);
        flowingAnimato.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                dx = dx + speed;
                shd_dx = shd_dx + speed/2;//Half the speed of the normal waves

                // 20171026
                if (shd_dx >= WAVE_WIDTH *2){
                    shd_dx = 0;
                }

                if (dx >= WAVE_WIDTH *2){
                    dx = 0;
                }
                rerefreshPoints();
                postInvalidate();
            }
        })
        ;
        flowingAnimato.start();
    }

    private void riseAnimation(){
        if (!isHasWindowFocus){
            // TODO: 2016/10/26 不可视的时候停止
            return ;
        }
        isMeasure = true;
        Log.i("yuan", "move "  + "dy " + dy);
        if (dy > 0) {
            float offset = updateDyData();
            Log.i("yuan", "move s " + offset + "and sum_dy" + sum_dy);
            reiseAnimator = ValueAnimator.ofFloat(0, offset)
                    .setDuration(500);
            reiseAnimator.setInterpolator(new LinearInterpolator());
            reiseAnimator.addListener(new Animator.AnimatorListener() {
                @Override
                public void onAnimationStart(Animator animator) {}

                @Override
                public void onAnimationEnd(Animator animator) {
                    // TODO: 2016/10/26 必须重置dy,修正偏移
                    dy = sum_dy - beforDy;
                }

                @Override
                public void onAnimationCancel(Animator animator) {}

                @Override
                public void onAnimationRepeat(Animator animator) {}
            });
            reiseAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                @Override
                public void onAnimationUpdate(ValueAnimator valueAnimator) {
                    float m = (float) valueAnimator.getAnimatedValue();
                    float s = old_dy - m;
                    dy = s;
//                        Log.i("yuan", "move m " + m + "dy " + dy);
                }
            });


            reiseAnimator.start();
        }
    }

    private void doneAnimation(){
        if (reiseAnimator != null) {
            reiseAnimator.addListener(new Animator.AnimatorListener() {
                @Override
                public void onAnimationStart(Animator animation) {

                }

                @Override
                public void onAnimationEnd(Animator animation) {
                    justDone();
                }

                @Override
                public void onAnimationCancel(Animator animation) {

                }

                @Override
                public void onAnimationRepeat(Animator animation) {

                }
            });
            reiseAnimator.end();
        }else{
            justDone();
        }

    }

    private void justDone(){
        mPaint.setColor(WAVE_COLOR);
//        mPaint.setAlpha(200);
        if (flowingAnimato != null && flowingAnimato.isRunning()) {
            flowingAnimato.end();
            flowingAnimato = null;
        }
        else invalidate();
    }

    /**
     * drawable to bitmap
     * @param drawable
     * @param canvas
     * @return
     */
    private void drawableToBitamp(Drawable drawable,Canvas canvas)
    {
        int w = (int) VIEW_WIDTH;
        int h = (int) VIEW_HEIGHT;
        Bitmap.Config config =
                drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888
                        : Bitmap.Config.RGB_565;
        Bitmap bitmap = Bitmap.createBitmap(w,h,config);
        canvas.drawBitmap(bitmap,0,0,mPaint);
        drawable.setBounds(0, 0, w, h);
        drawable.draw(canvas);
    }

public interface waveProgressListener{
    void onPorgress(boolean isDone, long progress, long max);
}

}



================================================
FILE: wavekit/src/main/java/com/yuan/waveview/utils/DensityUtil.java
================================================
package com.yuan.waveview.utils;

import android.content.Context;

/**
 * Created by Yuan on 2016/10/9.
 * Detail
 */

public class DensityUtil {

    /**
     * 根据手机的分辨率从 dp 的单位 转成为 px(像素)
     */
    public static int dip2px(Context context, float dpValue) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int) (dpValue * scale + 0.5f);
    }

    /**
     * 根据手机的分辨率从 px(像素) 的单位 转成为 dp
     */
    public static int px2dip(Context context, float pxValue) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int) (pxValue / scale + 0.5f);
    }

}


================================================
FILE: wavekit/src/main/res/values/attrs.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <!-- waveview -->
    <declare-styleable name="WaveView">
        <attr name="backgroudColor" format="color"></attr>
        <attr name="progressColor" format="color"></attr>
        <attr name="max" format="integer"></attr>
        <attr name="progress" format="integer"></attr>
    </declare-styleable>

</resources>


================================================
FILE: wavekit/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#6C7B8B</color>
    <color name="colorPrimaryDark">#00000000</color>
    <color name="colorAccent">#FF4081</color>

    <color name="white">#FFFFFF</color>
    <color name="black">#000000</color>

    <color name="light_black">#99000000</color>
    <color name="light_blue">#9963B8FF</color>
    <color name="light_red">#99CD0000</color>
    <color name="light_green">#99C1FFC1</color>

</resources>


================================================
FILE: wavekit/src/main/res/values/strings.xml
================================================
<resources>
    <string name="app_name">waveKit</string>
</resources>


================================================
FILE: wavekit/src/test/java/com/yuan/waveview/ExampleUnitTest.java
================================================
package com.yuan.waveview;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
public class ExampleUnitTest {
    @Test
    public void addition_isCorrect() throws Exception {
        assertEquals(4, 2 + 2);
    }
}
Download .txt
gitextract_a4vqsdf9/

├── .idea/
│   ├── libraries/
│   │   ├── animated_vector_drawable_24_0_0_beta1.xml
│   │   ├── appcompat_v7_24_0_0_beta1.xml
│   │   ├── espresso_core_2_2_2.xml
│   │   ├── espresso_idling_resource_2_2_2.xml
│   │   ├── exposed_instrumentation_api_publish_0_5.xml
│   │   ├── rules_0_5.xml
│   │   ├── runner_0_5.xml
│   │   ├── support_annotations_24_0_0_beta1.xml
│   │   ├── support_v4_24_0_0_beta1.xml
│   │   └── support_vector_drawable_24_0_0_beta1.xml
│   └── vcs.xml
├── .travis.yml
├── README.md
├── app/
│   └── build/
│       ├── BUILD_README
│       └── sample-debug.apk
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── sample/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── wave/
│       │               └── sample/
│       │                   └── ExampleInstrumentedTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── wave/
│       │   │           └── sample/
│       │   │               └── MainActivity.java
│       │   └── res/
│       │       ├── layout/
│       │       │   └── activity_main.xml
│       │       ├── values/
│       │       │   ├── colors.xml
│       │       │   ├── dimens.xml
│       │       │   ├── strings.xml
│       │       │   └── styles.xml
│       │       └── values-w820dp/
│       │           └── dimens.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── wave/
│                       └── sample/
│                           └── ExampleUnitTest.java
├── settings.gradle
└── wavekit/
    ├── .gitignore
    ├── build.gradle
    ├── proguard-rules.pro
    └── src/
        ├── androidTest/
        │   └── java/
        │       └── com/
        │           └── yuan/
        │               └── waveview/
        │                   └── ExampleInstrumentedTest.java
        ├── main/
        │   ├── AndroidManifest.xml
        │   ├── java/
        │   │   └── com/
        │   │       └── yuan/
        │   │           └── waveview/
        │   │               ├── WaveView.java
        │   │               └── utils/
        │   │                   └── DensityUtil.java
        │   └── res/
        │       └── values/
        │           ├── attrs.xml
        │           ├── colors.xml
        │           └── strings.xml
        └── test/
            └── java/
                └── com/
                    └── yuan/
                        └── waveview/
                            └── ExampleUnitTest.java
Download .txt
SYMBOL INDEX (51 symbols across 7 files)

FILE: sample/src/androidTest/java/com/wave/sample/ExampleInstrumentedTest.java
  class ExampleInstrumentedTest (line 17) | @RunWith(AndroidJUnit4.class)
    method useAppContext (line 19) | @Test

FILE: sample/src/main/java/com/wave/sample/MainActivity.java
  class MainActivity (line 22) | public class MainActivity extends AppCompatActivity {
    method handleMessage (line 37) | @Override
    method run (line 53) | @Override
    method onCreate (line 61) | @Override
    method initView (line 70) | private void initView(){
    method initListener (line 85) | private void initListener(){
    method doing (line 177) | public void doing(){
    method resetTimer (line 188) | private void resetTimer(){

FILE: sample/src/test/java/com/wave/sample/ExampleUnitTest.java
  class ExampleUnitTest (line 12) | public class ExampleUnitTest {
    method addition_isCorrect (line 13) | @Test

FILE: wavekit/src/androidTest/java/com/yuan/waveview/ExampleInstrumentedTest.java
  class ExampleInstrumentedTest (line 17) | @RunWith(AndroidJUnit4.class)
    method useAppContext (line 19) | @Test

FILE: wavekit/src/main/java/com/yuan/waveview/WaveView.java
  class WaveView (line 54) | public class WaveView extends View {
    method WaveView (line 154) | public WaveView(Context context) {
    method WaveView (line 159) | public WaveView(Context context, AttributeSet attrs) {
    method init (line 164) | private void init(Context context, AttributeSet attrs){
    method onMeasure (line 236) | @Override
    method initPoint (line 259) | private void initPoint(){
    method setProgressListener (line 325) | public void setProgressListener(waveProgressListener progressListener) {
    method getWaveHeight (line 330) | private int getWaveHeight(){
    method setSpeed (line 344) | public void setSpeed(float speed) {
    method setMode (line 365) | public void setMode(String mode) {
    method setMax (line 373) | public void setMax(long max) {
    method setbgColor (line 382) | public void setbgColor(int color) {
    method setWaveColor (line 390) | public void setWaveColor(int color) {
    method setProgress (line 398) | public void setProgress(long progress) {
    method getProgress (line 426) | public long getProgress() {
    method getMax (line 430) | public long getMax() {
    method rerefreshPoints (line 438) | private void rerefreshPoints(){
    method resetWave (line 476) | public void resetWave(){
    method updateDyData (line 482) | private int updateDyData(){
    method updateProgress (line 497) | private void updateProgress(){
    method getRealWidthMeasureSpec (line 506) | private int  getRealWidthMeasureSpec(int widthMeasureSpec){
    method getRealHeightMeasureSpec (line 528) | private int  getRealHeightMeasureSpec(int heightMeasureSpec){
    method onLayout (line 552) | @Override
    method onDraw (line 558) | @Override
    method onWindowFocusChanged (line 657) | @Override
    method flowingAnimation (line 691) | private void flowingAnimation(){
    method riseAnimation (line 717) | private void riseAnimation(){
    method doneAnimation (line 761) | private void doneAnimation(){
    method justDone (line 791) | private void justDone(){
    method drawableToBitamp (line 807) | private void drawableToBitamp(Drawable drawable,Canvas canvas)
    type waveProgressListener (line 820) | public interface waveProgressListener{
      method onPorgress (line 821) | void onPorgress(boolean isDone, long progress, long max);

FILE: wavekit/src/main/java/com/yuan/waveview/utils/DensityUtil.java
  class DensityUtil (line 10) | public class DensityUtil {
    method dip2px (line 15) | public static int dip2px(Context context, float dpValue) {
    method px2dip (line 23) | public static int px2dip(Context context, float pxValue) {

FILE: wavekit/src/test/java/com/yuan/waveview/ExampleUnitTest.java
  class ExampleUnitTest (line 12) | public class ExampleUnitTest {
    method addition_isCorrect (line 13) | @Test
Condensed preview — 45 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (80K chars).
[
  {
    "path": ".idea/libraries/animated_vector_drawable_24_0_0_beta1.xml",
    "chars": 884,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"animated-vector-drawable-24.0.0-beta1\">\n    <CLASSES>\n      <root url=\""
  },
  {
    "path": ".idea/libraries/appcompat_v7_24_0_0_beta1.xml",
    "chars": 1129,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"appcompat-v7-24.0.0-beta1\">\n    <ANNOTATIONS>\n      <root url=\"jar://$P"
  },
  {
    "path": ".idea/libraries/espresso_core_2_2_2.xml",
    "chars": 814,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"espresso-core-2.2.2\">\n    <CLASSES>\n      <root url=\"jar://$PROJECT_DIR"
  },
  {
    "path": ".idea/libraries/espresso_idling_resource_2_2_2.xml",
    "chars": 891,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"espresso-idling-resource-2.2.2\">\n    <CLASSES>\n      <root url=\"jar://$"
  },
  {
    "path": ".idea/libraries/exposed_instrumentation_api_publish_0_5.xml",
    "chars": 918,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"exposed-instrumentation-api-publish-0.5\">\n    <CLASSES>\n      <root url"
  },
  {
    "path": ".idea/libraries/rules_0_5.xml",
    "chars": 1015,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"rules-0.5\">\n    <ANNOTATIONS>\n      <root url=\"jar://$PROJECT_DIR$/wave"
  },
  {
    "path": ".idea/libraries/runner_0_5.xml",
    "chars": 1024,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"runner-0.5\">\n    <ANNOTATIONS>\n      <root url=\"jar://$PROJECT_DIR$/wav"
  },
  {
    "path": ".idea/libraries/support_annotations_24_0_0_beta1.xml",
    "chars": 547,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"support-annotations-24.0.0-beta1\">\n    <CLASSES>\n      <root url=\"jar:/"
  },
  {
    "path": ".idea/libraries/support_v4_24_0_0_beta1.xml",
    "chars": 1280,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"support-v4-24.0.0-beta1\">\n    <ANNOTATIONS>\n      <root url=\"jar://$PRO"
  },
  {
    "path": ".idea/libraries/support_vector_drawable_24_0_0_beta1.xml",
    "chars": 877,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"support-vector-drawable-24.0.0-beta1\">\n    <CLASSES>\n      <root url=\"j"
  },
  {
    "path": ".idea/vcs.xml",
    "chars": 180,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping dire"
  },
  {
    "path": ".travis.yml",
    "chars": 1104,
    "preview": "language: android\nandroid:\n  components:\n  - tools\n  - build-tools-24.0.1\n  - android-24\n  - extra-android-m2repository\n"
  },
  {
    "path": "README.md",
    "chars": 2660,
    "preview": "# WaveView\n\n### Thank you for your support!\n\nImitate the Android progress of  method, At present support functions:\n\n1. "
  },
  {
    "path": "app/build/BUILD_README",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "build.gradle",
    "chars": 498,
    "preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    r"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 233,
    "preview": "#Mon Dec 28 10:00:20 PST 2015\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "gradlew",
    "chars": 4971,
    "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": "sample/.gitignore",
    "chars": 42,
    "preview": "local.properties\n.idea\n*.iml\n.gradle\nbuild"
  },
  {
    "path": "sample/build.gradle",
    "chars": 1031,
    "preview": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 24\n    buildToolsVersion \"24.0.1\"\n\n    defaultC"
  },
  {
    "path": "sample/proguard-rules.pro",
    "chars": 651,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in D:"
  },
  {
    "path": "sample/src/androidTest/java/com/wave/sample/ExampleInstrumentedTest.java",
    "chars": 734,
    "preview": "package com.wave.sample;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimport an"
  },
  {
    "path": "sample/src/main/AndroidManifest.xml",
    "chars": 619,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\" package=\"com"
  },
  {
    "path": "sample/src/main/java/com/wave/sample/MainActivity.java",
    "chars": 6334,
    "preview": "package com.wave.sample;\n\nimport android.graphics.Color;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport and"
  },
  {
    "path": "sample/src/main/res/layout/activity_main.xml",
    "chars": 9908,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:"
  },
  {
    "path": "sample/src/main/res/values/colors.xml",
    "chars": 210,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#6C7B8B</color>\n    <color name=\"color"
  },
  {
    "path": "sample/src/main/res/values/dimens.xml",
    "chars": 211,
    "preview": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal"
  },
  {
    "path": "sample/src/main/res/values/strings.xml",
    "chars": 142,
    "preview": "<resources>\n    <string name=\"app_name\">WaveView</string>\n    <string name=\"my\">傻小孩b \\n welcome to QQ group : 450302004<"
  },
  {
    "path": "sample/src/main/res/values/styles.xml",
    "chars": 383,
    "preview": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar"
  },
  {
    "path": "sample/src/main/res/values-w820dp/dimens.xml",
    "chars": 358,
    "preview": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as s"
  },
  {
    "path": "sample/src/test/java/com/wave/sample/ExampleUnitTest.java",
    "chars": 393,
    "preview": "package com.wave.sample;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test, whi"
  },
  {
    "path": "settings.gradle",
    "chars": 30,
    "preview": "include ':sample', ':wavekit'\n"
  },
  {
    "path": "wavekit/.gitignore",
    "chars": 42,
    "preview": "local.properties\n.idea\n*.iml\n.gradle\nbuild"
  },
  {
    "path": "wavekit/build.gradle",
    "chars": 828,
    "preview": "apply plugin: 'com.android.library'\n\nandroid {\n    compileSdkVersion 24\n    buildToolsVersion \"24.0.1\"\n\n    defaultConfi"
  },
  {
    "path": "wavekit/proguard-rules.pro",
    "chars": 651,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in D:"
  },
  {
    "path": "wavekit/src/androidTest/java/com/yuan/waveview/ExampleInstrumentedTest.java",
    "chars": 743,
    "preview": "package com.yuan.waveview;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimport "
  },
  {
    "path": "wavekit/src/main/AndroidManifest.xml",
    "chars": 265,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.yuan.waveview\">\n\n    <application\n"
  },
  {
    "path": "wavekit/src/main/java/com/yuan/waveview/WaveView.java",
    "chars": 26578,
    "preview": "package com.yuan.waveview;\n\nimport android.animation.Animator;\nimport android.animation.ObjectAnimator;\nimport android.a"
  },
  {
    "path": "wavekit/src/main/java/com/yuan/waveview/utils/DensityUtil.java",
    "chars": 645,
    "preview": "package com.yuan.waveview.utils;\n\nimport android.content.Context;\n\n/**\n * Created by Yuan on 2016/10/9.\n * Detail\n */\n\np"
  },
  {
    "path": "wavekit/src/main/res/values/attrs.xml",
    "chars": 375,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <!-- waveview -->\n    <declare-styleable name=\"WaveView\">\n      "
  },
  {
    "path": "wavekit/src/main/res/values/colors.xml",
    "chars": 482,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#6C7B8B</color>\n    <color name=\"color"
  },
  {
    "path": "wavekit/src/main/res/values/strings.xml",
    "chars": 70,
    "preview": "<resources>\n    <string name=\"app_name\">waveKit</string>\n</resources>\n"
  },
  {
    "path": "wavekit/src/test/java/com/yuan/waveview/ExampleUnitTest.java",
    "chars": 395,
    "preview": "package com.yuan.waveview;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test, w"
  }
]

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

About this extraction

This page contains the full source code of the YuanClouds/WaveView GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 45 files (71.7 KB), approximately 19.4k tokens, and a symbol index with 51 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!