fix:修复排麦-点击抱上闪退问题(CommonLoadingDialog导致)
This commit is contained in:
@@ -8,6 +8,7 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.nnbc123.app.R;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
@@ -19,7 +20,7 @@ public class CommonLoadingDialog extends BaseDialog {
|
||||
private String msg = "加载中...";
|
||||
|
||||
private TextView tvTip;
|
||||
private ImageView ivLoading;
|
||||
private SVGAImageView ivLoading;
|
||||
|
||||
public CommonLoadingDialog(Context context, String tip) {
|
||||
super(context, R.style.dialog);
|
||||
@@ -36,8 +37,7 @@ public class CommonLoadingDialog extends BaseDialog {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.layout_progress_dialog);
|
||||
ivLoading = findViewById(R.id.iv_loading);
|
||||
((AnimationDrawable) ivLoading.getDrawable()).start();
|
||||
ivLoading = findViewById(R.id.iv_loading_icon);
|
||||
tvTip = (TextView) findViewById(R.id.tv_tip);
|
||||
tvTip.setText(msg);
|
||||
}
|
||||
@@ -60,4 +60,11 @@ public class CommonLoadingDialog extends BaseDialog {
|
||||
super.show();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
ivLoading.stopAnimation();
|
||||
ivLoading.clear();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user