修改中英文

This commit is contained in:
18401019693 2023-10-10 17:03:51 +08:00
parent 1625135d0c
commit a25ce2034f
24 changed files with 122 additions and 85 deletions

View File

@ -7,6 +7,7 @@ import android.os.Environment;
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseArray;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yunbao.common.bean.ConfigBean;
@ -19,6 +20,7 @@ import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.SpUtil;
import com.yunbao.common.utils.WordUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -78,8 +80,6 @@ public class CommonAppConfig {
public static int alert_end_time = 1;
private CommonAppConfig() {
}
@ -148,6 +148,7 @@ public class CommonAppConfig {
}
return Constants.DIAMONDS;
}
public String getGoldCoinName() {
ConfigBean configBean = getConfig();
if (configBean != null) {
@ -187,8 +188,15 @@ public class CommonAppConfig {
}
}
private String[][] liveType = null;
public String[][] getLiveType() {
return liveType;
}
public void setConfig(ConfigBean config) {
mConfig = config;
liveType = config.getLiveType();
}
/**
@ -391,7 +399,6 @@ public class CommonAppConfig {
}
/**
* 获取App图标的资源id
*/
@ -450,6 +457,7 @@ public class CommonAppConfig {
Log.i("tag", "url:" + res);
return res;
}
private static boolean getMetaDataBoolean(String key) {
boolean res = false;
try {
@ -670,6 +678,7 @@ public class CommonAppConfig {
public void setBeautySdkType(String sproutType) {
SpUtil.getInstance().setStringValue(SpUtil.BEAUTY_SDK_TYPE, sproutType);
}
public String getBeautySdkType() {
return SpUtil.getInstance().getStringValue(SpUtil.BEAUTY_SDK_TYPE);
}
@ -678,6 +687,7 @@ public class CommonAppConfig {
public void setTurnTableEnable(String enable) {
SpUtil.getInstance().setStringValue(SpUtil.TURNTABLE_ENABLE, enable);
}
public String getTurnTableEnable() {
return SpUtil.getInstance().getStringValue(SpUtil.TURNTABLE_ENABLE);
}
@ -686,6 +696,7 @@ public class CommonAppConfig {
public void setBeauty360TieZhiUrl(String tieZhiUrl) {
SpUtil.getInstance().setStringValue(SpUtil.BEAUTY_360_TIEZHI_URL, tieZhiUrl);
}
public String getBeauty360TieZhiUrl() {
return SpUtil.getInstance().getStringValue(SpUtil.BEAUTY_360_TIEZHI_URL);
}
@ -694,6 +705,7 @@ public class CommonAppConfig {
public void setBeauty360TieZhiExist(boolean isExist) {
SpUtil.getInstance().setBooleanValue(SpUtil.BEAUTY_360_TIEZHI_EXIST, isExist);
}
public boolean getBeauty360TieZhiExist() {
return SpUtil.getInstance().getBooleanValue(SpUtil.BEAUTY_360_TIEZHI_EXIST);
}
@ -702,6 +714,7 @@ public class CommonAppConfig {
public void setAnchorPkTime(String pkTime) {
SpUtil.getInstance().setStringValue(SpUtil.ANCHOR_PK_TIME, pkTime);
}
public String getAnchorPkTime() {
return SpUtil.getInstance().getStringValue(SpUtil.ANCHOR_PK_TIME);
}

View File

@ -157,7 +157,7 @@ public class SudGameListPopup extends BottomPopupView {
@Override
public void onViewClicks() {
LiveNetManager.get(getContext())
.randomRoom(new com.yunbao.common.http.base.HttpCallback<CreateSudRoomModel>() {
.randomRoom(id, mSill, roomHolderType,new com.yunbao.common.http.base.HttpCallback<CreateSudRoomModel>() {
@Override
public void onSuccess(CreateSudRoomModel data) {
if (data != null) {

View File

@ -83,7 +83,7 @@ public class LiveNewWishListFragment extends BaseFragment {
@Override
public void onError(String error) {
ToastUtil.show(R.string.net_error);
ToastUtil.show(getActivity().getString(R.string.net_error));
}
});
}

View File

@ -163,7 +163,7 @@ public class CommonHttpUtil {
} else {
locale = IMLoginManager.get(context).getLocaleLanguage();
}
if (locale.getLanguage().equals("zh")) {
if (WordUtil.isNewZh()) {
lang = "chinese";
} else {

View File

@ -1027,6 +1027,9 @@ public interface PDLiveApi {
@GET("/api/public/?service=Sudgameserver.randomRoom")
Observable<ResponseModel<CreateSudRoomModel>> randomRoom(
@Query("sud_game_id") String sudGameId,
@Query("threshold") String threshold,
@Query("room_holder_type") String roomHolderType
);
@GET("/api/public/?service=Sudgameserver.checkRoomStatus")

View File

@ -2270,9 +2270,9 @@ public class LiveNetManager {
}).isDisposed();
}
public void randomRoom(HttpCallback<CreateSudRoomModel> callback) {
public void randomRoom(String sudGameId, String threshold, String roomHolderType, HttpCallback<CreateSudRoomModel> callback) {
API.get().pdLiveApi(mContext)
.randomRoom()
.randomRoom(sudGameId, threshold, roomHolderType)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<CreateSudRoomModel>>() {

View File

@ -8,6 +8,7 @@ import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.alibaba.fastjson.JSONArray;
import com.google.gson.Gson;
import com.lzf.easyfloat.EasyFloat;
import com.umeng.analytics.MobclickAgent;
@ -57,6 +58,8 @@ public class IMLoginManager extends BaseCacheManager {
put(KEY_GAME, sudGameJson);
}
public String getSudGame() {
return getString(KEY_GAME);
}

View File

@ -43,7 +43,7 @@ public class ToastUtil {
public static void show(int res) {
show(WordUtil.getNewString(res));
show(CommonAppContext.sInstance.getString(res));
}
/**

View File

@ -35,16 +35,18 @@
<LinearLayout
android:layout_width="match_parent"
android:gravity="center_vertical"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:gravity="center_vertical">
<TextView
android:id="@+id/live_open_cancel"
android:layout_width="100dp"
android:layout_height="36dp"
android:layout_marginStart="16dp"
android:layout_width="120dp"
android:layout_height="40dp"
android:layout_marginStart="10dp"
android:background="@drawable/backgroud_live_open_lfet"
android:gravity="center"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/back"
android:textColor="#FFC621"
android:textSize="14sp" />
@ -56,9 +58,9 @@
<TextView
android:id="@+id/live_open_ok"
android:layout_width="100dp"
android:layout_height="36dp"
android:layout_marginEnd="16dp"
android:layout_width="120dp"
android:layout_height="40dp"
android:layout_marginEnd="10dp"
android:background="@drawable/backgroud_live_open_right"
android:gravity="center"
android:text="@string/stick_to_choice"

View File

@ -5,7 +5,7 @@ ext {
minSdkVersion : 21,
targetSdkVersion : 33,
versionCode : 450,
versionName : "6.5.6"
versionName : "6.6.0"
]
manifestPlaceholders = [
//

View File

@ -1495,6 +1495,11 @@ public class LiveAudienceActivity extends LiveActivity {
manager.showGiftWall(event.getUid(), event.isVoicePress(), event.getUname(), event.getAvatar());
}
break;
case SUD_GAME_CREATE_ROOM:
if (manager != null) {
manager.setSudName(event.getAvatar());
}
break;
}

View File

@ -379,7 +379,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
if (isDRPK != 1) {
openMicWindow(1);
} else {
ToastUtil.show("您已在PK中");
ToastUtil.show(WordUtil.isNewZh()?"您已在PK中":"You are already in the PK");
}
break;
case Constants.LIVE_FUNC_DR://多人PK
@ -460,7 +460,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
}
});
} else {
ToastUtil.show("您已在PK中");
ToastUtil.show(WordUtil.isNewZh()?"您已在PK中":"You are already in the PK");
}
break;
case Constants.LIVE_FUNC_BEAUTY://美颜
@ -496,7 +496,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
//openLinkMicAnchorWindow(false);
openFreePkWindow();
} else {
ToastUtil.show("您已在PK中");
ToastUtil.show(WordUtil.isNewZh()?"您已在PK中":"You are already in the PK");
}
break;
case Constants.LIVE_FUNC_WISHLIST://心愿单
@ -517,7 +517,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
if (isDRPK != 1) {
openRandomPkWindow();
} else {
ToastUtil.show("您已在PK中");
ToastUtil.show(WordUtil.isNewZh()?"您已在PK中":"You are already in the PK");
}
break;
default:

View File

@ -1,9 +1,6 @@
package com.yunbao.live.adapter;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@ -11,11 +8,14 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.bean.ConfigBean;
import com.yunbao.common.bean.LiveRoomTypeBean;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.live.R;
import com.yunbao.common.bean.LiveRoomTypeBean;
import java.util.ArrayList;
import java.util.Arrays;
@ -38,10 +38,8 @@ public class LiveRoomTypeAdapter extends RecyclerView.Adapter<LiveRoomTypeAdapte
mCheckedColor = ContextCompat.getColor(context, R.color.global);
mUnCheckedColor = 0xffffffff;
mList = new ArrayList<>();
ConfigBean configBean = CommonAppConfig.getInstance().getConfig();
Log.i("tag",configBean.toString());
if (configBean != null) {
String[][] liveType = configBean.getLiveType();
String[][] liveType = CommonAppConfig.getInstance().getLiveType();
if (liveType != null) {
Log.i("tag", Arrays.toString(liveType));
List<LiveRoomTypeBean> list = LiveRoomTypeBean.getLiveTypeList(liveType);
@ -52,7 +50,7 @@ public class LiveRoomTypeAdapter extends RecyclerView.Adapter<LiveRoomTypeAdapte
break;
}
}
}
}
mInflater = LayoutInflater.from(context);
mOnClickListener = new View.OnClickListener() {

View File

@ -12,14 +12,12 @@ import androidx.constraintlayout.widget.ConstraintLayout;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.ConfigBean;
import com.yunbao.common.bean.LiveRoomTypeBean;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.common.bean.LiveRoomTypeBean;
import java.util.ArrayList;
import java.util.Arrays;
@ -103,9 +101,8 @@ public class LiveNewRoomTypeDialogFragment extends AbsDialogFragment implements
private void initData() {
mList = new ArrayList<>();
ConfigBean configBean = CommonAppConfig.getInstance().getConfig();
Log.i("tag", configBean.toString());
String[][] liveType = configBean.getLiveType();
String[][] liveType = CommonAppConfig.getInstance().getLiveType();
if (liveType != null) {
Log.i("tag", Arrays.toString(liveType));
List<LiveRoomTypeBean> list = LiveRoomTypeBean.getLiveTypeList(liveType);

View File

@ -465,7 +465,8 @@ public class LiveAudienceEvent extends BaseModel {
INPUT_DIALOG(71, "输入框"),
IS_ATTENTION(72, "是否关注主播"),
GIFT_WALL(73, "礼物墙"),
UPDATE_FANS_TASK_STATUS(74,"更新粉丝任务状态");
UPDATE_FANS_TASK_STATUS(74, "更新粉丝任务状态"),
SUD_GAME_CREATE_ROOM(75, "主播创建sud游戏");
private int type;
private String name;

View File

@ -741,6 +741,11 @@ public class SocketRyClient {
case SOCKET_LIVE_MSG_TO_USER:
sendToUserMsg(map);
break;
case "SudGameCreateRoom":
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.SUD_GAME_CREATE_ROOM)
.setAvatar(map.getString("room_name")));
break;
}
}

View File

@ -35,6 +35,8 @@ import com.yunbao.common.bean.UserBean;
import com.yunbao.common.event.LivePushRyEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpConsts;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.interfaces.ImageResultCallback;
import com.yunbao.common.interfaces.OnItemClickListener;
@ -64,8 +66,6 @@ import com.yunbao.live.dialog.LiveNewRoomClassDialogFragment;
import com.yunbao.live.dialog.LiveNewRoomTypeDialogFragment;
import com.yunbao.live.dialog.LiveTimeDialogFragment;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.common.http.LiveHttpConsts;
import com.yunbao.common.http.LiveHttpUtil;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
@ -816,7 +816,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
ToastUtil.show(R.string.live_set_pwd_empty);
} else {
mLiveType = bean.getId();
mLiveTypeTextView.setText(bean.getName());
mLiveTypeTextView.setText(WordUtil.isNewZh() ? "密碼房" : "password room");
if (StringUtil.isInt(content)) {
mLiveTypeVal = Integer.parseInt(content);
}

View File

@ -650,6 +650,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
sud_text_name.setText(WordUtil.isNewZh() ?
String.format("主播创建了【%s】房间快来与主播同玩~", sudName) :
String.format("The anchor has created a 【%s】 room. Come and play with the anchor~", sudName));
sud_text_name.setVisibility(View.VISIBLE);
ViewClicksAntiShake.clicksAntiShake(sud_text_name, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {

View File

@ -168,7 +168,7 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
if (PKing == false) {
((LiveRyAnchorActivity) mContext).openLinkMicAnchorWindow(true);
} else {
ToastUtil.show("您已在PK中");
ToastUtil.show(WordUtil.isNewZh()?"您已在PK中":"You are already in the PK");
}
}
});

View File

@ -1956,6 +1956,12 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
}
public void setSudName(String sudName) {
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.setSudName(sudName);
}
}
/**
* 全服喇叭
*

View File

@ -86,6 +86,7 @@
android:textSize="14sp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -100,7 +101,7 @@
<LinearLayout
android:id="@+id/random_pk_info_btn"
android:layout_width="188dp"
android:layout_height="42dp"
android:layout_height="50dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_live_random_pk_info_btn"
android:gravity="center"
@ -115,14 +116,15 @@
android:layout_height="wrap_content"
android:text="@string/random_pk_info_btn_start"
android:textColor="#FFFFFF"
android:textSize="16sp" />
android:textSize="14sp" />
<TextView
android:id="@+id/random_pk_btn_desc"
android:layout_width="wrap_content"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="10sp"
android:textSize="8sp"
android:visibility="gone" />
</LinearLayout>

View File

@ -2453,6 +2453,7 @@
android:id="@+id/sud_text_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_alignParentBottom="true"
android:layout_marginStart="21dp"
android:layout_marginEnd="21dp"

View File

@ -75,7 +75,7 @@
<TextView
android:id="@+id/live_clarity"
android:layout_width="80dp"
android:layout_width="60dp"
android:singleLine="true"
android:ellipsize="end"
android:layout_height="wrap_content"

View File

@ -149,7 +149,7 @@ public class MainHomeGameViewHolder extends AbsMainHomeChildViewHolder implement
@Override
public void onViewClicks() {
LiveNetManager.get(mContext)
.randomRoom(new com.yunbao.common.http.base.HttpCallback<CreateSudRoomModel>() {
.randomRoom(id, mSill, roomHolderType,new com.yunbao.common.http.base.HttpCallback<CreateSudRoomModel>() {
@Override
public void onSuccess(CreateSudRoomModel data) {
if (data != null) {