AlerDialog 调整

master
hwf452 10 months ago
parent 3ae268fcaa
commit 9bdd1f6acc

@ -1,5 +1,7 @@
package com.rehome.bhdxj.activity.sbxdj; package com.rehome.bhdxj.activity.sbxdj;
import android.content.DialogInterface;
import android.graphics.Color;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
@ -333,6 +335,13 @@ public class DjdscFragment extends BaseFragment {
getDataInSQL(); getDataInSQL();
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
}); });
builder.show(); AlertDialog dialog = builder.create();
dialog.show();
//确定按钮
Button btnPos = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
//取消按钮
Button btnNeg = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
btnPos.setTextColor(Color.BLACK);
btnNeg.setTextColor(Color.BLACK);
} }
} }

@ -1,6 +1,7 @@
package com.rehome.bhdxj.activity.sbxj; package com.rehome.bhdxj.activity.sbxj;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.graphics.Color;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
@ -290,7 +291,14 @@ public class ScxsjhFragment extends BaseFragment {
sCData(json, zxidUpload); sCData(json, zxidUpload);
} }
}); });
builder.show(); AlertDialog dialog = builder.create();
dialog.show();
//确定按钮
Button btnPos = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
//取消按钮
Button btnNeg = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
btnPos.setTextColor(Color.BLACK);
btnNeg.setTextColor(Color.BLACK);
} else { } else {
sCData(json, zxidUpload); sCData(json, zxidUpload);
@ -451,6 +459,13 @@ public class ScxsjhFragment extends BaseFragment {
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
} }
}); });
builder.show(); AlertDialog dialog = builder.create();
dialog.show();
//确定按钮
Button btnPos = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
//取消按钮
Button btnNeg = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
btnPos.setTextColor(Color.BLACK);
btnNeg.setTextColor(Color.BLACK);
} }
} }

@ -2,6 +2,7 @@ package com.rehome.bhdxj.activity.sbxj;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.graphics.Color;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
@ -112,8 +113,14 @@ public class XscbqyWorkActivity extends BaseActivity {
} }
}); });
builder.create(); AlertDialog dialog = builder.create();
builder.show(); dialog.show();
//确定按钮
Button btnPos = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
//取消按钮
Button btnNeg = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
btnPos.setTextColor(Color.BLACK);
btnNeg.setTextColor(Color.BLACK);
} }
}); });
} }

@ -2,6 +2,7 @@ package com.rehome.bhdxj.activity.sbxj;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.graphics.Color;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
@ -106,8 +107,14 @@ public class XscbqyWorkXsActivity extends BaseActivity {
} }
}); });
builder.create(); AlertDialog dialog = builder.create();
builder.show(); dialog.show();
//确定按钮
Button btnPos = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
//取消按钮
Button btnNeg = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
btnPos.setTextColor(Color.BLACK);
btnNeg.setTextColor(Color.BLACK);
} }
}); });
} }

@ -2,6 +2,7 @@ package com.rehome.bhdxj.activity.sbxj;
import android.content.ContentValues; import android.content.ContentValues;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -137,7 +138,7 @@ public class XzxsjhFragment extends BaseFragment {
btnDelete.setOnClickListener(new View.OnClickListener() { btnDelete.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (xjjhs.size() != 0) { if (!xjjhs.isEmpty()) {
AlertDialog.Builder builder = new AlertDialog.Builder(context); AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle("提示"); builder.setTitle("提示");
@ -162,7 +163,14 @@ public class XzxsjhFragment extends BaseFragment {
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
} }
}); });
builder.show(); AlertDialog dialog = builder.create();
dialog.show();
//确定按钮
Button btnPos = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
//取消按钮
Button btnNeg = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
btnPos.setTextColor(Color.BLACK);
btnNeg.setTextColor(Color.BLACK);
} else { } else {
showToast("没有可删除计划"); showToast("没有可删除计划");

@ -1,6 +1,8 @@
package com.rehome.bhdxj.activity.yhpc; package com.rehome.bhdxj.activity.yhpc;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.DialogInterface;
import android.graphics.Color;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.CheckBox; import android.widget.CheckBox;
@ -318,7 +320,14 @@ public class YhpcDataListActivity extends BaseActivity3 {
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
} }
}); });
builder.show(); AlertDialog dialog = builder.create();
dialog.show();
//确定按钮
Button btnPos = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
//取消按钮
Button btnNeg = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
btnPos.setTextColor(Color.BLACK);
btnNeg.setTextColor(Color.BLACK);
} else { } else {
showToast("你还没有选择项目"); showToast("你还没有选择项目");
} }

@ -2,6 +2,9 @@ package com.rehome.bhdxj.weight;
import android.content.Context; import android.content.Context;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import android.content.DialogInterface;
import android.graphics.Color;
import android.view.View; import android.view.View;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
@ -34,6 +37,12 @@ public class SettingIpDialog {
dialog = new AlertDialog.Builder(context).create(); dialog = new AlertDialog.Builder(context).create();
dialog.setCancelable(true); dialog.setCancelable(true);
dialog.show(); dialog.show();
//确定按钮
Button btnPos = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
//取消按钮
Button btnNeg = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
btnPos.setTextColor(Color.BLACK);
btnNeg.setTextColor(Color.BLACK);
mWindow = dialog.getWindow(); mWindow = dialog.getWindow();
mWindow.clearFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM); mWindow.clearFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
mWindow.setContentView(R.layout.setting_ip); mWindow.setContentView(R.layout.setting_ip);

Loading…
Cancel
Save