Overview

PLEASE NOTE, THIS PROJECT IS NO LONGER BEING MAINTAINED


Android Arsenal

AVLoadingIndicatorView

Now AVLoadingIndicatorView was updated version to 2.X , If you have any question or suggestion with this library , welcome to tell me !

Introduction

AVLoadingIndicatorView is a collection of nice loading animations for Android.

You can also find iOS version of this here.

Demo

avi

Usage

Step 1

Add dependencies in build.gradle.

    dependencies {
       compile 'com.wang.avi:library:2.1.3'
    }

Step 2

Add the AVLoadingIndicatorView to your layout:

Simple

    <com.wang.avi.AVLoadingIndicatorView
        android:layout_width="wrap_content"  
        android:layout_height="wrap_content"
        app:indicatorName="BallPulseIndicator"
        />

Advance

    <com.wang.avi.AVLoadingIndicatorView
        android:id="@+id/avi"
        android:layout_width="wrap_content"  //or your custom size
        android:layout_height="wrap_content"  //or your custom size
        style="@style/AVLoadingIndicatorView"// or AVLoadingIndicatorView.Large or AVLoadingIndicatorView.Small
        android:visibility="visible"  //visible or gone
        app:indicatorName="BallPulseIndicator"//Indicator Name
        app:indicatorColor="your color"
        />

Step 3

It's very simple use just like .

   void startAnim(){
        avi.show();
        // or avi.smoothToShow();
   }
   
   void stopAnim(){
        avi.hide();
        // or avi.smoothToHide();
   }
   

Custom Indicator

See MyCustomIndicator in Sample .

Proguard

When using proguard need add rules:

-keep class com.wang.avi.** { *; }
-keep class com.wang.avi.indicators.** { *; }

Indicators is load from class names, proguard may change it (rename).

Indicators

As seen above in the Demo, the indicators are as follows:

Row 1

  • BallPulseIndicator
  • BallGridPulseIndicator
  • BallClipRotateIndicator
  • BallClipRotatePulseIndicator

Row 2

  • SquareSpinIndicator
  • BallClipRotateMultipleIndicator
  • BallPulseRiseIndicator
  • BallRotateIndicator

Row 3

  • CubeTransitionIndicator
  • BallZigZagIndicator
  • BallZigZagDeflectIndicator
  • BallTrianglePathIndicator

Row 4

  • BallScaleIndicator
  • LineScaleIndicator
  • LineScalePartyIndicator
  • BallScaleMultipleIndicator

Row 5

  • BallPulseSyncIndicator
  • BallBeatIndicator
  • LineScalePulseOutIndicator
  • LineScalePulseOutRapidIndicator

Row 6

  • BallScaleRippleIndicator
  • BallScaleRippleMultipleIndicator
  • BallSpinFadeLoaderIndicator
  • LineSpinFadeLoaderIndicator

Row 7

  • TriangleSkewSpinIndicator
  • PacmanIndicator
  • BallGridBeatIndicator
  • SemiCircleSpinIndicator

Row 8

  • com.wang.avi.sample.MyCustomIndicator

Thanks

Contact me

If you have a better idea or way on this project, please let me know, thanks :)

Email

Weibo

My Blog

License

