completed web msg dialog.
authorTrillGates <williamtrillgates@gmail.com>
Fri, 6 Aug 2021 07:41:40 +0000 (15:41 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Fri, 6 Aug 2021 07:41:40 +0000 (15:41 +0800)
27 files changed:
app/src/main/AndroidManifest.xml
app/src/main/java/com/enqualcomm/support/Constants.java
app/src/main/java/com/enqualcomm/support/utils/ContextProxy.java
app/src/main/java/com/enqualcomm/support/utils/ProcessReceiver.java
app/src/main/java/com/enqualcomm/support/utils/Util.java
app/src/main/java/com/ic/protocols/protocol_s123.java
app/src/main/java/com/ic/view/webmsgresponse/ShootItemAdapter.java [new file with mode: 0644]
app/src/main/java/com/ic/view/webmsgresponse/WebMessageAdapter.java [new file with mode: 0644]
app/src/main/java/com/ic/view/webmsgresponse/WebMsgView.java [new file with mode: 0644]
app/src/main/res/drawable/selector_item_bg.xml [new file with mode: 0644]
app/src/main/res/drawable/shape_item_bg_normal.xml [new file with mode: 0644]
app/src/main/res/drawable/shape_item_bg_press.xml [new file with mode: 0644]
app/src/main/res/drawable/shape_text_bg.xml [new file with mode: 0644]
app/src/main/res/layout/item_shoot.xml [new file with mode: 0644]
app/src/main/res/layout/web_msg_item_content.xml [new file with mode: 0644]
app/src/main/res/layout/web_msg_item_fail.xml [new file with mode: 0644]
app/src/main/res/layout/web_msg_item_shoot.xml [new file with mode: 0644]
app/src/main/res/layout/web_msg_item_success.xml [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/icon_failed.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/icon_success.png [new file with mode: 0644]
app/src/main/res/values-de-rCH/strings.xml
app/src/main/res/values-fr-rCH/strings.xml
app/src/main/res/values-it-rCH/strings.xml
app/src/main/res/values-ja/strings.xml
app/src/main/res/values-w820dp/strings.xml [new file with mode: 0644]
app/src/main/res/values-zh-rCN/strings.xml
app/src/main/res/values/strings.xml

index cf4b15e..18afbfc 100644 (file)
                 <action android:name="com.ic.action.message_sent" />
                 <action android:name="com.ic.action.temp_result" />
                 <action android:name="com.ic.action.set_sit_range" />
+                <action android:name="com.ic.dialog.action.DIALOG_RESPONSE" />
                 <!-- <action android:name="com.eqc.heartrate.action.SILENT_START" /> -->
             </intent-filter>
         </receiver>
index a8f01e4..925c67c 100644 (file)
@@ -129,6 +129,7 @@ public interface Constants {
     Uri CM_SERVICE_SETTING = Uri.parse("content://com.cmcm.service/cmsetting");
 
     String DIALOG_ACTION = "com.enqualcomm.support.DIALOG";
+    String DIALOG_ACTION_WITH_IC_RESPONSE = "com.ic.dialog.action.DIALOG_RESPONSE";
 
     int ENTER_SILENT_MODE = 212;
 
index fd1dec3..8eb1861 100644 (file)
@@ -32,6 +32,7 @@ import static com.enqualcomm.support.Constants.ACTION_KEEPSIT_ALARM;
 import static com.enqualcomm.support.Constants.ActionReceivePushTxt;
 import static com.enqualcomm.support.Constants.ActionSrvPushTxt;
 import static com.enqualcomm.support.Constants.DIALOG_ACTION;
+import static com.enqualcomm.support.Constants.DIALOG_ACTION_WITH_IC_RESPONSE;
 
 public class ContextProxy {
     private static final long ONE_WEEK = 604800000L;
@@ -381,107 +382,105 @@ public class ContextProxy {
     }
 
     public static void sendMsgBroadcast(Context _context, String msg, int msgType) {
-
+        ICLogger.d("sendMsgBroadcast ==> " + msg + " msgType==> " + msgType);
         if (msgType == 0) {
-            mHandler.postDelayed(new Runnable() {
-                @Override
-                public void run() {
-                    //本应用弹出消息框
-                    if (!Config.noPushTxtNotifyDialog) {
-                        Intent intent = new Intent();
-                        intent.setAction(DIALOG_ACTION);
-                        intent.putExtra("pushtxt", msg);
-                        _context.sendBroadcast(intent);
-                    } else {
-                        WakeLockUtil.ScreenOnWakeLockTemperary(_context);
-                        play_waning_notify(_context);
-                        VibrateUtil.getInstance(_context).VibrateOnOnce(true);
-                        Util.mSleep(2000);
-                    }
-                    //launcher 弹出消息
-                    if (!Config.noBroadCastPushTxtNotify) {
-                        Intent intent = new Intent(ActionSrvPushTxt);
-                        intent.putExtra("msgType", msgType); //0 代表 server下发消息,1代表 SMS消息
-                        intent.putExtra("txtMsg", msg);
-                        intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
-                        _context.sendBroadcast(intent);
-                    }
+            mHandler.postDelayed(() -> {
+                //本应用弹出消息框
+                if (!Config.noPushTxtNotifyDialog) {
+                    Intent intent = new Intent();
+                    intent.setAction(DIALOG_ACTION);
+                    intent.putExtra("pushtxt", msg);
+                    _context.sendBroadcast(intent);
+                } else {
+                    WakeLockUtil.ScreenOnWakeLockTemperary(_context);
+                    play_waning_notify(_context);
+                    VibrateUtil.getInstance(_context).VibrateOnOnce(true);
+                    Util.mSleep(2000);
+                }
+                //launcher 弹出消息
+                if (!Config.noBroadCastPushTxtNotify) {
+                    Intent intent = new Intent(ActionSrvPushTxt);
+                    intent.putExtra("msgType", msgType); //0 代表 server下发消息,1代表 SMS消息
+                    intent.putExtra("txtMsg", msg);
+                    intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
+                    _context.sendBroadcast(intent);
                 }
             }, 50);
 
         } else if (msgType == 2) {
-            mHandler.postDelayed(new Runnable() {
-                @Override
-                public void run() {
-                    //本应用弹出消息框
-                    if (Config.noPushTxtNotifyDialog == false) {
-                        Intent intent = new Intent();
-                        intent.setAction(DIALOG_ACTION);
-                        intent.putExtra("pushtxt", msg);
-                        _context.sendBroadcast(intent);
-                    } else {
-                        WakeLockUtil.ScreenOnWakeLockTemperary(_context);
-                        play_waning_notify(_context);
-                        VibrateUtil.getInstance(_context).VibrateOnOnce(true);
-                        Util.mSleep(2000);
-                    }
-                    //launcher 弹出消息
-                    if (Config.noBroadCastPushTxtNotify == false) {
-                        Intent intent = new Intent(ActionSrvPushTxt);
-                        intent.putExtra("msgType", msgType); //0 代表 server下发消息,1代表 SMS消息,2代表有提示音的消息
-                        intent.putExtra("txtMsg", msg);
-                        intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
-                        _context.sendBroadcast(intent);
-                    }
+            mHandler.postDelayed(() -> {
+                //本应用弹出消息框
+                if (!Config.noPushTxtNotifyDialog) {
+                    Intent intent = new Intent();
+                    intent.setAction(DIALOG_ACTION);
+                    intent.putExtra("pushtxt", msg);
+                    _context.sendBroadcast(intent);
+                } else {
+                    WakeLockUtil.ScreenOnWakeLockTemperary(_context);
+                    play_waning_notify(_context);
+                    VibrateUtil.getInstance(_context).VibrateOnOnce(true);
+                    Util.mSleep(2000);
+                }
+                //launcher 弹出消息
+                if (!Config.noBroadCastPushTxtNotify) {
+                    Intent intent = new Intent(ActionSrvPushTxt);
+                    intent.putExtra("msgType", msgType); //0 代表 server下发消息,1代表 SMS消息,2代表有提示音的消息
+                    intent.putExtra("txtMsg", msg);
+                    intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
+                    _context.sendBroadcast(intent);
                 }
             }, 50);
 
         } else if (msgType == 3) { //专门给需要回复的消息
-
-            mHandler.postDelayed(new Runnable() {
-                @Override
-                public void run() {
-                    //本应用弹出消息框
-                    if (Config.noPushTxtNotifyDialog == false) {
-                        Intent intent = new Intent();
-                        intent.setAction(DIALOG_ACTION);
-                        intent.putExtra("pushtxt", msg);
-                        intent.putExtra("needreply", true);
-                        _context.sendBroadcast(intent);
-                    } else {
-                        WakeLockUtil.ScreenOnWakeLockTemperary(_context);
-                        play_waning_notify(_context);
-                        VibrateUtil.getInstance(_context).VibrateOnOnce(true);
-                        Util.mSleep(2000);
-                    }
-
+            mHandler.postDelayed(() -> {
+                //本应用弹出消息框
+                if (!Config.noPushTxtNotifyDialog) {
+                    Intent intent = new Intent();
+                    intent.setAction(DIALOG_ACTION);
+                    intent.putExtra("pushtxt", msg);
+                    intent.putExtra("needreply", true);
+                    _context.sendBroadcast(intent);
+                } else {
+                    WakeLockUtil.ScreenOnWakeLockTemperary(_context);
+                    play_waning_notify(_context);
+                    VibrateUtil.getInstance(_context).VibrateOnOnce(true);
+                    Util.mSleep(2000);
                 }
             }, 50);
+        } else if (msgType == 123) {
+            mHandler.postDelayed(() -> {
+                //判断是否有弹窗,如查已经弹窗了,那么亮屏即可
+                Intent intent = new Intent();
+                intent.setAction(DIALOG_ACTION_WITH_IC_RESPONSE);
+                intent.putExtra("pushTxt", msg);
+                intent.putExtra("needReply", true);
+                _context.sendBroadcast(intent);
+                ICLogger.d("s123 send broadcast...");
+                WakeLockUtil.ScreenOnWakeLockTemperary(_context);
+                play_waning_notify(_context);
+                VibrateUtil.getInstance(_context).VibrateOnOnce(true);
+            }, 50);
         } else {
-
-            mHandler.postDelayed(new Runnable() {
-                @Override
-                public void run() {
-                    //本应用弹出消息框
-                    if (Config.noSMSNotifyDialog == false) {
-                        Intent intent = new Intent();
-                        intent.setAction(DIALOG_ACTION);
-                        intent.putExtra("sms", msg);
-                        _context.sendBroadcast(intent);
-                    } else {
-                        WakeLockUtil.ScreenOnWakeLockTemperary(_context);
-                        play_waning_notify(_context);
-                        VibrateUtil.getInstance(_context).VibrateOnOnce(true);
-                        Util.mSleep(2000);
-                    }
-                    //launcher 弹出消息
-                    if (Config.noBroadCastPushTxtNotify == false) {
-                        Intent intent = new Intent(ActionSrvPushTxt);
-                        intent.putExtra("msgType", msgType); //0 代表 server下发消息,1代表 SMS消息,2代表有提示音的消息
-                        intent.putExtra("txtMsg", msg);
-                        intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
-                        _context.sendBroadcast(intent);
-                    }
+            mHandler.postDelayed(() -> {
+                //本应用弹出消息框
+                if (!Config.noSMSNotifyDialog) {
+                    Intent intent = new Intent();
+                    intent.setAction(DIALOG_ACTION);
+                    intent.putExtra("sms", msg);
+                    _context.sendBroadcast(intent);
+                } else {
+                    WakeLockUtil.ScreenOnWakeLockTemperary(_context);
+                    play_waning_notify(_context);
+                    VibrateUtil.getInstance(_context).VibrateOnOnce(true);
+                    Util.mSleep(2000);
+                }
+                //launcher 弹出消息
+                if (!Config.noBroadCastPushTxtNotify) {
+                    Intent intent = new Intent(ActionSrvPushTxt);
+                    intent.putExtra("msgType", msgType); //0 代表 server下发消息,1代表 SMS消息,2代表有提示音的消息
+                    intent.putExtra("txtMsg", msg);
+                    intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
+                    _context.sendBroadcast(intent);
                 }
             }, 50);
         }
index 02bfb5d..0a33022 100644 (file)
@@ -23,6 +23,7 @@ import com.enqualcomm.support.service.AudioService;
 import com.enqualcomm.support.service.Deliver;
 import com.enqualcomm.support.service.HeartRateManager;
 import com.ic.protocols.protocolAPIHelper;
+import com.ic.view.webmsgresponse.WebMsgView;
 
 import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
 import static android.os.PowerManager.ACQUIRE_CAUSES_WAKEUP;
@@ -33,6 +34,7 @@ import static com.enqualcomm.support.Constants.ACTION_REMOTE_CAMERA;
 import static com.enqualcomm.support.Constants.ACTION_SET_SIT_RANGE;
 import static com.enqualcomm.support.Constants.ACTION_SHUTDOWN;
 import static com.enqualcomm.support.Constants.DIALOG_ACTION;
+import static com.enqualcomm.support.Constants.DIALOG_ACTION_WITH_IC_RESPONSE;
 import static com.enqualcomm.support.Constants.FROM_SERVER;
 import static com.enqualcomm.support.Constants.KEY_MESSAGE_FROM;
 import static com.enqualcomm.support.Constants.KEY_MESSAGE_TYPE;
@@ -320,19 +322,19 @@ public class ProcessReceiver extends BroadcastReceiver {
              */
             if (msgType.equals("voice")) {
                 //创建voiceConent并添加到数据
-                final VoiceContent voiceContent = VoiceContent.placeHolderOut(CONTACT_CATEGORY_GROUP, msgFrom,"0000", msgUrl, 1, 3);
+                final VoiceContent voiceContent = VoiceContent.placeHolderOut(CONTACT_CATEGORY_GROUP, msgFrom, "0000", msgUrl, 1, 3);
 
                 // 把voiceContent拆解成1024的分包
-                Util.parseToVoicePacketSent(voiceContent,1024);
+                Util.parseToVoicePacketSent(voiceContent, 1024);
                 //trigger 分包发送
                 if (CoreService.getInstance().getConnection() != null)
                     CoreService.getInstance().getConnection().DeliverCMDMessageToSystem("SentVoicePacket", "");
             } else if (msgType.equals("pic")) {
                 //创建voiceConent并添加到数据
-                final VoiceContent voiceContent = VoiceContent.placeHolderOut(CONTACT_CATEGORY_GROUP, msgFrom,"0000", msgUrl, 2, 3);
+                final VoiceContent voiceContent = VoiceContent.placeHolderOut(CONTACT_CATEGORY_GROUP, msgFrom, "0000", msgUrl, 2, 3);
 
                 // 把voiceContent拆解成1024的分包
-                Util.parseToVoicePacketSent(voiceContent,1024);
+                Util.parseToVoicePacketSent(voiceContent, 1024);
                 //trigger 分包发送
                 if (CoreService.getInstance().getConnection() != null) {
 
@@ -381,11 +383,11 @@ public class ProcessReceiver extends BroadcastReceiver {
                 String msgUrl = paramIntent.getStringExtra("filepath");
                 ICLogger.i("receive taken photo to send " + msgUrl);
                 //创建voiceConent并添加到数据
-                final VoiceContent voiceContent = VoiceContent.placeHolderOut(CONTACT_CATEGORY_GROUP, msgFrom,"0000", msgUrl, 2, 2);
+                final VoiceContent voiceContent = VoiceContent.placeHolderOut(CONTACT_CATEGORY_GROUP, msgFrom, "0000", msgUrl, 2, 2);
 
 
                 // 把voiceContent拆解成1024的分包
-                Util.parseToVoicePacketSent(voiceContent,1024);
+                Util.parseToVoicePacketSent(voiceContent, 1024);
                 //trigger 分包发送
                 if (CoreService.getInstance().getConnection() != null) {
 
@@ -502,12 +504,19 @@ public class ProcessReceiver extends BroadcastReceiver {
                 Runtime.lastSitCheckStepCount = CoreService.getInstance().getRuntime().getTotalStepCount();
                 Runtime.lastSitCheckTiimeyyyyMMddHHmmss = TimeUtil.getSystemTime3();
             }
+        } else if (DIALOG_ACTION_WITH_IC_RESPONSE.equals(str)) {
+            ICLogger.d("show response ble dialog..");
+            //弹出一个需要回复的弹窗
+            WebMsgView webMsgView = WebMsgView.getInstance();
+            webMsgView.showMsgDialog();
+            String pushTxt = paramIntent.getStringExtra("pushTxt");
+            ICLogger.d("pushTxt ==> " + pushTxt);
+            webMsgView.setShowMsg(pushTxt);
         } else {
             //如果来电了,还有未读的消息,干脆关掉,防止影响接电话。
             if (mCustomDialog != null && mCustomDialog.isShowing()) {
                 mCustomDialog.dismiss();
             }
-
             if (this.mCustomNotification != null && this.mCustomNotification.isShowing()) {
                 this.mCustomNotification.dismiss();
             }
index 0c9d4f7..2d23b19 100644 (file)
@@ -259,6 +259,47 @@ public class Util {
         return sb.toString();
     }
 
+    /**
+     * 16进制直接转换成为字符串(无需Unicode解码)
+     *
+     * @param hex Byte字符串(Byte之间无分隔符
+     * @return 对应的字符串
+     * @author xxs
+     */
+    public static String hexStr2Str(String hex, String charSet) {
+        String hexStr = "";
+        String str = "0123456789ABCDEF"; //16进制能用到的所有字符 0-15
+        for (int i = 0; i < hex.length(); i++) {
+            String s = hex.substring(i, i + 1);
+            if (s.equals("a") || s.equals("b") || s.equals("c") || s.equals("d") || s.equals("e") || s.equals("f")) {
+                s = s.toUpperCase().substring(0, 1);
+            }
+            hexStr += s;
+        }
+
+        char[] hexs = hexStr.toCharArray();//toCharArray() 方法将字符串转换为字符数组。
+        int length = (hexStr.length() / 2);//1个byte数值 -> 两个16进制字符
+        byte[] bytes = new byte[length];
+        int n;
+        for (int i = 0; i < bytes.length; i++) {
+            int position = i * 2;//两个16进制字符 -> 1个byte数值
+            n = str.indexOf(hexs[position]) * 16;
+            n += str.indexOf(hexs[position + 1]);
+            // 保持二进制补码的一致性 因为byte类型字符是8bit的  而int为32bit 会自动补齐高位1  所以与上0xFF之后可以保持高位一致性
+            //当byte要转化为int的时候,高的24位必然会补1,这样,其二进制补码其实已经不一致了,&0xff可以将高的24位置为0,低8位保持原样,这样做的目的就是为了保证二进制数据的一致性。
+            bytes[i] = (byte) (n & 0xff);
+        }
+        String name = "";
+        try {
+            name = new String(bytes, charSet);
+        } catch (UnsupportedEncodingException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+        return name;
+    }
+
     /**
      * 此函数专门给L02 协议使用 ,解析名字用
      *
index 9b594eb..85f7ed3 100644 (file)
@@ -179,7 +179,21 @@ public class protocol_s123 {
         //IWAP94,123456,1,XXXXXXXXXXXXXXXX
         //以下这部分内容由UI给到数据库再给过来
         //123456,1,XXXXXXXXXXXXXXXX
-        //TODO:
+        String[] split = value.split(CMDSPLIT);
+        if (split.length == 3) {
+            //对数据进行编码
+            genStringMessage(cmdMap.get(CMD_TYPE.AP94),
+                    new StringBuilder()
+                            .append(CMDHEADER)
+                            .append(cmdMap.get(CMD_TYPE.AP94))
+                            .append(CMDSPLIT).append(split[0])
+                            .append(CMDSPLIT).append(split[1])
+                            .append(CMDSPLIT).append(Util.utf8ToUnicode(split[2]))
+                            .append(CMDEND)
+                            .toString());
+        } else {
+            ICLogger.d("parse send msg error==> " + value);
+        }
     }
 
     public enum CMD_TYPE {
@@ -1549,8 +1563,6 @@ public class protocol_s123 {
 
         String[] cmdlist = cmd.split(",");
         if (cmdlist.length == 6) {
-
-
             log("com.ic.work mode " + cmdlist[3]);
             try {
                 int mod = Integer.parseInt(cmdlist[3]);
@@ -1593,55 +1605,63 @@ public class protocol_s123 {
         ICLogger.d("cmd == > " + cmd);
         //这里的切割,如查是云图的后台,会有问题,如果文本内容里有,那么就会切割出错了。所以需要后台去解决这个问题。
         String[] cmdlist = cmd.split(",");
-        ICLogger.d("cmdlist length == > " + cmdlist);
-        if (cmdlist.length == 4) {
-            String cmdindex = cmdlist[2];
-            String txtmsg = cmdlist[3];
-            StringBuilder sb = new StringBuilder();
-            Runtime.PushtxtMsg_srv_index = cmdindex;//给回复AP94用
-            sb.append(cmdindex).append(CMDSPLIT).append(TimeUtil.getSystemTimeyyyyMMddHHmmss()).append(CMDSPLIT).append(txtmsg);
-            if (Config.custom_name.equals("VitracK")) {
-
-            } else if (Util.getSystemProperties("persist.sys.pushtxt_encode", "gb2312").equals("utf-8")) {
-                //  txtmsg = Util.decodeUnicode2Utf8(txtmsg);
+        ICLogger.d("cmdlist length == > " + cmdlist.length);
+        if (cmdlist.length == 5) {
+            String cmdIndex = cmdlist[2];
+            //新增加的类型
+            //TODO:
+            String type = cmdlist[3];
+            ICLogger.d("web msg type ==> " + type);
+            String txtMsg = Util.hexStr2Str(cmdlist[4], "gb2312");
+            if ("2".equals(type)) {
+                //文本消息
+                StringBuilder sb = new StringBuilder();
+                Runtime.PushtxtMsg_srv_index = cmdIndex;//给回复AP94用
+                sb.append(cmdIndex).append(CMDSPLIT).append(TimeUtil.getSystemTimeyyyyMMddHHmmss()).append(CMDSPLIT).append(txtMsg);
+                if (Config.custom_name.equals("VitracK")) {
+
+                } else if (Util.getSystemProperties("persist.sys.pushtxt_encode", "gb2312").equals("utf-8")) {
+                    //  txtmsg = Util.decodeUnicode2Utf8(txtmsg);
 //                txtmsg = Util.UrlGB2312ToUTF8(txtmsg);
-                txtmsg = Util.UrlUTF8ToStrUTF8(txtmsg);
-            } else {
-                txtmsg = Util.UrlGB2312ToUTF8(txtmsg);
-            }
-            StringMessage msg = AP40(cmdindex, 1);
-            //设定当前工作模式及循环频率
-            connection.send(msg);
-            ICLogger.i("received Txt Msg " + txtmsg);
-            if (!Config.noPushTxtReadReply) {
-                Config.setLastUnReadMessage(runtime.getContextProxy().context, sb.toString());
-                runtime.getContextProxy().sendMsgBroadcast(txtmsg, 3);//msgType 3需要回复,0不需要回复
-            } else {
-                //读取一个变量值,判断是否强制弹窗
-                String forceReadMsg = Util.getSystemProperties("persist.sys.forcereadmsg");
-                ICLogger.d("forceReadMsg == > " + forceReadMsg);
-                if (!TextUtils.isEmpty(forceReadMsg)) {
-                    //强制阅读的话,弹窗显示
-                    MsgMustReadDialog instance = MsgMustReadDialog.getInstance();
-                    instance.showMsgDialog();
-                    List<String> list = new ArrayList<>();
-                    list.add(txtmsg);
-                    instance.addData(list);
+                    txtMsg = Util.UrlUTF8ToStrUTF8(txtMsg);
                 } else {
-                    //msgType 3需要回复,0不需要回复
-                    runtime.getContextProxy().sendMsgBroadcast(txtmsg, 0);
+                    txtMsg = Util.UrlGB2312ToUTF8(txtMsg);
                 }
+                StringMessage msg = AP40(cmdIndex, 1);
+                //设定当前工作模式及循环频率
+                connection.send(msg);
+                ICLogger.i("received Txt Msg " + txtMsg);
+                if (!Config.noPushTxtReadReply) {
+                    Config.setLastUnReadMessage(runtime.getContextProxy().context, sb.toString());
+                    runtime.getContextProxy().sendMsgBroadcast(txtMsg, 3);//msgType 3需要回复,0不需要回复
+                } else {
+                    //读取一个变量值,判断是否强制弹窗
+                    String forceReadMsg = Util.getSystemProperties("persist.sys.forcereadmsg");
+                    ICLogger.d("forceReadMsg == > " + forceReadMsg);
+                    if (!TextUtils.isEmpty(forceReadMsg)) {
+                        //强制阅读的话,弹窗显示
+                        MsgMustReadDialog instance = MsgMustReadDialog.getInstance();
+                        instance.showMsgDialog();
+                        List<String> list = new ArrayList<>();
+                        list.add(txtMsg);
+                        instance.addData(list);
+                    } else {
+                        //msgType 3需要回复,0不需要回复
+                        //123表示s123的,需要回复已读,或者回复文本消息
+                        runtime.getContextProxy().sendMsgBroadcast(txtMsg, 123);
+                    }
+                }
+                //保存到云短信的库里
+                ContentResolver resolver = runtime.getContextProxy().getResolver();
+                ContentValues contentValues = new ContentValues();
+                contentValues.put(ICDatabaseHelper.web_sms_content, txtMsg);
+                //弹窗表示已阅读了
+                contentValues.put(ICDatabaseHelper.web_sms_has_read, 1);
+                contentValues.put(ICDatabaseHelper.web_sms_create_time, System.currentTimeMillis());
+                resolver.insert(Uri.parse(WebSmsProvider.WEB_MSG), contentValues);
+                //保存到数据库里,以下是原来的做法
+                //runtime.getContextProxy().saveMstToSMSDB(txtmsg);
             }
-            //保存到云短信的库里
-            ContentResolver resolver = runtime.getContextProxy().getResolver();
-            ContentValues contentValues = new ContentValues();
-            contentValues.put(ICDatabaseHelper.web_sms_content, txtmsg);
-            //弹窗表示已阅读了
-            contentValues.put(ICDatabaseHelper.web_sms_has_read, 1);
-            contentValues.put(ICDatabaseHelper.web_sms_create_time, System.currentTimeMillis());
-            resolver.insert(Uri.parse(WebSmsProvider.WEB_MSG), contentValues);
-            //保存到数据库里,以下是原来的做法
-            //runtime.getContextProxy().saveMstToSMSDB(txtmsg);
         } else {
             ICLogger.i("BP40 format error!");
         }
@@ -3510,14 +3530,14 @@ public class protocol_s123 {
                 break;
             case BP40:
                 //服务器推送文本
-                handleBP40(mConnection, mRuntime, cmd);
                 ICLogger.i("收到服务器推送文本消息");
+                handleBP40(mConnection, mRuntime, cmd);
                 mConnection.DeliverCMDMessageToSystem("showTxt", cmd);//通知下面线程状态变化
                 break;
 
             case BPXL:
-                handleBPXL(cmd, mConnection);
                 ICLogger.i("收到服务器心率检测命令");
+                handleBPXL(cmd, mConnection);
                 if (mRuntime.check_stat_do_ppg_test()) {
                     HeartRateManager.getInstance().triggerPPGTest(FROM_SERVER);
                 }
diff --git a/app/src/main/java/com/ic/view/webmsgresponse/ShootItemAdapter.java b/app/src/main/java/com/ic/view/webmsgresponse/ShootItemAdapter.java
new file mode 100644 (file)
index 0000000..a81b41a
--- /dev/null
@@ -0,0 +1,64 @@
+package com.ic.view.webmsgresponse;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import com.enqualcomm.support.R;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ShootItemAdapter extends RecyclerView.Adapter<ShootItemAdapter.InnerHolder> {
+
+    private final List<String> dataList = new ArrayList<>();
+    private OnItemClickListener mItemClickListener;
+
+    @Override
+    public InnerHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+        View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_shoot, parent, false);
+        return new InnerHolder(itemView);
+    }
+
+    @Override
+    public void onBindViewHolder(InnerHolder holder, int position) {
+        TextView itemTextView = (TextView) holder.itemView.findViewById(R.id.shoot_item_tv);
+        String itemText = dataList.get(position);
+        itemTextView.setText(itemText);
+        //设置点击事件
+        holder.itemView.setOnClickListener(v -> {
+            if (mItemClickListener != null) {
+                mItemClickListener.onItemClick(itemText);
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return dataList.size();
+    }
+
+    public void updateData(List<String> dataList) {
+        this.dataList.clear();
+        this.dataList.addAll(dataList);
+        notifyDataSetChanged();
+    }
+
+
+    public void setOnItemClickListener(OnItemClickListener listener) {
+        this.mItemClickListener = listener;
+    }
+
+    public interface OnItemClickListener {
+        void onItemClick(String text);
+    }
+
+
+    public class InnerHolder extends RecyclerView.ViewHolder {
+        public InnerHolder(View itemView) {
+            super(itemView);
+        }
+    }
+}
diff --git a/app/src/main/java/com/ic/view/webmsgresponse/WebMessageAdapter.java b/app/src/main/java/com/ic/view/webmsgresponse/WebMessageAdapter.java
new file mode 100644 (file)
index 0000000..94336fd
--- /dev/null
@@ -0,0 +1,117 @@
+package com.ic.view.webmsgresponse;
+
+import android.graphics.Rect;
+import android.support.v4.view.PagerAdapter;
+import android.support.v4.view.ViewPager;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import com.enqualcomm.support.R;
+
+import java.util.List;
+
+public class WebMessageAdapter extends PagerAdapter {
+
+    private final ViewPager mViewPager;
+    private TextView webMsgView;
+    private RecyclerView shootListView;
+    private String mCurrentText;
+    private ShootItemAdapter shootItemAdapter;
+    private List<String> mResponseTextList;
+    private View replyBtn;
+
+    public WebMessageAdapter(ViewPager msgPage) {
+        this.mViewPager = msgPage;
+    }
+
+    @Override
+    public Object instantiateItem(ViewGroup container, int position) {
+        //根据位置来加载内容
+        View item;
+        if (position == 0) {
+            item = View.inflate(container.getContext(), R.layout.web_msg_item_content, null);
+            webMsgView = (TextView) item.findViewById(R.id.web_msg_tv);
+            if (TextUtils.isEmpty(mCurrentText)) {
+                webMsgView.setText(mCurrentText);
+            }
+            replyBtn = item.findViewById(R.id.reply_btn);
+            //设置点击事件
+            replyBtn.setOnClickListener(v -> {
+                //跳转到列表页面
+                if (mViewPager != null) {
+                    //第二个页面是数据选择的页面
+                    mViewPager.setCurrentItem(1);
+                }
+            });
+        } else if (position == 1) {
+            item = View.inflate(container.getContext(), R.layout.web_msg_item_shoot, null);
+            shootListView = (RecyclerView) item.findViewById(R.id.shoot_list_view);
+            if (shootItemAdapter == null) {
+                shootItemAdapter = new ShootItemAdapter();
+            }
+            shootListView.setLayoutManager(new LinearLayoutManager(container.getContext()));
+            shootListView.addItemDecoration(new RecyclerView.ItemDecoration() {
+                @Override
+                public void getItemOffsets(Rect outRect, View view,
+                                           RecyclerView parent,
+                                           RecyclerView.State state) {
+                    outRect.top = 1;
+                    outRect.bottom = 1;
+                }
+            });
+            //设置适配器
+            shootListView.setAdapter(shootItemAdapter);
+            if (mResponseTextList != null) {
+                shootItemAdapter.updateData(mResponseTextList);
+            }
+        } else if (position == 2) {
+            item = View.inflate(container.getContext(), R.layout.web_msg_item_success, null);
+        } else {
+            item = View.inflate(container.getContext(), R.layout.web_msg_item_fail, null);
+        }
+        container.addView(item);
+        return item;
+    }
+
+    @Override
+    public void destroyItem(ViewGroup container, int position, Object object) {
+        container.removeView((View) object);
+    }
+
+    @Override
+    public int getCount() {
+        return 4;//4个页面,
+        //一个是消息页面,
+        //一个是快捷回复页面
+        //一个是成功页面
+        //一个是失败页面
+    }
+
+    @Override
+    public boolean isViewFromObject(View view, Object object) {
+        return view == object;
+    }
+
+    @Override
+    public int getItemPosition(Object object) {
+        return POSITION_NONE;
+    }
+
+    public void updateShootList(List<String> responseText) {
+        this.mResponseTextList = responseText;
+        if (shootItemAdapter != null) {
+            shootItemAdapter.updateData(responseText);
+        }
+    }
+
+    public void updateMsgText(String text) {
+        this.mCurrentText = text;
+        if (webMsgView != null) {
+            webMsgView.setText(text);
+        }
+    }
+}
diff --git a/app/src/main/java/com/ic/view/webmsgresponse/WebMsgView.java b/app/src/main/java/com/ic/view/webmsgresponse/WebMsgView.java
new file mode 100644 (file)
index 0000000..8aeb8e2
--- /dev/null
@@ -0,0 +1,132 @@
+package com.ic.view.webmsgresponse;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.database.Cursor;
+import android.net.Uri;
+import android.support.v4.view.ViewPager;
+import android.text.TextUtils;
+import android.view.Gravity;
+import android.view.View;
+import android.view.WindowManager;
+
+import com.enqualcomm.support.ICApplication;
+import com.enqualcomm.support.R;
+import com.enqualcomm.support.provider.ShootTextProvider;
+import com.enqualcomm.support.utils.ICLogger;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * 云消息&短信弹窗
+ * 直接塞到Window里
+ * 要求:不阅读完,不可以关闭
+ * 交互:阅读完,有下一页的按钮,最后一页才有关闭按钮。
+ */
+public class WebMsgView {
+
+    private WindowManager windowManager;
+    private WebMessageAdapter messageAdapter;
+    private ViewPager msgPage;
+    private ExecutorService executorService;
+    private ContentResolver contentResolver;
+    private View view;
+    private String currentText;
+
+    private WebMsgView() {
+        //获取到数据库里的数据,显示快捷回复列表
+        executorService = Executors.newSingleThreadExecutor();
+    }
+
+    private final List<String> responseText = new ArrayList<>();
+
+    private void initShootData() {
+        executorService.execute(() -> {
+            responseText.clear();
+            contentResolver = ICApplication.sContext.getContentResolver();
+            Cursor query = contentResolver.query(Uri.parse(ShootTextProvider.SHOOT_TEXT),
+                    new String[]{"_id", "value"},
+                    "type=?", new String[]{"3"}, null);
+            if (query != null) {
+                while (query.moveToNext()) {
+                    String text = query.getString(1);
+                    ICLogger.d("text ==> " + text);
+                    responseText.add(text);
+                }
+                query.close();
+            }
+            if (view != null && messageAdapter != null) {
+                view.post(() -> {
+                    messageAdapter.updateShootList(responseText);
+                });
+            }
+        });
+    }
+
+    private static WebMsgView sInstance;
+
+    public static WebMsgView getInstance() {
+        if (sInstance == null) {
+            sInstance = new WebMsgView();
+        }
+        return sInstance;
+    }
+
+    private boolean isShow = false;
+
+    public void showMsgDialog() {
+        ICLogger.d("showMsgDialog..." + isShow);
+        if (isShow) {
+            return;
+        }
+        isShow = true;
+        Context context = ICApplication.sContext;
+        windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
+        //设置属性
+        WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
+        layoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
+        //这个是针对S123的屏幕,如果要适配其他,可以动态获取屏幕宽度,高度,再以百分比的形式计算即可。
+        layoutParams.height = WindowManager.LayoutParams.MATCH_PARENT;
+        layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
+        layoutParams.packageName = context.getPackageName();
+        layoutParams.gravity = Gravity.CENTER;
+        //加载布局
+        view = View.inflate(context, R.layout.msg_dialog_layout, null);
+        //设置适配器
+        initView(view);
+        //准备数据
+        //添加到Window里
+        initShootData();
+        windowManager.addView(view, layoutParams);
+    }
+
+    public void setShowMsg(String text) {
+        this.currentText = text;
+        //设置要显示的消息
+        if (messageAdapter != null) {
+            messageAdapter.updateMsgText(text);
+        }
+    }
+
+    public void dismiss() {
+        executorService.shutdown();
+        executorService = null;
+        sInstance = null;
+        contentResolver = null;
+    }
+
+
+    private void initView(final View view) {
+        msgPage = (ViewPager) view.findViewById(R.id.msg_pager);
+        msgPage.setOffscreenPageLimit(2);
+        //设置适配器
+        messageAdapter = new WebMessageAdapter(msgPage);
+        if (!TextUtils.isEmpty(currentText)) {
+            messageAdapter.updateMsgText(currentText);
+        }
+        msgPage.setAdapter(messageAdapter);
+    }
+}
\ No newline at end of file
diff --git a/app/src/main/res/drawable/selector_item_bg.xml b/app/src/main/res/drawable/selector_item_bg.xml
new file mode 100644 (file)
index 0000000..c8cbe35
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/shape_item_bg_press" android:state_pressed="true" />
+    <item android:drawable="@drawable/shape_item_bg_normal" />
+</selector>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/shape_item_bg_normal.xml b/app/src/main/res/drawable/shape_item_bg_normal.xml
new file mode 100644 (file)
index 0000000..6b610f6
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="#E7E5E5" />
+</shape>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/shape_item_bg_press.xml b/app/src/main/res/drawable/shape_item_bg_press.xml
new file mode 100644 (file)
index 0000000..f086202
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+
+    <solid android:color="#B7B5B6" />
+
+
+</shape>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/shape_text_bg.xml b/app/src/main/res/drawable/shape_text_bg.xml
new file mode 100644 (file)
index 0000000..c8e3c78
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <corners android:radius="10dp" />
+
+    <solid android:color="#A6A6A6" />
+
+</shape>
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_shoot.xml b/app/src/main/res/layout/item_shoot.xml
new file mode 100644 (file)
index 0000000..0f77299
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/shoot_item_tv"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@drawable/selector_item_bg"
+    android:paddingLeft="10dp"
+    android:paddingTop="20dp"
+    android:paddingBottom="20dp"
+    android:textColor="@android:color/background_dark"
+    android:textSize="20sp"
+    android:textStyle="bold"
+    app:layout_constraintTop_toTopOf="parent">
+
+</TextView>
\ No newline at end of file
diff --git a/app/src/main/res/layout/web_msg_item_content.xml b/app/src/main/res/layout/web_msg_item_content.xml
new file mode 100644 (file)
index 0000000..f97e8c5
--- /dev/null
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#ffffff">
+
+
+    <LinearLayout
+        android:id="@+id/container"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
+
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="#117CFD"
+            android:gravity="center_horizontal"
+            android:padding="10dp"
+            android:text="@string/web_sms_title_text"
+            android:textColor="@android:color/black"
+            android:textSize="20sp"
+            app:layout_constraintBottom_toTopOf="@id/container" />
+
+
+        <ScrollView
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1">
+
+            <TextView
+                android:id="@+id/web_msg_tv"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:gravity="left|top"
+                android:padding="10dp"
+                android:textColor="#000"
+                android:textSize="20sp"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintRight_toRightOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+        </ScrollView>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="#117CFD"
+            android:gravity="center_vertical"
+            android:orientation="horizontal">
+
+            <TextView
+                android:id="@+id/reply_btn"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:gravity="center"
+                android:padding="10dp"
+                android:text="@string/reply_text"
+                android:textColor="#fff"
+                android:textSize="26sp"
+                android:textStyle="bold" />
+
+            <TextView
+                android:id="@+id/read_btn"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:gravity="center"
+                android:padding="10dp"
+                android:text="@string/read_text"
+                android:textColor="#fff"
+                android:textSize="26sp"
+                android:textStyle="bold" />
+
+        </LinearLayout>
+
+    </LinearLayout>
+
+
+</android.support.constraint.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/web_msg_item_fail.xml b/app/src/main/res/layout/web_msg_item_fail.xml
new file mode 100644 (file)
index 0000000..54bee0f
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+
+    <ImageView
+        android:id="@+id/top_icon"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="30dp"
+        android:src="@mipmap/icon_failed"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="10dp"
+        android:layout_marginTop="10dp"
+        android:layout_marginRight="10dp"
+        android:background="@drawable/shape_text_bg"
+        android:gravity="center"
+        android:padding="20dp"
+        android:text="@string/send_msg_error_tips_text"
+        android:textColor="@android:color/background_dark"
+        android:textSize="20sp"
+        android:textStyle="bold"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/top_icon" />
+
+
+</android.support.constraint.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/web_msg_item_shoot.xml b/app/src/main/res/layout/web_msg_item_shoot.xml
new file mode 100644 (file)
index 0000000..e92f1d7
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+
+    <LinearLayout
+        android:id="@+id/container"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="#ffffff"
+        android:orientation="vertical"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
+
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="#117CFD"
+            android:gravity="center_horizontal"
+            android:padding="10dp"
+            android:text="@string/web_sms_title_text"
+            android:textColor="@android:color/black"
+            android:textSize="26sp"
+            app:layout_constraintBottom_toTopOf="@id/container" />
+
+
+        <android.support.v7.widget.RecyclerView
+            android:id="@+id/shoot_list_view"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1" />
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="#117CFD"
+            android:gravity="center_vertical"
+            android:orientation="horizontal">
+
+            <TextView
+                android:id="@+id/reply_btn"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:gravity="center"
+                android:padding="10dp"
+                android:text="@string/back_text"
+                android:textColor="#fff"
+                android:textSize="26sp"
+                android:textStyle="bold" />
+
+            <TextView
+                android:id="@+id/read_btn"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:gravity="center"
+                android:padding="10dp"
+                android:text="@string/send_text"
+                android:textColor="#fff"
+                android:textSize="26sp"
+                android:textStyle="bold" />
+
+        </LinearLayout>
+
+    </LinearLayout>
+
+
+</android.support.constraint.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/web_msg_item_success.xml b/app/src/main/res/layout/web_msg_item_success.xml
new file mode 100644 (file)
index 0000000..f3cf520
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+
+    <ImageView
+        android:id="@+id/top_icon"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="30dp"
+        android:src="@mipmap/icon_success"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="10dp"
+        android:layout_marginTop="15dp"
+        android:layout_marginRight="10dp"
+        android:background="@drawable/shape_text_bg"
+        android:gravity="center"
+        android:padding="24dp"
+        android:text="@string/send_success_tips_text"
+        android:textColor="@android:color/background_dark"
+        android:textSize="20sp"
+        android:textStyle="bold"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/top_icon" />
+
+</android.support.constraint.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-mdpi/icon_failed.png b/app/src/main/res/mipmap-mdpi/icon_failed.png
new file mode 100644 (file)
index 0000000..68ef972
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/icon_failed.png differ
diff --git a/app/src/main/res/mipmap-mdpi/icon_success.png b/app/src/main/res/mipmap-mdpi/icon_success.png
new file mode 100644 (file)
index 0000000..343a145
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/icon_success.png differ
index d8d9111..993d27d 100644 (file)
     <string name="low_power_warning_text">低电量报警</string>\r
     <string name="sos_warning_msg_text">SOS紧急报警</string>\r
     <string name="sos_sms_content_text">%s发出了SOS信号。%s</string>\r
+    <string name="read_text">已阅读</string>\r
+    <string name="reply_text">回复</string>\r
+    <string name="send_msg_error_tips_text">发送失败请重试</string>\r
+    <string name="send_success_tips_text">发送成功</string>\r
+    <string name="back_text">返回</string>\r
+    <string name="send_text">发送</string>\r
 </resources>\r
index d8d9111..993d27d 100644 (file)
     <string name="low_power_warning_text">低电量报警</string>\r
     <string name="sos_warning_msg_text">SOS紧急报警</string>\r
     <string name="sos_sms_content_text">%s发出了SOS信号。%s</string>\r
+    <string name="read_text">已阅读</string>\r
+    <string name="reply_text">回复</string>\r
+    <string name="send_msg_error_tips_text">发送失败请重试</string>\r
+    <string name="send_success_tips_text">发送成功</string>\r
+    <string name="back_text">返回</string>\r
+    <string name="send_text">发送</string>\r
 </resources>\r
index b619ede..358fc5f 100644 (file)
     <string name="low_power_warning_text">低电量报警</string>\r
     <string name="sos_warning_msg_text">SOS紧急报警</string>\r
     <string name="sos_sms_content_text">%s发出了SOS信号。%s</string>\r
+    <string name="read_text">已阅读</string>\r
+    <string name="reply_text">回复</string>\r
+    <string name="send_msg_error_tips_text">发送失败请重试</string>\r
+    <string name="send_success_tips_text">发送成功</string>\r
+    <string name="back_text">返回</string>\r
+    <string name="send_text">发送</string>\r
 </resources>\r
index b61ca7c..022080f 100644 (file)
     <string name="low_power_warning_text">低電力アラート</string>
     <string name="sos_warning_msg_text">緊急SOS</string>
     <string name="sos_sms_content_text">%sからSOSが発信されました。%s</string>
+    <string name="read_text">已阅读</string>
+    <string name="reply_text">回复</string>
+    <string name="send_msg_error_tips_text">发送失败请重试</string>
+    <string name="send_success_tips_text">发送成功</string>
+    <string name="back_text">返回</string>
+    <string name="send_text">发送</string>
 
 </resources>
diff --git a/app/src/main/res/values-w820dp/strings.xml b/app/src/main/res/values-w820dp/strings.xml
new file mode 100644 (file)
index 0000000..49acd3b
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="read_text">已阅读</string>
+    <string name="reply_text">回复</string>
+    <string name="send_msg_error_tips_text">发送失败请重试</string>
+    <string name="send_success_tips_text">发送成功</string>
+    <string name="back_text">返回</string>
+    <string name="send_text">发送</string>
+</resources>
\ No newline at end of file
index b43a9b6..089d5ff 100644 (file)
     <string name="low_power_warning_text">低电量报警</string>
     <string name="sos_warning_msg_text">SOS紧急报警</string>
     <string name="sos_sms_content_text">%s发出了SOS信号。%s</string>
+    <string name="read_text">已阅读</string>
+    <string name="reply_text">回复</string>
+    <string name="send_msg_error_tips_text">发送失败请重试</string>
+    <string name="send_success_tips_text">发送成功</string>
+    <string name="back_text">返回</string>
+    <string name="send_text">发送</string>
 </resources>
index b93e7b8..cf9b7f8 100644 (file)
     <string name="sos_warning_msg_text">SOS紧急报警</string>
 
     <string name="sos_sms_content_text">SOS was sent from "%s". %s</string>
+    <string name="read_text">已阅读</string>
+    <string name="reply_text">回复</string>
+    <string name="send_msg_error_tips_text">发送失败请重试</string>
+    <string name="send_success_tips_text">发送成功</string>
+    <string name="back_text">返回</string>
+    <string name="send_text">发送</string>
 
 </resources>