多语言切换

This commit is contained in:
18401019693 2023-04-19 10:16:56 +08:00
parent 293c9dcf9e
commit dc5633bcb9
17 changed files with 90 additions and 40 deletions

View File

@ -10,6 +10,9 @@ import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.HtmlConfig; import com.yunbao.common.HtmlConfig;
import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.manager.IMLoginManager;
import java.util.Locale;
/** /**
* Created by cxf on 2019/2/25. * Created by cxf on 2019/2/25.
@ -109,7 +112,7 @@ public class RouteUtil {
if (!"".equals(Constants.chatActionUrl)) { if (!"".equals(Constants.chatActionUrl)) {
url = Constants.chatActionUrl; url = Constants.chatActionUrl;
} }
Constants.myUrl = url + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&t=" + System.currentTimeMillis(); Constants.myUrl = url + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&t=" + System.currentTimeMillis() + "&isZh=" + ((IMLoginManager.get(context).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
ARouter.getInstance().build(PATH_MYWEBVIEWACTIVTITY) ARouter.getInstance().build(PATH_MYWEBVIEWACTIVTITY)
.withString(Constants.URL, url) .withString(Constants.URL, url)
.navigation(); .navigation();

View File

@ -9,9 +9,9 @@ ext {
] ]
manifestPlaceholders = [ manifestPlaceholders = [
// //
serverHost : "https://napi.yaoulive.com", // serverHost : "https://napi.yaoulive.com",
// //
// serverHost : "https://ceshi.yaoulive.com", serverHost : "https://ceshi.yaoulive.com",
// //
txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",

View File

@ -1,5 +1,9 @@
package com.yunbao.live.activity; package com.yunbao.live.activity;
import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_DISABLE;
import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_ENABLE;
import static com.yunbao.live.views.LivePushTxViewHolder.mTRTCCloud;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
@ -24,6 +28,7 @@ import com.tencent.trtc.TRTCCloudDef;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext; import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
import com.yunbao.common.dialog.NotCancelableDialog; import com.yunbao.common.dialog.NotCancelableDialog;
import com.yunbao.common.event.LoginInvalidEvent; import com.yunbao.common.event.LoginInvalidEvent;
@ -32,14 +37,13 @@ import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient; import com.yunbao.common.http.HttpClient;
import com.yunbao.common.http.JsonBean; import com.yunbao.common.http.JsonBean;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.DateFormatUtil; import com.yunbao.common.utils.DateFormatUtil;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.L; import com.yunbao.common.utils.L;
import com.yunbao.common.utils.LogUtil; import com.yunbao.common.utils.LogUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.live.bean.LiveKsyConfigBean; import com.yunbao.live.bean.LiveKsyConfigBean;
import com.yunbao.live.dialog.LiveBeautyDialogFragment; import com.yunbao.live.dialog.LiveBeautyDialogFragment;
@ -72,13 +76,10 @@ import org.greenrobot.eventbus.ThreadMode;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import java.util.Locale;
import pl.droidsonroids.gif.GifImageView; import pl.droidsonroids.gif.GifImageView;
import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_DISABLE;
import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_ENABLE;
import static com.yunbao.live.views.LivePushTxViewHolder.mTRTCCloud;
/** /**
* Created by cxf on 2018/10/7. * Created by cxf on 2018/10/7.
* 主播直播间 * 主播直播间
@ -276,7 +277,11 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
}); });
break; break;
case Constants.LIVE_FUNC_WKS: case Constants.LIVE_FUNC_WKS:
String url = CommonAppConfig.HOST + "/h5/activity/weekStar/index.html?&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; String url = CommonAppConfig.HOST
+ "/h5/activity/weekStar/index.html?&uid="
+ CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid
+ "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
ZhuangBanActivity.forward(mContext, url, false); ZhuangBanActivity.forward(mContext, url, false);
break; break;
case Constants.LIVE_FUNC_LINK_MIC://连麦 case Constants.LIVE_FUNC_LINK_MIC://连麦

View File

@ -31,6 +31,7 @@ import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.event.JavascriptInterfaceEvent; import com.yunbao.common.event.JavascriptInterfaceEvent;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.JavascriptInterfaceUtils; import com.yunbao.common.utils.JavascriptInterfaceUtils;
@ -45,6 +46,8 @@ import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import java.util.Locale;
/** /**
* Created by cxf on 2018/9/25. * Created by cxf on 2018/9/25.
* 我的徽章 h5页面 * 我的徽章 h5页面
@ -152,7 +155,7 @@ public class WebViewActivityMedal extends AbsActivity {
mIvQuestion.setOnClickListener(new View.OnClickListener() { mIvQuestion.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
MedalQuestionWebViewActivity.forward(mContext, HtmlConfig.MEDAL_QUESTION); MedalQuestionWebViewActivity.forward(mContext, HtmlConfig.MEDAL_QUESTION + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
} }
}); });
} }

View File

@ -12,6 +12,7 @@ import com.yunbao.common.Constants;
import com.yunbao.common.HtmlConfig; import com.yunbao.common.HtmlConfig;
import com.yunbao.common.bean.JsTurnTableBean; import com.yunbao.common.bean.JsTurnTableBean;
import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.views.TurnTableWebViewHolder; import com.yunbao.live.views.TurnTableWebViewHolder;
@ -19,6 +20,8 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import java.util.Locale;
import cn.qqtheme.framework.util.ScreenUtils; import cn.qqtheme.framework.util.ScreenUtils;
@ -73,7 +76,7 @@ public class LiveTurnTableDialogFragment4Audience extends AbsDialogFragment {
if (mTurnTableViewHolder == null) { if (mTurnTableViewHolder == null) {
String url = HtmlConfig.TURNTABLE_URL; String url = HtmlConfig.TURNTABLE_URL;
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken() + "&liveUid=" + mLiveUid; + CommonAppConfig.getInstance().getToken() + "&liveUid=" + mLiveUid + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
mTurnTableViewHolder = new TurnTableWebViewHolder(getActivity(), rlWebview, url); mTurnTableViewHolder = new TurnTableWebViewHolder(getActivity(), rlWebview, url);
mTurnTableViewHolder.subscribeActivityLifeCycle(); mTurnTableViewHolder.subscribeActivityLifeCycle();
mTurnTableViewHolder.addToParent(); mTurnTableViewHolder.addToParent();

View File

@ -11,6 +11,7 @@ import com.yunbao.common.Constants;
import com.yunbao.common.HtmlConfig; import com.yunbao.common.HtmlConfig;
import com.yunbao.common.bean.JsWishBean; import com.yunbao.common.bean.JsWishBean;
import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveAudienceActivity;
@ -20,6 +21,8 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import java.util.Locale;
/** /**
* Created by cxf on 2018/10/19. * Created by cxf on 2018/10/19.
* 观众查看 心愿单弹窗 * 观众查看 心愿单弹窗
@ -69,7 +72,7 @@ public class LiveWishListDialogFragment4Audience extends AbsDialogFragment {
if (mWishWebViewHolder == null) { if (mWishWebViewHolder == null) {
String url = HtmlConfig.WISHLIST_URL; String url = HtmlConfig.WISHLIST_URL;
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken() + "&liveUid=" + mLiveUid; + CommonAppConfig.getInstance().getToken() + "&liveUid=" + mLiveUid + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
mWishWebViewHolder = new WishlistWebViewHolder(mContext, rlWebview, url); mWishWebViewHolder = new WishlistWebViewHolder(mContext, rlWebview, url);
mWishWebViewHolder.subscribeActivityLifeCycle(); mWishWebViewHolder.subscribeActivityLifeCycle();
mWishWebViewHolder.addToParent(); mWishWebViewHolder.addToParent();

View File

@ -72,6 +72,7 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.lang.ref.SoftReference; import java.lang.ref.SoftReference;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ConcurrentLinkedQueue;
@ -339,7 +340,7 @@ public class LiveGiftAnimPresenter {
mGifGiftTipGroupBuyZuoji.setOnClickListener(new View.OnClickListener() { mGifGiftTipGroupBuyZuoji.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
WebViewActivity.forward(mContext, HtmlConfig.SHOP); WebViewActivity.forward(mContext, HtmlConfig.SHOP + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
} }
}); });
} }
@ -348,7 +349,7 @@ public class LiveGiftAnimPresenter {
mGifGiftTipGroupBuyLiangName.setOnClickListener(new View.OnClickListener() { mGifGiftTipGroupBuyLiangName.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
WebViewActivity.forward(mContext, HtmlConfig.SHOP); WebViewActivity.forward(mContext, HtmlConfig.SHOP + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
} }
}); });
} }

View File

@ -6,10 +6,13 @@ import android.content.Context;
import android.text.TextUtils; import android.text.TextUtils;
import com.yunbao.common.HtmlConfig; import com.yunbao.common.HtmlConfig;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import java.util.Locale;
/** /**
* Created by cxf on 2018/10/30. * Created by cxf on 2018/10/30.
*/ */
@ -56,7 +59,7 @@ public class UserHomeSharePresenter {
return; return;
} }
String link = HtmlConfig.SHARE_HOME_PAGE + mToUid; String link = HtmlConfig.SHARE_HOME_PAGE + mToUid;
ClipboardManager cm = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE); ClipboardManager cm = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
ClipData clipData = ClipData.newPlainText("text", link); ClipData clipData = ClipData.newPlainText("text", link);
cm.setPrimaryClip(clipData); cm.setPrimaryClip(clipData);
ToastUtil.show(R.string.copy_success); ToastUtil.show(R.string.copy_success);