Copyright 2015 jack wang

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • add missing gradle.properties file

    add missing gradle.properties file

    when I cloned this project,then switch to the root directory of the project under.I executed the following command. gradle clean --stacktrace,The following error message appears:

    FAILURE: Build failed with an exception.

    • Where: Build file '/home/malin/github_demo/AVLoadingIndicatorView/build.gradle' line: 18

    • What went wrong: A problem occurred evaluating root project 'AVLoadingIndicatorView'.

      /home/malin/github_demo/AVLoadingIndicatorView/local.properties (没有那个文件或目录)

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    BUILD FAILED

    error-info2

    opened by androidmalin 8
  • Crash in pre-Lollipop devices

    Crash in pre-Lollipop devices

    Version 2.0.x is crashing in pre-Lollipop devices because it tries to use a constructor that is only available in API 21 and higher.

    The problem is located in this line in AVLoadingIndicatorView:

    super(context, attrs, defStyleAttr, defStyleRes);
    
    opened by waninkoko 7
  • AVLoadingIndicatorView memory leak

    AVLoadingIndicatorView memory leak

    Hello! I noticed that AVLoadingIndicatorView never release a reference to target View. That why activities will never be garbage collected.

    I built a simple application with 2 activities. Second(LeakActivity) just have animation First: screen shot 2015-11-19 at 12 41 52 am Second: screen shot 2015-11-19 at 12 41 43 am

    and after open and close LeakActvity we can see: screen shot 2015-11-19 at 12 38 01 am

    and a root to GC screen shot 2015-11-19 at 12 38 11 am

    opened by IgorB10 7
  • 在下拉刷新和上拉加载布局中使用该库导致Crash

    在下拉刷新和上拉加载布局中使用该库导致Crash

    我在下拉刷新和上拉加载的头脚布局中使用该库,会导致crash.

    使用方式为:

        <com.wang.avi.AVLoadingIndicatorView
                android:id="@+id/header_progressbar"
                xmlns:app="http://schemas.android.com/apk/res-auto"
                android:layout_width="25dp"
                android:layout_height="25dp"
                android:layout_centerVertical="true"
                android:layout_toLeftOf="@+id/header_text"
                android:layout_toStartOf="@+id/header_text"
                android:visibility="invisible"
                app:indicator="BallSpinFadeLoader"
                app:indicator_color="@color/gray_88808080"
                />
    

    在代码中仅作了显示和隐藏. 未做其他操作. 结果打开app进入列表就发现主线程阻塞了. 最终导致crash. crash日志如下: 日志1 日志2

    opened by cizkey 5
  • Fix bug: the animator is not started when the AVLoadingIndicatorView added to a layout the second time.

    Fix bug: the animator is not started when the AVLoadingIndicatorView added to a layout the second time.

    The first time an AVLoadingIndicatorView added into a layout, the animator runs as expected. But if you remove the AVLoadingIndicatorView from the layout, and after some time, add the same AVLoadingIndicatorView to the layout again, the animator is not started.

    opened by cclink 5
  • Indicator Color not working

    Indicator Color not working

    Hello, dev!

    I try to use app:indicator_color="your color" with no luck... I've try it with hex "000000" (not working), @color/black (not working). "0xFF000000" (also not working).

    Any idea? Also It would be great if we can change the color by code, like: mProgress.setProgressColor(int color) or similar.

    opened by mkiisoft 4
  • AVLoadingIndicatorView无法在代码里动态构造问题

    AVLoadingIndicatorView无法在代码里动态构造问题

    BallBeatIndicator ballBeatIndicator = new BallBeatIndicator(); AVLoadingIndicatorView avLoadingIndicatorView = new AVLoadingIndicatorView(this); avLoadingIndicatorView.setIndicator(ballBeatIndicator); avLoadingIndicatorView.setIndicatorColor(0xffffff);

    我这里动态构造抛出下面的异常

    java.lang.NullPointerException: Attempt to invoke virtual method 'void com.wang.avi.Indicator.setColor(int)' on a null object reference

    是因为AVLoadingIndicatorView在构造函数里没给indicatorName一个默认值:

    String indicatorName=a.getString(R.styleable.AVLoadingIndicatorView_indicatorName); int indicatorColor=a.getColor(R.styleable.AVLoadingIndicatorView_indicatorColor, Color.WHITE); setIndicator(indicatorName); //这里没有默认值 setIndicatorColor(indicatorColor); //导致这里空指针异常

    opened by JackRo 3
  • Delete allowBackup=true in library's AndroidManifest

    Delete allowBackup=true in library's AndroidManifest

    @81813780 Hi, AVLoadingIndicatorView is a great library. I want to use this in my app. When I add dependencies in build.gradle, following error occurred.

    Error:Execution failed for task ':app:processDevelopmentDebugManifest'.
    > Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:29:9-36
        is also present at [com.wang.avi:library:1.0.1] AndroidManifest.xml:12:9-35 value=(true).
        Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:27:5-102:19 to override.
    

    The cause of this error is allowBackup=true in library's AndroidManifest. I think any library should't use allowBackup attribute, because it's attribute for client app.

    opened by yuyakaido 3
  • FadeOut and In animation

    FadeOut and In animation

    Hi,

    I am trying to set fade in and out animation with this indicators, but VISIBLE and GONE is not working when set startAnimation to control.

    Could you fix the issue.

    Thanks

    opened by ravenet 3
  • Unable compile 'com.wang.avi:library:2.1.3'

    Unable compile 'com.wang.avi:library:2.1.3'

    Hello,

    I have been trying to compile 'com.wang.avi:library:2.1.3' for some time now, to no avail, i use Gradle 2.3.3, i git clone the 'https://github.com/81813780/AVLoadingIndicatorView/' then tried to import as a module and added include ':AVLoadingIndicatorView:library:' to the settings.gradle, did not work, added the maven { url "https://jitpack.io" } did not work.

    Is there something else i am missing?.

    opened by Jendorski 2
  • Add proguard rule

    Add proguard rule

    When using proguard need add rules:

    -keep class com.wang.avi.** { *; }
    -keep class com.wang.avi.indicators.** { *; }
    

    Indicators is load from class names, proguard may change it (rename).

    opened by kenumir 2
  • I can't hide the Loading indicator View

    I can't hide the Loading indicator View

    Sometimes It does not hide when moving to the next fragment.

    if (email.isEmpty()) {
    
            showProgress(); // I defined this function using AVLoadingIndicatorView in BaseActivity
    
            auth.signInWithEmailAndPassword(email, password)
                    .addOnCompleteListener(getActivity(), task -> {
    
                        hideProgress(); // hide the AVLoadingIndicatorView
    
                        if (task.isSuccessful()) {
                            // Sign in success, update UI with the signed-in user's information
                            moveToSubjectSelectFragment();
                        } else {
                            Log.w(TAG, "createUserWithEmail:failure", task.getException());
                            Toast.makeText(getActivity(), "Login fail", Toast.LENGTH_SHORT).show();
                        }
    
                });
    }
    

    Here is the showProgress(), HideProgress() function in BaseActivity

    public void showProgress() {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                if(activityIndicator != null) activityIndicator.show();
            }
        });
    }
    
    public void HideProgress() {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                if(activityIndicator != null) activityIndicator.hide();
            }
        });
    }
    
    
    opened by newbision 1
Releases(1.0.1)
Owner
汪海游龙
微信公众号:汪海游龙
汪海游龙