wjc
2024-12-12 7e1ff0216432f674021c3e882ae5ff3724accea7
app/src/main/java/com/hdl/photovoltaic/other/HdlThreadLogic.java
@@ -15,6 +15,7 @@
import com.hdl.photovoltaic.widget.ConfirmationCancelDialog;
import com.hdl.photovoltaic.widget.ConfirmationExceptionDialog;
import com.hdl.photovoltaic.widget.FlashingBoxDialog;
import com.hdl.photovoltaic.widget.FlashingIconBoxDialog;
/**
 * 线程逻辑
@@ -110,6 +111,9 @@
        handler.post(new Runnable() {
            @Override
            public void run() {
//                FlashingBoxDialog flashingIconBoxDialog = new FlashingBoxDialog(context, 1500);
//                flashingIconBoxDialog.setContent(text);
//                flashingIconBoxDialog.show();
                Toast.makeText(context, text, Toast.LENGTH_SHORT).show();
            }
        });
@@ -122,6 +126,9 @@
        handler.post(new Runnable() {
            @Override
            public void run() {
//                FlashingBoxDialog flashingIconBoxDialog = new FlashingBoxDialog(context, 1500);
//                flashingIconBoxDialog.setContent(hdlException.getMsg() + "(" + hdlException.getCode() + ")");
//                flashingIconBoxDialog.show();
                Toast.makeText(context, hdlException.getMsg() + "(" + hdlException.getCode() + ")", Toast.LENGTH_SHORT).show();
            }
        });
@@ -134,6 +141,7 @@
        handler.post(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
            }
        });
@@ -166,21 +174,21 @@
        HdlThreadLogic.runMainThread(new Runnable() {
            @Override
            public void run() {
                FlashingBoxDialog flashingBoxDialog = new FlashingBoxDialog(context, millisecond);
                FlashingIconBoxDialog flashingIconBoxDialog = new FlashingIconBoxDialog(context, millisecond);
                if (isBoolean) {
                    Drawable drawable = AppCompatResources.getDrawable(context, R.drawable.tip_succeed);
                    flashingBoxDialog.setImage(drawable);
                    flashingIconBoxDialog.setImage(drawable);
                } else {
                    Drawable drawable = AppCompatResources.getDrawable(context, R.drawable.tip_fail);
                    flashingBoxDialog.setImage(drawable);
                    flashingIconBoxDialog.setImage(drawable);
                }
                if (code == 0) {
                    //成功不需要增加状态码
                    flashingBoxDialog.setContent(msg);
                    flashingIconBoxDialog.setContent(msg);
                } else {
                    flashingBoxDialog.setContent(msg + "(" + code + ")");
                    flashingIconBoxDialog.setContent(msg + "(" + code + ")");
                }
                flashingBoxDialog.show();
                flashingIconBoxDialog.show();
            }
        }, null, null);
    }