|
|
@@ -23,6 +23,11 @@ public class WaitLoadingController {
|
|
|
*/
|
|
|
private long showTime;
|
|
|
|
|
|
+ /**
|
|
|
+ * 是否可用
|
|
|
+ */
|
|
|
+ private boolean isEnable = true;
|
|
|
+
|
|
|
public WaitLoadingController(Context context, Window hostWindow) {
|
|
|
mMainHandler = new Handler(Looper.getMainLooper());
|
|
|
setup(context, hostWindow);
|
|
|
@@ -34,8 +39,18 @@ public class WaitLoadingController {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 设置是否可用
|
|
|
+ */
|
|
|
+ public void setEnable(boolean enable) {
|
|
|
+ this.isEnable = enable;
|
|
|
+ }
|
|
|
+
|
|
|
public void showWait() {
|
|
|
ensureMainThreadRun(() -> {
|
|
|
+ if (!isEnable) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (vLoadingDialog != null && !vLoadingDialog.isShowing()) {
|
|
|
showTime = System.currentTimeMillis();
|
|
|
vLoadingDialog.show();
|