//第一步 导入依赖
implementation 'com.github.zzz40500:android-shapeLoadingView:1.0.3.2'
//第二步 xml布局
<Button
android:id="@+id/mButton"
android:text="按钮"
android:layout_width="100dp"
android:layout_height="wrap_content" />
<com.mingle.widget.LoadingView
android:id="@+id/loadView"
android:layout_gravity="center_horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
//第三步 Activity里使用:
private void initView() {
mButton = (Button) findViewById(R.id.mButton);
loadView = (LoadingView) findViewById(R.id.loadView);
loadView.setLoadingText("加载中...");
mButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//点击button按钮隐藏
loadView.setVisibility(View.GONE);
}
});
}
//最好改成16的
minSdkVersion 16
//--------------------------------------------------------------------完-------------------------------------------------------------------------------