View File

@ -14,11 +14,14 @@ import android.widget.ProgressBar;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.HtmlConfig; import com.yunbao.common.HtmlConfig;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.activity.LiveContributeActivity; import com.yunbao.live.activity.LiveContributeActivity;
import com.yunbao.common.utils.L; import com.yunbao.common.utils.L;
import java.util.Locale;
/** /**
* Created by cxf on 2018/10/15. * Created by cxf on 2018/10/15.
* 直播间粉丝排行榜 * 直播间粉丝排行榜
@ -79,7 +82,7 @@ public class LiveContributeViewHolder extends AbsLivePageViewHolder implements V
public void loadData() { public void loadData() {
if (!mLoad) { if (!mLoad) {
mLoad = true; mLoad = true;
mWebView.loadUrl(HtmlConfig.LIVE_LIST + mLiveUid); mWebView.loadUrl(HtmlConfig.LIVE_LIST + mLiveUid + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
} else { } else {
mWebView.reload(); mWebView.reload();
} }

View File

@ -13,11 +13,14 @@ import android.widget.ProgressBar;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.HtmlConfig; import com.yunbao.common.HtmlConfig;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.L; import com.yunbao.common.utils.L;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.activity.LiveContributeActivity; import com.yunbao.live.activity.LiveContributeActivity;
import java.util.Locale;
/** /**
* Created by cxf on 2018/10/15. * Created by cxf on 2018/10/15.
* 直播间粉丝排行榜 * 直播间粉丝排行榜
@ -78,7 +81,7 @@ public class LiveMedalRankViewHolder extends AbsLivePageViewHolder implements Vi
public void loadData() { public void loadData() {
if (!mLoad) { if (!mLoad) {
mLoad = true; mLoad = true;
mWebView.loadUrl(HtmlConfig.LIVE_FANS_MEDAL_RANKING + mLiveUid); mWebView.loadUrl(HtmlConfig.LIVE_FANS_MEDAL_RANKING + mLiveUid + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
} else { } else {
mWebView.reload(); mWebView.reload();
} }

View File

@ -110,7 +110,6 @@ import com.yunbao.common.utils.ScreenDimenUtil;
import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.SpUtil;
import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.utils.formatBigNum; import com.yunbao.common.utils.formatBigNum;
import com.yunbao.common.views.AbsViewHolder; import com.yunbao.common.views.AbsViewHolder;
import com.yunbao.common.views.weight.ClipPathCircleImage; import com.yunbao.common.views.weight.ClipPathCircleImage;
@ -1621,7 +1620,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.append("&uid=") .append("&uid=")
.append(userInfo.getId()) .append(userInfo.getId())
.append("&k=") .append("&k=")
.append(System.currentTimeMillis()); .append(System.currentTimeMillis())
.append("&isZh=")
.append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
} else { } else {
type = bean.getShow_type(); type = bean.getShow_type();
htmlUrl.append(bean.getLink()) htmlUrl.append(bean.getLink())
@ -1632,7 +1634,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.append("&anchorUid=") .append("&anchorUid=")
.append(mLiveUid) .append(mLiveUid)
.append("&t=") .append("&t=")
.append(System.currentTimeMillis()); .append(System.currentTimeMillis())
.append("&isZh=")
.append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
} }
if (TextUtils.equals(type, "1")) { if (TextUtils.equals(type, "1")) {
ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false);
@ -1680,7 +1684,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.append("&uid=") .append("&uid=")
.append(userInfo.getId()) .append(userInfo.getId())
.append("&k=") .append("&k=")
.append(System.currentTimeMillis()); .append(System.currentTimeMillis())
.append("&isZh=")
.append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
} else { } else {
type = bean.getShow_type(); type = bean.getShow_type();
htmlUrl.append(bean.getLink()) htmlUrl.append(bean.getLink())
@ -1694,7 +1700,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.append(mLiveUid) .append(mLiveUid)
.append("&t=") .append("&t=")
.append(System.currentTimeMillis()) .append(System.currentTimeMillis())
.append("&g=Appapi&m=Wish&a=index"); .append("&g=Appapi&m=Wish&a=index")
.append("&isZh=")
.append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
} }
if (TextUtils.equals(type, "1")) { if (TextUtils.equals(type, "1")) {
ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false);
@ -2024,7 +2032,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
String url = CommonAppConfig.HOST + path; String url = CommonAppConfig.HOST + path;
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid
+ "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
bundle.putString("url", url); bundle.putString("url", url);
bundle.putInt("height", DpUtil.dp2px(500)); bundle.putInt("height", DpUtil.dp2px(500));
bundle.putInt("show_type", 0); bundle.putInt("show_type", 0);
@ -4875,7 +4884,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.append(mLiveUid) .append(mLiveUid)
.append("&t=") .append("&t=")
.append(System.currentTimeMillis()) .append(System.currentTimeMillis())
.append("&g=Appapi&m=Wish&a=index"); .append("&g=Appapi&m=Wish&a=index")
.append("&isZh=")
.append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
if (TextUtils.equals(type, "1")) { if (TextUtils.equals(type, "1")) {
ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false);
} else { } else {
@ -4948,7 +4959,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.append(mLiveUid) .append(mLiveUid)
.append("&t=") .append("&t=")
.append(System.currentTimeMillis()) .append(System.currentTimeMillis())
.append("&g=Appapi&m=Wish&a=index"); .append("&g=Appapi&m=Wish&a=index")
.append("&isZh=")
.append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
if (TextUtils.equals(type, "1")) { if (TextUtils.equals(type, "1")) {
ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false);
} else { } else {

View File

@ -17,6 +17,7 @@ import com.yunbao.common.HtmlConfig;
import com.yunbao.common.activity.WebViewActivity; import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.bean.JsTurnTableBean; import com.yunbao.common.bean.JsTurnTableBean;
import com.yunbao.common.event.JavascriptInterfaceEvent; import com.yunbao.common.event.JavascriptInterfaceEvent;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.JavascriptInterfaceUtils; import com.yunbao.common.utils.JavascriptInterfaceUtils;
import com.yunbao.common.utils.L; import com.yunbao.common.utils.L;
@ -26,6 +27,8 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import java.util.Locale;
/** /**
* Created by cxf on 2018/10/15. * Created by cxf on 2018/10/15.
* 心愿单WebView * 心愿单WebView
@ -125,7 +128,7 @@ public class TurnTableWebViewHolder extends AbsLivePageViewHolder implements Vie
if (!TextUtils.isEmpty(event.getMethod())) { if (!TextUtils.isEmpty(event.getMethod())) {
if (TextUtils.equals(event.getMethod(), "androidMethod")) { if (TextUtils.equals(event.getMethod(), "androidMethod")) {
if (event.getData() != null && !event.getData().isEmpty()) { if (event.getData() != null && !event.getData().isEmpty()) {
WebViewActivity.forward(mContext, HtmlConfig.SHOP); WebViewActivity.forward(mContext, HtmlConfig.SHOP + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
EventBus.getDefault().post(new JsTurnTableBean(event.getData())); EventBus.getDefault().post(new JsTurnTableBean(event.getData()));
} }
} }

View File

@ -70,7 +70,7 @@ public class LanguageSettingActivity extends AbsActivity {
Stack<Activity> allActivityStacks = AppManager.getInstance().getAllActivityStacks(); Stack<Activity> allActivityStacks = AppManager.getInstance().getAllActivityStacks();
for (int i = 0; i < allActivityStacks.size(); i++) { for (int i = 0; i < allActivityStacks.size(); i++) {
if (!(allActivityStacks.get(i) instanceof LanguageSettingActivity)) { if (!(allActivityStacks.get(i) instanceof LanguageSettingActivity)) {
LanguageUtil.shiftLanguage(locale, allActivityStacks.get(i), mContext); allActivityStacks.get(i).finish();
} }
} }
IMLoginManager.get(mContext).setLanguage(locale != Locale.SIMPLIFIED_CHINESE); IMLoginManager.get(mContext).setLanguage(locale != Locale.SIMPLIFIED_CHINESE);

View File

@ -24,6 +24,7 @@ import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.pay.PayCallback; import com.yunbao.common.pay.PayCallback;
import com.yunbao.common.pay.PayPresenter; import com.yunbao.common.pay.PayPresenter;
import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.StringUtil;
@ -38,6 +39,7 @@ import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import java.util.List; import java.util.List;
import java.util.Locale;
/** /**
* Created by cxf on 2018/10/23. * Created by cxf on 2018/10/23.
@ -295,10 +297,10 @@ public class MyCoinActivity extends AbsActivity implements OnItemClickListener<C
int i = v.getId(); int i = v.getId();
if (i == R.id.btn_tip) { if (i == R.id.btn_tip) {
//充值协议 //充值协议
WebViewActivity.forward(mContext, HtmlConfig.CHARGE_PRIVCAY); WebViewActivity.forward(mContext, HtmlConfig.CHARGE_PRIVCAY + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
}else if (i == R.id.btn_charge_explain) { }else if (i == R.id.btn_charge_explain) {
//充值说明 //充值说明
WebViewActivity.forward(mContext, HtmlConfig.CHARGE_EXPLAIN); WebViewActivity.forward(mContext, HtmlConfig.CHARGE_EXPLAIN + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
} }
} }

View File

@ -17,6 +17,7 @@ import com.yunbao.common.HtmlConfig;
import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.activity.WebViewActivity; import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.L; import com.yunbao.common.utils.L;
import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.SpUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
@ -26,6 +27,8 @@ import com.yunbao.main.http.MainHttpConsts;
import com.yunbao.main.http.MainHttpUtil; import com.yunbao.main.http.MainHttpUtil;
import com.yunbao.main.utils.MainIconUtil; import com.yunbao.main.utils.MainIconUtil;
import java.util.Locale;
/** /**
* Created by cxf on 2018/10/20. * Created by cxf on 2018/10/20.
*/ */
@ -156,7 +159,7 @@ public class MyProfitActivity extends AbsActivity implements View.OnClickListene
* 提现记录 * 提现记录
*/ */
private void cashRecord() { private void cashRecord() {
WebViewActivity.forward(mContext, HtmlConfig.CASH_RECORD); WebViewActivity.forward(mContext, HtmlConfig.CASH_RECORD + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
} }

View File

@ -35,14 +35,13 @@ import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.event.JavascriptInterfaceEvent; import com.yunbao.common.event.JavascriptInterfaceEvent;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.JavascriptInterfaceUtils; import com.yunbao.common.utils.JavascriptInterfaceUtils;
import com.yunbao.common.utils.L; import com.yunbao.common.utils.L;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
import com.yunbao.live.views.LoadingView; import com.yunbao.live.views.LoadingView;
@ -58,6 +57,7 @@ import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import java.util.Arrays; import java.util.Arrays;
import java.util.Locale;
/** /**
* Created by Chen Haoxuan on 2022/3/25. * Created by Chen Haoxuan on 2022/3/25.
@ -87,7 +87,8 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
@Override @Override
public void init() { public void init() {
Bus.getOn(this); Bus.getOn(this);
String url = HtmlConfig.ENCOURAGE + "?t=" + Math.random() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); String url = HtmlConfig.ENCOURAGE + "?t=" + Math.random() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()
+ "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
final LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView); final LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView);
mProgressBar = (ProgressBar) findViewById(R.id.progressbar); mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
mWebView = new WebView(mContext); mWebView = new WebView(mContext);

View File

@ -40,6 +40,7 @@ import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.APKManager; import com.yunbao.common.manager.APKManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.utils.SVGAViewUtils;
import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.StringUtil;
@ -452,7 +453,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
Log.i("tsa", url); Log.i("tsa", url);
RewardActivity.forward(mContext, url); RewardActivity.forward(mContext, url);
} else if (bean.getId() == 4) { } else if (bean.getId() == 4) {
url = HtmlConfig.SHOP + "?t=" + Math.random() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); url = HtmlConfig.SHOP + "?t=" + Math.random() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
WebViewActivity.forward(mContext, url); WebViewActivity.forward(mContext, url);
} else if (bean.getId() == 3) {//我的等级 } else if (bean.getId() == 3) {//我的等级
Constants.myIntoIndex = 2; Constants.myIntoIndex = 2;