项目
在 GitHub 查看
StevenDXC/DxLoadingButton
关于
Android material button with loading animation
设计与媒体实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- -1
- 1个月
- 更新延迟
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文DxLoadingButton
android button to loading view with animation,and load successful/failed animation
Demo:

with activity transition animation demo:

Usage:
layout:
<com.dx.dxloadingbutton.lib.LoadingButton
android:id="@+id/loading_btn"
android:layout_gravity="center"
android:layout_width="228dp"
android:layout_height="wrap_content"
app:lb_resetAfterFailed="true"
app:lb_btnRippleColor="#000000"
app:lb_btnDisabledColor="#cccccc"
app:lb_disabledTextColor="#999999"
app:lb_cornerRadius="32"
app:lb_rippleEnable="true"
app:lb_btnText="@string/button_text"
/>
code:
LoadingButton lb = (LoadingButton)findViewById(R.id.loading_btn);
lb.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
lb.startLoading(); //start loading
}
});
show successful animation:
lb.loadingSuccessful();
show failed animation:
lb.loadingFailed();
cancel loading:
lb.cancelLoading();
reset:
lb.reset();
enable:
lb.setEnable(true/false);
- notice: lb_btnDisabledColor & lb_disabledTextColor only display while LoadingButton is normal button state, LoadingButton is playing animation or other state will display normal color

backgroundShader:
lb.setBackgroundShader(new LinearGradient(0f,0f,1000f,100f, 0xAAE53935, 0xAAFF5722, Shader.TileMode.CLAMP));
cornerRadius:
lb.setCornerRadius(32f)
dependency
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
add dependency:
dependencies {
compile 'com.github.StevenDXC:DxLoadingButton:2.4'
}
探索相关项目
加载中…