From e01efd770fcf79505e854965b16352bff0992910 Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期四, 04 一月 2024 14:35:28 +0800 Subject: [PATCH] 2024年01月04日14:35:21 --- app/src/main/java/com/hdl/photovoltaic/ui/message/MessageInfoActivity.java | 41 + app/src/main/res/values/strings.xml | 9 app/src/main/java/com/hdl/photovoltaic/ui/message/RecoverMessageFragment.java | 9 app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java | 37 ++ app/src/main/java/com/hdl/photovoltaic/ui/adapter/MessageAdapter.java | 13 app/src/main/java/com/hdl/photovoltaic/HDLApp.java | 1 app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java | 8 app/src/main/java/com/hdl/photovoltaic/utils/TimeUtils.java | 2 app/src/main/java/com/hdl/photovoltaic/jpush/JPushMessageInfoBean.java | 72 ++++ app/src/main/java/com/hdl/photovoltaic/other/HdlDialogLogic.java | 2 app/src/main/java/com/hdl/photovoltaic/ui/message/MessageFragment.java | 10 app/src/main/java/com/hdl/photovoltaic/internet/api/HttpApi.java | 3 app/src/main/java/com/hdl/photovoltaic/ui/me/MeChangePasswordActivity.java | 4 app/src/main/res/values-zh/strings.xml | 9 app/src/main/java/com/hdl/photovoltaic/config/ConstantManage.java | 3 app/src/main/java/com/hdl/photovoltaic/other/HdlJpushLogic.java | 82 ++++ app/src/main/java/com/hdl/photovoltaic/ui/message/NascentMessageFragment.java | 10 app/src/main/java/com/hdl/photovoltaic/config/UserConfigManage.java | 27 + app/src/main/res/values-en/strings.xml | 317 +++++++++--------- app/src/main/java/com/hdl/photovoltaic/ui/MyPowerStationActivity.java | 63 +++ app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java | 8 app/src/main/java/com/hdl/photovoltaic/other/HdlMessageLogic.java | 164 ++++++++- app/src/main/java/com/hdl/photovoltaic/ui/HomeLoginActivity.java | 12 app/src/main/java/com/hdl/photovoltaic/jpush/JPushReceiverService.java | 78 +++- 24 files changed, 755 insertions(+), 229 deletions(-) diff --git a/app/src/main/java/com/hdl/photovoltaic/HDLApp.java b/app/src/main/java/com/hdl/photovoltaic/HDLApp.java index 53ddf88..4514325 100644 --- a/app/src/main/java/com/hdl/photovoltaic/HDLApp.java +++ b/app/src/main/java/com/hdl/photovoltaic/HDLApp.java @@ -220,6 +220,7 @@ private void initJPush() { JPushInterface.setDebugMode(true); JPushInterface.init(getBaseContext()); + } diff --git a/app/src/main/java/com/hdl/photovoltaic/config/ConstantManage.java b/app/src/main/java/com/hdl/photovoltaic/config/ConstantManage.java index add6714..4014d8a 100644 --- a/app/src/main/java/com/hdl/photovoltaic/config/ConstantManage.java +++ b/app/src/main/java/com/hdl/photovoltaic/config/ConstantManage.java @@ -18,7 +18,10 @@ public static final String message_function_tab_switch = "message_function_tab_switch"; //娑堟伅璀﹀憡瑙e喅鎴栬�呮湭瑙e喅 public static final String message_function_push_post = "message_function_push"; + //娑堟伅鏁伴噺 + public static final String message_count = "message_count"; public static final String homepage_title_tab_switch = "homepage_title_tab_switch"; + //缃戠粶鐘舵�佸彂鐢熷彉鍖� public static final String network_change_post = "network_change"; diff --git a/app/src/main/java/com/hdl/photovoltaic/config/UserConfigManage.java b/app/src/main/java/com/hdl/photovoltaic/config/UserConfigManage.java index e72dbb6..6602b66 100644 --- a/app/src/main/java/com/hdl/photovoltaic/config/UserConfigManage.java +++ b/app/src/main/java/com/hdl/photovoltaic/config/UserConfigManage.java @@ -90,6 +90,33 @@ //app褰撳墠鐨勮瑷� private String currentAppLanguage; + + /// <summary> + /// 娉ㄥ唽鏋佸厜ID + /// </summary> + public String registrationID; + /// <summary> + /// 娣诲姞鏋佸厜ID鍒颁簯绔垚鍔熸椂杩斿洖鐨� + /// </summary> + public String pushId; + + + public String getRegistrationID() { + return registrationID == null ? "" : registrationID; + } + + public void setRegistrationID(String registrationID) { + this.registrationID = registrationID; + } + + public String getPushId() { + return pushId == null ? "" : pushId; + } + + public void setPushId(String pushId) { + this.pushId = pushId; + } + public String getCurrentAppLanguage() { return currentAppLanguage; } diff --git a/app/src/main/java/com/hdl/photovoltaic/internet/api/HttpApi.java b/app/src/main/java/com/hdl/photovoltaic/internet/api/HttpApi.java index ec66f84..669d131 100644 --- a/app/src/main/java/com/hdl/photovoltaic/internet/api/HttpApi.java +++ b/app/src/main/java/com/hdl/photovoltaic/internet/api/HttpApi.java @@ -2,6 +2,9 @@ public class HttpApi { + //娣诲姞鎺ㄩ�乀oken + public static final String POST_push_add = "/smart-footstone/app/push-information/add"; + //region **********銆怋绔�戝拰銆怌绔�戝叡鐢ㄦ帴鍙�********** //mqtt杩炴帴闇�瑕侊紙璇泙鎺ュ彛鍦板潃:https://hdl-gz.yuque.com/wnkbmh/cdrglh/totdnt#40b28997锛� public static final String POST_Mqtt_GetRemoteInfo = "/home-wisdom/app/mqtt/getRemoteInfo"; diff --git a/app/src/main/java/com/hdl/photovoltaic/jpush/JPushMessageInfoBean.java b/app/src/main/java/com/hdl/photovoltaic/jpush/JPushMessageInfoBean.java new file mode 100644 index 0000000..b45f04d --- /dev/null +++ b/app/src/main/java/com/hdl/photovoltaic/jpush/JPushMessageInfoBean.java @@ -0,0 +1,72 @@ +package com.hdl.photovoltaic.jpush; + +import java.io.Serializable; + +/** + * 鏋佸厜鎺ㄩ�佺殑淇℃伅瀹炰綋绫� + */ +public class JPushMessageInfoBean implements Serializable { + // 浣忓畢ID + private String homeId; + // 鎺ㄩ�佹爣棰� + private String title; + // 鎺ㄩ�佸唴瀹� + private String content; + // 鎺ㄩ�侀檮鍔犳暟鎹� + private String expandData; + // 淇℃伅绫诲瀷 + private String messageType; + // 鎵╁睍鏁版嵁鍐呭 + private String expantContent; + + + public String getHomeId() { + return homeId == null ? "" : homeId; + } + + public void setHomeId(String homeId) { + this.homeId = homeId; + } + + public String getTitle() { + return title == null ? "" : title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content == null ? "" : content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getExpandData() { + return expandData == null ? "" : expandData; + } + + public void setExpandData(String extras) { + this.expandData = extras; + } + + public String getMessageType() { + return messageType == null ? "" : messageType; + } + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + public String getExpantContent() { + return expantContent == null ? "" : expantContent; + } + + public void setExpantContent(String expantContent) { + this.expantContent = expantContent; + } + + +} diff --git a/app/src/main/java/com/hdl/photovoltaic/jpush/JPushReceiverService.java b/app/src/main/java/com/hdl/photovoltaic/jpush/JPushReceiverService.java index 51b23ab..864299c 100644 --- a/app/src/main/java/com/hdl/photovoltaic/jpush/JPushReceiverService.java +++ b/app/src/main/java/com/hdl/photovoltaic/jpush/JPushReceiverService.java @@ -3,9 +3,15 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; +import android.text.TextUtils; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.reflect.TypeToken; import com.hdl.photovoltaic.config.ConstantManage; +import com.hdl.photovoltaic.other.HdlJpushLogic; import com.hdl.photovoltaic.other.HdlLogLogic; import com.hdl.photovoltaic.ui.MyPowerStationActivity; import com.hdl.photovoltaic.ui.StartActivity; @@ -13,6 +19,10 @@ import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus; import org.greenrobot.eventbus.EventBus; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.Objects; import cn.jpush.android.api.CustomMessage; import cn.jpush.android.api.JPushInterface; @@ -42,23 +52,10 @@ * @param message 鎺ユ敹鍒扮殑閫氱煡鍐呭 */ public void onNotifyMessageOpened(Context context, NotificationMessage message) { - + JPushMessageInfoBean jPushMessageInfoBean = pushDataProcessing(message); + HdlJpushLogic.getInstance().JpushPushCommonData(context, jPushMessageInfoBean, true); // //鐐瑰嚮鍚庡垹闄ゆ湰鍦伴�氱煡 // JPushInterface.clearAllNotifications(context); - HdlLogLogic.print("鏋佸厜--->鐐瑰嚮閫氱煡鍥炶皟--->" + new Gson().toJson(message), true); - Intent intent = new Intent(context, MyPowerStationActivity.class); -// Bundle bundle = new Bundle(); -// bundle.putString(JPushInterface.EXTRA_NOTIFICATION_TITLE, message.notificationTitle); -// bundle.putString(JPushInterface.EXTRA_ALERT, message.notificationContent); -// intent.putExtras(bundle); - intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); - intent.putExtra("skip", "skip");//鏍囪瘑璺宠浆 - context.startActivity(intent); - - BaseEventBus bus = new BaseEventBus(); - bus.setTopic(ConstantManage.message_function_push_post); - EventBus.getDefault().postSticky(bus); - } /** @@ -68,8 +65,8 @@ * @param message 鎺ユ敹鍒扮殑閫氱煡鍐呭 */ public void onNotifyMessageArrived(Context context, NotificationMessage message) { - HdlLogLogic.print("鏋佸厜--->鎺ユ敹鍒扮殑閫氱煡鍐呭--->" + new Gson().toJson(message), true); - + JPushMessageInfoBean jPushMessageInfoBean = pushDataProcessing(message); + HdlJpushLogic.getInstance().JpushPushCommonData(context, jPushMessageInfoBean, false); } /** @@ -92,4 +89,51 @@ HdlLogLogic.print("鏋佸厜--->闀胯繛鎺ョ姸鎬佸洖璋�--->" + isConnected, true); } + /** + * 鎺ㄩ�佹暟鎹綔澶勭悊 + */ + private JPushMessageInfoBean pushDataProcessing(NotificationMessage message) { + try { + JPushMessageInfoBean jPushMessageInfoBean = new JPushMessageInfoBean(); + String title = message.notificationTitle; + String content = message.notificationContent; + String pushData = message.notificationExtras; + jPushMessageInfoBean.setTitle(title); + jPushMessageInfoBean.setContent(content); + if (TextUtils.isEmpty(pushData)) { + return jPushMessageInfoBean; + } + JSONObject expandDataObject = JSON.parseObject(pushData); + if (expandDataObject.containsKey("expandData")) { + String expandDataJson = Objects.requireNonNull(expandDataObject.get("expandData")).toString(); + if (TextUtils.isEmpty(expandDataJson)) { + return jPushMessageInfoBean; + } + jPushMessageInfoBean.setExpandData(expandDataJson); + JSONObject expantContentObject = JSON.parseObject(expandDataJson); + if (expantContentObject.containsKey("messageType")) { + String messageType = Objects.requireNonNull(expantContentObject.get("messageType")).toString(); + if (!TextUtils.isEmpty(messageType)) { + jPushMessageInfoBean.setMessageType(messageType); + } + } + if (expantContentObject.containsKey("homeId")) { + String homeId = Objects.requireNonNull(expantContentObject.get("homeId")).toString(); + if (!TextUtils.isEmpty(homeId)) { + jPushMessageInfoBean.setHomeId(homeId); + } + } + if (expantContentObject.containsKey("expantContent")) { + String expantContentJosn = Objects.requireNonNull(expantContentObject.get("expantContent")).toString(); + if (!TextUtils.isEmpty(expantContentJosn)) { + jPushMessageInfoBean.setExpantContent(expantContentJosn); + } + } + } + return jPushMessageInfoBean; + } catch (Exception e) { + return new JPushMessageInfoBean(); + } + } + } diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlDialogLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlDialogLogic.java index c46988b..aaf0e78 100644 --- a/app/src/main/java/com/hdl/photovoltaic/other/HdlDialogLogic.java +++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlDialogLogic.java @@ -48,7 +48,7 @@ ConfirmationCancelDialog dialog = new ConfirmationCancelDialog(context); dialog.setTitle(context.getString(R.string.loading_title_tip)); - dialog.setContent("璇峰墠寰�璁剧疆鏉冮檺."); + dialog.setContent(context.getString(R.string.please_go_set_permissions)); dialog.setConfirmation(context.getString(R.string.me_set)); dialog.show(); dialog.setYesOnclickListener(new ConfirmationCancelDialog.onYesOnclickListener() { diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlJpushLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlJpushLogic.java new file mode 100644 index 0000000..db36dde --- /dev/null +++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlJpushLogic.java @@ -0,0 +1,82 @@ +package com.hdl.photovoltaic.other; + +import android.content.Context; +import android.content.Intent; +import android.text.TextUtils; + +import com.google.gson.Gson; +import com.hdl.photovoltaic.config.ConstantManage; +import com.hdl.photovoltaic.enums.MessageStateType; +import com.hdl.photovoltaic.jpush.JPushMessageInfoBean; +import com.hdl.photovoltaic.ui.MyPowerStationActivity; +import com.hdl.photovoltaic.ui.bean.MessageBean; +import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus; + +import org.greenrobot.eventbus.EventBus; + + +/** + * 鏋佸厜鎺ㄩ�佷俊鎭鐞嗛�昏緫 + */ +public class HdlJpushLogic { + private static volatile HdlJpushLogic sHdlJpushLogic; + + /** + * 鑾峰彇褰撳墠瀵硅薄 + * + * @return HdlAccountLogic + */ + public static synchronized HdlJpushLogic getInstance() { + if (sHdlJpushLogic == null) { + synchronized (HdlJpushLogic.class) { + if (sHdlJpushLogic == null) { + sHdlJpushLogic = new HdlJpushLogic(); + } + } + + } + return sHdlJpushLogic; + } + + /** + * 鏋佸厜鎺ㄩ�佹暟鎹粺涓�澶勭悊鐨勬柟娉� + * + * @param context 涓婁笅鏂� + * @param jPushMessageInfoBean 鎺ㄩ�佹暟鎹璞″疄浣� + * @param isOpened true=鐐瑰嚮閫氱煡鏍忓洖璋�,false=鏀跺埌鎺ㄩ�侀�氱煡鍥炶皟; + */ + public void JpushPushCommonData(Context context, JPushMessageInfoBean jPushMessageInfoBean, boolean isOpened) { + //娣诲姞鍦ㄦ帹閫佹暟鎹埌缂撳瓨鍒楄〃涓�; + this.addPushDataToMemoryList(jPushMessageInfoBean); + if (isOpened) { + Intent intent = new Intent(context, MyPowerStationActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); + intent.putExtra("skip", "skip");//閲岄潰鍒ゆ柇鏈夎繖涓爣璇嗗氨璺宠浆鍒版秷鎭腑蹇冪晫闈� + context.startActivity(intent); + } else { + BaseEventBus bus = new BaseEventBus(); + bus.setTopic(ConstantManage.message_function_push_post); + bus.setType(MessageStateType.untreated); + EventBus.getDefault().post(bus); + } + } + + + /** + * 娣诲姞鍦ㄦ帹閫佹暟鎹埌缂撳瓨鍒楄〃涓� + */ + private void addPushDataToMemoryList(JPushMessageInfoBean jPushMessageInfoBean) { + if (TextUtils.isEmpty(jPushMessageInfoBean.getExpantContent())) { + return; + } + Gson gson = new Gson(); + MessageBean messageBean = gson.fromJson(jPushMessageInfoBean.getExpantContent(), MessageBean.class); + if (messageBean == null) { + return; + } + messageBean.setTitle(jPushMessageInfoBean.getTitle()); + messageBean.setDeviceDesc(jPushMessageInfoBean.getContent()); + HdlMessageLogic.getInstance().setListMessage(messageBean, 0); + HdlLogLogic.print("娣诲姞鍦ㄦ帹閫佹暟鎹埌缂撳瓨鍒楄〃涓�--->鎴愬姛"); + } +} diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlMessageLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlMessageLogic.java index f6c19bb..43e9624 100644 --- a/app/src/main/java/com/hdl/photovoltaic/other/HdlMessageLogic.java +++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlMessageLogic.java @@ -1,5 +1,6 @@ package com.hdl.photovoltaic.other; +import android.os.Build; import android.text.TextUtils; import com.google.gson.Gson; @@ -12,6 +13,7 @@ import com.hdl.photovoltaic.ui.bean.MessageBean; import java.util.ArrayList; +import java.util.Comparator; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; @@ -50,13 +52,17 @@ List<MessageBean> newList = new ArrayList<>(); for (int i = 0; i < mListMessage.size(); i++) { MessageBean messageBean = mListMessage.get(i); + if (messageBean == null) { + continue; + } if (messageBean.getStatus().equals(MessageStateType.untreated)) { newList.add(messageBean); } } - return newList; + return sortList(newList); } + /** * 鑾峰彇鎭㈠涓紦瀛樺垪琛� @@ -73,6 +79,49 @@ } } + return sortList(newList); + } + + /** + * 鍒楄〃杩涜鎺掑簭 + * + * @param list 婧愭暟鎹� + * @return - + */ + private List<MessageBean> sortList(List<MessageBean> list) { + List<MessageBean> newList = new ArrayList<>(); + List<MessageBean> readList = new ArrayList<>(); + List<MessageBean> unReadList = new ArrayList<>(); + for (int i = 0; i < list.size(); i++) { + MessageBean messageBean = list.get(i); + if (messageBean.isRead()) { + //宸茶 + readList.add(messageBean); + } else { + //鏈 + unReadList.add(messageBean); + } + + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + readList.sort(new Comparator<MessageBean>() { + @Override + public int compare(MessageBean o1, MessageBean o2) { + if (o1 == null && o2 == null) { + return -1; + } + //鍊掑簭锛堥『搴� Long.compare(o2.getCreateTime(), o1.getCreateTime())锛� + return Long.compare(o1.getCreateTime(), o2.getCreateTime()); + } + }); + } + + if (unReadList.size() > 0) { + newList.addAll(unReadList); + } + if (readList.size() > 0) { + newList.addAll(readList); + } return newList; } @@ -80,22 +129,31 @@ return mListMessage; } + /** - * 娣诲姞娑堟伅鍒板垪琛ㄩ噷闈� + * 璁剧疆璇诲彇鐘舵�� * - * @param list - + * @param msgId -娑堟伅ID + * @param read 鏄惁宸茶鍙� true琛ㄧず宸茶鍙� + * @param messageStateType UNTREATED : 鏈鐞嗭紝PROCESSED 锛� 宸插鐞� */ - public void setListMessage(List<MessageBean> list) { + public void setMessageState(long msgId, boolean read, String messageStateType) { try { - if (list == null || list.size() == 0) { + if (msgId == 0) { return; } - if (this.mListMessage.size() == 0) { - this.mListMessage.addAll(list); - return; - } - for (int i = 0; i < list.size(); i++) { - this.setListMessage(list.get(i)); + for (int i = 0; i < mListMessage.size(); i++) { + MessageBean messageBean = mListMessage.get(i); + if (messageBean == null) { + continue; + } + if (messageBean.getMsgId() == msgId) { + messageBean.setRead(read); + if (!TextUtils.isEmpty(messageStateType)) { + messageBean.setStatus(messageStateType); + } + break; + } } } catch (Exception ignored) { } @@ -124,6 +182,60 @@ if (!if_boolean) { //娌℃湁娣诲姞 this.mListMessage.add(messageBean); + } + } catch (Exception e) { + String mes = e.getMessage(); + HdlLogLogic.print("--->" + mes); + } + } + + /** + * 娣诲姞娑堟伅鍒板垪琛ㄩ噷闈� + * + * @param messageBean - + * @param position 琛ㄧず鍔犲埌鍒楄〃鐨勪綅缃� + */ + public void setListMessage(MessageBean messageBean, int position) { + try { + if (messageBean == null) { + return; + } + boolean if_boolean = false; + for (int i = 0; i < mListMessage.size(); i++) { + if (mListMessage.get(i).getMsgId().toString().equals(messageBean.getMsgId().toString())) { + //瀛樺湪鏇挎崲 + mListMessage.remove(i); + mListMessage.add(i, messageBean); + if_boolean = true; + break; + } + } + if (!if_boolean) { + //娌℃湁娣诲姞 + this.mListMessage.add(position, messageBean); + } + } catch (Exception e) { + String mes = e.getMessage(); + HdlLogLogic.print("--->" + mes); + } + } + + /** + * 娣诲姞娑堟伅鍒板垪琛ㄩ噷闈� + * + * @param list - + */ + public void setListMessage(List<MessageBean> list) { + try { + if (list == null || list.size() == 0) { + return; + } + if (this.mListMessage.size() == 0) { + this.mListMessage.addAll(list); + return; + } + for (int i = 0; i < list.size(); i++) { + this.setListMessage(list.get(i)); } } catch (Exception ignored) { } @@ -215,11 +327,11 @@ return; } Gson gson = new Gson(); - MessageListClass messageListClass = gson.fromJson(jsonStr, MessageListClass.class); - list.addAll(messageListClass.getList()); - setListMessage(messageListClass.getList()); + MessageListClass oldMessageListClass = gson.fromJson(jsonStr, MessageListClass.class); + list.addAll(oldMessageListClass.getList()); + setListMessage(oldMessageListClass.getList()); //鎬诲叡鏈夊灏戦〉 - long totalPage = messageListClass.totalPage; + long totalPage = oldMessageListClass.totalPage; if (totalPage < 2) { if (cloudCallBeak != null) { cloudCallBeak.onSuccess(list); @@ -235,9 +347,9 @@ @Override public void onSuccess(String jsonStr) { atomicInteger.set(atomicInteger.get() + 1); - MessageListClass messageListClass1 = gson.fromJson(jsonStr, MessageListClass.class); - list.addAll(messageListClass1.getList()); - setListMessage(messageListClass.getList()); + MessageListClass newMessageListClass = gson.fromJson(jsonStr, MessageListClass.class); + list.addAll(newMessageListClass.getList()); + setListMessage(newMessageListClass.getList()); if (atomicInteger.get() == totalPage - 1) { //鏈�鍚庝竴鏉¢��鍑� if (cloudCallBeak != null) { @@ -285,7 +397,7 @@ json.addProperty("status", messageStateType); } json.addProperty("pageNo", 1);//椤电爜 - json.addProperty("pageSize", pageSize);//椤垫暟 + json.addProperty("pageSize", 50);//椤垫暟 List<MessageBean> list = new ArrayList<>(); HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() { @@ -298,11 +410,11 @@ return; } Gson gson = new Gson(); - MessageListClass messageListClass = gson.fromJson(jsonStr, MessageListClass.class); - list.addAll(messageListClass.getList()); - setListMessage(messageListClass.getList()); + MessageListClass oldMessageListClass = gson.fromJson(jsonStr, MessageListClass.class); + list.addAll(oldMessageListClass.getList()); + setListMessage(oldMessageListClass.getList()); //鎬诲叡鏈夊灏戦〉 - long totalPage = messageListClass.totalPage; + long totalPage = oldMessageListClass.totalPage; if (totalPage < 2) { if (cloudCallBeak != null) { cloudCallBeak.onSuccess(list); @@ -318,9 +430,9 @@ @Override public void onSuccess(String jsonStr) { atomicInteger.set(atomicInteger.get() + 1); - MessageListClass messageListClass1 = gson.fromJson(jsonStr, MessageListClass.class); - list.addAll(messageListClass1.getList()); - setListMessage(messageListClass.getList()); + MessageListClass newMessageListClass = gson.fromJson(jsonStr, MessageListClass.class); + list.addAll(newMessageListClass.getList()); + setListMessage(newMessageListClass.getList()); if (atomicInteger.get() == totalPage - 1) { //鏈�鍚庝竴鏉¢��鍑� if (cloudCallBeak != null) { diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java index 5c91849..2985755 100644 --- a/app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java +++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java @@ -2,12 +2,14 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; +import android.os.Build; import android.text.TextUtils; import com.google.gson.Gson; import com.google.gson.JsonObject; import com.hdl.linkpm.sdk.core.exception.HDLException; import com.hdl.photovoltaic.bean.HttpResponsePack; +import com.hdl.photovoltaic.config.AppConfigManage; import com.hdl.photovoltaic.config.UserConfigManage; import com.hdl.photovoltaic.internet.HttpClient; import com.hdl.photovoltaic.internet.api.HttpApi; @@ -646,6 +648,41 @@ }); } + + /** + * 娣诲姞鎺ㄩ�乀oken + * + * @param cloudCallBeak - + */ + public void pushAdd(CloudCallBeak<String> cloudCallBeak) { + String requestUrl = HttpApi.POST_push_add; + JsonObject json = new JsonObject(); + json.addProperty("deviceName", Build.MODEL);//璁惧鍚嶇О + json.addProperty("deviceType", "Android");//璁惧绫诲瀷 + json.addProperty("produce", AppConfigManage.isIsOnlineServer());//鏄惁鏄敓鎴愮増鏈� + json.addProperty("pushToken", UserConfigManage.getInstance().getRegistrationID());//App鐨勬帹閫乀oken锛屽湪鏋佸厜涓篟egId + json.addProperty("software", "PHOTOVOLTAIC");//杞欢鏉ユ簮 + + HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() { + @Override + public void onSuccess(String jsonStr) { + if (cloudCallBeak != null) { + cloudCallBeak.onSuccess(jsonStr); + } + + } + + @Override + public void onFailure(HDLException e) { + if (cloudCallBeak != null) { + cloudCallBeak.onFailure(e); + } + } + }); + + + } + static class HouseBeanClass { //鎬绘潯鏁� diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java index 47ba0b4..2e0010c 100644 --- a/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java +++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java @@ -1087,7 +1087,7 @@ public void onSuccess(Boolean obj) { GatewayBean gatewayBean = HDLLinkLocalGateway.getInstance().getLocalGateway(mac); if (gatewayBean == null) { - uniCallbackData(null, -100, "鏈湴鎵句笉鍒扮綉鍏�", callback); + uniCallbackData(null, -100, HDLApp.getInstance().getString(R.string.The_gateway_cannot_be_found_locally), callback); return; } @@ -1218,7 +1218,7 @@ private void sendModBus(Object data, DCUniMPJSCallback callback) { String tempData = getKeyValue("data", data); if (TextUtils.isEmpty(tempData)) { - HdlLogLogic.print("data鍐呭涓虹┖", false); + HdlLogLogic.print("data鍐呭涓虹┖--->", false); return; } ModBusBean modBusBean = new Gson().fromJson(tempData, ModBusBean.class); @@ -1229,7 +1229,7 @@ // modBusBean.setOid("0101050217BBC400"); // } if (modBusBean.getMac() == null || modBusBean.getData() == null) { - HdlLogLogic.print("鍐呭涓虹┖===oid=" + modBusBean.getMac() + " data=" + Arrays.toString(modBusBean.getData()), false); + HdlLogLogic.print("鍐呭涓虹┖--->oid--->" + modBusBean.getMac() + " data--->" + Arrays.toString(modBusBean.getData()), false); return; } @@ -1305,7 +1305,7 @@ } } catch (Exception e) { - HdlLogLogic.print("uni===缁勮uni鍙戦�佹暟鎹牸寮�===" + e.getMessage(), false); + HdlLogLogic.print("uni--->缁勮uni鍙戦�佹暟鎹牸寮�--->" + e.getMessage(), false); } diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/HomeLoginActivity.java b/app/src/main/java/com/hdl/photovoltaic/ui/HomeLoginActivity.java index c528186..01cea17 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/HomeLoginActivity.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/HomeLoginActivity.java @@ -127,6 +127,12 @@ */ private void initEvent() { + viewBinding.homeLoginMoreIv.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + HdlThreadLogic.toast(_mActivity, getString(R.string.loading_not_supported)); + } + }); //璇█閫夋嫨 viewBinding.homeLoginLanguageTv.setOnClickListener(new View.OnClickListener() { @Override @@ -265,7 +271,7 @@ if (System.currentTimeMillis() < e.getmExtra().getUnlockTime()) { long time = e.getmExtra().getUnlockTime() - System.currentTimeMillis(); int minute = Integer.parseInt(TimeUtils.getMinuteTime(time)); - HdlThreadLogic.toast(_mActivity, e.getMsg() + "鍓╀綑" + minute + "鍒嗛挓" + "(" + e.getCode() + ")"); + HdlThreadLogic.toast(_mActivity, e.getMsg() + getString(R.string.residue) + minute + getString(R.string.minute) + "(" + e.getCode() + ")"); } } } catch (Exception ee) { @@ -394,7 +400,9 @@ } String s = textView.getText().toString(); - + if (!s.contains("銆�")) { + return; + } int startIndex1 = s.indexOf("銆�"); int endIndex1 = s.indexOf("銆�") + 1; diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/MyPowerStationActivity.java b/app/src/main/java/com/hdl/photovoltaic/ui/MyPowerStationActivity.java index a83b80e..068f126 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/MyPowerStationActivity.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/MyPowerStationActivity.java @@ -12,9 +12,12 @@ import android.content.pm.PackageManager; import android.os.Bundle; import android.os.Process; +import android.os.SystemClock; import android.text.TextUtils; import android.view.View; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.hdl.linkpm.sdk.core.exception.HDLException; @@ -23,21 +26,25 @@ import com.hdl.photovoltaic.base.CustomBaseActivity; import com.hdl.photovoltaic.bean.MqttInfo; import com.hdl.photovoltaic.broadcast.NetworkChangeReceiver; +import com.hdl.photovoltaic.config.AppConfigManage; import com.hdl.photovoltaic.config.ConstantManage; import com.hdl.photovoltaic.config.UserConfigManage; import com.hdl.photovoltaic.databinding.ActivityMyPowerStationBinding; import com.hdl.photovoltaic.enums.HomepageTitleTabSwitch; import com.hdl.photovoltaic.enums.NetworkType; +import com.hdl.photovoltaic.jpush.JPushMessageInfoBean; import com.hdl.photovoltaic.listener.CloudCallBeak; import com.hdl.photovoltaic.other.HdlCommonLogic; import com.hdl.photovoltaic.other.HdlDeviceLogic; import com.hdl.photovoltaic.other.HdlLogLogic; import com.hdl.photovoltaic.other.HdlMqttLogic; import com.hdl.photovoltaic.other.HdlOtaLogic; +import com.hdl.photovoltaic.other.HdlResidenceLogic; import com.hdl.photovoltaic.other.HdlThreadLogic; import com.hdl.photovoltaic.other.HdlUniLogic; import com.hdl.photovoltaic.ui.bean.BUserInfo; import com.hdl.photovoltaic.ui.bean.DeviceRemoteInfo; +import com.hdl.photovoltaic.ui.bean.HouseIdBean; import com.hdl.photovoltaic.ui.bean.OidBean; import com.hdl.photovoltaic.uni.HDLUniMP; import com.hdl.photovoltaic.utils.AppManagerUtils; @@ -57,7 +64,11 @@ import org.greenrobot.eventbus.ThreadMode; import java.lang.reflect.Type; +import java.util.HashMap; import java.util.List; +import java.util.Objects; + +import cn.jpush.android.api.JPushInterface; /** @@ -94,12 +105,62 @@ this.initMqttClient(); //鐩戝惉缃戠粶鐘舵�佸彉鍖� this.networkMonitoring(); + //涓婁紶鏋佸厜娉ㄥ唽ID + this.pushTokens(); //鐐瑰嚮鏋佸厜閫氱煡鏍忔秷鎭繘鏉� this.clickJpushNotificationMessage(); //閫氱煡闄愭潈 this.notificationSet(); + } + + + /** + * 涓婁紶鏋佸厜娉ㄥ唽ID + */ + private void pushTokens() { + HdlThreadLogic.runSubThread(new Runnable() { + @Override + public void run() { + String registrationID = JPushInterface.getRegistrationID(_mActivity); + int addCount = 0; + while (TextUtils.isEmpty(registrationID)) { + SystemClock.sleep(1000);//1s浼戠湢 + registrationID = JPushInterface.getRegistrationID(_mActivity); + addCount++; + if (addCount > 5) { + //5s瓒呮椂 + break; + } + } + if (!TextUtils.isEmpty(registrationID)) { + UserConfigManage.getInstance().setRegistrationID(registrationID); + UserConfigManage.getInstance().Save(); + String finalRegistrationID = registrationID; + HdlResidenceLogic.getInstance().pushAdd(new CloudCallBeak<String>() { + @Override + public void onSuccess(String pushId) { + + if (!TextUtils.isEmpty(pushId)) { + UserConfigManage.getInstance().setPushId(pushId); + UserConfigManage.getInstance().Save(); + } + HdlLogLogic.print("娣诲姞鎺ㄩ�佹瀬鍏塈D--->registrationID===" + finalRegistrationID, true); + + } + + @Override + public void onFailure(HDLException e) { + HdlLogLogic.print("娣诲姞鎺ㄩ�佹瀬鍏塈D澶辫触--->registrationID===" + finalRegistrationID, true); + } + }); + + } + + + } + }); } /** @@ -183,7 +244,7 @@ } private void initView() { - viewBinding.myPowerStationBottomIl1.titleTv.setText("棣栭〉");// + viewBinding.myPowerStationBottomIl1.titleTv.setText(R.string.power_shome_page);// viewBinding.myMessageBottomIl2.titleTv.setText(R.string.message); viewBinding.myMeBottomIl3.titleTv.setText(R.string.power_station_me); this.bottomViewChangeOfStyle(); diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java b/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java index dad0918..b22812f 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java @@ -63,13 +63,17 @@ //鍙戠數鍔熺巼 String power = mContext.getString(R.string.power_station_generated_power) + kw + "kW"; holder.powerTv.setText(power); + holder.itemView.setTag(position); setTextViewStyle(holder.stateTv, houseIdBean.getPowerStationStatus()); GlideUtils.getRoundedCornersImage(mContext, houseIdBean.getPowerStationImage(), holder.homeIconIv, new RoundedCorners(4)); holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - if (noOnclickListener != null) { - noOnclickListener.onClick(holder.getAdapterPosition(), houseIdBean); + try { + if (noOnclickListener != null) { + noOnclickListener.onClick((int) holder.itemView.getTag(), houseIdBean); + } + } catch (Exception ignored) { } } }); diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/adapter/MessageAdapter.java b/app/src/main/java/com/hdl/photovoltaic/ui/adapter/MessageAdapter.java index 6ac9044..3dcd091 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/adapter/MessageAdapter.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/adapter/MessageAdapter.java @@ -43,7 +43,7 @@ MessageBean messageBean = this.mList.get(position); holder.item_content_tv.setText(messageBean.getTitle()); holder.item_home_name_tv.setText(messageBean.getHomeName()); - String date = TimeUtils.getDateTimestamp(messageBean.getCreateTime()); + String date = TimeUtils.getTimeFromTimestamp(messageBean.getCreateTime()); holder.item_time_tv.setText(date); String type = "";//FAULT:鏁呴殰,WARN:鍛婅,EVENT:浜嬩欢 Drawable drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_ffb300); @@ -54,7 +54,7 @@ type = mContext.getString(R.string.message_alarm); drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_ffb300); } else if (messageBean.getType().equals(MessageAlarmStateType.event)) { - type = "浜嬩欢"; + type =mContext.getString(R.string.event); drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_ffb300); } holder.item_estate_tv.setText(type); @@ -63,11 +63,16 @@ if (messageBean.isRead()) { holder.item_unread_message_tv.setVisibility(View.GONE); } + //鏍囪绱㈠紩 + holder.itemView.setTag(position); holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - if (noOnclickListener != null) { - noOnclickListener.onClick(holder.getAdapterPosition(), messageBean); + try { + if (noOnclickListener != null) { + noOnclickListener.onClick((int) holder.itemView.getTag(), messageBean); + } + } catch (Exception ignored) { } } }); diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/me/MeChangePasswordActivity.java b/app/src/main/java/com/hdl/photovoltaic/ui/me/MeChangePasswordActivity.java index 53cfc82..29df611 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/me/MeChangePasswordActivity.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/me/MeChangePasswordActivity.java @@ -97,7 +97,7 @@ // 浜屾纭鎻愮ず妗� ConfirmationCancelDialog dialog = new ConfirmationCancelDialog(_mActivity); dialog.setTitle(getString(R.string.loading_title_tip)); - dialog.setContent("瀵嗙爜淇敼鎴愬姛,灏嗛噸鏂扮櫥褰�."); + dialog.setContent(_mActivity.getString(R.string.home_password_changed_successfully_log_in)); dialog.show(); dialog.setYesOnclickListener(new ConfirmationCancelDialog.onYesOnclickListener() { @Override @@ -211,7 +211,7 @@ return false; } if (oldPsw.equals(newPsw)) { - HdlThreadLogic.tipFlashingBox(_mActivity, true, "鍘熷瘑鐮佸拰鏂板瘑鐮佷笉鑳戒竴鏍�.", -1); + HdlThreadLogic.tipFlashingBox(_mActivity, true, getString(R.string.home_old_password_not_new_password), -1); return false; } return true; diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/message/MessageFragment.java b/app/src/main/java/com/hdl/photovoltaic/ui/message/MessageFragment.java index 026dfa0..81c37bc 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/message/MessageFragment.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/message/MessageFragment.java @@ -15,8 +15,10 @@ import com.hdl.photovoltaic.databinding.FragmentMessageBinding; import com.hdl.photovoltaic.enums.HomepageTitleTabSwitch; import com.hdl.photovoltaic.enums.MessageFunctionTabSwitch; +import com.hdl.photovoltaic.enums.MessageStateType; import com.hdl.photovoltaic.other.HdlCommonLogic; import com.hdl.photovoltaic.other.HdlLogLogic; +import com.hdl.photovoltaic.other.HdlMessageLogic; import com.hdl.photovoltaic.ui.bean.BUserInfo; import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus; @@ -224,6 +226,14 @@ EventBus.getDefault().removeStickyEvent(eventBus); } + } else if (eventBus.getTopic().equals(ConstantManage.message_count)) { + if (eventBus.getType().equals(MessageStateType.untreated)) { + String s = getText(R.string.message_nascent) + "(" + HdlMessageLogic.getInstance().getNascentMessageMemoryList().size() + ")"; + viewBinding.messageTabNascentTitleTv.setText(s); + } else if (eventBus.getType().equals(MessageStateType.processed)) { + String s = getText(R.string.message_recover) + "(" + HdlMessageLogic.getInstance().getRecoverMessageMemoryList().size() + ")"; + viewBinding.messageTabRecoverTitleTv.setText(s); + } } } diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/message/MessageInfoActivity.java b/app/src/main/java/com/hdl/photovoltaic/ui/message/MessageInfoActivity.java index b17d003..c9d4164 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/message/MessageInfoActivity.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/message/MessageInfoActivity.java @@ -77,7 +77,7 @@ viewBinding.messageInfoAlarmDeviceIn.rightContentTv.setText(mMessageBean.getDeviceDesc()); viewBinding.messageInfoAlarmRangeIn.rightContentTv.setText(mMessageBean.getEffectScopeDesc()); viewBinding.messageInfoPowerStationLocationIn.rightContentTv.setText(mMessageBean.getLocationAddress()); - String date = TimeUtils.getDateTimestamp(mMessageBean.getCreateTime()); + String date = TimeUtils.getTimeFromTimestamp(mMessageBean.getCreateTime()); viewBinding.messageInfoAlarmTimeIn.rightContentTv.setText(date); String type = "";//FAULT:鏁呴殰,WARN:鍛婅,EVENT:浜嬩欢 @@ -89,7 +89,7 @@ type = _mActivity.getString(R.string.message_alarm); drawable = AppCompatResources.getDrawable(_mActivity, R.drawable.alarm_ffb300); } else if (mMessageBean.getType().equals(MessageAlarmStateType.event)) { - type = "浜嬩欢"; + type = _mActivity.getString(R.string.event); drawable = AppCompatResources.getDrawable(_mActivity, R.drawable.alarm_ffb300); } viewBinding.messageInfoAlarmStateTv.setText(type); @@ -116,11 +116,12 @@ viewBinding.toolbarTopIn.topBackBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + if (mMessageBean == null) { + return; + } //鎭㈠杩涙潵鍙槸鏌ョ湅鐨� if (mMessageBean.getStatus().equals(MessageStateType.untreated)) { - mMessageBean.setRead(true); - mMessageBean.setStatus(MessageStateType.untreated); - HdlMessageLogic.getInstance().setListMessage(mMessageBean); + HdlMessageLogic.getInstance().setMessageState(mMessageBean.getMsgId(), true, MessageStateType.untreated); BaseEventBus baseEventBus = new BaseEventBus(); baseEventBus.setTopic(ConstantManage.message_function_push_post); baseEventBus.setType(MessageStateType.untreated); @@ -133,11 +134,12 @@ viewBinding.messageInfoBackTv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + if (mMessageBean == null) { + return; + } //鎭㈠杩涙潵鍙槸鏌ョ湅鐨� if (mMessageBean.getStatus().equals(MessageStateType.untreated)) { - mMessageBean.setRead(true); - mMessageBean.setStatus(MessageStateType.untreated); - HdlMessageLogic.getInstance().setListMessage(mMessageBean); + HdlMessageLogic.getInstance().setMessageState(mMessageBean.getMsgId(), true, MessageStateType.untreated); BaseEventBus baseEventBus = new BaseEventBus(); baseEventBus.setTopic(ConstantManage.message_function_push_post); baseEventBus.setType(MessageStateType.untreated); @@ -153,16 +155,23 @@ HdlMessageLogic.getInstance().getMessageMessageSolve(mMsgId, new CloudCallBeak<Boolean>() { @Override public void onSuccess(Boolean obj) { + if (mMessageBean == null) { + return; + } //鎭㈠杩涙潵鍙槸鏌ョ湅鐨� if (mMessageBean.getStatus().equals(MessageStateType.untreated)) { - //閲嶇疆鍙橀噺 - mMessageBean.setRead(true); - mMessageBean.setStatus(MessageStateType.processed); - HdlMessageLogic.getInstance().setListMessage(mMessageBean); - BaseEventBus baseEventBus = new BaseEventBus(); - baseEventBus.setTopic(ConstantManage.message_function_push_post); - baseEventBus.setType(MessageStateType.processed); - EventBus.getDefault().post(baseEventBus); + HdlMessageLogic.getInstance().setMessageState(mMessageBean.getMsgId(), true, MessageStateType.processed); + + //宸插鐞嗚鏇存柊鏁版嵁 + BaseEventBus processedBus = new BaseEventBus(); + processedBus.setTopic(ConstantManage.message_function_push_post); + processedBus.setType(MessageStateType.processed); + EventBus.getDefault().post(processedBus); + //鏈鐞嗚鏇存柊鏁版嵁 + BaseEventBus untreatedBus = new BaseEventBus(); + untreatedBus.setTopic(ConstantManage.message_function_push_post); + untreatedBus.setType(MessageStateType.untreated); + EventBus.getDefault().post(untreatedBus); } finish(); diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/message/NascentMessageFragment.java b/app/src/main/java/com/hdl/photovoltaic/ui/message/NascentMessageFragment.java index b86779f..3388a68 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/message/NascentMessageFragment.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/message/NascentMessageFragment.java @@ -18,6 +18,7 @@ import com.hdl.photovoltaic.enums.MessageFunctionTabSwitch; import com.hdl.photovoltaic.enums.MessageStateType; import com.hdl.photovoltaic.listener.CloudCallBeak; +import com.hdl.photovoltaic.other.HdlLogLogic; import com.hdl.photovoltaic.other.HdlMessageLogic; import com.hdl.photovoltaic.other.HdlThreadLogic; import com.hdl.photovoltaic.ui.adapter.MessageAdapter; @@ -123,6 +124,15 @@ this.messageNascentAdapter.setList(mList); this.messageNascentAdapter.notifyDataSetChanged(); } + + if (mList.size() > 0) { + BaseEventBus baseEventBus = new BaseEventBus(); + baseEventBus.setTopic(ConstantManage.message_count); + baseEventBus.setType(MessageStateType.untreated); + baseEventBus.setData(mList.size()); + EventBus.getDefault().post(baseEventBus); + } + } @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/message/RecoverMessageFragment.java b/app/src/main/java/com/hdl/photovoltaic/ui/message/RecoverMessageFragment.java index 04659b7..08fa6d6 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/message/RecoverMessageFragment.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/message/RecoverMessageFragment.java @@ -103,6 +103,14 @@ this.messageRecoverAdapter.setList(mList); this.messageRecoverAdapter.notifyDataSetChanged(); } + + if (mList.size() > 0) { + BaseEventBus baseEventBus = new BaseEventBus(); + baseEventBus.setTopic(ConstantManage.message_count); + baseEventBus.setType(MessageStateType.processed); + baseEventBus.setData(mList.size()); + EventBus.getDefault().post(baseEventBus); + } } @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) @@ -124,6 +132,7 @@ //娑堟伅璇︽儏鍥炶皟 initData(); updateListData(); + } } } diff --git a/app/src/main/java/com/hdl/photovoltaic/utils/TimeUtils.java b/app/src/main/java/com/hdl/photovoltaic/utils/TimeUtils.java index 89aa006..fec90e3 100644 --- a/app/src/main/java/com/hdl/photovoltaic/utils/TimeUtils.java +++ b/app/src/main/java/com/hdl/photovoltaic/utils/TimeUtils.java @@ -37,7 +37,7 @@ */ public static String getDateTimestamp(long timestamp) { try { - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd ", Locale.ENGLISH); Date date = new Date(timestamp); return dateFormat.format(date); } catch (Exception e) { diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index 0ac2776..6bf1ffe 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -1,6 +1,6 @@ <resources> <!-- <string name="app_name">PhotovoltaicDebug</string>--> - <string name="app_name">鏅烘収鑳芥簮</string> + <string name="app_name">Smart energy</string> <string name="title_activity_home_login">HomeLoginActivity</string> <!-- Strings used for fragments for navigation --> <string name="first_fragment_label">First Fragment</string> @@ -13,184 +13,195 @@ <!--鐧诲綍妯″潡--> <string name="home_login_chinese">绠�浣撲腑鏂�</string> - <string name="home_login_hdl_stored_energy">HDL鍏変紡鍌ㄨ兘</string> - <string name="home_login_an_installer">鎴戞槸瀹夎鍟�</string> - <string name="home_login__input_phone_email">璇疯緭鍏ユ墜鏈哄彿/閭鍙�</string> - <string name="home_login_input_phone">璇疯緭鍏ユ墜鏈哄彿</string> - <string name="home_login_email_address">閭鍙�</string> - <string name="home_login_input_psw">璇疯緭鍏ュ瘑鐮�</string> - <string name="home_login_register">娉ㄥ唽</string> - <string name="home_login_forget_password">蹇樿瀵嗙爜</string> - <string name="home_login_change_password">淇敼瀵嗙爜</string> - <string name="home_login_logoin">鐧诲綍</string> - <string name="home_login_be_logging_in">鐧诲綍涓��</string> - <string name="home_login_power_station">浣撻獙鐢电珯</string> - <string name="home_login_consent_service_agreement">鍚屾剰銆婃湇鍔″崗璁�嬪拰銆婄敤鎴蜂俊鎭繚鎶よ瀹氥��</string> - <string name="home_login_error_account_null">璐﹀彿涓嶈兘涓虹┖.</string> - <string name="home_login_error_password_null">瀵嗙爜涓嶈兘涓虹┖.</string> - <string name="home_login_error_account_or_password">璐﹀彿鎴栬�呭瘑鐮佷笉瀵�,璇烽噸鏂拌緭鍏�.</string> - <string name="home_login_error_6_16_str">瀵嗙爜涓嶇鍚堟渶浣庡畨鍏ㄨ姹�,鏈�灏�6鈥�16涓瓧绗�.</string> - <string name="home_login_error_password_6">瀵嗙爜涓嶈兘灏忎簬6涓瓧绗�.</string> - <string name="home_login_error_password_16">瀵嗙爜涓嶈兘澶т簬16涓瓧绗�.</string> - <string name="home_login_input_6_16">璇疯緭鍏�6鈥�16浣嶇殑瀵嗙爜</string> - <string name="home_login_confirm_psw">璇峰啀娆$‘璁ゅ瘑鐮�</string> - <string name="home_login_phone">鎵嬫満鍙�</string> - <string name="home_login_email">閭</string> - <string name="home_login_input_mail">璇疯緭鍏ラ偖绠�</string> - <string name="home_login_national_region">璇烽�夋嫨鍥藉/鍖哄煙</string> - <string name="home_login_verification_code">鑾峰彇楠岃瘉鐮�</string> - <string name="home_login_input_verification_code">璇疯緭鍏ラ獙璇佺爜</string> - <string name="home_login_confirm_reset">纭閲嶇疆</string> - <string name="home_login_null_verification_code">楠岃瘉鐮佷笉鑳戒负绌�.</string> - <string name="home_login_phone_null">鎵嬫満鍙蜂笉鑳戒负绌�.</string> - <string name="home_login_mail_null">閭涓嶈兘涓虹┖.</string> - <string name="home_login_psw_unlikeliness">涓ゆ杈撳叆瀵嗙爜涓嶄竴鏍�.</string> - <string name="home_login_psw_verification_repeater">鍚庨噸鍙�</string> - <string name="home_login_verification_regain">閲嶆柊鑾峰彇</string> - <string name="home_login_pws_reset_succeeded">瀵嗙爜閲嶇疆鎴愬姛</string> - <string name="home_login_back_login">杩斿洖鐧诲綍</string> - <string name="home_login_send_mail">鍙戦�佽嚦閭</string> - <string name="home_login_already_exists">璇ョ敤鎴峰凡瀛樺湪锛屽彲鐩存帴鐧诲綍</string> - <string name="home_login_old_pws">鍘熷瘑鐮�</string> - <string name="home_login_new_pws">鏂板瘑鐮�</string> - <string name="home_login_affirm_psw">纭瀵嗙爜</string> - <string name="home_login_affirm">纭</string> - <string name="home_login_least6">瀵嗙爜鑷冲皯6浣嶅瓧绗�</string> - <string name="home_login_input_old_pws">璇疯緭鍏ュ師瀵嗙爜</string> - <string name="home_login_input_new_pws">璇疯緭鍏ユ柊瀵嗙爜</string> - <string name="home_login_input_affirm_psw">璇峰啀娆¤緭鍏ユ柊瀵嗙爜</string> - <string name="home_login_input_unlike_psw">鏂板瘑鐮佸拰纭瀵嗙爜涓嶄竴鑷�.</string> - <string name="home_login_change_name_succeed">淇敼澶囨敞鎴愬姛.</string> - <string name="verification">楠岃瘉鐮�</string> - <string name="home_phone_number">鍖哄彿</string> - <string name="home_chinese_mainland">涓浗澶ч檰</string> + <string name="home_login_hdl_stored_energy">HDL Solar Energy</string> + <string name="home_login_an_installer">I am an installer</string> + <string name="home_login__input_phone_email">Please enter your phone number/email address</string> + <string name="home_login_input_phone">Please enter your phone number</string> + <string name="home_login_email_address">Email address</string> + <string name="home_login_input_psw">Please enter your password</string> + <string name="home_login_register"> Register</string> + <string name="home_login_forget_password">Forgot password</string> + <string name="home_login_change_password">Change password</string> + <string name="home_login_logoin">Log in</string> + <string name="home_login_be_logging_in">Logging in鈥�</string> + <string name="home_login_power_station">Guest mode</string> + <string name="home_login_consent_service_agreement">Agree to the 銆奡ervice Agreement銆� and 銆奤ser Information Protection Regulations銆�</string> + <string name="home_login_error_account_null">Account cannot be empty.</string> + <string name="home_login_error_password_null">Password cannot be empty.</string> + <string name="home_login_error_account_or_password">Incorrect account or password, please re-enter.</string> + <string name="home_login_error_6_16_str">Password does not meet minimum security requirements, must be 6-16 characters.</string> + <string name="home_login_error_password_6">Password cannot be less than 6 characters.</string> + <string name="home_login_error_password_16">Password cannot be more than 16 characters.</string> + <string name="home_login_input_6_16">Please enter a 6-16 character password</string> + <string name="home_login_confirm_psw">Please confirm your password again</string> + <string name="home_login_phone">Phone number</string> + <string name="home_login_email">Email</string> + <string name="home_login_input_mail">Please enter your email address</string> + <string name="home_login_national_region">Please select country/region</string> + <string name="home_login_verification_code">Get verification code</string> + <string name="home_login_input_verification_code">Please enter verification code</string> + <string name="home_login_confirm_reset">Confirm reset</string> + <string name="home_login_null_verification_code">Verification code cannot be empty.</string> + <string name="home_login_phone_null">Phone number cannot be empty.</string> + <string name="home_login_mail_null">Email cannot be empty.</string> + <string name="home_login_psw_unlikeliness">Passwords do not match.</string> + <string name="home_login_psw_verification_repeater">Resend later</string> + <string name="home_login_verification_regain">Reacquire</string> + <string name="home_login_pws_reset_succeeded"> Password reset successful</string> + <string name="home_login_back_login">Back to login</string> + <string name="home_login_send_mail">Send to email</string> + <string name="home_login_already_exists">This user already exists, you can log in directly</string> + <string name="home_login_old_pws">Current password</string> + <string name="home_login_new_pws">New password</string> + <string name="home_login_affirm_psw">Confirm password</string> + <string name="home_login_affirm">Confirm</string> + <string name="home_login_least6">Password must be at least 6 characters</string> + <string name="home_login_input_old_pws">Please enter your current password</string> + <string name="home_login_input_new_pws">Please enter your new password</string> + <string name="home_login_input_affirm_psw">Please enter your new password again</string> + <string name="home_login_input_unlike_psw">New password and confirm password do not match.</string> + <string name="home_login_change_name_succeed">Remark successfully updated.</string> + <string name="verification">Verification code</string> + <string name="home_phone_number">Area code</string> + <string name="home_chinese_mainland">Mainland China</string> + <string name="home_password_changed_successfully_log_in">The password has been successfully changed. Please log in again.</string> + <string name="home_old_password_not_new_password">The original password and the new password should not be identical.</string> <!--鎴戠殑鐢电珯--> - <string name="power_station">鐢电珯</string> - <string name="power_station_me">鎴戠殑</string> - <string name="my_power_station">鎴戠殑鐢电珯</string> - <string name="power_station_generated_power">鍙戠數鍔熺巼:</string> - <string name="power_station_Power_generation_today">浠婃棩鍙戠數</string> - <string name="power_station_creation_time">鍒涘缓鏃堕棿</string> - <string name="my_power_station_installed_capacity">瑁呮満瀹归噺:</string> - <string name="my_power_station_connecting">杩炴帴涓�</string> - <string name="my_power_station_off_line">绂荤嚎</string> - <string name="my_power_station_malfunction">鏁呴殰</string> - <string name="my_power_station_operation">杩愯</string> - <string name="my_power_station_await">寰呮満</string> + <string name="power_shome_page">Homepage</string> + <string name="power_station">Power station</string> + <string name="power_station_me">Mine</string> + <string name="my_power_station">My power station</string> + <string name="power_station_generated_power">Power generation:</string> + <string name="power_station_Power_generation_today">Today power generation</string> + <string name="power_station_creation_time">Established at</string> + <string name="my_power_station_installed_capacity">Installed capacity:</string> + <string name="my_power_station_connecting">Connecting</string> + <string name="my_power_station_off_line">Offline</string> + <string name="my_power_station_malfunction">Malfunction</string> + <string name="my_power_station_operation">Operating</string> + <string name="my_power_station_await">Standby</string> <!--璁惧--> - <string name="device_manual_connection">鎵嬪姩杩炴帴</string> - <string name="device_loading">鍔犺浇涓��</string> + <string name="device_manual_connection">Manual connect</string> + <string name="device_loading">Loading鈥�</string> <!--鍛婅娑堟伅--> - <string name="message">娑堟伅</string> - <string name="message_all">鍏ㄩ儴</string> - <string name="message_nascent">鍙戠敓涓�</string> - <string name="message_recover">宸叉仮澶�</string> - <string name="message_alarm_info">鎶ヨ璇︽儏</string> - <string name="message_alarm">鍛婅</string> - <string name="message_alarm_malfunction">鏁呴殰</string> - <string name="messagealarm_details_content">鎶ヨ鍐呭</string> - <string name="messagealarm_details_device">鎶ヨ璁惧</string> - <string name="message_alarm_detailsaffect_region">褰卞搷鑼冨洿</string> - <string name="message_alarm_detailspower_station_location">鐢电珯浣嶇疆</string> - <string name="message_alarm_details_time">鎶ヨ鏃堕棿</string> - <string name="message_alarm_details_back">杩斿洖</string> - <string name="message_alarm_details_resolved">宸茶В鍐�</string> + <string name="message">Message</string> + <string name="message_all">All</string> + <string name="message_nascent">Occurring</string> + <string name="message_recover">Restored</string> + <string name="message_alarm_info">Alarm details</string> + <string name="message_alarm">Alarm</string> + <string name="message_alarm_malfunction">Malfunction</string> + <string name="messagealarm_details_content">Alarm content</string> + <string name="messagealarm_details_device">Alarm device</string> + <string name="message_alarm_detailsaffect_region">Impact area</string> + <string name="message_alarm_detailspower_station_location">Power station location</string> + <string name="message_alarm_details_time">Alarm time</string> + <string name="message_alarm_details_back">Back</string> + <string name="message_alarm_details_resolved">Solved</string> <!--鎴戠殑--> - <string name="me">鎴戠殑</string> - <string name="me_set">璁剧疆</string> - <string name="me_regard">鍏充簬</string> - <string name="set_account">璐﹀彿瀹夊叏</string> - <string name="set_nickname">鏄电О</string> - <string name="set_close_account">娉ㄩ攢璐﹀彿</string> - <string name="set_message_setting">娑堟伅璁剧疆</string> - <string name="set_push_notification">鎺ㄩ�佹秷鎭�</string> - <string name="set_alarm_message">鎶ヨ娑堟伅</string> - <string name="set_general_setting">閫氱敤璁剧疆</string> - <string name="set_multilingual">澶氳瑷�</string> - <string name="set_data_centre">鏁版嵁涓績</string> - <string name="set_system_rights_managemen">绯荤粺鏉冮檺绠$悊</string> - <string name="set_3_msg_sharing">绗笁鏂逛俊鎭叡浜竻鍗�</string> - <string name="set_account_security">璐﹀彿涓庡畨鍏�</string> - <string name="set_temperature_unit">娓╁害鍗曚綅</string> - <string name="set_logout">閫�鍑虹櫥褰�</string> - <string name="set_privacy">闅愮璁剧疆</string> - <string name="set_nickname_modification">鏄电О淇敼</string> - <string name="set_user_management">鐢ㄦ埛绠$悊</string> - <string name="set_message_center">娑堟伅涓績</string> - <string name="me_personal_data">涓汉璧勬枡</string> - <string name="me_personal_data_portrait">澶村儚</string> - <string name="me_personal_data_user_name">鐢ㄦ埛鍚�</string> - <string name="me_personal_data_role">瑙掕壊</string> - <string name="me_personal_data_super_admin">瓒呯骇绠$悊鍛�</string> - <string name="me_personal_data_photograph">鎷嶇収</string> - <string name="me_personal_data_select_album">浠庣浉鍐屼腑閫夋嫨</string> - <string name="set_email_address">鐢靛瓙閭</string> - <string name="set_not_bind">鏈粦瀹�</string> - <string name="set_language_choice">璇█閫夋嫨</string> - <string name="set_c">鈩�(鎽勬皬搴�)</string> - <string name="set_f">鈩�(鍗庢皬搴�)</string> - <string name="set_change_bind_phone_number">淇敼鎵嬫満鍙风爜</string> - <string name="set_change_bind_mail">淇敼閭鍦板潃</string> - <string name="set_bind_phone_succeed">缁戝畾鎵嬫満鍙锋垚鍔�.</string> - <string name="set_bind_mail_succeed">缁戝畾閭鎴愬姛.</string> + + <string name="me">Mine</string> + <string name="me_set">Settings</string> + <string name="me_regard">About</string> + <string name="set_account">Account Security</string> + <string name="set_nickname">Nickname</string> + <string name="set_close_account">Logout Account</string> + <string name="set_message_setting">Message Settings</string> + <string name="set_push_notification">Push Notifications</string> + <string name="set_alarm_message">Alert Messages</string> + <string name="set_general_setting">General Settings</string> + <string name="set_multilingual">Multi-language</string> + <string name="set_data_centre">Data Center</string> + <string name="set_system_rights_managemen">System Permissions Management</string> + <string name="set_3_msg_sharing">Third-Party Information Sharing List</string> + <string name="set_account_security">Account and Security</string> + <string name="set_temperature_unit">Temperature Unit</string> + <string name="set_logout">Log Out</string> + <string name="set_privacy">Privacy Settings</string> + <string name="set_nickname_modification">Nickname modification</string> + <string name="set_user_management">User management</string> + <string name="set_message_center">Message center</string> + <string name="me_personal_data">Personal information</string> + <string name="me_personal_data_portrait">profile photo</string> + <string name="me_personal_data_user_name">Username</string> + <string name="me_personal_data_role">Role</string> + <string name="me_personal_data_super_admin">Super administrator</string> + <string name="me_personal_data_photograph">Take a photo</string> + <string name="me_personal_data_select_album">Choose from album</string> + <string name="set_email_address">Email</string> + <string name="set_not_bind">Not bound</string> + <string name="set_language_choice">Language selection</string> + <string name="set_c">掳C (Celsius)</string> + <string name="set_f">F (Fahrenheit)</string> + <string name="set_change_bind_phone_number">Modify phone number</string> + <string name="set_change_bind_mail">Modify email address</string> + <string name="set_bind_phone_succeed">Phone number bound successfully.</string> + <string name="set_bind_mail_succeed">Email bound successfully.</string> <!--app鏇存柊--> - <string name="app_version_number">鐗堟湰鍙�</string> - <string name="app_scan_code_download">鎵爜涓嬭浇鏅烘収鑳芥簮APP</string> - <string name="app_version_upgrade">鐗堟湰鏇存柊</string> - <string name="app_new_version">宸茬粡鏄渶鏂扮増鏈�</string> - <string name="app_service_agreement">鏈嶅姟鍗忚</string> - <string name="app_privacy_policy">闅愮鏀跨瓥</string> - <string name="app_update_now">绔嬪嵆鏇存柊</string> - <string name="app_cancel_update">鍙栨秷鏇存柊</string> - <string name="app_discover_new_version">鍙戠幇鏂扮増鏈�</string> - <string name="app_be_updating">姝e湪鏇存柊</string> - <string name="app_stop_current_download">鏄惁鍋滄褰撳墠涓嬭浇锛�</string> - <string name="app_version">鐗堟湰</string> - <string name="app_package_size">澶у皬</string> - <string name="app_update_content">涓轰簡姝e父鍗囩骇娌充笢APP锛岃鐐瑰嚮璁剧疆鎸夐挳锛屽厑璁稿畨瑁呮湭鐭ユ潵婧愬簲鐢紝鏈姛鑳藉彧闄愮敤浜庢渤涓淎PP鐗堟湰鍗囩骇锛孉ndroid 11鐗堟湰鍙婁互涓婇渶瑕佸湪鎺堟潈涔嬪悗閲嶆柊涓嬭浇瀹夎銆�</string> - <string name="app_update_fail">鎺堟潈澶辫触锛屾棤娉曞畨瑁呭簲鐢�</string> + <string name="app_version_number">Version number</string> + <string name="app_scan_code_download">Scan to download the Smart Energy App</string> + <string name="app_version_upgrade">Version update</string> + <string name="app_new_version">Already the latest version</string> + <string name="app_service_agreement">Service agreement</string> + <string name="app_privacy_policy">Privacy policy</string> + <string name="app_update_now">Update now</string> + <string name="app_cancel_update">Cancel update</string> + <string name="app_discover_new_version">New version found</string> + <string name="app_be_updating">Updating</string> + <string name="app_stop_current_download">Stop current download?</string> + <string name="app_version">Version</string> + <string name="app_package_size">Size</string> + <string name="app_update_content">In order to upgrade the HDL APP normally, please click the Settings button to allow the installation of applications from unknown sources. This function is only available for APP upgrades. Android versions 11 and above need to be re-downloaded and installed after authorization.</string> + <string name="app_update_fail">Authorization failed, unable to install the application</string> <!--ota--> - <string name="ota_binding_cloud_upgrade_fails">閫嗗彉鍣ㄦ病缁戝畾杩�,鍗囩骇澶辫触.</string> - <string name="ota_not_cloud_upgrade_fails">閫嗗彉鍣ㄦ病杩炰笂浜�,鍗囩骇澶辫触.</string> + <string name="ota_binding_cloud_upgrade_fails">The inverter has not been bound before, upgrade failed.</string> + <string name="ota_not_cloud_upgrade_fails">The inverter is not connected to the cloud, upgrade failed.</string> <!--uin--> - <string name="uni_open_error">椤甸潰鍒濆鍖栦腑 璇风瓑寰�5绉掑啀鐐瑰嚮</string> + <string name="uni_open_error">Page initializing, please wait 5 seconds before clicking</string> <!--寮规--> - <string name="loading_cancel">鍙栨秷</string> - <string name="loading_affirm">纭</string> - <string name="loading_agree">鍚屾剰</string> - <string name="loading_on_agree">涓嶅悓鎰�</string> - <string name="loading_privacy">闅愮鏉冩斂绛栧強鏈嶅姟鏉℃</string> - <string name="loading_privacy_server">涓轰簡鏇村ソ鐨勪繚闅滄偍鐨勫悎娉曟潈鐩婏紝璇锋偍闃呰骞跺悓鎰忎互涓嬪崗璁�婇殣绉佹潈鏀跨瓥銆嬪拰銆婃湇鍔℃潯娆俱��</string> - <string name="kill_app">鍐嶆寜涓�娆¢��鍑哄簲鐢�</string> - <string name="loading_not_supported">鎶辨瓑,鏆備笉鏀寔.</string> - <string name="loading_title_tip">鎻愮ず</string> - <string name="loading_app_restart">纭鍚嶢pp灏嗕細閲嶆柊鍚姩.</string> - <string name="loading_log_out">纭閫�鍑虹櫥褰�?</string> + <string name="loading_cancel">Cancel</string> + <string name="loading_affirm">Confirm</string> + <string name="loading_agree">Agree</string> + <string name="loading_on_agree">Disagree</string> + <string name="loading_privacy">Privacy policy and terms of service</string> + <string name="loading_privacy_server">To better protect your legitimate rights and interests, please read and agree to the following agreements: 銆奝rivacy Policy銆� and 銆奣erms of Service銆�.</string> + <string name="kill_app">Press again to exit the application</string> + <string name="loading_not_supported">Sorry, not supported at the moment.</string> + <string name="loading_title_tip">Prompt</string> + <string name="loading_app_restart">Confirm to restart the App.</string> + <string name="loading_log_out">Confirm logout?</string> <!-- 鏉冮檺 --> - <string name="camera_album_file_create_fial">鏂囦欢鍒涘缓澶辫触</string> - <string name="camera_album_file_save_fial">淇濆瓨璺緞寮傚父锛岃閲嶈瘯</string> + <string name="camera_album_file_create_fial">File creation failed</string> + <string name="camera_album_file_save_fial">Save path abnormal, please retry</string> <!-- 鏉冮檺 --> <!-- 鍥剧墖涓婁紶 --> - <string name="camera_album_file_get_fial">鍥剧墖鑾峰彇澶辫触</string> - <string name="camera_album_system_fial">绯荤粺澶勭悊鍥剧墖澶辫触锛岃閲嶈瘯</string> - <string name="apk_update_content">涓轰簡姝e父鍗囩骇娌充笢APP锛岃鐐瑰嚮璁剧疆鎸夐挳锛屽厑璁稿畨瑁呮湭鐭ユ潵婧愬簲鐢紝鏈姛鑳藉彧闄愮敤浜庢渤涓淎PP鐗堟湰鍗囩骇锛孉ndroid 11鐗堟湰鍙婁互涓婇渶瑕佸湪鎺堟潈涔嬪悗閲嶆柊涓嬭浇瀹夎銆�</string> - <string name="apk_update_sure">璁剧疆</string> - <string name="permission_open">璇峰埌璁剧疆涓墦寮�鏉冮檺</string> + <string name="camera_album_file_get_fial">Failed to retrieve image</string> + <string name="camera_album_system_fial">System failed to process image, please retry</string> + <string name="apk_update_content">In order to upgrade the HDL APP normally, please click the Settings button to allow the installation of applications from unknown sources. This function is only available for APP upgrades. Android versions 11 and above need to be re-downloaded and installed after authorization.</string> + <string name="apk_update_sure">Settings</string> + <string name="permission_open">Please authorize permission in settings</string> + + + <string name="please_go_set_permissions">Please set permissions.</string> + <string name="residue"> Remaining time:</string> + <string name="minute">minutes</string> + <string name="event"> Event</string> + <string name="The_gateway_cannot_be_found_locally">Unable to find gateway under local network</string> </resources> \ No newline at end of file diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 0ac2776..98d6c1d 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -64,9 +64,12 @@ <string name="verification">楠岃瘉鐮�</string> <string name="home_phone_number">鍖哄彿</string> <string name="home_chinese_mainland">涓浗澶ч檰</string> + <string name="home_password_changed_successfully_log_in">瀵嗙爜淇敼鎴愬姛,灏嗛噸鏂扮櫥褰�.</string> + <string name="home_old_password_not_new_password">鍘熷瘑鐮佸拰鏂板瘑鐮佷笉鑳戒竴鏍�.</string> <!--鎴戠殑鐢电珯--> + <string name="power_shome_page">棣栭〉</string> <string name="power_station">鐢电珯</string> <string name="power_station_me">鎴戠殑</string> <string name="my_power_station">鎴戠殑鐢电珯</string> @@ -192,5 +195,11 @@ <string name="apk_update_sure">璁剧疆</string> <string name="permission_open">璇峰埌璁剧疆涓墦寮�鏉冮檺</string> + <string name="please_go_set_permissions">璇峰墠寰�璁剧疆鏉冮檺</string> + <string name="residue">鍓╀綑</string> + <string name="minute">鍒嗛挓</string> + <string name="event">浜嬩欢</string> + <string name="The_gateway_cannot_be_found_locally">鏈湴鎵句笉鍒扮綉鍏�</string> + </resources> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0ac2776..98d6c1d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -64,9 +64,12 @@ <string name="verification">楠岃瘉鐮�</string> <string name="home_phone_number">鍖哄彿</string> <string name="home_chinese_mainland">涓浗澶ч檰</string> + <string name="home_password_changed_successfully_log_in">瀵嗙爜淇敼鎴愬姛,灏嗛噸鏂扮櫥褰�.</string> + <string name="home_old_password_not_new_password">鍘熷瘑鐮佸拰鏂板瘑鐮佷笉鑳戒竴鏍�.</string> <!--鎴戠殑鐢电珯--> + <string name="power_shome_page">棣栭〉</string> <string name="power_station">鐢电珯</string> <string name="power_station_me">鎴戠殑</string> <string name="my_power_station">鎴戠殑鐢电珯</string> @@ -192,5 +195,11 @@ <string name="apk_update_sure">璁剧疆</string> <string name="permission_open">璇峰埌璁剧疆涓墦寮�鏉冮檺</string> + <string name="please_go_set_permissions">璇峰墠寰�璁剧疆鏉冮檺</string> + <string name="residue">鍓╀綑</string> + <string name="minute">鍒嗛挓</string> + <string name="event">浜嬩欢</string> + <string name="The_gateway_cannot_be_found_locally">鏈湴鎵句笉鍒扮綉鍏�</string> + </resources> \ No newline at end of file -- Gitblit v1.8.0