From e2ee7420917a22c87c648b2cefea854bc8e419d9 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 9 Nov 2023 18:07:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E7=94=A8=E6=88=B7=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E4=B8=BA=E8=8B=B1=E8=AF=AD=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=B0=86=E4=BC=9A=E8=B0=83=E6=95=B4=E9=A6=96=E9=A1=B5=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E9=80=BB=E8=BE=91=EF=BC=8C=E3=80=90=E8=8B=B1=E8=AF=AD?= =?UTF-8?q?=E3=80=91=E6=A0=87=E7=AD=BE=E5=B0=86=E4=BC=9A=E6=8F=90=E5=89=8D?= =?UTF-8?q?=E5=88=B0=E7=AC=AC=E4=B8=80=E4=BD=8D=E5=B9=B6=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E3=80=90=E8=8B=B1=E8=AF=AD=E3=80=91=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=86=85=E5=AE=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/manager/LiveClassManager.java | 28 +++++++++++++++++-- common/src/main/res/values-en-rUS/string.xml | 12 ++++++++ common/src/main/res/values-zh-rHK/strings.xml | 12 ++++++++ common/src/main/res/values-zh-rTW/strings.xml | 12 ++++++++ common/src/main/res/values-zh/strings.xml | 12 ++++++++ common/src/main/res/values/strings.xml | 24 ++++++++-------- .../main/views/MainHomeLiveViewHolder.java | 19 ++++++------- 7 files changed, 94 insertions(+), 25 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/manager/LiveClassManager.java b/common/src/main/java/com/yunbao/common/manager/LiveClassManager.java index 9a875ba53..50d5f2a6d 100644 --- a/common/src/main/java/com/yunbao/common/manager/LiveClassManager.java +++ b/common/src/main/java/com/yunbao/common/manager/LiveClassManager.java @@ -1,12 +1,13 @@ package com.yunbao.common.manager; import android.content.Context; +import android.text.TextUtils; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.yunbao.common.bean.LiveClassBean; -import com.yunbao.common.bean.NewLevelModel; import com.yunbao.common.manager.base.BaseCacheManager; +import com.yunbao.common.utils.WordUtil; import java.util.ArrayList; import java.util.List; @@ -36,7 +37,30 @@ public class LiveClassManager extends BaseCacheManager { * @return */ public List getLiveClass() { - return getList(KEY_LIVE_CLASS, new TypeToken>() { + List liveModels = new ArrayList<>(); + List liveClassBeans = getList(KEY_LIVE_CLASS, new TypeToken>() { }.getType()); + if (WordUtil.isNewZh()) { + for (int i = 0; i < liveClassBeans.size(); i++) { + if (TextUtils.equals(liveClassBeans.get(i).getEnglish(), "Hot") || TextUtils.equals(liveClassBeans.get(i).getEnglish(), "hot") || TextUtils.equals(liveClassBeans.get(i).getEnglish(), "熱門")) { + liveModels.add(0, liveClassBeans.get(i)); + } else { + liveModels.add(liveClassBeans.get(i)); + } + + } + } else { + for (int i = 0; i < liveClassBeans.size(); i++) { + if (TextUtils.equals(liveClassBeans.get(i).getEnglish(), "English") || TextUtils.equals(liveClassBeans.get(i).getEnglish(), "english") + || TextUtils.equals(liveClassBeans.get(i).getEnglish(), "英語")) { + liveModels.add(0, liveClassBeans.get(i)); + } else { + liveModels.add(liveClassBeans.get(i)); + } + + } + } + + return liveModels; } } diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 901764811..93bc53e1d 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1367,10 +1367,22 @@ Limited ride And limited avatar frame You are currently in the game, please return in a timely manner.\n Failure to return for a long time will be considered a surrender. \n During the minimization, it will not be able to switch between live rooms Exiting the live room will synchronize with exiting the game room. \n Do you want to continue minimize + "≤7 days " + ≤ 30 days + Game type + End Time + "Paired Users " + " Currently No Records~" + "Today " 1. Interactive games are a new section provided by PDLIVE for users, who can participate in the game section on the homepage or in the live room; 2. Currently, we have launched \'GoBang\',\' Bumper car \',\' Flying Chess\', \'Minesweeping\', \'Dart Master\', and \'Monster Eliminating\'. We will provide more game types in the future. Stay tuned; 3. Users can customize the game threshold, which must be between 100 to 50000 gold beans or 10 to 1000 star coins, and the amount must be a multiple of 10; 4. At the beginning of the game, chips from participating users will be collected. After the game ends, 10% of the chips will be collected as tickets, and all remaining chips will be given to the winning users.In a draw, the corresponding chips will be deducted from the tickets and returned to the users; 5. The final interpretation right of the event belongs to PDLIVE. + Currency + Currency: + Time: + Game Record + Random diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 34df13862..0de0c245f 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1364,9 +1364,21 @@ 您正在遊戲中,請及時返回 長時間未返回將會視爲認輸哦 退出直播間將會同步退出遊戲房間 是否继续 最小化 + 7日内 + 30日内 + 游戲類型 + 結算時間 + 對局用戶 + 暫無記錄~ + 今日 1、互動遊戲是PDLIVE為用戶提供的全新板塊,用戶可以在首頁【遊戲專區】或直播間內參與; 2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】,後續將會提供更多遊戲種類,敬請期待; 3、用戶可自定義設定遊戲門檻,要求在100~50000金豆之間,數額必須為10的倍數; 4、遊戲開始時將會收取參與遊戲用戶的門檻金豆,在遊戲結束後,將收取10%的金豆作為門票,剩餘金豆將全部給予勝利用戶,平局時將會扣除相應金豆门票後返還給用戶; 5、活動最終解釋權歸PDLIVE所有。 + 貨幣 + 貨幣: + 時間: + 游戲記錄 + 随机 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 56873da1c..418967ccc 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1363,9 +1363,21 @@ 若您正在遊戲中,請及時返回\n長時間未返回將會視爲認輸哦\n【最小化期間將無法切換直播間】 退出直播間將會同步退出遊戲房間 是否继续 最小化 + 7日内 + 30日内 + 游戲類型 + 結算時間 + 對局用戶 + 暫無記錄~ + 今日 1、互動遊戲是PDLIVE為用戶提供的全新板塊,用戶可以在首頁【遊戲專區】或直播間內參與; 2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】,後續將會提供更多遊戲種類,敬請期待; 3、用戶可自定義設定遊戲門檻,要求在100~50000金豆之間,數額必須為10的倍數; 4、遊戲開始時將會收取參與遊戲用戶的門檻金豆,在遊戲結束後,將收取10%的金豆作為門票,剩餘金豆將全部給予勝利用戶,平局時將會扣除相應金豆门票後返還給用戶; 5、活動最終解釋權歸PDLIVE所有。 + 貨幣 + 貨幣: + 時間: + 游戲記錄 + 随机 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index ef4582d34..204909afa 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1363,10 +1363,22 @@ 若您正在遊戲中,請及時返回\n長時間未返回將會視爲認輸哦\n【最小化期間將無法切換直播間】 退出直播間將會同步退出遊戲房間\n是否继续 最小化 + 7日内 + 30日内 + 游戲類型 + 結算時間 + 對局用戶 + 暫無記錄~ + 今日 1、互動遊戲是PDLIVE為用戶提供的全新板塊,用戶可以在首頁【遊戲專區】或直播間內參與; 2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】,後續將會提供更多遊戲種類,敬請期待; 3、用戶可自定義設定遊戲門檻,要求在100~50000金豆之間,數額必須為10的倍數; 4、遊戲開始時將會收取參與遊戲用戶的門檻金豆,在遊戲結束後,將收取10%的金豆作為門票,剩餘金豆將全部給予勝利用戶,平局時將會扣除相應金豆门票後返還給用戶; 5、活動最終解釋權歸PDLIVE所有。 + 貨幣 + 貨幣: + 時間: + 游戲記錄 + 随机 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index c5433b00e..4d3088767 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1370,18 +1370,18 @@ Limited ride And limited avatar frame Exiting the live room will synchronize with exiting the game room. \ n Do you want to continue IN GAME minimize - 随机 - 游戲記錄 - 時間: - 貨幣: - 貨幣 - 游戲類型 - 結算時間 - 對局用戶 - 暫無記錄~ - 今日 - 7日内 - 30日内 + Game type + Random + Game Record + Time: + Currency: + Currency + End Time + "Paired Users " + " Currently No Records~" + "Today " + "≤7 days " + ≤ 30 days 1. Interactive games are a new section provided by PDLIVE for users, who can participate in the game section on the homepage or in the live room; 2. Currently, we have launched \'GoBang\',\' Bumper car \',\' Flying Chess\', \'Minesweeping\', \'Dart Master\', and \'Monster Eliminating\'. We will provide more game types in the future. Stay tuned; 3. Users can customize the game threshold, which must be between 100 to 50000 gold beans or 10 to 1000 star coins, and the amount must be a multiple of 10; diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java index 5464a2297..3be369f55 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java @@ -97,6 +97,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement private boolean isHave = false; private Map gotoRoomKey = new HashMap<>(); private Dialog mShowLoadingDialog; + private String typeHot; public MainHomeLiveViewHolder(Context context, ViewGroup parentView) { super(context, parentView); @@ -127,6 +128,8 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement @Override public void init() { + List list = new LiveClassManager(mContext).getLiveClass(); + typeHot= list.get(0).getEnglish(); mShadow = findViewById(R.id.shadow); mBtnDismiss = findViewById(R.id.btn_dismiss); mBtnDismiss.setOnClickListener(new View.OnClickListener() { @@ -175,7 +178,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement @Override public void loadData(int p, HttpCallback callback) { Log.i("t2", "aaa" + p); - if (select == 0) { + if (TextUtils.equals(typeHot, "Hot") || TextUtils.equals(typeHot, "hot") || TextUtils.equals(typeHot, "熱門")) { pp = 1; LiveHttpUtil.getAnchorLastWeekList(new HttpCallback() { @Override @@ -210,7 +213,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement new_data = new ArrayList<>(); if (info.length > 0) { JSONObject obj = JSON.parseObject(info[0]); - if (select == 0) { + mBannerList = JSON.parseArray(obj.getString("slide"), BannerBean.class); if (!obj.containsKey("list")) { return new_data; @@ -235,10 +238,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement old_data.remove(liveModel); } new_data.addAll(old_data); - } else { - new_data = JSON.parseArray(Arrays.toString(info), LiveBean.class); - } } return new_data; } @@ -278,7 +278,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement mClassRecyclerViewTop = (RecyclerView) findViewById(R.id.classRecyclerView_top); mClassRecyclerViewTop.setHasFixedSize(true); mClassRecyclerViewTop.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false)); - List list = new LiveClassManager(mContext).getLiveClass(); + if (list != null && list.size() > 0) { List targetList = new ArrayList<>(); if (list.size() <= 6) { @@ -316,11 +316,8 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement if (!canClick()) { return; } - if (position != 0) { - select = bean.getId(); - } else { - select = 0; - } + select = bean.getId(); + typeHot = bean.getEnglish(); mRefreshView.initData(); topAdapter.choice = position; topAdapter.notifyDataSetChanged();