当用户设置语言为英语时,将会调整首页推送逻辑,【英语】标签将会提前到第一位并默认展示【英语】标签内容;

This commit is contained in:
18401019693 2023-11-09 18:07:21 +08:00
parent bcc86a899c
commit e2ee742091
7 changed files with 94 additions and 25 deletions

View File

@ -1,12 +1,13 @@
package com.yunbao.common.manager; package com.yunbao.common.manager;
import android.content.Context; import android.content.Context;
import android.text.TextUtils;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.yunbao.common.bean.LiveClassBean; import com.yunbao.common.bean.LiveClassBean;
import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.manager.base.BaseCacheManager; import com.yunbao.common.manager.base.BaseCacheManager;
import com.yunbao.common.utils.WordUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -36,7 +37,30 @@ public class LiveClassManager extends BaseCacheManager {
* @return * @return
*/ */
public List<LiveClassBean> getLiveClass() { public List<LiveClassBean> getLiveClass() {
return getList(KEY_LIVE_CLASS, new TypeToken<List<LiveClassBean>>() { List<LiveClassBean> liveModels = new ArrayList<>();
List<LiveClassBean> liveClassBeans = getList(KEY_LIVE_CLASS, new TypeToken<List<LiveClassBean>>() {
}.getType()); }.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;
} }
} }

View File

@ -1367,10 +1367,22 @@ Limited ride And limited avatar frame</string>
<string name="currently_in_the_game">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</string> <string name="currently_in_the_game">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</string>
<string name="the_live_room">Exiting the live room will synchronize with exiting the game room. \n Do you want to continue</string> <string name="the_live_room">Exiting the live room will synchronize with exiting the game room. \n Do you want to continue</string>
<string name="sud_in_game_minimize">minimize</string> <string name="sud_in_game_minimize">minimize</string>
<string name="sud_in_game_game_game_peer_today_7">"≤7 days "</string>
<string name="sud_in_game_game_game_peer_today_30">≤ 30 days</string>
<string name="sud_in_game_game_game_type">Game type</string>
<string name="sud_in_game_game_game_settlement_time">End Time</string>
<string name="sud_in_game_game_game_peer_user">"Paired Users "</string>
<string name="sud_in_game_game_game_peer_user_nodata">" Currently No Records~"</string>
<string name="sud_in_game_game_game_peer_today">"Today "</string>
<string name="sud_in_game_rule_hint1">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;</string> <string name="sud_in_game_rule_hint1">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;</string>
<string name="sud_in_game_rule_hint2">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;</string> <string name="sud_in_game_rule_hint2">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;</string>
<string name="sud_in_game_rule_hint3">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;</string> <string name="sud_in_game_rule_hint3">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;</string>
<string name="sud_in_game_rule_hint4">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;</string> <string name="sud_in_game_rule_hint4">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;</string>
<string name="sud_in_game_rule_hint5">5. The final interpretation right of the event belongs to PDLIVE.</string> <string name="sud_in_game_rule_hint5">5. The final interpretation right of the event belongs to PDLIVE.</string>
<string name="sud_in_game_game_currency_item">Currency</string>
<string name="sud_in_game_game_currency">Currency:</string>
<string name="sud_in_game_game_time">Time:</string>
<string name="sud_in_game_game_record">Game Record</string>
<string name="sud_in_game_random_name">Random</string>
</resources> </resources>

View File

