├── settings.gradle ├── apk └── app-debug.apk ├── screenshots └── avi.gif ├── library ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ ├── strings.xml │ │ │ │ ├── attrs.xml │ │ │ │ └── style.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── wang │ │ │ └── avi │ │ │ ├── indicators │ │ │ ├── LineSpinFadeLoaderIndicator.java │ │ │ ├── LineScalePulseOutIndicator.java │ │ │ ├── LineScalePulseOutRapidIndicator.java │ │ │ ├── SemiCircleSpinIndicator.java │ │ │ ├── BallScaleRippleIndicator.java │ │ │ ├── BallPulseSyncIndicator.java │ │ │ ├── BallScaleIndicator.java │ │ │ ├── LineScaleIndicator.java │ │ │ ├── BallPulseIndicator.java │ │ │ ├── LineScalePartyIndicator.java │ │ │ ├── BallClipRotateIndicator.java │ │ │ ├── BallPulseRiseIndicator.java │ │ │ ├── BallScaleRippleMultipleIndicator.java │ │ │ ├── BallZigZagDeflectIndicator.java │ │ │ ├── BallGridBeatIndicator.java │ │ │ ├── BallScaleMultipleIndicator.java │ │ │ ├── SquareSpinIndicator.java │ │ │ ├── TriangleSkewSpinIndicator.java │ │ │ ├── BallBeatIndicator.java │ │ │ ├── BallZigZagIndicator.java │ │ │ ├── BallRotateIndicator.java │ │ │ ├── BallClipRotateMultipleIndicator.java │ │ │ ├── BallClipRotatePulseIndicator.java │ │ │ ├── BallTrianglePathIndicator.java │ │ │ ├── BallGridPulseIndicator.java │ │ │ ├── BallSpinFadeLoaderIndicator.java │ │ │ ├── PacmanIndicator.java │ │ │ └── CubeTransitionIndicator.java │ │ │ ├── Indicator.java │ │ │ └── AVLoadingIndicatorView.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── wang │ │ └── avi │ │ └── ApplicationTest.java ├── .gitignore ├── proguard-rules.pro └── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── app ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── styles.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ ├── activity_sample.xml │ │ │ │ ├── item_indicator.xml │ │ │ │ └── activity_indicator.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── wang │ │ │ └── avi │ │ │ └── sample │ │ │ ├── IndicatorActivity.java │ │ │ ├── MyCustomIndicator.java │ │ │ └── SampleActivity.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── wang │ │ └── avi │ │ └── sample │ │ └── ApplicationTest.java ├── .gitignore ├── proguard-rules.pro └── build.gradle ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── README.md └── gradlew /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':library' 2 | -------------------------------------------------------------------------------- /apk/app-debug.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarlonWang/AVLoadingIndicatorView/HEAD/apk/app-debug.apk -------------------------------------------------------------------------------- /screenshots/avi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarlonWang/AVLoadingIndicatorView/HEAD/screenshots/avi.gif -------------------------------------------------------------------------------- /library/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Library 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarlonWang/AVLoadingIndicatorView/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarlonWang/AVLoadingIndicatorView/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarlonWang/AVLoadingIndicatorView/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarlonWang/AVLoadingIndicatorView/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarlonWang/AVLoadingIndicatorView/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AVLoadingIndicatorView 3 | 4 | Hello world! 5 | Settings 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Oct 16 02:32:07 CST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /library/src/androidTest/java/com/wang/avi/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.wang.avi; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/androidTest/java/com/wang/avi/sample/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.wang.avi.sample; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /library/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.ap_ 3 | 4 | # files for the dex VM 5 | *.dex 6 | 7 | # Java class files 8 | *.class 9 | 10 | # generated files 11 | bin/ 12 | gen/ 13 | 14 | # Local configuration file (sdk path, etc) 15 | local.properties 16 | 17 | # Proguard folder generated by Eclipse 18 | proguard/ 19 | 20 | # Ignore gradle files 21 | .gradle/ 22 | build/ 23 | 24 | # Eclipse project files 25 | .classpath 26 | .project 27 | .settings/ 28 | 29 | # Intellij project files 30 | *.iml 31 | *.ipr 32 | *.iws 33 | .idea/ 34 | 35 | # Mac system files 36 | .DS_Store 37 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.ap_ 3 | 4 | # files for the dex VM 5 | *.dex 6 | 7 | # Java class files 8 | *.class 9 | 10 | # generated files 11 | bin/ 12 | gen/ 13 | 14 | # Local configuration file (sdk path, etc) 15 | local.properties 16 | 17 | # Proguard folder generated by Eclipse 18 | proguard/ 19 | 20 | # Ignore gradle files 21 | .gradle/ 22 | build/ 23 | 24 | # Eclipse project files 25 | .classpath 26 | .project 27 | .settings/ 28 | 29 | # Intellij project files 30 | *.iml 31 | *.ipr 32 | *.iws 33 | .idea/ 34 | 35 | # Mac system files 36 | .DS_Store 37 | -------------------------------------------------------------------------------- /library/.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.ap_ 3 | 4 | # files for the dex VM 5 | *.dex 6 | 7 | # Java class files 8 | *.class 9 | 10 | # generated files 11 | bin/ 12 | gen/ 13 | 14 | # Local configuration file (sdk path, etc) 15 | local.properties 16 | 17 | # Proguard folder generated by Eclipse 18 | proguard/ 19 | 20 | # Ignore gradle files 21 | .gradle/ 22 | build/ 23 | 24 | # Eclipse project files 25 | .classpath 26 | .project 27 | .settings/ 28 | 29 | # Intellij project files 30 | *.iml 31 | *.ipr 32 | *.iws 33 | .idea/ 34 | 35 | # Mac system files 36 | .DS_Store 37 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Jack\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /library/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Jack\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_sample.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_indicator.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 18 | 19 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | applicationId "com.wang.avi.sample" 9 | minSdkVersion 14 10 | targetSdkVersion 23 11 | versionCode 33 12 | versionName "2.1.3" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(include: ['*.jar'], dir: 'libs') 24 | compile 'com.android.support:appcompat-v7:23.2.0' 25 | compile 'com.android.support:recyclerview-v7:23.2.0' 26 | compile project(':library') 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /library/src/main/res/values/style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 18 | 19 | 26 | 27 | -------------------------------------------------------------------------------- /library/src/main/java/com/wang/avi/indicators/LineSpinFadeLoaderIndicator.java: -------------------------------------------------------------------------------- 1 | package com.wang.avi.indicators; 2 | 3 | import android.graphics.Canvas; 4 | import android.graphics.Paint; 5 | import android.graphics.RectF; 6 | 7 | /** 8 | * Created by Jack on 2015/10/24. 9 | * Email:81813780@qq.com 10 | */ 11 | public class LineSpinFadeLoaderIndicator extends BallSpinFadeLoaderIndicator { 12 | 13 | 14 | @Override 15 | public void draw(Canvas canvas, Paint paint) { 16 | float radius=getWidth()/10; 17 | for (int i = 0; i < 8; i++) { 18 | canvas.save(); 19 | Point point=circleAt(getWidth(),getHeight(),getWidth()/2.5f-radius,i*(Math.PI/4)); 20 | canvas.translate(point.x, point.y); 21 | canvas.scale(scaleFloats[i], scaleFloats[i]); 22 | canvas.rotate(i*45); 23 | paint.setAlpha(alphas[i]); 24 | RectF rectF=new RectF(-radius,-radius/1.5f,1.5f*radius,radius/1.5f); 25 | canvas.drawRoundRect(rectF,5,5,paint); 26 | canvas.restore(); 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/wang/avi/sample/IndicatorActivity.java: -------------------------------------------------------------------------------- 1 | package com.wang.avi.sample; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.view.View; 7 | 8 | import com.wang.avi.AVLoadingIndicatorView; 9 | 10 | /** 11 | * Created by Jack Wang on 2016/8/5. 12 | */ 13 | 14 | public class IndicatorActivity extends AppCompatActivity{ 15 | 16 | private AVLoadingIndicatorView avi; 17 | 18 | @Override 19 | protected void onCreate(@Nullable Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.activity_indicator); 22 | 23 | String indicator=getIntent().getStringExtra("indicator"); 24 | avi= (AVLoadingIndicatorView) findViewById(R.id.avi); 25 | avi.setIndicator(indicator); 26 | } 27 | 28 | public void hideClick(View view) { 29 | avi.hide(); 30 | // or avi.smoothToHide(); 31 | } 32 | 33 | public void showClick(View view) { 34 | avi.show(); 35 | // or avi.smoothToShow(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /library/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | minSdkVersion 14 9 | targetSdkVersion 23 10 | versionCode 33 11 | versionName "2.1.3" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile fileTree(dir: 'libs', include: ['*.jar']) 23 | } 24 | 25 | ext { 26 | PUBLISH_GROUP_ID = 'com.wang.avi' 27 | PUBLISH_VERSION = '2.1.3' 28 | PUBLISH_DES = 'Nice loading animations for Android' 29 | LIB_NAME = 'AVLoadingIndicatorView' 30 | 31 | WEBSITE_URL = 'https://github.com/81813780/AVLoadingIndicatorView' 32 | ISSUE_TRACKER_URL = 'https://github.com/81813780/AVLoadingIndicatorView/issues' 33 | VSC_URL = 'https://github.com/81813780/AVLoadingIndicatorView' 34 | } 35 | 36 | apply from: 'https://raw.githubusercontent.com/andforce/release-android-lib-to-jcenter/master/bintray.gradle' -------------------------------------------------------------------------------- /library/src/main/java/com/wang/avi/indicators/LineScalePulseOutIndicator.java: -------------------------------------------------------------------------------- 1 | package com.wang.avi.indicators; 2 | 3 | 4 | import android.animation.ValueAnimator; 5 | 6 | import java.util.ArrayList; 7 | 8 | /** 9 | * Created by Jack on 2015/10/19. 10 | */ 11 | public class LineScalePulseOutIndicator extends LineScaleIndicator { 12 | 13 | @Override 14 | public ArrayList onCreateAnimators() { 15 | ArrayList animators=new ArrayList<>(); 16 | long[] delays=new long[]{500,250,0,250,500}; 17 | for (int i = 0; i < 5; i++) { 18 | final int index=i; 19 | ValueAnimator scaleAnim=ValueAnimator.ofFloat(1,0.3f,1); 20 | scaleAnim.setDuration(900); 21 | scaleAnim.setRepeatCount(-1); 22 | scaleAnim.setStartDelay(delays[i]); 23 | addUpdateListener(scaleAnim,new ValueAnimator.AnimatorUpdateListener() { 24 | @Override 25 | public void onAnimationUpdate(ValueAnimator animation) { 26 | scaleYFloats[index] = (float) animation.getAnimatedValue(); 27 | postInvalidate(); 28 | } 29 | }); 30 | animators.add(scaleAnim); 31 | } 32 | return animators; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /library/src/main/java/com/wang/avi/indicators/LineScalePulseOutRapidIndicator.java: -------------------------------------------------------------------------------- 1 | package com.wang.avi.indicators; 2 | 3 | 4 | import android.animation.ValueAnimator; 5 | 6 | import java.util.ArrayList; 7 | 8 | /** 9 | * Created by Jack on 2015/10/19. 10 | */ 11 | public class LineScalePulseOutRapidIndicator extends LineScaleIndicator { 12 | 13 | @Override 14 | public ArrayList onCreateAnimators() { 15 | ArrayList animators=new ArrayList<>(); 16 | long[] delays=new long[]{400,200,0,200,400}; 17 | for (int i = 0; i < 5; i++) { 18 | final int index=i; 19 | ValueAnimator scaleAnim=ValueAnimator.ofFloat(1,0.4f,1); 20 | scaleAnim.setDuration(1000); 21 | scaleAnim.setRepeatCount(-1); 22 | scaleAnim.setStartDelay(delays[i]); 23 | addUpdateListener(scaleAnim,new ValueAnimator.AnimatorUpdateListener() { 24 | @Override 25 | public void onAnimationUpdate(ValueAnimator animation) { 26 | scaleYFloats[index] = (float) animation.getAnimatedValue(); 27 | postInvalidate(); 28 | } 29 | }); 30 | animators.add(scaleAnim); 31 | } 32 | return animators; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /library/src/main/java/com/wang/avi/indicators/SemiCircleSpinIndicator.java: -------------------------------------------------------------------------------- 1 | package com.wang.avi.indicators; 2 | 3 | import android.animation.ValueAnimator; 4 | import android.graphics.Canvas; 5 | import android.graphics.Paint; 6 | import android.graphics.RectF; 7 | 8 | import com.wang.avi.Indicator; 9 | 10 | import java.util.ArrayList; 11 | 12 | /** 13 | * Created by Jack on 2015/10/20. 14 | */ 15 | public class SemiCircleSpinIndicator extends Indicator { 16 | 17 | private float degress; 18 | 19 | @Override 20 | public void draw(Canvas canvas, Paint paint) { 21 | canvas.rotate(degress,centerX(),centerY()); 22 | RectF rectF=new RectF(0,0,getWidth(),getHeight()); 23 | canvas.drawArc(rectF,-60,120,false,paint); 24 | } 25 | 26 | @Override 27 | public ArrayList onCreateAnimators() { 28 | ArrayList animators=new ArrayList<>(); 29 | ValueAnimator rotateAnim=ValueAnimator.ofFloat(0,180,360); 30 | addUpdateListener(rotateAnim,new ValueAnimator.AnimatorUpdateListener() { 31 | @Override 32 | public void onAnimationUpdate(ValueAnimator animation) { 33 | degress= (float) animation.getAnimatedValue(); 34 | postInvalidate(); 35 | } 36 | }); 37 | rotateAnim.setDuration(600); 38 | rotateAnim.setRepeatCount(-1); 39 | animators.add(rotateAnim); 40 | return animators; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_indicator.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 28 | 29 |