From 192587f7589a97484e49be826c03c75f22b0e665 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Mon, 3 Apr 2023 15:15:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=9A=E8=BF=87=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E8=8E=B7=E5=8F=96=E5=9B=BD=E5=AE=B6=E5=9C=B0=E5=8C=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E5=9C=A8=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E6=97=B6=E8=87=AA=E5=8A=A8=E5=A1=AB=E5=86=99=E5=8F=B7=E7=A0=81?= =?UTF-8?q?=E7=BC=96=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/sahooz/library/Country.java | 10 ++++++---- .../yunbao/live/dialog/LiveAnchorEditCallMeDialog.java | 2 +- .../com/yunbao/main/activity/RegisterActivity.java | 5 ++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib_country_code/src/main/java/com/sahooz/library/Country.java b/lib_country_code/src/main/java/com/sahooz/library/Country.java index a624744fb..002fb9360 100644 --- a/lib_country_code/src/main/java/com/sahooz/library/Country.java +++ b/lib_country_code/src/main/java/com/sahooz/library/Country.java @@ -22,15 +22,17 @@ import java.util.ArrayList; public class Country implements PyEntity { private static final String TAG = Country.class.getSimpleName(); public int code; - public String name, locale, pinyin; + public String name, locale, pinyin,chs,cht; public int flag; private static ArrayList countries = null; - public Country(int code, String name, String locale, int flag) { + public Country(int code, String name, String locale, int flag,String chs,String cht) { this.code = code; this.name = name; this.flag = flag; this.locale = locale; + this.chs=chs; + this.cht=cht; } @Override @@ -62,7 +64,7 @@ public class Country implements PyEntity { if(!TextUtils.isEmpty(locale)) { flag = ctx.getResources().getIdentifier("flag_" + locale.toLowerCase(), "drawable", ctx.getPackageName()); } - countries.add(new Country(jo.getInt("code"), jo.getString(key), locale, flag)); + countries.add(new Country(jo.getInt("code"), jo.getString(key), locale, flag,jo.getString("zh"),jo.getString("tw"))); } Log.i(TAG, countries.toString()); @@ -80,7 +82,7 @@ public class Country implements PyEntity { if(TextUtils.isEmpty(json)) return null; try { JSONObject jo = new JSONObject(json); - return new Country(jo.optInt("code") ,jo.optString("name"), jo.optString("locale"), jo.optInt("flag")); + return new Country(jo.optInt("code") ,jo.optString("name"), jo.optString("locale"), jo.optInt("flag"),jo.getString("zh"),jo.getString("tw")); } catch (JSONException e) { e.printStackTrace(); } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveAnchorEditCallMeDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveAnchorEditCallMeDialog.java index db1a1bf88..8bebda8e4 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveAnchorEditCallMeDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveAnchorEditCallMeDialog.java @@ -151,7 +151,7 @@ public class LiveAnchorEditCallMeDialog extends AbsDialogPopupWindow { .setAnchorCallMe(mLiveUid, callMeModel, new HttpCallback() { @Override public void onSuccess(String data) { - ToastUtil.show(WordUtil.isZh() ? "成功" : "success"); + ToastUtil.showDebug(WordUtil.isZh() ? "成功" : "success"); } @Override diff --git a/main/src/main/java/com/yunbao/main/activity/RegisterActivity.java b/main/src/main/java/com/yunbao/main/activity/RegisterActivity.java index 032abdc9d..17facc61b 100644 --- a/main/src/main/java/com/yunbao/main/activity/RegisterActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/RegisterActivity.java @@ -194,10 +194,9 @@ public class RegisterActivity extends AbsActivity { //String ct = Locale.getDefault().getCountry(); String ct = IMLoginManager.get(mContext).getString("sys_user_area"); - ToastUtil.show("地区:"+ct); - ct = TextUtils.equals("CN", ct) ? "HK" : ct; + ct = TextUtils.equals("中国", ct) ? "HK" : ct; for (int i = 0; i < allCountries.size(); i++) { - if (allCountries.get(i).locale.equals(ct)) { + if (allCountries.get(i).chs.equals(ct)) { String countryName = allCountries.get(i).name; countryName = countryName.length() > 4 ? countryName.substring(0, 4) : countryName; mTvCountryCode.setText("+" + allCountries.get(i).code + " " + countryName);