samlss / SignalLoadingView

📶A signal rotation loading view.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SignalLoadingView

A signal rotation loading view(一个信号旋转loading view).

Api reqeust MIT Licence Blog



gif1

中文

使用

在根目录的build.gradle添加这一句代码:

allprojects {
    repositories {
        //...
        maven { url 'https://jitpack.io' }
    }
}

在app目录下的build.gradle添加依赖使用:

dependencies {
    implementation 'com.github.samlss:SignalLoadingView:1.1'
}

布局中使用:

<com.iigo.library.SignalLoadingView
            android:id="@+id/slv_loading1"
            android:layout_width="100dp"
            android:layout_height="100dp"
            app:duration="1500"
            app:interpolator="LinearInterpolator"
            app:signal_color="#fbc02d" />

代码中使用:

  signalLoadingView.start(); //开始动画
  signalLoadingView.stop(); //结束动画
  
  signalLoadingView.setInterpolator(new LinearInterpolator());//设置动画插值器
  signalLoadingView.setSignalColor(Color.RED);//设置信号颜色
  signalLoadingView.setDuration(500); //设置动画执行时间

属性说明:

属性 说明
signal_color 信号颜色
duration 动画时间
interpolator 动画加速器

插值器值interpolator:

  • AccelerateDecelerateInterpolator
  • AccelerateInterpolator
  • DecelerateInterpolator
  • BounceInterpolator
  • CycleInterpolator
  • LinearInterpolator
  • AnticipateOvershootInterpolator
  • AnticipateInterpolator
  • OvershootInterpolator

如果不能满足你的需要,你可以下载源码自行修改。

English

Use

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        //...
        maven { url 'https://jitpack.io' }
    }
}

Add it in your app build.gradle at the end of repositories:

dependencies {
    implementation 'com.github.samlss:SignalLoadingView:1.1'
}

in layout.xml:

<com.iigo.library.SignalLoadingView
            android:id="@+id/slv_loading1"
            android:layout_width="100dp"
            android:layout_height="100dp"
            app:duration="1500"
            app:interpolator="LinearInterpolator"
            app:signal_color="#fbc02d" />

in java code:

  signalLoadingView.start(); //start animation
  signalLoadingView.stop(); //stop animation
  
  signalLoadingView.setInterpolator(new LinearInterpolator());//set the animator interpolator
  signalLoadingView.setSignalColor(Color.RED);//set the signal color
  signalLoadingView.setDuration(500); //set the animator duration

Attributes description:

attr description
signal_color the signal color
duration the animator duration
interpolator the animator interpolator

interpolator:

  • AccelerateDecelerateInterpolator
  • AccelerateInterpolator
  • DecelerateInterpolator
  • BounceInterpolator
  • CycleInterpolator
  • LinearInterpolator
  • AnticipateOvershootInterpolator
  • AnticipateInterpolator
  • OvershootInterpolator

If you can not meet your needs, you can download the source code to modify it.

About

📶A signal rotation loading view.

License:MIT License


Languages

Language:Java 100.0%