diff --git a/common/src/main/java/com/yunbao/common/bean/LiveRoomVoteModel.java b/common/src/main/java/com/yunbao/common/bean/LiveRoomVoteModel.java index c9de60a77..123ea368b 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveRoomVoteModel.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveRoomVoteModel.java @@ -1,8 +1,8 @@ package com.yunbao.common.bean; -import com.alibaba.fastjson.annotation.JSONField; import com.google.gson.annotations.SerializedName; import com.yunbao.common.utils.StringUtil; +import com.yunbao.common.utils.WordUtil; import java.util.List; @@ -36,8 +36,10 @@ public class LiveRoomVoteModel extends BaseModel { private String answer1; @SerializedName("option_content_second") private String answer2; - @SerializedName("result") - private String result; + @SerializedName("result_zh") + private String resultZh; + @SerializedName("result_en") + private String resultEn; @SerializedName("option_text") private String optionText; @SerializedName("option_content_key") @@ -126,11 +128,23 @@ public class LiveRoomVoteModel extends BaseModel { } public String getResult() { - return result; + return WordUtil.isZh() ? resultZh : resultEn; } - public void setResult(String result) { - this.result = result; + public String getResultZh() { + return resultZh; + } + + public void setResultZh(String resultZh) { + this.resultZh = resultZh; + } + + public String getResultEn() { + return resultEn; + } + + public void setResultEn(String resultEn) { + this.resultEn = resultEn; } public String getOptionText() { @@ -153,7 +167,8 @@ public class LiveRoomVoteModel extends BaseModel { ", userIds=" + userIds + ", answer1='" + answer1 + '\'' + ", answer2='" + answer2 + '\'' + - ", result='" + result + '\'' + + ", resultZh='" + resultZh + '\'' + + ", resultEn='" + resultEn + '\'' + ", optionText='" + optionText + '\'' + ", vote='" + vote + '\'' + ", liveUid='" + liveUid + '\'' + diff --git a/common/src/main/java/com/yunbao/common/utils/WordUtil.java b/common/src/main/java/com/yunbao/common/utils/WordUtil.java index 41c0c83ff..f3725bef9 100644 --- a/common/src/main/java/com/yunbao/common/utils/WordUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/WordUtil.java @@ -3,6 +3,7 @@ package com.yunbao.common.utils; import android.content.res.Resources; import com.yunbao.common.CommonAppContext; +import com.yunbao.common.manager.IMLoginManager; import java.util.Locale; import java.util.regex.Matcher; @@ -26,9 +27,7 @@ public class WordUtil { } public static boolean isZh() { - Locale locale = sResources.getConfiguration().locale; - String language = locale.getLanguage(); - return language.endsWith("zh"); + return IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE; } /** diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index 26f7ead05..52e55c9c5 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -1365,7 +1365,8 @@ public class LiveAudienceActivity extends LiveActivity { voteModel.setAnswer2(map.getString("answer2")); voteModel.setAnswer1Num(map.getInteger("num1")); voteModel.setAnswer2Num(map.getInteger("num2")); - voteModel.setResult(map.getString("result")); + voteModel.setResultZh(map.getString("result_zh")); + voteModel.setResultEn(map.getString("result_en")); voteModel.setOptionText(map.getString("option_text")); System.out.println(">>>" + voteModel); String content = voteModel.getResult();