@ -1364,9 +1364,21 @@
<string name="currently_in_the_game">您正在遊戲中,請及時返回 長時間未返回將會視爲認輸哦</string> <string name="currently_in_the_game">您正在遊戲中,請及時返回 長時間未返回將會視爲認輸哦</string>
<string name="the_live_room">退出直播間將會同步退出遊戲房間 是否继续</string> <string name="the_live_room">退出直播間將會同步退出遊戲房間 是否继续</string>
<string name="sud_in_game_minimize">最小化</string> <string name="sud_in_game_minimize">最小化</string>
<string name="sud_in_game_game_game_peer_today_7">7日内</string>
<string name="sud_in_game_game_game_peer_today_30">30日内</string>
<string name="sud_in_game_game_game_type">游戲類型</string>
<string name="sud_in_game_game_game_settlement_time">結算時間</string>
<string name="sud_in_game_game_game_peer_user">對局用戶</string>
<string name="sud_in_game_game_game_peer_user_nodata">暫無記錄~</string>
<string name="sud_in_game_game_game_peer_today">今日</string>
<string name="sud_in_game_rule_hint1">1、互動遊戲是PDLIVE為用戶提供的全新板塊用戶可以在首頁【遊戲專區】或直播間內參與</string> <string name="sud_in_game_rule_hint1">1、互動遊戲是PDLIVE為用戶提供的全新板塊用戶可以在首頁【遊戲專區】或直播間內參與</string>
<string name="sud_in_game_rule_hint2">2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】後續將會提供更多遊戲種類敬請期待</string> <string name="sud_in_game_rule_hint2">2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】後續將會提供更多遊戲種類敬請期待</string>
<string name="sud_in_game_rule_hint3">3、用戶可自定義設定遊戲門檻要求在100~50000金豆之間數額必須為10的倍數</string> <string name="sud_in_game_rule_hint3">3、用戶可自定義設定遊戲門檻要求在100~50000金豆之間數額必須為10的倍數</string>
<string name="sud_in_game_rule_hint4">4、遊戲開始時將會收取參與遊戲用戶的門檻金豆在遊戲結束後將收取10%的金豆作為門票,剩餘金豆將全部給予勝利用戶,平局時將會扣除相應金豆门票後返還給用戶;</string> <string name="sud_in_game_rule_hint4">4、遊戲開始時將會收取參與遊戲用戶的門檻金豆在遊戲結束後將收取10%的金豆作為門票,剩餘金豆將全部給予勝利用戶,平局時將會扣除相應金豆门票後返還給用戶;</string>
<string name="sud_in_game_rule_hint5">5、活動最終解釋權歸PDLIVE所有。</string> <string name="sud_in_game_rule_hint5">5、活動最終解釋權歸PDLIVE所有。</string>
<string name="sud_in_game_game_currency_item">貨幣</string>
<string name="sud_in_game_game_currency">貨幣:</string>
<string name="sud_in_game_game_time">時間:</string>
<string name="sud_in_game_game_record">游戲記錄</string>
<string name="sud_in_game_random_name">随机</string>
</resources> </resources>

View File

@ -1363,9 +1363,21 @@
<string name="currently_in_the_game">若您正在遊戲中,請及時返回\n長時間未返回將會視爲認輸哦\n【最小化期間將無法切換直播間】</string> <string name="currently_in_the_game">若您正在遊戲中,請及時返回\n長時間未返回將會視爲認輸哦\n【最小化期間將無法切換直播間】</string>
<string name="the_live_room">退出直播間將會同步退出遊戲房間 是否继续</string> <string name="the_live_room">退出直播間將會同步退出遊戲房間 是否继续</string>
<string name="sud_in_game_minimize">最小化</string> <string name="sud_in_game_minimize">最小化</string>
<string name="sud_in_game_game_game_peer_today_7">7日内</string>
<string name="sud_in_game_game_game_peer_today_30">30日内</string>
<string name="sud_in_game_game_game_type">游戲類型</string>
<string name="sud_in_game_game_game_settlement_time">結算時間</string>
<string name="sud_in_game_game_game_peer_user">對局用戶</string>
<string name="sud_in_game_game_game_peer_user_nodata">暫無記錄~</string>
<string name="sud_in_game_game_game_peer_today">今日</string>
<string name="sud_in_game_rule_hint1">1、互動遊戲是PDLIVE為用戶提供的全新板塊用戶可以在首頁【遊戲專區】或直播間內參與</string> <string name="sud_in_game_rule_hint1">1、互動遊戲是PDLIVE為用戶提供的全新板塊用戶可以在首頁【遊戲專區】或直播間內參與</string>
<string name="sud_in_game_rule_hint2">2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】後續將會提供更多遊戲種類敬請期待</string> <string name="sud_in_game_rule_hint2">2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】後續將會提供更多遊戲種類敬請期待</string>
<string name="sud_in_game_rule_hint3">3、用戶可自定義設定遊戲門檻要求在100~50000金豆之間數額必須為10的倍數</string> <string name="sud_in_game_rule_hint3">3、用戶可自定義設定遊戲門檻要求在100~50000金豆之間數額必須為10的倍數</string>
<string name="sud_in_game_rule_hint4">4、遊戲開始時將會收取參與遊戲用戶的門檻金豆在遊戲結束後將收取10%的金豆作為門票,剩餘金豆將全部給予勝利用戶,平局時將會扣除相應金豆门票後返還給用戶;</string> <string name="sud_in_game_rule_hint4">4、遊戲開始時將會收取參與遊戲用戶的門檻金豆在遊戲結束後將收取10%的金豆作為門票,剩餘金豆將全部給予勝利用戶,平局時將會扣除相應金豆门票後返還給用戶;</string>
<string name="sud_in_game_rule_hint5">5、活動最終解釋權歸PDLIVE所有。</string> <string name="sud_in_game_rule_hint5">5、活動最終解釋權歸PDLIVE所有。</string>
<string name="sud_in_game_game_currency_item">貨幣</string>
<string name="sud_in_game_game_currency">貨幣:</string>
<string name="sud_in_game_game_time">時間:</string>
<string name="sud_in_game_game_record">游戲記錄</string>
<string name="sud_in_game_random_name">随机</string>
</resources> </resources>

