|
@@ -98,7 +98,7 @@ public class WaitDialog extends BaseDialog {
|
|
if (noInstance) instanceBuild();
|
|
if (noInstance) instanceBuild();
|
|
WaitDialog instance = getInstanceNotNull(activity);
|
|
WaitDialog instance = getInstanceNotNull(activity);
|
|
instance.setTip(message, TYPE.NONE);
|
|
instance.setTip(message, TYPE.NONE);
|
|
- showWithInstance(instance, activity);
|
|
|
|
|
|
+ if (noInstance) showWithInstance(instance, activity);
|
|
return instance;
|
|
return instance;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -115,7 +115,7 @@ public class WaitDialog extends BaseDialog {
|
|
if (noInstance) instanceBuild();
|
|
if (noInstance) instanceBuild();
|
|
WaitDialog instance = getInstanceNotNull(activity);
|
|
WaitDialog instance = getInstanceNotNull(activity);
|
|
instance.setTip(messageResId, TYPE.NONE);
|
|
instance.setTip(messageResId, TYPE.NONE);
|
|
- showWithInstance(instance, activity);
|
|
|
|
|
|
+ if (noInstance) showWithInstance(instance, activity);
|
|
return instance;
|
|
return instance;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -134,7 +134,7 @@ public class WaitDialog extends BaseDialog {
|
|
WaitDialog instance = getInstanceNotNull(activity);
|
|
WaitDialog instance = getInstanceNotNull(activity);
|
|
instance.setTip(message, TYPE.NONE);
|
|
instance.setTip(message, TYPE.NONE);
|
|
instance.setProgress(progress);
|
|
instance.setProgress(progress);
|
|
- showWithInstance(instance, activity);
|
|
|
|
|
|
+ if (noInstance) showWithInstance(instance, activity);
|
|
return instance;
|
|
return instance;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -153,7 +153,7 @@ public class WaitDialog extends BaseDialog {
|
|
WaitDialog instance = getInstanceNotNull(activity);
|
|
WaitDialog instance = getInstanceNotNull(activity);
|
|
instance.setTip(messageResId, TYPE.NONE);
|
|
instance.setTip(messageResId, TYPE.NONE);
|
|
instance.setProgress(progress);
|
|
instance.setProgress(progress);
|
|
- showWithInstance(instance, activity);
|
|
|
|
|
|
+ if (noInstance) showWithInstance(instance, activity);
|
|
return instance;
|
|
return instance;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -163,7 +163,7 @@ public class WaitDialog extends BaseDialog {
|
|
WaitDialog instance = getInstanceNotNull(activity);
|
|
WaitDialog instance = getInstanceNotNull(activity);
|
|
instance.setTip(TYPE.NONE);
|
|
instance.setTip(TYPE.NONE);
|
|
instance.setProgress(progress);
|
|
instance.setProgress(progress);
|
|
- showWithInstance(instance, activity);
|
|
|
|
|
|
+ if (noInstance) showWithInstance(instance, activity);
|
|
return instance;
|
|
return instance;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -221,7 +221,7 @@ public class WaitDialog extends BaseDialog {
|
|
|
|
|
|
public WaitDialog show(final Activity activity) {
|
|
public WaitDialog show(final Activity activity) {
|
|
super.beforeShow();
|
|
super.beforeShow();
|
|
- runOnMain(new Runnable() {
|
|
|
|
|
|
+ activity.runOnUiThread(new Runnable() {
|
|
@Override
|
|
@Override
|
|
public void run() {
|
|
public void run() {
|
|
int layoutResId = R.layout.layout_dialogx_wait;
|
|
int layoutResId = R.layout.layout_dialogx_wait;
|
|
@@ -232,7 +232,7 @@ public class WaitDialog extends BaseDialog {
|
|
if (getDialogImpl() != null) {
|
|
if (getDialogImpl() != null) {
|
|
getDialogImpl().lazyCreate();
|
|
getDialogImpl().lazyCreate();
|
|
if (getWaitDialogView() != null) {
|
|
if (getWaitDialogView() != null) {
|
|
- getWaitDialogView().setTag(me.get());
|
|
|
|
|
|
+ getWaitDialogView().setTag(me());
|
|
show(activity, getWaitDialogView());
|
|
show(activity, getWaitDialogView());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -309,7 +309,7 @@ public class WaitDialog extends BaseDialog {
|
|
}
|
|
}
|
|
boxRoot.setClickable(true);
|
|
boxRoot.setClickable(true);
|
|
|
|
|
|
- boxRoot.setParentDialog(me.get());
|
|
|
|
|
|
+ boxRoot.setParentDialog(me());
|
|
boxRoot.setOnLifecycleCallBack(new DialogXBaseRelativeLayout.OnLifecycleCallBack() {
|
|
boxRoot.setOnLifecycleCallBack(new DialogXBaseRelativeLayout.OnLifecycleCallBack() {
|
|
@Override
|
|
@Override
|
|
public void onShow() {
|
|
public void onShow() {
|
|
@@ -463,7 +463,7 @@ public class WaitDialog extends BaseDialog {
|
|
if (maskColor != -1) boxRoot.setBackgroundColor(maskColor);
|
|
if (maskColor != -1) boxRoot.setBackgroundColor(maskColor);
|
|
|
|
|
|
if (onBindView != null && onBindView.getCustomView() != null) {
|
|
if (onBindView != null && onBindView.getCustomView() != null) {
|
|
- onBindView.bindParent(boxCustomView, me.get());
|
|
|
|
|
|
+ onBindView.bindParent(boxCustomView, WaitDialog.this);
|
|
boxCustomView.setVisibility(View.VISIBLE);
|
|
boxCustomView.setVisibility(View.VISIBLE);
|
|
boxProgress.setVisibility(View.GONE);
|
|
boxProgress.setVisibility(View.GONE);
|
|
} else {
|
|
} else {
|
|
@@ -596,7 +596,7 @@ public class WaitDialog extends BaseDialog {
|
|
}
|
|
}
|
|
|
|
|
|
private void setDialogImpl(DialogImpl d) {
|
|
private void setDialogImpl(DialogImpl d) {
|
|
- dialogImpl = new WeakReference<>(d);
|
|
|
|
|
|
+ if (dialogImpl != null && dialogImpl.get() != d) dialogImpl = new WeakReference<>(d);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -696,34 +696,40 @@ public class WaitDialog extends BaseDialog {
|
|
protected void setTip(TYPE type) {
|
|
protected void setTip(TYPE type) {
|
|
showType = type.ordinal();
|
|
showType = type.ordinal();
|
|
readyTipType = type;
|
|
readyTipType = type;
|
|
|
|
+ refreshUI();
|
|
}
|
|
}
|
|
|
|
|
|
protected void setTip(Activity activity, int messageResId, TYPE type) {
|
|
protected void setTip(Activity activity, int messageResId, TYPE type) {
|
|
showType = type.ordinal();
|
|
showType = type.ordinal();
|
|
this.message = getString(messageResId);
|
|
this.message = getString(messageResId);
|
|
readyTipType = type;
|
|
readyTipType = type;
|
|
|
|
+ refreshUI();
|
|
}
|
|
}
|
|
|
|
|
|
protected void setTip(CharSequence message, TYPE type) {
|
|
protected void setTip(CharSequence message, TYPE type) {
|
|
showType = type.ordinal();
|
|
showType = type.ordinal();
|
|
this.message = message;
|
|
this.message = message;
|
|
readyTipType = type;
|
|
readyTipType = type;
|
|
|
|
+ refreshUI();
|
|
}
|
|
}
|
|
|
|
|
|
protected void setTip(Activity activity, CharSequence message, TYPE type) {
|
|
protected void setTip(Activity activity, CharSequence message, TYPE type) {
|
|
showType = type.ordinal();
|
|
showType = type.ordinal();
|
|
this.message = message;
|
|
this.message = message;
|
|
readyTipType = type;
|
|
readyTipType = type;
|
|
|
|
+ refreshUI();
|
|
}
|
|
}
|
|
|
|
|
|
protected void setTip(int messageResId, TYPE type) {
|
|
protected void setTip(int messageResId, TYPE type) {
|
|
showType = type.ordinal();
|
|
showType = type.ordinal();
|
|
this.message = getString(messageResId);
|
|
this.message = getString(messageResId);
|
|
readyTipType = type;
|
|
readyTipType = type;
|
|
|
|
+ refreshUI();
|
|
}
|
|
}
|
|
|
|
|
|
protected void setTipShowDuration(long tipShowDuration) {
|
|
protected void setTipShowDuration(long tipShowDuration) {
|
|
this.tipShowDuration = tipShowDuration;
|
|
this.tipShowDuration = tipShowDuration;
|
|
|
|
+ refreshUI();
|
|
}
|
|
}
|
|
|
|
|
|
public static CharSequence getMessage() {
|
|
public static CharSequence getMessage() {
|
|
@@ -754,6 +760,7 @@ public class WaitDialog extends BaseDialog {
|
|
|
|
|
|
public WaitDialog setCancelable(boolean cancelable) {
|
|
public WaitDialog setCancelable(boolean cancelable) {
|
|
privateCancelable = cancelable ? BOOLEAN.TRUE : BOOLEAN.FALSE;
|
|
privateCancelable = cancelable ? BOOLEAN.TRUE : BOOLEAN.FALSE;
|
|
|
|
+ refreshUI();
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|