AVLoadingIndicatorView是一个精致载入动画的合集,应用于Android。
Demo
使用方法
step1
在build.gradle中添加依赖
dependencies {
compile 'com.wang.avi:library:2.1.3'
}
step2
将AVLoadingIndicatorView添加到你的布局
简单的
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:indicatorName="BallPulseIndicator"
/>
先进的
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"
/>
step3
使用很简单,如下
void startAnim(){
avi.show();
// or avi.smoothToShow();
}
void stopAnim(){
avi.hide();
// or avi.smoothToHide();
}