|
@@ -25,10 +25,14 @@ import com.wdkl.ncs.android.middleware.utils.CommonUtils;
|
|
|
|
|
|
public class ServerConfigDialogHelper {
|
|
public class ServerConfigDialogHelper {
|
|
|
|
|
|
- private static AlertDialog callDialog;
|
|
|
|
|
|
+ private static AlertDialog dialog;
|
|
private static String pwd = "";
|
|
private static String pwd = "";
|
|
|
|
|
|
public static void showPasswordDialog(final Activity activity) {
|
|
public static void showPasswordDialog(final Activity activity) {
|
|
|
|
+ if (dialog != null && dialog.isShowing()) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
View contentView = LayoutInflater.from(activity).inflate(R.layout.server_config_dialog_lay, null);
|
|
View contentView = LayoutInflater.from(activity).inflate(R.layout.server_config_dialog_lay, null);
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
|
builder.setView(contentView);
|
|
builder.setView(contentView);
|
|
@@ -123,14 +127,12 @@ public class ServerConfigDialogHelper {
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
- callDialog = builder.create();
|
|
|
|
- //callDialog.setCanceledOnTouchOutside(false);
|
|
|
|
- //callDialog.setCancelable(false);
|
|
|
|
- callDialog.show();
|
|
|
|
|
|
+ dialog = builder.create();
|
|
|
|
+ dialog.show();
|
|
|
|
|
|
//设置dialog宽高及位置
|
|
//设置dialog宽高及位置
|
|
try {
|
|
try {
|
|
- Window window = callDialog.getWindow();
|
|
|
|
|
|
+ Window window = dialog.getWindow();
|
|
window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
|
|
window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
|
|
WindowManager.LayoutParams lp = window.getAttributes();
|
|
WindowManager.LayoutParams lp = window.getAttributes();
|
|
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
|
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
|
@@ -152,8 +154,9 @@ public class ServerConfigDialogHelper {
|
|
|
|
|
|
public static void dismissCallDialog() {
|
|
public static void dismissCallDialog() {
|
|
pwd = "";
|
|
pwd = "";
|
|
- if (callDialog != null && callDialog.isShowing()) {
|
|
|
|
- callDialog.dismiss();
|
|
|
|
|
|
+ if (dialog != null && dialog.isShowing()) {
|
|
|
|
+ dialog.dismiss();
|
|
|
|
+ dialog = null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|