|
@@ -249,15 +249,15 @@ public class WaitDialog extends BaseDialog {
|
|
|
|
|
|
public WaitDialog show() {
|
|
|
super.beforeShow();
|
|
|
+ int layoutResId = R.layout.layout_dialogx_wait;
|
|
|
+ if (style.overrideWaitTipRes() != null && style.overrideWaitTipRes().overrideWaitLayout(isLightTheme()) != 0) {
|
|
|
+ layoutResId = style.overrideWaitTipRes().overrideWaitLayout(isLightTheme());
|
|
|
+ }
|
|
|
+ dialogImpl = new DialogImpl(layoutResId);
|
|
|
runOnMain(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
- int layoutResId = R.layout.layout_dialogx_wait;
|
|
|
- if (style.overrideWaitTipRes() != null && style.overrideWaitTipRes().overrideWaitLayout(isLightTheme()) != 0) {
|
|
|
- layoutResId = style.overrideWaitTipRes().overrideWaitLayout(isLightTheme());
|
|
|
- }
|
|
|
- dialogView = createView(layoutResId);
|
|
|
- dialogImpl = new DialogImpl(dialogView);
|
|
|
+ dialogImpl.lazyCreate();
|
|
|
dialogView.setTag(me.get());
|
|
|
show(dialogView);
|
|
|
}
|
|
@@ -267,15 +267,15 @@ public class WaitDialog extends BaseDialog {
|
|
|
|
|
|
public WaitDialog show(final Activity activity) {
|
|
|
super.beforeShow();
|
|
|
+ int layoutResId = R.layout.layout_dialogx_wait;
|
|
|
+ if (style.overrideWaitTipRes() != null && style.overrideWaitTipRes().overrideWaitLayout(isLightTheme()) != 0) {
|
|
|
+ layoutResId = style.overrideWaitTipRes().overrideWaitLayout(isLightTheme());
|
|
|
+ }
|
|
|
+ dialogImpl = new DialogImpl(layoutResId);
|
|
|
runOnMain(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
- int layoutResId = R.layout.layout_dialogx_wait;
|
|
|
- if (style.overrideWaitTipRes() != null && style.overrideWaitTipRes().overrideWaitLayout(isLightTheme()) != 0) {
|
|
|
- layoutResId = style.overrideWaitTipRes().overrideWaitLayout(isLightTheme());
|
|
|
- }
|
|
|
- dialogView = createView(layoutResId);
|
|
|
- dialogImpl = new DialogImpl(dialogView);
|
|
|
+ dialogImpl.lazyCreate();
|
|
|
dialogView.setTag(me.get());
|
|
|
show(activity, dialogView);
|
|
|
}
|
|
@@ -294,6 +294,31 @@ public class WaitDialog extends BaseDialog {
|
|
|
public RelativeLayout boxCustomView;
|
|
|
public TextView txtInfo;
|
|
|
|
|
|
+ private int layoutResId;
|
|
|
+
|
|
|
+ public DialogImpl(int layoutResId) {
|
|
|
+ this.layoutResId = layoutResId;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void lazyCreate(){
|
|
|
+ dialogView = createView(layoutResId);
|
|
|
+ boxRoot = dialogView.findViewById(R.id.box_root);
|
|
|
+ bkg = dialogView.findViewById(R.id.bkg);
|
|
|
+ blurView = dialogView.findViewById(R.id.blurView);
|
|
|
+ boxProgress = dialogView.findViewById(R.id.box_progress);
|
|
|
+ View progressViewCache = (View) style.overrideWaitTipRes().overrideWaitView(getContext(), isLightTheme());
|
|
|
+ if (progressViewCache == null) {
|
|
|
+ progressViewCache = new ProgressView(getContext());
|
|
|
+ }
|
|
|
+ progressView = (ProgressViewInterface) progressViewCache;
|
|
|
+ boxProgress.addView(progressViewCache, new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
|
|
+ boxCustomView = dialogView.findViewById(R.id.box_customView);
|
|
|
+ txtInfo = dialogView.findViewById(R.id.txt_info);
|
|
|
+ init();
|
|
|
+ dialogImpl = this;
|
|
|
+ refreshView();
|
|
|
+ }
|
|
|
+
|
|
|
public DialogImpl(View convertView) {
|
|
|
boxRoot = convertView.findViewById(R.id.box_root);
|
|
|
bkg = convertView.findViewById(R.id.bkg);
|
|
@@ -474,7 +499,7 @@ public class WaitDialog extends BaseDialog {
|
|
|
public void run() {
|
|
|
dismiss(dialogView);
|
|
|
}
|
|
|
- },exitAnimDurationTemp);
|
|
|
+ }, exitAnimDurationTemp);
|
|
|
}
|
|
|
});
|
|
|
}
|