View File

@ -1363,10 +1363,22 @@
<string name="currently_in_the_game">若您正在遊戲中,請及時返回\n長時間未返回將會視爲認輸哦\n【最小化期間將無法切換直播間】</string> <string name="currently_in_the_game">若您正在遊戲中,請及時返回\n長時間未返回將會視爲認輸哦\n【最小化期間將無法切換直播間】</string>
<string name="the_live_room">退出直播間將會同步退出遊戲房間\n是否继续</string> <string name="the_live_room">退出直播間將會同步退出遊戲房間\n是否继续</string>
<string name="sud_in_game_minimize">最小化</string> <string name="sud_in_game_minimize">最小化</string>
<string name="sud_in_game_game_game_peer_today_7">7日内</string>
<string name="sud_in_game_game_game_peer_today_30">30日内</string>
<string name="sud_in_game_game_game_type">游戲類型</string>
<string name="sud_in_game_game_game_settlement_time">結算時間</string>
<string name="sud_in_game_game_game_peer_user">對局用戶</string>
<string name="sud_in_game_game_game_peer_user_nodata">暫無記錄~</string>
<string name="sud_in_game_game_game_peer_today">今日</string>
<string name="sud_in_game_rule_hint1">1、互動遊戲是PDLIVE為用戶提供的全新板塊用戶可以在首頁【遊戲專區】或直播間內參與</string> <string name="sud_in_game_rule_hint1">1、互動遊戲是PDLIVE為用戶提供的全新板塊用戶可以在首頁【遊戲專區】或直播間內參與</string>
<string name="sud_in_game_rule_hint2">2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】後續將會提供更多遊戲種類敬請期待</string> <string name="sud_in_game_rule_hint2">2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】後續將會提供更多遊戲種類敬請期待</string>
<string name="sud_in_game_rule_hint3">3、用戶可自定義設定遊戲門檻要求在100~50000金豆之間數額必須為10的倍數</string> <string name="sud_in_game_rule_hint3">3、用戶可自定義設定遊戲門檻要求在100~50000金豆之間數額必須為10的倍數</string>
<string name="sud_in_game_rule_hint4">4、遊戲開始時將會收取參與遊戲用戶的門檻金豆在遊戲結束後將收取10%的金豆作為門票,剩餘金豆將全部給予勝利用戶,平局時將會扣除相應金豆门票後返還給用戶;</string> <string name="sud_in_game_rule_hint4">4、遊戲開始時將會收取參與遊戲用戶的門檻金豆在遊戲結束後將收取10%的金豆作為門票,剩餘金豆將全部給予勝利用戶,平局時將會扣除相應金豆门票後返還給用戶;</string>
<string name="sud_in_game_rule_hint5">5、活動最終解釋權歸PDLIVE所有。</string> <string name="sud_in_game_rule_hint5">5、活動最終解釋權歸PDLIVE所有。</string>
<string name="sud_in_game_game_currency_item">貨幣</string>
<string name="sud_in_game_game_currency">貨幣:</string>
<string name="sud_in_game_game_time">時間:</string>
<string name="sud_in_game_game_record">游戲記錄</string>
<string name="sud_in_game_random_name">随机</string>
</resources> </resources>

View File

@ -1370,18 +1370,18 @@ Limited ride And limited avatar frame</string>
<string name="the_live_room">Exiting the live room will synchronize with exiting the game room. \ n Do you want to continue</string> <string name="the_live_room">Exiting the live room will synchronize with exiting the game room. \ n Do you want to continue</string>
<string name="sud_in_game">IN GAME</string> <string name="sud_in_game">IN GAME</string>
<string name="sud_in_game_minimize">minimize</string> <string name="sud_in_game_minimize">minimize</string>
<string name="sud_in_game_random_name">随机</string> <string name="sud_in_game_game_game_type">Game type</string>
<string name="sud_in_game_game_record">游戲記錄</string> <string name="sud_in_game_random_name">Random</string>
<string name="sud_in_game_game_time">時間:</string> <string name="sud_in_game_game_record">Game Record</string>
<string name="sud_in_game_game_currency">貨幣:</string> <string name="sud_in_game_game_time">Time:</string>
<string name="sud_in_game_game_currency_item">貨幣</string> <string name="sud_in_game_game_currency">Currency:</string>
<string name="sud_in_game_game_game_type">游戲類型</string> <string name="sud_in_game_game_currency_item">Currency</string>
<string name="sud_in_game_game_game_settlement_time">結算時間</string> <string name="sud_in_game_game_game_settlement_time">End Time</string>
<string name="sud_in_game_game_game_peer_user">對局用戶</string> <string name="sud_in_game_game_game_peer_user">"Paired Users "</string>
<string name="sud_in_game_game_game_peer_user_nodata">暫無記錄~</string> <string name="sud_in_game_game_game_peer_user_nodata">" Currently No Records~"</string>
<string name="sud_in_game_game_game_peer_today">今日</string> <string name="sud_in_game_game_game_peer_today">"Today "</string>
<string name="sud_in_game_game_game_peer_today_7">7日内</string> <string name="sud_in_game_game_game_peer_today_7">"≤7 days "</string>
<string name="sud_in_game_game_game_peer_today_30">30日内</string> <string name="sud_in_game_game_game_peer_today_30">≤ 30 days</string>
<string name="sud_in_game_rule_hint1">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;</string> <string name="sud_in_game_rule_hint1">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;</string>
<string name="sud_in_game_rule_hint2">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;</string> <string name="sud_in_game_rule_hint2">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;</string>
<string name="sud_in_game_rule_hint3">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;</string> <string name="sud_in_game_rule_hint3">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;</string>

View File

@ -97,6 +97,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
private boolean isHave = false; private boolean isHave = false;
private Map<String, String> gotoRoomKey = new HashMap<>(); private Map<String, String> gotoRoomKey = new HashMap<>();
private Dialog mShowLoadingDialog; private Dialog mShowLoadingDialog;
private String typeHot;
public MainHomeLiveViewHolder(Context context, ViewGroup parentView) { public MainHomeLiveViewHolder(Context context, ViewGroup parentView) {
super(context, parentView); super(context, parentView);
@ -127,6 +128,8 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
@Override @Override
public void init() { public void init() {
List<LiveClassBean> list = new LiveClassManager(mContext).getLiveClass();
typeHot= list.get(0).getEnglish();
mShadow = findViewById(R.id.shadow); mShadow = findViewById(R.id.shadow);
mBtnDismiss = findViewById(R.id.btn_dismiss); mBtnDismiss = findViewById(R.id.btn_dismiss);
mBtnDismiss.setOnClickListener(new View.OnClickListener() { mBtnDismiss.setOnClickListener(new View.OnClickListener() {
@ -175,7 +178,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
@Override @Override
public void loadData(int p, HttpCallback callback) { public void loadData(int p, HttpCallback callback) {
Log.i("t2", "aaa" + p); Log.i("t2", "aaa" + p);
if (select == 0) { if (TextUtils.equals(typeHot, "Hot") || TextUtils.equals(typeHot, "hot") || TextUtils.equals(typeHot, "熱門")) {
pp = 1; pp = 1;
LiveHttpUtil.getAnchorLastWeekList(new HttpCallback() { LiveHttpUtil.getAnchorLastWeekList(new HttpCallback() {
@Override @Override
@ -210,7 +213,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
new_data = new ArrayList<>(); new_data = new ArrayList<>();
if (info.length > 0) { if (info.length > 0) {
JSONObject obj = JSON.parseObject(info[0]); JSONObject obj = JSON.parseObject(info[0]);
if (select == 0) {
mBannerList = JSON.parseArray(obj.getString("slide"), BannerBean.class); mBannerList = JSON.parseArray(obj.getString("slide"), BannerBean.class);
if (!obj.containsKey("list")) { if (!obj.containsKey("list")) {
return new_data; return new_data;
@ -235,10 +238,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
old_data.remove(liveModel); old_data.remove(liveModel);
} }
new_data.addAll(old_data); new_data.addAll(old_data);
} else {
new_data = JSON.parseArray(Arrays.toString(info), LiveBean.class);
}
} }
return new_data; return new_data;
} }
@ -278,7 +278,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
mClassRecyclerViewTop = (RecyclerView) findViewById(R.id.classRecyclerView_top); mClassRecyclerViewTop = (RecyclerView) findViewById(R.id.classRecyclerView_top);
mClassRecyclerViewTop.setHasFixedSize(true); mClassRecyclerViewTop.setHasFixedSize(true);
mClassRecyclerViewTop.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false)); mClassRecyclerViewTop.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
List<LiveClassBean> list = new LiveClassManager(mContext).getLiveClass();
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
List<LiveClassBean> targetList = new ArrayList<>(); List<LiveClassBean> targetList = new ArrayList<>();
if (list.size() <= 6) { if (list.size() <= 6) {
@ -316,11 +316,8 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
if (!canClick()) { if (!canClick()) {
return; return;
} }
if (position != 0) { select = bean.getId();
select = bean.getId(); typeHot = bean.getEnglish();
} else {
select = 0;
}
mRefreshView.initData(); mRefreshView.initData();
topAdapter.choice = position; topAdapter.choice = position;
topAdapter.notifyDataSetChanged(); topAdapter.notifyDataSetChanged();