diff --git a/common/src/main/java/com/yunbao/common/adapter/CustomDrawerPopupAdapter.java b/common/src/main/java/com/yunbao/common/adapter/CustomDrawerPopupAdapter.java index 918d6de18..abcffeb3a 100644 --- a/common/src/main/java/com/yunbao/common/adapter/CustomDrawerPopupAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/CustomDrawerPopupAdapter.java @@ -129,7 +129,7 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter { @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(mContext.getString(R.string.net_error)); } }); } diff --git a/common/src/main/java/com/yunbao/common/adapter/LiveNewWishAdapter.java b/common/src/main/java/com/yunbao/common/adapter/LiveNewWishAdapter.java index 4363e6dd2..69c38cfed 100644 --- a/common/src/main/java/com/yunbao/common/adapter/LiveNewWishAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/LiveNewWishAdapter.java @@ -13,6 +13,7 @@ import com.yunbao.common.bean.WishModel; import com.yunbao.common.event.LiveNewWishListCloseEvent; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.DayWishItemViewHolder; import com.yunbao.common.views.LunarWishItemViewHolder; import com.yunbao.common.views.SeasonalWishItemViewHolder; @@ -53,7 +54,7 @@ public class LiveNewWishAdapter extends RecyclerView.Adapter { if (wishList.get(i)!=null){ if (!TextUtils.isEmpty(wishList.get(i).getLid()) && !TextUtils.isEmpty(model.getLid()) && TextUtils.equals(wishList.get(i).getLid(), model.getLid())) { - ToastUtil.show(R.string.too_many_gifts); + ToastUtil.show(WordUtil.isNewZh()?"重複添加禮物":"Too many gifts"); isAdd = true; } } diff --git a/common/src/main/java/com/yunbao/common/custom/CommonRefreshView.java b/common/src/main/java/com/yunbao/common/custom/CommonRefreshView.java index e7e28cc31..4da3fbca8 100644 --- a/common/src/main/java/com/yunbao/common/custom/CommonRefreshView.java +++ b/common/src/main/java/com/yunbao/common/custom/CommonRefreshView.java @@ -17,7 +17,6 @@ import androidx.recyclerview.widget.SimpleItemAnimator; import com.scwang.smartrefresh.layout.SmartRefreshLayout; import com.scwang.smartrefresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.footer.ClassicsFooter; -import com.scwang.smartrefresh.layout.header.ClassicsHeader; import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener; import com.scwang.smartrefresh.layout.listener.OnRefreshListener; import com.yunbao.common.R; @@ -188,7 +187,7 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen if (mRecyclerView != null) { RecyclerView.Adapter adapter = mRecyclerView.getAdapter(); if (adapter != null && adapter.getItemCount() > 0) { - ToastUtil.show(R.string.load_failure); + ToastUtil.show(mContext.getString(R.string.load_failure)); } else { mLoadFailureView.setVisibility(View.VISIBLE); } @@ -196,7 +195,7 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen mLoadFailureView.setVisibility(View.VISIBLE); } } else { - ToastUtil.show(R.string.load_failure); + ToastUtil.show(mContext.getString(R.string.load_failure)); } } if (mDataHelper != null) { diff --git a/common/src/main/java/com/yunbao/common/dialog/LiveNewRolePopup.java b/common/src/main/java/com/yunbao/common/dialog/LiveNewRolePopup.java index b7810f9a2..442bc2577 100644 --- a/common/src/main/java/com/yunbao/common/dialog/LiveNewRolePopup.java +++ b/common/src/main/java/com/yunbao/common/dialog/LiveNewRolePopup.java @@ -14,6 +14,7 @@ import com.yunbao.common.event.LiveNewRoleEvent; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; @@ -59,7 +60,7 @@ public class LiveNewRolePopup extends BottomPopupView { @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } diff --git a/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java b/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java index dd101d26d..88801f6bd 100644 --- a/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java +++ b/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java @@ -155,7 +155,7 @@ public class LiveNewWishListFragment extends BaseFragment { @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } else if (wishList2.size() == 1) { @@ -175,7 +175,7 @@ public class LiveNewWishListFragment extends BaseFragment { public void onCancel() { if (wishList2.size() > 10) { - ToastUtil.show(R.string.must_hint); + ToastUtil.show(getActivity().getString(R.string.must_hint)); return; } LiveNetManager.get(getContext()). @@ -187,14 +187,14 @@ public class LiveNewWishListFragment extends BaseFragment { @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } })).show(); } else { if (wishList2.size() > 10) { - ToastUtil.show(R.string.must_hint); + ToastUtil.show(getContext().getString(R.string.must_hint)); return; } LiveNetManager.get(getContext()). @@ -206,7 +206,7 @@ public class LiveNewWishListFragment extends BaseFragment { @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); diff --git a/common/src/main/java/com/yunbao/common/fragment/ProcessFragment.java b/common/src/main/java/com/yunbao/common/fragment/ProcessFragment.java index 2519b3016..49793cd89 100644 --- a/common/src/main/java/com/yunbao/common/fragment/ProcessFragment.java +++ b/common/src/main/java/com/yunbao/common/fragment/ProcessFragment.java @@ -81,20 +81,20 @@ public class ProcessFragment extends Fragment { switch (permission) { case Manifest.permission.READ_EXTERNAL_STORAGE: case Manifest.permission.WRITE_EXTERNAL_STORAGE: - ToastUtil.show(R.string.permission_storage_refused); + ToastUtil.show(getActivity().getString(R.string.permission_storage_refused)); break; case Manifest.permission.CAMERA: - ToastUtil.show(R.string.permission_camera_refused); + ToastUtil.show(getActivity().getString(R.string.permission_camera_refused)); break; case Manifest.permission.RECORD_AUDIO: - ToastUtil.show(R.string.permission_record_audio_refused); + ToastUtil.show(getActivity().getString(R.string.permission_record_audio_refused)); break; case Manifest.permission.ACCESS_COARSE_LOCATION: - ToastUtil.show(R.string.permission_location_refused); + ToastUtil.show(getActivity().getString(R.string.permission_location_refused)); CommonAppConfig.getInstance().clearLocationInfo(); break; case Manifest.permission.READ_PHONE_STATE: - ToastUtil.show(R.string.permission_read_phone_state_refused); + ToastUtil.show(getActivity().getString(R.string.permission_read_phone_state_refused)); break; } } diff --git a/common/src/main/java/com/yunbao/common/http/HttpCallback.java b/common/src/main/java/com/yunbao/common/http/HttpCallback.java index 31cc2e101..404aab7e5 100644 --- a/common/src/main/java/com/yunbao/common/http/HttpCallback.java +++ b/common/src/main/java/com/yunbao/common/http/HttpCallback.java @@ -8,10 +8,10 @@ import com.google.gson.Gson; import com.lzy.okgo.callback.AbsCallback; import com.lzy.okgo.model.Response; import com.lzy.okgo.request.base.Request; -import com.yunbao.common.R; import com.yunbao.common.utils.L; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import java.net.ConnectException; import java.net.SocketException; @@ -36,7 +36,7 @@ public abstract class HttpCallback extends AbsCallback { public void onSuccess(Response response) { JsonBean bean = response.body(); String gson = new Gson().toJson(bean); - Log.e("onSuccess",gson); + Log.e("onSuccess", gson); if (bean != null) { if (200 == bean.getRet()) { Data data = bean.getData(); @@ -65,7 +65,7 @@ public abstract class HttpCallback extends AbsCallback { t.printStackTrace(); L.e("网络请求错误---->" + t.getClass() + " : " + t.getMessage()); if (t instanceof SocketTimeoutException || t instanceof ConnectException || t instanceof UnknownHostException || t instanceof UnknownServiceException || t instanceof SocketException) { - ToastUtil.show(R.string.load_failure); + ToastUtil.show(WordUtil.isNewZh() ? "網絡請求失敗" : "Network request failed"); } // if (showLoadingDialog() && mLoadingDialog != null) { // mLoadingDialog.dismiss(); diff --git a/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java b/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java index a5a85961a..ebb586b0a 100644 --- a/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java +++ b/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java @@ -10,6 +10,7 @@ import com.yunbao.common.bean.RankPkInfoBean; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import java.util.ArrayList; import java.util.List; @@ -342,7 +343,7 @@ public class RandomPkManager { @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } diff --git a/common/src/main/java/com/yunbao/common/pay/PayPresenter.java b/common/src/main/java/com/yunbao/common/pay/PayPresenter.java index b8bd3f2a2..cae17cc09 100644 --- a/common/src/main/java/com/yunbao/common/pay/PayPresenter.java +++ b/common/src/main/java/com/yunbao/common/pay/PayPresenter.java @@ -1,11 +1,11 @@ package com.yunbao.common.pay; import android.app.Activity; - -import androidx.annotation.NonNull; import android.text.TextUtils; import android.util.Log; +import androidx.annotation.NonNull; + import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.android.billingclient.api.Purchase; @@ -18,13 +18,14 @@ import com.yunbao.common.bean.UserBean; import com.yunbao.common.event.CoinChangeEvent; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; -import com.yunbao.common.pay.ali.AliPayBuilder; import com.yunbao.common.pay.wx.WxPayBuilder; import com.yunbao.common.utils.GoogleBillingUtil; import com.yunbao.common.utils.OnGoogleBillingListener; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; + import org.greenrobot.eventbus.EventBus; + import java.lang.ref.WeakReference; import java.util.List; import java.util.Locale; @@ -48,16 +49,16 @@ public class PayPresenter { private GoogleBillingUtil googleBillingUtil; - private String TAG="PayPresenter"; - private String [] arrPro = {"1"}; + private String TAG = "PayPresenter"; + private String[] arrPro = {"1"}; private String mOrderid; public PayPresenter(Activity activity) { mActivity = new WeakReference<>(activity).get(); } - public void setPayCallback(PayCallback callback){ - mPayCallback=callback; + public void setPayCallback(PayCallback callback) { + mPayCallback = callback; } public long getBalanceValue() { @@ -96,9 +97,10 @@ public class PayPresenter { public void setAliCallbackUrl(String aliCallbackUrl) { mAliCallbackUrl = aliCallbackUrl; } + public void pay(String payType, String money, String goodsName, String orderParams) { if (TextUtils.isEmpty(payType)) { - ToastUtil.show(R.string.wallet_tip_5); + ToastUtil.show(mActivity.getString(R.string.wallet_tip_5)); return; } //L.e("《==》支付按钮4--->" +payType); @@ -128,40 +130,42 @@ public class PayPresenter { case Constants.PAY_TYPE_GOOGLE://google支付 googlePay(orderParams); break; - default: - otherPay(orderParams,payType); - break; + default: + otherPay(orderParams, payType); + break; } } //谷歌支付 private void googlePay(String orderParams) { - mOrderid="1"; - String pid="2"; - if (pid != null && !pid.isEmpty()){ - arrPro[0]=pid; + mOrderid = "1"; + String pid = "2"; + if (pid != null && !pid.isEmpty()) { + arrPro[0] = pid; initGooglePay(); } - String newParm= StringUtil.contact("Charge.getGoogleOrder",orderParams,"&type=android", - "&appname=",mActivity.getString(R.string.app_name), - "&desc="+mActivity.getPackageName()+"&source=android" + String newParm = StringUtil.contact("Charge.getGoogleOrder", orderParams, "&type=android", + "&appname=", mActivity.getString(R.string.app_name), + "&desc=" + mActivity.getPackageName() + "&source=android" ); CommonHttpUtil.getWxH5Order(newParm, new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { - if(code==0){ + if (code == 0) { try { ToastUtil.show("开始支付,请稍后"); - org.json.JSONObject jsonObject=new org.json.JSONObject(info[0]); - mOrderid=jsonObject.getString("orderid"); - String pid=jsonObject.getString("pid"); - if (pid != null && !pid.isEmpty()){ - arrPro[0]=pid; + org.json.JSONObject jsonObject = new org.json.JSONObject(info[0]); + mOrderid = jsonObject.getString("orderid"); + String pid = jsonObject.getString("pid"); + if (pid != null && !pid.isEmpty()) { + arrPro[0] = pid; initGooglePay(); } - }catch (Exception e){ e.printStackTrace(); } - }else { + } catch (Exception e) { + e.printStackTrace(); + } + } else { ToastUtil.show("无法支付,请联系客服"); } @@ -171,7 +175,7 @@ public class PayPresenter { private void initGooglePay() { GoogleBillingUtil.isDebug(true); - GoogleBillingUtil.setSkus(arrPro,null); + GoogleBillingUtil.setSkus(arrPro, null); GoogleBillingUtil.setIsAutoAcknowledgePurchase(true);//设置自动确认购买 googleBillingUtil = GoogleBillingUtil.getInstance() .addOnGoogleBillingListener(mActivity, mOnMyGoogleBillingListener) @@ -179,35 +183,35 @@ public class PayPresenter { } private void paypalPay(String orderParams) { - String url1="/index.php?m=App&a=paypal" +orderParams +"&source=android"; - String url2= CommonAppConfig.HOST+url1; + String url1 = "/index.php?m=App&a=paypal" + orderParams + "&source=android"; + String url2 = CommonAppConfig.HOST + url1; open(url2); } private void payssionPay(String orderParams) { - String url1="/index.php?m=App&a=pay" +orderParams +"&source=android"; - String url2= CommonAppConfig.HOST+url1; + String url1 = "/index.php?m=App&a=pay" + orderParams + "&source=android"; + String url2 = CommonAppConfig.HOST + url1; open(url2); } private void yunquPay(String orderParams) { - String newParm= StringUtil.contact("Charge.getYunquOrder",orderParams,"&type=android", - "&appname=",mActivity.getString(R.string.app_name), - "&desc="+mActivity.getPackageName()+"&source=android" + String newParm = StringUtil.contact("Charge.getYunquOrder", orderParams, "&type=android", + "&appname=", mActivity.getString(R.string.app_name), + "&desc=" + mActivity.getPackageName() + "&source=android" ); //L.e("《==》支付URL--->" +newParm); CommonHttpUtil.getWxH5Order(newParm, new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { - if(code==0){ + if (code == 0) { try { - org.json.JSONObject jsonObject=new org.json.JSONObject(info[0]); - String payment_url=jsonObject.getString("payment_url"); + org.json.JSONObject jsonObject = new org.json.JSONObject(info[0]); + String payment_url = jsonObject.getString("payment_url"); open(payment_url); // L.e("《==》支付URL--->" +payment_url); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } @@ -216,20 +220,20 @@ public class PayPresenter { } private void hfbPay(String orderParams) { - String newParm= StringUtil.contact("Charge.getWxH5Order",orderParams,"&type=android", - "&appname=",mActivity.getString(R.string.app_name), - "&desc="+mActivity.getPackageName() - ); + String newParm = StringUtil.contact("Charge.getWxH5Order", orderParams, "&type=android", + "&appname=", mActivity.getString(R.string.app_name), + "&desc=" + mActivity.getPackageName() + ); CommonHttpUtil.getCashierOrder(newParm, new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { - if(code==0){ + if (code == 0) { try { - org.json.JSONObject jsonObject=new org.json.JSONObject(info[0]); - String redirectUrl=jsonObject.getString("redirectUrl"); + org.json.JSONObject jsonObject = new org.json.JSONObject(info[0]); + String redirectUrl = jsonObject.getString("redirectUrl"); open(redirectUrl); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } @@ -237,66 +241,68 @@ public class PayPresenter { }); } - public void open(String url){ + public void open(String url) { //支付时内部跳转 false要添加 - WebViewActivity.forward(mActivity,url,false,false); + WebViewActivity.forward(mActivity, url, false, false); } private void hwPay(String orderParams) { - String newParm= StringUtil.contact("Charge.getCashierOrder",orderParams,"&type=android", - "&appname=",mActivity.getString(R.string.app_name), - "&desc="+mActivity.getPackageName()+"&source=android" + String newParm = StringUtil.contact("Charge.getCashierOrder", orderParams, "&type=android", + "&appname=", mActivity.getString(R.string.app_name), + "&desc=" + mActivity.getPackageName() + "&source=android" ); //L.e("《==》支付URL--->" +newParm); CommonHttpUtil.getWxH5Order(newParm, new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { - if(code==0){ + if (code == 0) { try { - org.json.JSONObject jsonObject=new org.json.JSONObject(info[0]); - String payment_url=jsonObject.getString("payment_url"); + org.json.JSONObject jsonObject = new org.json.JSONObject(info[0]); + String payment_url = jsonObject.getString("payment_url"); open(payment_url); - // L.e("《==》支付URL--->" +payment_url); + // L.e("《==》支付URL--->" +payment_url); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } } }); } - private void otherPay(String orderParams,String payType) { - String newParm= StringUtil.contact("Charge.getOtherPayOrder",orderParams,"&type=android", - "&appname=",mActivity.getString(R.string.app_name), - "&desc="+mActivity.getPackageName()+"&source=android&payType="+payType + + private void otherPay(String orderParams, String payType) { + String newParm = StringUtil.contact("Charge.getOtherPayOrder", orderParams, "&type=android", + "&appname=", mActivity.getString(R.string.app_name), + "&desc=" + mActivity.getPackageName() + "&source=android&payType=" + payType ); CommonHttpUtil.getWxH5Order(newParm, new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { - if(code==0){ + if (code == 0) { try { - org.json.JSONObject jsonObject=new org.json.JSONObject(info[0]); - String payment_url=jsonObject.getString("payment_url"); + org.json.JSONObject jsonObject = new org.json.JSONObject(info[0]); + String payment_url = jsonObject.getString("payment_url"); open(payment_url); // L.e("《==》支付URL--->" +payment_url); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } } }); } + /** * 支付宝支付 */ private void aliPay(String money, String goodsName, String orderParams) { - if (mActivity == null || TextUtils.isEmpty(mServiceNameAli)|| TextUtils.isEmpty(mAliCallbackUrl)) { + if (mActivity == null || TextUtils.isEmpty(mServiceNameAli) || TextUtils.isEmpty(mAliCallbackUrl)) { return; } // if (!CommonAppConfig.isAppExist(Constants.PACKAGE_NAME_ALI)) { -// ToastUtil.show(R.string.coin_ali_not_install); +// ToastUtil.show(mContext.getString(R.string.coin_ali_not_install); // return; // } if (TextUtils.isEmpty(mAliPartner) || TextUtils.isEmpty(mAliSellerId) || TextUtils.isEmpty(mAliPrivateKey)) { @@ -321,7 +327,7 @@ public class PayPresenter { return; } if (!CommonAppConfig.isAppExist(Constants.PACKAGE_NAME_WX)) { - ToastUtil.show(R.string.coin_wx_not_install); + ToastUtil.show(mActivity.getString(R.string.coin_wx_not_install)); return; } if (TextUtils.isEmpty(mWxAppID)) { @@ -351,12 +357,12 @@ public class PayPresenter { long goldValue = Long.parseLong(goldCoin); if (balanceValue > mBalanceValue) { mBalanceValue = balanceValue; - ToastUtil.show(R.string.coin_charge_success); + ToastUtil.show(mActivity.getString(R.string.coin_charge_success)); UserBean u = CommonAppConfig.getInstance().getUserBean(); if (u != null) { u.setCoin(coin); } - EventBus.getDefault().post(new CoinChangeEvent(coin,goldCoin, true)); + EventBus.getDefault().post(new CoinChangeEvent(coin, goldCoin, true)); } } } @@ -364,11 +370,11 @@ public class PayPresenter { } - private OnGoogleBillingListener mOnMyGoogleBillingListener=new OnGoogleBillingListener(){ + private OnGoogleBillingListener mOnMyGoogleBillingListener = new OnGoogleBillingListener() { @Override public void onSetupSuccess(boolean isSelf) { super.onSetupSuccess(isSelf); - Log.d(TAG,"内购服务初始化完成"); + Log.d(TAG, "内购服务初始化完成"); checkSubs(); } @@ -393,30 +399,30 @@ public class PayPresenter { // } // googleBillingUtil.purchaseInApp(mActivity,"zs640"); - googleBillingUtil.purchaseInApp(mActivity,googleBillingUtil.getInAppSkuByPosition(0)); + googleBillingUtil.purchaseInApp(mActivity, googleBillingUtil.getInAppSkuByPosition(0)); // Log.d(TAG,tempBuffer.toString()); } @Override public boolean onPurchaseSuccess(@NonNull Purchase purchase, boolean isSelf) { - StringBuffer tempBuffer =new StringBuffer(); - if(purchase.getPurchaseState()==Purchase.PurchaseState.PURCHASED){ + StringBuffer tempBuffer = new StringBuffer(); + if (purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED) { tempBuffer.append("购买成功:"); //通知自己服务器 - if (mOrderid == null || purchase.getOrderId() == null){ + if (mOrderid == null || purchase.getOrderId() == null) { return false; } - String allData=""; - allData="OrderId=" +purchase.getOrderId()+ - ",PackageName="+purchase.getPackageName() + - ",Sku=" +"purchase.getSku()"+ - ",PurchaseTime=" +purchase.getPurchaseTime()+ - ",PurchaseToken=" +purchase.getPurchaseToken()+ - ",DeveloperPayload=" +purchase.getDeveloperPayload()+ - ",OriginalJson=" +purchase.getOriginalJson()+ - ",PurchaseState=" +purchase.getPurchaseState()+ - ",Signature="+purchase.getSignature(); + String allData = ""; + allData = "OrderId=" + purchase.getOrderId() + + ",PackageName=" + purchase.getPackageName() + + ",Sku=" + "purchase.getSku()" + + ",PurchaseTime=" + purchase.getPurchaseTime() + + ",PurchaseToken=" + purchase.getPurchaseToken() + + ",DeveloperPayload=" + purchase.getDeveloperPayload() + + ",OriginalJson=" + purchase.getOriginalJson() + + ",PurchaseState=" + purchase.getPurchaseState() + + ",Signature=" + purchase.getSignature(); // CommonHttpUtil.notifyGoogle("1",mOrderid,purchase.getOrderId(),allData, new HttpCallback() { // @Override // public void onSuccess(int code, String msg, String[] info) { @@ -433,22 +439,21 @@ public class PayPresenter { // }); - }else{ + } else { tempBuffer.append("暂未支付:"); } - String details = String.format(Locale.getDefault(),"%s \n"," purchase.getSku()"); + String details = String.format(Locale.getDefault(), "%s \n", " purchase.getSku()"); tempBuffer.append(details); - Log.d(TAG,tempBuffer.toString()); - return true ;//自动消耗(只有当isSelf为true,并且支付状态为PURCHASED时,该值才会生效) + Log.d(TAG, tempBuffer.toString()); + return true;//自动消耗(只有当isSelf为true,并且支付状态为PURCHASED时,该值才会生效) } - @Override public boolean onRecheck(@NonNull String skuType, @NonNull Purchase purchase, boolean isSelf) { - StringBuffer tempBuffer =new StringBuffer(); + StringBuffer tempBuffer = new StringBuffer(); tempBuffer.append("检测到未处理的订单($skuType):${purchase.sku}()"); - Log.d(TAG,tempBuffer.toString()); + Log.d(TAG, tempBuffer.toString()); return true; } @@ -459,43 +464,43 @@ public class PayPresenter { @Override public void onConsumeSuccess(@NonNull String purchaseToken, boolean isSelf) { - Log.d(TAG,"消耗商品成功:$purchaseToken"); + Log.d(TAG, "消耗商品成功:$purchaseToken"); } @Override public void onAcknowledgePurchaseSuccess(boolean isSelf) { - Log.d(TAG,"确认购买商品成功"); + Log.d(TAG, "确认购买商品成功"); } @Override public void onFail(@NonNull GoogleBillingUtil.GoogleBillingListenerTag tag, int responseCode, boolean isSelf) { - Log.d(TAG,"操作失败:tag=${" + tag.name() + "responseCode=" + responseCode); + Log.d(TAG, "操作失败:tag=${" + tag.name() + "responseCode=" + responseCode); } @Override public void onError(@NonNull GoogleBillingUtil.GoogleBillingListenerTag tag, boolean isSelf) { - Log.d(TAG,"发生错误:tag="+tag.name()); + Log.d(TAG, "发生错误:tag=" + tag.name()); } }; private void checkSubs() { int size = googleBillingUtil.getPurchasesSizeSubs(mActivity); - switch (size){ + switch (size) { case 0: //不具备有效订阅 - Log.d(TAG,"有效订阅数:0(无有效订阅)"); + Log.d(TAG, "有效订阅数:0(无有效订阅)"); break; case -1: //查询失败 - Log.d(TAG,"有效订阅数:-1(查询失败)"); + Log.d(TAG, "有效订阅数:-1(查询失败)"); break; default: //具有有效订阅 - Log.d(TAG,"有效订阅数:$size(具备有效订阅)"); + Log.d(TAG, "有效订阅数:$size(具备有效订阅)"); break; } } @@ -504,7 +509,7 @@ public class PayPresenter { mActivity = null; mPayCallback = null; - if (googleBillingUtil != null){ + if (googleBillingUtil != null) { googleBillingUtil.onDestroy(mActivity); //退出程序的时候可以调用(实验性) GoogleBillingUtil.endConnection(); diff --git a/common/src/main/java/com/yunbao/common/pay/wx/WxPayBuilder.java b/common/src/main/java/com/yunbao/common/pay/wx/WxPayBuilder.java index a34349bc7..181b78bcc 100644 --- a/common/src/main/java/com/yunbao/common/pay/wx/WxPayBuilder.java +++ b/common/src/main/java/com/yunbao/common/pay/wx/WxPayBuilder.java @@ -80,12 +80,12 @@ public class WxPayBuilder { // req.sign = sign; // IWXAPI wxApi = WxApiWrapper.getInstance().getWxApi(); // if (wxApi == null) { -// ToastUtil.show(R.string.coin_charge_failed); +// ToastUtil.show(mContext.getString(R.string.coin_charge_failed); // return; // } // boolean result = wxApi.sendReq(req); // if (!result) { -// ToastUtil.show(R.string.coin_charge_failed); +// ToastUtil.show(mContext.getString(R.string.coin_charge_failed); // } } } diff --git a/common/src/main/java/com/yunbao/common/utils/ProcessImageUtil.java b/common/src/main/java/com/yunbao/common/utils/ProcessImageUtil.java index 2b4731fcc..c58ad32ee 100644 --- a/common/src/main/java/com/yunbao/common/utils/ProcessImageUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/ProcessImageUtil.java @@ -92,7 +92,7 @@ public class ProcessImageUtil extends ProcessResultUtil { @Override public void onFailure() { - ToastUtil.show(R.string.img_camera_cancel); + ToastUtil.show(mContext.getString(R.string.img_camera_cancel)); } }; mAlumbResultCallback = new ActivityResultCallback() { @@ -103,7 +103,7 @@ public class ProcessImageUtil extends ProcessResultUtil { @Override public void onFailure() { - ToastUtil.show(R.string.img_alumb_cancel); + ToastUtil.show(mContext.getString(R.string.img_alumb_cancel)); } }; mCropResultCallback = new ActivityResultCallback() { @@ -116,7 +116,7 @@ public class ProcessImageUtil extends ProcessResultUtil { @Override public void onFailure() { - ToastUtil.show(R.string.img_crop_cancel); + ToastUtil.show(mContext.getString(R.string.img_crop_cancel)); } }; } diff --git a/common/src/main/java/com/yunbao/common/utils/ToastUtil.java b/common/src/main/java/com/yunbao/common/utils/ToastUtil.java index bf4431ce1..80304292f 100644 --- a/common/src/main/java/com/yunbao/common/utils/ToastUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/ToastUtil.java @@ -1,5 +1,6 @@ package com.yunbao.common.utils; +import android.app.Activity; import android.app.Dialog; import android.content.Context; import android.graphics.Color; @@ -43,7 +44,7 @@ public class ToastUtil { public static void show(int res) { - show(CommonAppContext.sInstance.getString(res)); + show(WordUtil.getNewString(res)); } /** @@ -85,9 +86,10 @@ public class ToastUtil { } public static void showDebug(int s){ if(BuildConfig.DEBUG){ - show(s); + show("开发模式:"+s); } } + public static void show(String s) { if (TextUtils.isEmpty(s)) { return; diff --git a/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java b/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java index 3d94725a2..9ad0e8686 100644 --- a/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java +++ b/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java @@ -179,7 +179,7 @@ public class CustomDrawerPopupView extends DrawerPopupView { @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(mContext.getString(R.string.net_error)); } }); } diff --git a/common/src/main/java/com/yunbao/common/views/DrawerTaskChildViewHolder.java b/common/src/main/java/com/yunbao/common/views/DrawerTaskChildViewHolder.java index af7e22b5f..da952ddfe 100644 --- a/common/src/main/java/com/yunbao/common/views/DrawerTaskChildViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/DrawerTaskChildViewHolder.java @@ -19,6 +19,7 @@ import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; public class DrawerTaskChildViewHolder extends RecyclerView.ViewHolder { @@ -110,7 +111,7 @@ public class DrawerTaskChildViewHolder extends RecyclerView.ViewHolder { @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } else { diff --git a/common/src/main/java/com/yunbao/common/views/LiveAnchorMessageCustomPopup.java b/common/src/main/java/com/yunbao/common/views/LiveAnchorMessageCustomPopup.java index 15e9c34c4..8e35daaf9 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveAnchorMessageCustomPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveAnchorMessageCustomPopup.java @@ -13,6 +13,7 @@ import com.yunbao.common.bean.ListInfoMessageModel; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.weight.OnRecyclerViewScrollListener; import java.util.List; @@ -68,7 +69,7 @@ public class LiveAnchorMessageCustomPopup extends BottomPopupView { @Override public void onError(String error) { - ToastUtil.show( R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); diff --git a/common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java b/common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java index f4ed86164..d4df1c650 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java @@ -116,9 +116,9 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl ViewClicksAntiShake.clicksAntiShake(lineHd, () -> { if (lineHd.getTag() != null) { if (isUser) {//用户端 - ToastUtil.show(R.string.live_user_ban_hd); + ToastUtil.show(getContext().getString(R.string.live_user_ban_hd)); } else {//主播端 - ToastUtil.show(R.string.function_is_suspended); + ToastUtil.show(getContext().getString(R.string.function_is_suspended)); } return; } @@ -151,9 +151,9 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl ViewClicksAntiShake.clicksAntiShake(lineFhd, () -> { if (lineFhd.getTag() != null) { if (isUser) {//用户端 - ToastUtil.show(R.string.live_user_ban_fhd); + ToastUtil.show(getContext().getString(R.string.live_user_ban_fhd)); } else {//主播端 - ToastUtil.show(R.string.function_is_suspended); + ToastUtil.show(getContext().getString(R.string.function_is_suspended)); } return; } diff --git a/common/src/main/java/com/yunbao/common/views/LiveNewWishGiftPopup.java b/common/src/main/java/com/yunbao/common/views/LiveNewWishGiftPopup.java index f307d76f1..f8cc6bb8c 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveNewWishGiftPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveNewWishGiftPopup.java @@ -29,6 +29,7 @@ import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; import org.greenrobot.eventbus.Subscribe; @@ -166,7 +167,7 @@ public class LiveNewWishGiftPopup extends BottomPopupView { @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); diff --git a/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java b/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java index a6ea6fc22..b0f409204 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java @@ -326,7 +326,7 @@ public class LiveNewWishListPopup extends BottomPopupView { List wishList2 = new ArrayList<>(); Gson gson = new Gson(); if (wishList2.size()>10){ - ToastUtil.show(R.string.must_hint); + ToastUtil.show(mContext.getString(R.string.must_hint)); return; } LiveNetManager.get(getContext()). @@ -338,7 +338,7 @@ public class LiveNewWishListPopup extends BottomPopupView { @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); })) diff --git a/common/src/main/java/com/yunbao/common/views/LiveOpenCustomPopup.java b/common/src/main/java/com/yunbao/common/views/LiveOpenCustomPopup.java index e616d8605..bc86b844d 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveOpenCustomPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveOpenCustomPopup.java @@ -195,7 +195,7 @@ public class LiveOpenCustomPopup extends CenterPopupView { @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); diff --git a/common/src/main/java/com/yunbao/common/views/LiveRobotMessageCustomPopup.java b/common/src/main/java/com/yunbao/common/views/LiveRobotMessageCustomPopup.java index ea727fba8..d82157fd1 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveRobotMessageCustomPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveRobotMessageCustomPopup.java @@ -24,6 +24,7 @@ import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; @@ -130,7 +131,7 @@ public class LiveRobotMessageCustomPopup extends BottomPopupView { } }); } else { - ToastUtil.show(R.string.robot_minimum_interval); + ToastUtil.show(getContext().getString(R.string.robot_minimum_interval)); } @@ -181,7 +182,7 @@ public class LiveRobotMessageCustomPopup extends BottomPopupView { @Override public void onError(String error) { - ToastUtil.show( R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } diff --git a/common/src/main/java/com/yunbao/common/views/LiveRobotSayHelloCustomPopup.java b/common/src/main/java/com/yunbao/common/views/LiveRobotSayHelloCustomPopup.java index eeef5348b..4356f38b2 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveRobotSayHelloCustomPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveRobotSayHelloCustomPopup.java @@ -19,6 +19,7 @@ import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; @@ -125,7 +126,7 @@ public class LiveRobotSayHelloCustomPopup extends BottomPopupView { @Override public void onError(String error) { - ToastUtil.show( R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } diff --git a/common/src/main/java/com/yunbao/common/views/LiveRobotSettingCustomPopup.java b/common/src/main/java/com/yunbao/common/views/LiveRobotSettingCustomPopup.java index be5d489f2..d777f6ca0 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveRobotSettingCustomPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveRobotSettingCustomPopup.java @@ -22,6 +22,7 @@ import com.yunbao.common.bean.LiveAiRobotBean; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; public class LiveRobotSettingCustomPopup extends BottomPopupView implements View.OnClickListener { private static String TAG = "AI机器人"; @@ -251,7 +252,7 @@ public class LiveRobotSettingCustomPopup extends BottomPopupView implements View @Override public void onError(String error) { - ToastUtil.show( R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); diff --git a/common/src/main/java/com/yunbao/common/views/RobotMessageViewHolder.java b/common/src/main/java/com/yunbao/common/views/RobotMessageViewHolder.java index 34eb112d9..36ce1e7f0 100644 --- a/common/src/main/java/com/yunbao/common/views/RobotMessageViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/RobotMessageViewHolder.java @@ -16,6 +16,7 @@ import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; public class RobotMessageViewHolder extends RecyclerView.ViewHolder { @@ -44,7 +45,7 @@ public class RobotMessageViewHolder extends RecyclerView.ViewHolder { @Override public void onError(String error) { - ToastUtil.show( R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } diff --git a/common/src/main/java/com/yunbao/common/views/RobotSayHelloViewHoler.java b/common/src/main/java/com/yunbao/common/views/RobotSayHelloViewHoler.java index 2b2951c06..199118d50 100644 --- a/common/src/main/java/com/yunbao/common/views/RobotSayHelloViewHoler.java +++ b/common/src/main/java/com/yunbao/common/views/RobotSayHelloViewHoler.java @@ -16,6 +16,7 @@ import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; public class RobotSayHelloViewHoler extends RecyclerView.ViewHolder { private TextView serialNumber, messageText; @@ -44,7 +45,7 @@ public class RobotSayHelloViewHoler extends RecyclerView.ViewHolder { @Override public void onError(String error) { - ToastUtil.show( R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 889907acb..0cd68dd9c 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -191,7 +191,7 @@ Pack Guardian list Guard the anchor - homepage + Homepage "%1$s" is also in%2$s, ~ Click to view TA\'s story TA has%1$s fans. Come and watch! Hi ~ I\'m the anchor. Come and talk to me. diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index f9a9fafa6..1529f8164 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -191,7 +191,7 @@ Pack Guardian list Guard the anchor - homepage + Homepage "%1$s" is also in%2$s, ~ Click to view TA\'s story TA has%1$s fans. Come and watch! Hi ~ I\'m the anchor. Come and talk to me. diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index 6a1aac149..d5a616fd5 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -1331,7 +1331,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL @Override public void onError(String error) { Log.e("LiveUserMoreDialog", error); - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } else { diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java index eb4ebaa30..9a2484077 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java @@ -159,7 +159,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic @Override public void onPushFailed() { //推流失败回调 - ToastUtil.show(R.string.live_push_failed); + ToastUtil.show(mContext.getString(R.string.live_push_failed)); } }); mLivePushViewHolder.addToParent(); @@ -370,7 +370,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic */ private void openMusicWindow() { if (isLinkMicAnchor() || isLinkMicAnchor()) { - ToastUtil.show(R.string.link_mic_not_bgm); + ToastUtil.show(mContext.getString(R.string.link_mic_not_bgm)); return; } LiveMusicDialogFragment fragment = new LiveMusicDialogFragment(); @@ -442,7 +442,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic */ private void openGameWindow() { if (isLinkMic() || isLinkMicAnchor()) { - ToastUtil.show(R.string.live_link_mic_cannot_game); + ToastUtil.show(mContext.getString(R.string.live_link_mic_cannot_game)); return; } } diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index cfc90402e..7fcc5e195 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -739,7 +739,7 @@ public class LiveAudienceActivity extends LiveActivity { public void onLiveRoomChangeEvent(LiveRoomChangeEvent e) { LiveBean liveBean = e.getLiveBean(); if (TextUtils.equals(mLiveUid, liveBean.getUid())) { - ToastUtil.show(R.string.current_live_room); + ToastUtil.show(mContext.getString(R.string.current_live_room)); } else { if (e.isLiveEnd()) { manager.removeLiveEnd(); @@ -1594,7 +1594,7 @@ public class LiveAudienceActivity extends LiveActivity { @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); diff --git a/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java index 7525d230a..6826205bd 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java @@ -104,7 +104,7 @@ public class LiveReportActivity extends AbsActivity implements LiveReportAdapter // return; // } // if (bean == null) { -// ToastUtil.show(R.string.video_report_tip_3); +// ToastUtil.show(mContext.getString(R.string.video_report_tip_3); // return; // } // String content = bean.getName(); @@ -120,7 +120,7 @@ public class LiveReportActivity extends AbsActivity implements LiveReportAdapter mToUid = ""; } if (bean == null) { - ToastUtil.show(R.string.video_report_tip_3); + ToastUtil.show(mContext.getString(R.string.video_report_tip_3)); return; } String content = ""; @@ -137,7 +137,7 @@ public class LiveReportActivity extends AbsActivity implements LiveReportAdapter @Override public void onSuccess(int code, String msg, String[] info) { if (code == 0) { - ToastUtil.show(R.string.video_report_tip_4); + ToastUtil.show(mContext.getString(R.string.video_report_tip_4)); onBackPressed(); } else { ToastUtil.show(msg); @@ -149,7 +149,7 @@ public class LiveReportActivity extends AbsActivity implements LiveReportAdapter @Override public void onSuccess(int code, String msg, String[] info) { if (code == 0) { - ToastUtil.show(R.string.video_report_tip_4); + ToastUtil.show(mContext.getString(R.string.video_report_tip_4)); onBackPressed(); } else { ToastUtil.show(msg); diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index 50851f1a8..db9073755 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -288,7 +288,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl @Override public void onPushFailed() { //推流失败回调 - ToastUtil.show(R.string.live_push_failed); + ToastUtil.show(mContext.getString(R.string.live_push_failed)); } }); @@ -638,7 +638,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl */ private void openMusicWindow() { if (isLinkMicAnchor() || isLinkMicAnchor()) { - ToastUtil.show(R.string.link_mic_not_bgm); + ToastUtil.show(mContext.getString(R.string.link_mic_not_bgm)); return; } LiveMusicDialogFragment fragment = new LiveMusicDialogFragment(); @@ -736,7 +736,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl */ private void openGameWindow() { if (isLinkMic() || isLinkMicAnchor()) { - ToastUtil.show(R.string.live_link_mic_cannot_game); + ToastUtil.show(mContext.getString(R.string.live_link_mic_cannot_game)); return; } } @@ -1773,7 +1773,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } diff --git a/live/src/main/java/com/yunbao/live/activity/LiveTRTCAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveTRTCAnchorActivity.java index b75013a91..0db3b6e73 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveTRTCAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveTRTCAnchorActivity.java @@ -344,7 +344,7 @@ public class LiveTRTCAnchorActivity extends TRTCBaseActivity { @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { - ToastUtil.show(R.string.live_set_pwd_empty); + ToastUtil.show(getString(R.string.live_set_pwd_empty)); } else { mLiveType = bean.getId(); mLiveTypeTextView.setText(bean.getName()); diff --git a/live/src/main/java/com/yunbao/live/adapter/FreePkRecyclerAdapter.java b/live/src/main/java/com/yunbao/live/adapter/FreePkRecyclerAdapter.java index ca94b19df..96e27f2ed 100644 --- a/live/src/main/java/com/yunbao/live/adapter/FreePkRecyclerAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/FreePkRecyclerAdapter.java @@ -118,11 +118,11 @@ public class FreePkRecyclerAdapter extends RefreshAdapter { mPkStatus.setOnClickListener(v -> { RandomPkUserBean bean = (RandomPkUserBean) itemView.getTag(); if (bean.isPk()) { - ToastUtil.show(R.string.free_pk_user_pking); + ToastUtil.show(mContext.getString(R.string.free_pk_user_pking)); return; } if (freePkNum == 0 && mDrPkNum == -1) { - ToastUtil.show(R.string.free_pk_num_null); + ToastUtil.show(mContext.getString(R.string.free_pk_num_null)); // return; } @@ -172,10 +172,10 @@ public class FreePkRecyclerAdapter extends RefreshAdapter { public void onSuccess(SetAttentsModel data) { bean.setAttention(data.getIsattent()); if ("1".equals(data.getIsattent())) { - ToastUtil.show(R.string.following); + ToastUtil.show(mContext.getString(R.string.following)); mOnItemClickListener.onItemClick(bean, 1); } else { - ToastUtil.show(R.string.unfollow_cancel); + ToastUtil.show(mContext.getString(R.string.unfollow_cancel)); mOnItemClickListener.onItemClick(bean, 0); } @@ -183,7 +183,7 @@ public class FreePkRecyclerAdapter extends RefreshAdapter { @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); }); diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveNewWishListAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveNewWishListAdapter.java index ca1d30d70..d35160118 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveNewWishListAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveNewWishListAdapter.java @@ -174,7 +174,7 @@ public class LiveNewWishListAdapter extends RecyclerView.Adapter { @Override public void onClick(View v) { if (bean.isHide() && (type.equals("5") || type.equals("4"))) { - ToastUtil.show(R.string.can_not_go); + ToastUtil.show(mContext.getString(R.string.can_not_go)); } else { ((LiveActivity) mContext).showUserDialog(bean.getId()); fragments.dismiss(); diff --git a/live/src/main/java/com/yunbao/live/dialog/FreePkDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/FreePkDialogFragment.java index ef52c9a21..5d7ec954b 100644 --- a/live/src/main/java/com/yunbao/live/dialog/FreePkDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/FreePkDialogFragment.java @@ -179,7 +179,7 @@ public class FreePkDialogFragment extends AbsDialogFragment implements View.OnCl @Override public void onError(String error) { - ToastUtil.show(com.yunbao.common.R.string.net_error); + ToastUtil.show(mContext.getString(com.yunbao.common.R.string.net_error)); } }); } 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 98a96cae0..ba7d417cf 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveAnchorEditCallMeDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveAnchorEditCallMeDialog.java @@ -119,11 +119,11 @@ public class LiveAnchorEditCallMeDialog extends AbsDialogPopupWindow { status.setTag(0); status.setOnClickListener(v -> { if (callMeModel.getGiftId() == 0) { - ToastUtil.show(R.string.live_anchor_edit_call_me_not_gift_toash); + ToastUtil.show(mContext.getString(R.string.live_anchor_edit_call_me_not_gift_toash)); return; } if (callMeModel.getWechat().getIsShow() == 0 && callMeModel.getLine().getIsShow() == 0 && callMeModel.getWhatsApp().getIsShow() == 0) { - ToastUtil.show(R.string.live_anchor_edit_call_me_not_call_info_toash); + ToastUtil.show(mContext.getString(R.string.live_anchor_edit_call_me_not_call_info_toash)); return; } int tag = (int) v.getTag(); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveDataInfoDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveDataInfoDialog.java index cb5caf834..018ff8462 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveDataInfoDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveDataInfoDialog.java @@ -89,7 +89,7 @@ public class LiveDataInfoDialog extends AbsDialogPopupWindow { @Override public void onError(String error) { - ToastUtil.show(com.yunbao.common.R.string.net_error); + ToastUtil.show(mContext.getString(com.yunbao.common.R.string.net_error)); } }); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveFansFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveFansFragment.java index d92669e1c..ce169f070 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveFansFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveFansFragment.java @@ -137,7 +137,7 @@ public class LiveFansFragment extends AbsDialogFragment { } else if (TextUtils.equals(event.getMethod(), "sendFansCard")) { if (LiveRoomViewHolder.mBtnFollow != null && LiveRoomViewHolder.mBtnFollow.getVisibility() == View.VISIBLE) { LiveRoomViewHolder.follow(); - ToastUtil.show(R.string.live_fans_follow_toast); + ToastUtil.show(mContext.getString(R.string.live_fans_follow_toast)); } //点击 开通粉丝勋章,打开礼物列表送礼物 ((LiveAudienceActivity) mContext).openGiftWindow(event.getLiveId(), "0"); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java index a883b0335..ea5cc7968 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java @@ -206,7 +206,7 @@ public class LiveGameDialogFragment extends AbsDialogFragment { @Override public void onError(String error) { Log.i("debug", "onError: " + error); - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); dismiss(); } }); @@ -401,7 +401,7 @@ public class LiveGameDialogFragment extends AbsDialogFragment { return; } if (TextUtils.equals(roomId, event.getLiveId())) { - ToastUtil.show(R.string.current_live_room); + ToastUtil.show(mContext.getString(R.string.current_live_room)); dismiss(); } else { //看直播 diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java index faba1f19b..9bbe4e02b 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java @@ -913,7 +913,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On } }); } else { - ToastUtil.show(R.string.only_one); + ToastUtil.show(mContext.getString(R.string.only_one)); } } else { if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream) || mLiveGiftBean == null) { @@ -921,7 +921,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On } if (mLiveGuardInfo != null) { if (mLiveGiftBean.getMark() == LiveGiftBean2.MARK_GUARD && mLiveGuardInfo.getMyGuardType() != Constants.GUARD_TYPE_YEAR) { - ToastUtil.show(R.string.guard_gift_tip); + ToastUtil.show(mContext.getString(R.string.guard_gift_tip)); return; } } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment4Wishlist.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment4Wishlist.java index d8ce554d2..aebd248d2 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment4Wishlist.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment4Wishlist.java @@ -384,7 +384,7 @@ public class LiveGiftDialogFragment4Wishlist extends AbsDialogFragment implement // } // if (mLiveGuardInfo != null) { // if (mLiveGiftBean.getMark() == LiveGiftBean.MARK_GUARD && mLiveGuardInfo.getMyGuardType() != Constants.GUARD_TYPE_YEAR) { -// ToastUtil.show(R.string.guard_gift_tip); +// ToastUtil.show(mContext.getString(R.string.guard_gift_tip); // return; // } // } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java index 3e51d0d99..0e972a1a3 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -715,7 +715,7 @@ public class LiveGiftPopup extends AbsDialogFragment { } }); } else { - ToastUtil.show(com.yunbao.live.R.string.only_one); + ToastUtil.show(mContext.getString(com.yunbao.live.R.string.only_one)); } } else { if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream) || liveGiftModel == null) { @@ -723,7 +723,7 @@ public class LiveGiftPopup extends AbsDialogFragment { } if (mLiveGuardInfo != null) { if (liveGiftModel.getMark() == LiveGiftBean2.MARK_GUARD && mLiveGuardInfo.getMyGuardType() != Constants.GUARD_TYPE_YEAR) { - ToastUtil.show(com.yunbao.live.R.string.guard_gift_tip); + ToastUtil.show(mContext.getString(com.yunbao.live.R.string.guard_gift_tip)); return; } } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java index 59579c46e..5958a37a7 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java @@ -350,7 +350,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment { return; } if (TextUtils.equals(roomId, event.getLiveId())) { - ToastUtil.show(R.string.current_live_room); + ToastUtil.show(mContext.getString(R.string.current_live_room)); dismiss(); } else { //看直播 diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java index 266ecd941..d4c77b0c6 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java @@ -40,6 +40,7 @@ import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.weight.AtTextWatcher; import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.R; @@ -222,7 +223,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O private void sendMessage() { String content = mInput.getText().toString().trim(); if (TextUtils.isEmpty(content)) { - ToastUtil.show(R.string.cannot_be_empty); + ToastUtil.show(mContext.getString(R.string.cannot_be_empty)); return; } switch (messageType) { @@ -244,7 +245,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O } }); } else { - ToastUtil.show(R.string.enough_speakers); + ToastUtil.show(mContext.getString(R.string.enough_speakers)); // dismiss(); } @@ -384,7 +385,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveLinkMicListDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveLinkMicListDialogFragment.java index 0c313113f..d00a5321e 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveLinkMicListDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveLinkMicListDialogFragment.java @@ -302,7 +302,7 @@ public class LiveLinkMicListDialogFragment extends AbsDialogFragment implements private void searchOnLineAnchor() { String key = mEditText.getText().toString().trim(); if (TextUtils.isEmpty(key)) { - ToastUtil.show(R.string.content_empty); + ToastUtil.show(mContext.getString(R.string.content_empty)); return; } LiveHttpUtil.cancel(LiveHttpConsts.LIVE_PK_SEARCH_ANCHOR); diff --git a/live/src/main/java/com/yunbao/live/dialog/LivePrankDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LivePrankDialogFragment.java index 7e77599ab..5c4d69ca7 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LivePrankDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LivePrankDialogFragment.java @@ -26,6 +26,7 @@ import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; import com.yunbao.live.adapter.LivePrankRecyclerAdapter; @@ -288,7 +289,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveRedPackSendDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveRedPackSendDialogFragment.java index 626af8244..9874429e1 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveRedPackSendDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveRedPackSendDialogFragment.java @@ -223,11 +223,11 @@ public class LiveRedPackSendDialogFragment extends AbsDialogFragment implements count = mEditCountPj.getText().toString().trim(); } if (TextUtils.isEmpty(coin)) { - ToastUtil.show(R.string.red_pack_7); + ToastUtil.show(mContext.getString(R.string.red_pack_7)); return; } if (TextUtils.isEmpty(count)) { - ToastUtil.show(R.string.red_pack_8); + ToastUtil.show(mContext.getString(R.string.red_pack_8)); return; } String title = mEditTitle.getText().toString().trim(); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveTaskDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveTaskDialog.java index 8f94745d8..e5c0565d0 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveTaskDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveTaskDialog.java @@ -174,7 +174,7 @@ public class LiveTaskDialog extends AbsDialogPopupWindow { if (loadDialog != null) { loadDialog.dismiss(); } - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java index ba776b875..9dca0664c 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java @@ -93,7 +93,7 @@ public class LiveTotalDialog extends AbsDialogFragment { @Override public void onError(String error) { - ToastUtil.show( R.string.net_error); + ToastUtil.show( mContext.getString(R.string.net_error)); } }); } else { diff --git a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java index cdcc39d41..f5c7f0666 100644 --- a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java @@ -197,7 +197,7 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } diff --git a/live/src/main/java/com/yunbao/live/dialog/ResultRendPacketPopup.java b/live/src/main/java/com/yunbao/live/dialog/ResultRendPacketPopup.java index 4a490ef7f..323a5eb53 100644 --- a/live/src/main/java/com/yunbao/live/dialog/ResultRendPacketPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/ResultRendPacketPopup.java @@ -154,7 +154,7 @@ public class ResultRendPacketPopup extends CenterPopupView { } } else { - ToastUtil.show(R.string.no_data); + ToastUtil.show(getContext().getString(R.string.no_data)); } } }); diff --git a/live/src/main/java/com/yunbao/live/music/LiveMusicDialogFragment.java b/live/src/main/java/com/yunbao/live/music/LiveMusicDialogFragment.java index 631ffea8f..ed8f563de 100644 --- a/live/src/main/java/com/yunbao/live/music/LiveMusicDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/music/LiveMusicDialogFragment.java @@ -255,7 +255,7 @@ public class LiveMusicDialogFragment extends AbsDialogFragment implements View.O }); } } else { - ToastUtil.show(R.string.music_url_empty); + ToastUtil.show(mContext.getString(R.string.music_url_empty)); } } else { ToastUtil.show(msg); diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicAnchorPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicAnchorPresenter.java index bbca24f15..a620d9556 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicAnchorPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicAnchorPresenter.java @@ -128,7 +128,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener { playUrl = mPlayUrl; } SocketLinkMicAnchorUtil.linkMicAnchorApply(mSocketClient, playUrl, stream, pkUid); - ToastUtil.show(R.string.link_mic_apply); + ToastUtil.show(mContext.getString(R.string.link_mic_apply)); } /** @@ -198,7 +198,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener { } if (mAcceptLinkMic) { if (((LiveActivity) mContext).isGamePlaying()) { - ToastUtil.show(R.string.live_game_cannot_link_mic); + ToastUtil.show(mContext.getString(R.string.live_game_cannot_link_mic)); SocketLinkMicAnchorUtil.linkMicPlayGaming(mSocketClient, mApplyUid); } else { LiveHttpUtil.livePkCheckLive(mApplyUid, mApplyStream, mSelfStream, new HttpCallback() { @@ -330,7 +330,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener { mLiveLinkMicPlayViewHolder.addToParent(); mLiveLinkMicPlayViewHolder.play(playUrl); if (mIsAnchor) { - ToastUtil.show(R.string.link_mic_anchor_accept_2); + ToastUtil.show(mContext.getString(R.string.link_mic_anchor_accept_2)); ((LiveAnchorActivity) mContext).setPkBtnVisible(true); if (mLiveSdk == Constants.LIVE_SDK_TX) { //主播混流 @@ -376,7 +376,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener { mApplyUid = null; mApplyStream = null; mPkUid = null; - ToastUtil.show(R.string.link_mic_anchor_close); + ToastUtil.show(mContext.getString(R.string.link_mic_anchor_close)); if (mIsAnchor) { ((LiveAnchorActivity) mContext).setPkBtnVisible(false); if (mLiveSdk == Constants.LIVE_SDK_TX) { @@ -390,7 +390,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener { */ public void onLinkMicAnchorRefuse() { mLastApplyLinkMicTime = 0; - ToastUtil.show(R.string.link_mic_refuse_2); + ToastUtil.show(mContext.getString(R.string.link_mic_refuse_2)); } /** @@ -398,7 +398,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener { */ public void onLinkMicNotResponse() { mLastApplyLinkMicTime = 0; - ToastUtil.show(R.string.link_mic_anchor_not_response_2); + ToastUtil.show(mContext.getString(R.string.link_mic_anchor_not_response_2)); } /** @@ -406,7 +406,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener { */ public void onLinkMicAnchorBusy() { mLastApplyLinkMicTime = 0; - ToastUtil.show(R.string.link_mic_anchor_busy_2); + ToastUtil.show(mContext.getString(R.string.link_mic_anchor_busy_2)); } public void pause() { @@ -442,15 +442,15 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener { */ public boolean canOpenLinkMicAnchor() { if (((LiveActivity) mContext).isGamePlaying()) { - ToastUtil.show(R.string.live_game_cannot_link_mic); + ToastUtil.show(mContext.getString(R.string.live_game_cannot_link_mic)); return false; } if (mIsLinkMic || ((LiveActivity) mContext).isLinkMic()) { - ToastUtil.show(mIsAnchor ? R.string.live_link_mic_cannot_link_2 : R.string.live_link_mic_cannot_link); + ToastUtil.show(mIsAnchor ? mContext.getString(R.string.live_link_mic_cannot_link_2) : mContext.getString(R.string.live_link_mic_cannot_link)); return false; } if (System.currentTimeMillis() - mLastApplyLinkMicTime < 11000) { - ToastUtil.show(R.string.link_mic_apply_waiting); + ToastUtil.show(mContext.getString(R.string.link_mic_apply_waiting)); return false; } return true; diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java index 61409af18..356827e93 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java @@ -320,16 +320,16 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener { */ public void applyLinkMicPk(String pkUid, String stream) { if (mPkSend) { - ToastUtil.show(R.string.link_mic_apply_waiting); + ToastUtil.show(mContext.getString(R.string.link_mic_apply_waiting)); return; } if (mIsPk) { - ToastUtil.show(R.string.live_link_mic_cannot_pk); + ToastUtil.show(mContext.getString(R.string.live_link_mic_cannot_pk)); return; } mPkSend = true; SocketLinkMicPkUtil.linkMicPkApply(mSocketClient, pkUid, stream); - ToastUtil.show(R.string.link_mic_apply_pk); + ToastUtil.show(mContext.getString(R.string.link_mic_apply_pk)); if (mLiveLinkMicPkViewHolder == null) { mLiveLinkMicPkViewHolder = new LiveLinkMicPkViewHolder(mContext, mPkContainer); @@ -1119,7 +1119,7 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener { if (mIsAnchor) { ((LiveAnchorActivity) mContext).setPkBtnVisible(true); } - ToastUtil.show(R.string.link_mic_refuse_pk); + ToastUtil.show(mContext.getString(R.string.link_mic_refuse_pk)); } /** @@ -1130,7 +1130,7 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener { if (mIsAnchor) { ((LiveAnchorActivity) mContext).setPkBtnVisible(true); } - ToastUtil.show(R.string.link_mic_anchor_not_response_2); + ToastUtil.show(mContext.getString(R.string.link_mic_anchor_not_response_2)); } /** @@ -1141,7 +1141,7 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener { if (mIsAnchor) { ((LiveAnchorActivity) mContext).setPkBtnVisible(true); } - ToastUtil.show(R.string.link_mic_anchor_busy_2); + ToastUtil.show(mContext.getString(R.string.link_mic_anchor_busy_2)); } diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPresenter.java index 9cd0f1f4f..f0a530658 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPresenter.java @@ -254,7 +254,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener { public void onAnchorAcceptLinkMic() { if (!mIsAnchor) { mLastApplyLinkMicTime = 0; - ToastUtil.show(R.string.link_mic_anchor_accept); + ToastUtil.show(mContext.getString(R.string.link_mic_anchor_accept)); mIsLinkMic = true; mLinkMicUid = CommonAppConfig.getInstance().getUid(); if (mLinkMicTip != null) { @@ -304,7 +304,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener { */ public void onAnchorRefuseLinkMic() { mLastApplyLinkMicTime = 0; - ToastUtil.show(R.string.link_mic_refuse); + ToastUtil.show(mContext.getString(R.string.link_mic_refuse)); } /** @@ -411,7 +411,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener { */ public void onAnchorNotResponse() { mLastApplyLinkMicTime = 0; - ToastUtil.show(R.string.link_mic_anchor_not_response); + ToastUtil.show(mContext.getString(R.string.link_mic_anchor_not_response)); } /** @@ -419,7 +419,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener { */ public void onAnchorBusy() { mLastApplyLinkMicTime = 0; - ToastUtil.show(R.string.link_mic_anchor_busy); + ToastUtil.show(mContext.getString(R.string.link_mic_anchor_busy)); } /** @@ -509,11 +509,11 @@ public class LiveLinkMicPresenter implements View.OnClickListener { private void onLinkMicBtnClick() { if (((LiveActivity) mContext).isGamePlaying()) { - ToastUtil.show(R.string.live_game_cannot_link_mic); + ToastUtil.show(mContext.getString(R.string.live_game_cannot_link_mic)); return; } if (((LiveActivity) mContext).isLinkMicAnchor()) { - ToastUtil.show(R.string.live_link_mic_cannot_link); + ToastUtil.show(mContext.getString(R.string.live_link_mic_cannot_link)); return; } if (mIsLinkMic) { @@ -580,7 +580,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener { private void audienceApplyLinkMic() { long curTime = System.currentTimeMillis(); if (curTime - mLastApplyLinkMicTime < 11000) {//时间间隔11秒 - ToastUtil.show(R.string.link_mic_apply_waiting); + ToastUtil.show(mContext.getString(R.string.link_mic_apply_waiting)); } else { mLastApplyLinkMicTime = curTime; //请求权限 @@ -607,7 +607,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener { @Override public void run() { SocketLinkMicUtil.audienceApplyLinkMic(mSocketClient); - ToastUtil.show(R.string.link_mic_apply); + ToastUtil.show(mContext.getString(R.string.link_mic_apply)); } }); } @@ -648,12 +648,12 @@ public class LiveLinkMicPresenter implements View.OnClickListener { } if (mAcceptLinkMic) { if (((LiveActivity) mContext).isGamePlaying()) { - ToastUtil.show(R.string.live_game_cannot_link_mic); + ToastUtil.show(mContext.getString(R.string.live_game_cannot_link_mic)); SocketLinkMicUtil.anchorRefuseLinkMic(mSocketClient, mApplyUid); return; } if (((LiveActivity) mContext).isLinkMicAnchor()) { - ToastUtil.show(R.string.live_link_mic_cannot_link_2); + ToastUtil.show(mContext.getString(R.string.live_link_mic_cannot_link_2)); return; } SocketLinkMicUtil.anchorAcceptLinkMic(mSocketClient, mApplyUid); diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java index 223419aa9..a5e55dccd 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java @@ -489,16 +489,16 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { */ public void applyLinkMicPk(String pkUid, String stream) { if (mPkSend) { - ToastUtil.show(R.string.link_mic_apply_waiting); + ToastUtil.show(mContext.getString(R.string.link_mic_apply_waiting)); return; } if (mIsPk) { - ToastUtil.show(R.string.live_link_mic_cannot_pk); + ToastUtil.show(mContext.getString(R.string.live_link_mic_cannot_pk)); return; } mPkSend = true; SocketRyLinkMicPkUtil.linkMicPkApply(mSocketRyClient, pkUid, stream); - ToastUtil.show(R.string.link_mic_apply_pk); + ToastUtil.show(mContext.getString(R.string.link_mic_apply_pk)); if (mLiveLinkMicPkViewHolder == null) { mLiveLinkMicPkViewHolder = new LiveLinkMicPkViewHolder(mContext, mPkContainer); @@ -1697,7 +1697,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); @@ -2429,7 +2429,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { if (mIsAnchor) { ((LiveRyAnchorActivity) mContext).setPkBtnVisible(true); } - ToastUtil.show(R.string.link_mic_refuse_pk); + ToastUtil.show(mContext.getString(R.string.link_mic_refuse_pk)); } /** @@ -2440,7 +2440,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { if (mIsAnchor) { ((LiveRyAnchorActivity) mContext).setPkBtnVisible(true); } - ToastUtil.show(R.string.link_mic_anchor_not_response_2); + ToastUtil.show(mContext.getString(R.string.link_mic_anchor_not_response_2)); } /** @@ -2451,7 +2451,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { if (mIsAnchor) { ((LiveRyAnchorActivity) mContext).setPkBtnVisible(true); } - ToastUtil.show(R.string.link_mic_anchor_busy_2); + ToastUtil.show(mContext.getString(R.string.link_mic_anchor_busy_2)); } diff --git a/live/src/main/java/com/yunbao/live/presenter/UserHomeSharePresenter.java b/live/src/main/java/com/yunbao/live/presenter/UserHomeSharePresenter.java index 204ec3452..d4e545a63 100644 --- a/live/src/main/java/com/yunbao/live/presenter/UserHomeSharePresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/UserHomeSharePresenter.java @@ -62,7 +62,7 @@ public class UserHomeSharePresenter { ClipboardManager cm = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); ClipData clipData = ClipData.newPlainText("text", link); cm.setPrimaryClip(clipData); - ToastUtil.show(R.string.copy_success); + ToastUtil.show(mContext.getString(com.yunbao.common.R.string.copy_success)); } diff --git a/live/src/main/java/com/yunbao/live/socket/SocketClient.java b/live/src/main/java/com/yunbao/live/socket/SocketClient.java index a60969099..4647f45d1 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketClient.java @@ -25,6 +25,7 @@ import com.yunbao.common.manager.NewLevelManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.L; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.bean.LiveBuyGuardMsgBean; @@ -409,7 +410,7 @@ public class SocketClient { String msgtype = map.getString("msgtype"); if ("2".equals(msgtype)) {//发言,点亮 if ("409002".equals(received.getRetcode())) { - ToastUtil.show(R.string.live_you_are_shut); + ToastUtil.show(WordUtil.isNewZh()?"你已經被禁言":"You\'ve been banned"); return; } diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java b/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java index 69d0313e3..6d961aaa7 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java @@ -134,7 +134,7 @@ public class SocketRyChatUtil { public void onError(Message message, RongIMClient.ErrorCode errorCode) { Log.e("tx", "aaa" + errorCode.toString()); if (errorCode.code == 23408) { - ToastUtil.show(R.string.live_ban_tip); + ToastUtil.show(WordUtil.isNewZh()?"您已被禁言":"You have been banned"); } else { ToastUtil.show(errorCode.code + ":" + errorCode.msg); } @@ -257,7 +257,7 @@ public class SocketRyChatUtil { public void onError(Message message, RongIMClient.ErrorCode errorCode) { Log.e("tx", "aaa" + errorCode.toString()); if (errorCode.code == 23408) { - ToastUtil.show(R.string.live_ban_tip); + ToastUtil.show(WordUtil.isNewZh()?"您已被禁言":"You have been banned"); } else { ToastUtil.show(errorCode.code + ":" + errorCode.msg); } diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index af7389bb1..f6d2d41c4 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -865,7 +865,7 @@ public class SocketRyClient { String msgtype = map.getString("msgtype"); if ("2".equals(msgtype)) {//发言,点亮 if ("409002".equals(received.getRetcode())) { - ToastUtil.show(R.string.live_you_are_shut); + ToastUtil.show(WordUtil.isNewZh()?"你已經被禁言":"You\'ve been banned"); return; } diff --git a/live/src/main/java/com/yunbao/live/views/ChatListViewHolder.java b/live/src/main/java/com/yunbao/live/views/ChatListViewHolder.java index ffda2ce61..b9de51587 100644 --- a/live/src/main/java/com/yunbao/live/views/ChatListViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/ChatListViewHolder.java @@ -19,6 +19,7 @@ import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.AbsMainViewHolder; import com.yunbao.live.R; import com.yunbao.live.activity.MyTUIConversationFragment; @@ -180,7 +181,7 @@ public class ChatListViewHolder extends AbsMainViewHolder implements View.OnClic mSystemMsgRedPoint.setVisibility(View.INVISIBLE); } // ImMessageUtil.getInstance().markAllConversationAsRead(); - ToastUtil.show(R.string.im_msg_ignore_unread_2); + ToastUtil.show(WordUtil.isNewZh()?"已忽略未讀消息":"Unread message ignored"); } } diff --git a/live/src/main/java/com/yunbao/live/views/LiveAddImpressViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAddImpressViewHolder.java index bac3f07c2..66b7f8903 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAddImpressViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAddImpressViewHolder.java @@ -66,7 +66,7 @@ public class LiveAddImpressViewHolder extends AbsLivePageViewHolder { addId(mtv.getBean().getId()); mChanged = true; } else { - ToastUtil.show(R.string.impress_add_max); + ToastUtil.show(mContext.getString(R.string.impress_add_max)); } } else { removeId(mtv.getBean().getId()); @@ -168,11 +168,11 @@ public class LiveAddImpressViewHolder extends AbsLivePageViewHolder { private void save() { if (mLinkedList.size() == 0) { - ToastUtil.show(R.string.impress_please_choose); + ToastUtil.show(mContext.getString(R.string.impress_please_choose)); return; } if (!mChanged) { - ToastUtil.show(R.string.impress_not_changed); + ToastUtil.show(mContext.getString(R.string.impress_not_changed)); return; } String ids = ""; diff --git a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java index 4700fed5f..23f69c46e 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java @@ -30,6 +30,7 @@ import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.AbsViewHolder; import com.yunbao.common.views.weight.ClipPathCircleImage; import com.yunbao.live.R; @@ -200,7 +201,7 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); } diff --git a/live/src/main/java/com/yunbao/live/views/LiveLinkMicPushTxViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveLinkMicPushTxViewHolder.java index 689ee6b0f..32f842e24 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveLinkMicPushTxViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveLinkMicPushTxViewHolder.java @@ -108,12 +108,12 @@ public class LiveLinkMicPushTxViewHolder extends AbsLiveLinkMicPushViewHolder im @Override public void onPushEvent(int e, Bundle bundle) { if (e == TXLiveConstants.PUSH_ERR_OPEN_CAMERA_FAIL) { - ToastUtil.show(R.string.live_push_failed_1); + ToastUtil.show(mContext.getString(R.string.live_push_failed_1)); if (mLivePushListener != null) { mLivePushListener.onPushFailed(); } } else if (e == TXLiveConstants.PUSH_ERR_OPEN_MIC_FAIL) { - ToastUtil.show(R.string.live_push_failed_1); + ToastUtil.show(mContext.getString(R.string.live_push_failed_1)); if (mLivePushListener != null) { mLivePushListener.onPushFailed(); } diff --git a/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java index eae351171..b6191ac04 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java @@ -388,7 +388,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl chooseLiveType(); } else if (i == R.id.btn_start_live) { if (!selector) { - ToastUtil.show(R.string.anchor_agreement_hint); + ToastUtil.show(mContext.getString(R.string.anchor_agreement_hint)); return; } if (mLiveClassID == 0) { @@ -813,7 +813,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { - ToastUtil.show(R.string.live_set_pwd_empty); + ToastUtil.show(mContext.getString(R.string.live_set_pwd_empty)); } else { mLiveType = bean.getId(); mLiveTypeTextView.setText(WordUtil.isNewZh() ? "密碼房" : "password room"); @@ -835,7 +835,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { - ToastUtil.show(R.string.live_set_fee_empty); + ToastUtil.show(mContext.getString(R.string.live_set_fee_empty)); } else { mLiveType = bean.getId(); mLiveTypeTextView.setText(bean.getName()); diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayTxViewHolder_backup.java b/live/src/main/java/com/yunbao/live/views/LivePlayTxViewHolder_backup.java index 9c9bcb12d..28a1f10ed 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayTxViewHolder_backup.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayTxViewHolder_backup.java @@ -265,7 +265,7 @@ public class LivePlayTxViewHolder_backup extends LiveRoomPlayViewHolder implemen playType = TXLivePlayer.PLAY_TYPE_VOD_MP4; } if (playType == -1) { - ToastUtil.show(R.string.live_play_error_2); + ToastUtil.show(mContext.getString(R.string.live_play_error_2)); return; } if (mPlayer != null) { diff --git a/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java index a8f129a94..9b50cfc7f 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java @@ -414,7 +414,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); } }); @@ -834,7 +834,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX @Override public void toggleFlash() { if (mCameraFront) { - ToastUtil.show(R.string.live_open_flash); + ToastUtil.show(mContext.getString(R.string.live_open_flash)); return; } @@ -999,10 +999,10 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX @Override public void onPushEvent(int e, Bundle bundle) { if (e == TXLiveConstants.PUSH_ERR_OPEN_CAMERA_FAIL) { - ToastUtil.show(R.string.live_push_failed_1); + ToastUtil.show(mContext.getString(R.string.live_push_failed_1)); } else if (e == TXLiveConstants.PUSH_ERR_OPEN_MIC_FAIL) { - ToastUtil.show(R.string.live_push_failed_2); + ToastUtil.show(mContext.getString(R.string.live_push_failed_2)); } else if (e == TXLiveConstants.PUSH_ERR_NET_DISCONNECT || e == TXLiveConstants.PUSH_ERR_INVALID_ADDRESS) { L.e(TAG, "网络断开,推流失败------>"); diff --git a/live/src/main/java/com/yunbao/live/views/LivePushTxViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePushTxViewHolder.java index e4213577c..42a0219f6 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePushTxViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePushTxViewHolder.java @@ -269,7 +269,7 @@ public class LivePushTxViewHolder extends AbsLivePushViewHolder implements ITXLi @Override public void toggleFlash() { if (mCameraFront) { - ToastUtil.show(R.string.live_open_flash); + ToastUtil.show(mContext.getString(R.string.live_open_flash)); return; } // if (mLivePusher != null) { @@ -486,10 +486,10 @@ public class LivePushTxViewHolder extends AbsLivePushViewHolder implements ITXLi @Override public void onPushEvent(int e, Bundle bundle) { if (e == TXLiveConstants.PUSH_ERR_OPEN_CAMERA_FAIL) { - ToastUtil.show(R.string.live_push_failed_1); + ToastUtil.show(mContext.getString(R.string.live_push_failed_1)); } else if (e == TXLiveConstants.PUSH_ERR_OPEN_MIC_FAIL) { - ToastUtil.show(R.string.live_push_failed_2); + ToastUtil.show(mContext.getString(R.string.live_push_failed_2)); } else if (e == TXLiveConstants.PUSH_ERR_NET_DISCONNECT || e == TXLiveConstants.PUSH_ERR_INVALID_ADDRESS) { L.e(TAG, "网络断开,推流失败------>"); diff --git a/live/src/main/java/com/yunbao/live/views/LivePushTxViewHolder360Beauty.java b/live/src/main/java/com/yunbao/live/views/LivePushTxViewHolder360Beauty.java index 5e7fcf03c..c08d50405 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePushTxViewHolder360Beauty.java +++ b/live/src/main/java/com/yunbao/live/views/LivePushTxViewHolder360Beauty.java @@ -314,7 +314,7 @@ public class LivePushTxViewHolder360Beauty extends AbsLivePushViewHolder impleme @Override public void toggleFlash() { if (mCameraFront) { - ToastUtil.show(R.string.live_open_flash); + ToastUtil.show(mContext.getString(R.string.live_open_flash)); return; } if (mLivePusher != null) { @@ -471,10 +471,10 @@ public class LivePushTxViewHolder360Beauty extends AbsLivePushViewHolder impleme Log.d("onPushEvent",""+e+" "+bundle.toString()); if (e == TXLiveConstants.PUSH_ERR_OPEN_CAMERA_FAIL) { - ToastUtil.show(R.string.live_push_failed_1); + ToastUtil.show(mContext.getString(R.string.live_push_failed_1)); } else if (e == TXLiveConstants.PUSH_ERR_OPEN_MIC_FAIL) { - ToastUtil.show(R.string.live_push_failed_2); + ToastUtil.show(mContext.getString(R.string.live_push_failed_2)); } else if (e == TXLiveConstants.PUSH_ERR_NET_DISCONNECT || e == TXLiveConstants.PUSH_ERR_INVALID_ADDRESS) { L.e(TAG, "网络断开,推流失败------>"); diff --git a/live/src/main/java/com/yunbao/live/views/LiveReadyRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveReadyRyViewHolder.java index de5eb23a8..e329329eb 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveReadyRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveReadyRyViewHolder.java @@ -345,7 +345,7 @@ public class LiveReadyRyViewHolder extends AbsViewHolder implements View.OnClick @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { - ToastUtil.show(R.string.live_set_pwd_empty); + ToastUtil.show(mContext.getString(R.string.live_set_pwd_empty)); } else { mLiveType = bean.getId(); mLiveTypeTextView.setText(bean.getName()); @@ -367,7 +367,7 @@ public class LiveReadyRyViewHolder extends AbsViewHolder implements View.OnClick @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { - ToastUtil.show(R.string.live_set_fee_empty); + ToastUtil.show(mContext.getString(R.string.live_set_fee_empty)); } else { mLiveType = bean.getId(); mLiveTypeTextView.setText(bean.getName()); diff --git a/live/src/main/java/com/yunbao/live/views/LiveReadyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveReadyViewHolder.java index 699d3019a..abf89e1fb 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveReadyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveReadyViewHolder.java @@ -369,7 +369,7 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { - ToastUtil.show(R.string.live_set_pwd_empty); + ToastUtil.show(mContext.getString(R.string.live_set_pwd_empty)); } else { mLiveType = bean.getId(); mLiveTypeTextView.setText(bean.getName()); @@ -391,7 +391,7 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi @Override public void onConfirmClick(Dialog dialog, String content) { if (TextUtils.isEmpty(content)) { - ToastUtil.show(R.string.live_set_fee_empty); + ToastUtil.show(mContext.getString(R.string.live_set_fee_empty)); } else { mLiveType = bean.getId(); mLiveTypeTextView.setText(bean.getName()); diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 1cc79f09f..75eaf6114 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -2380,7 +2380,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); pkUidTmp = ""; } }); diff --git a/live/src/main/java/com/yunbao/live/views/LiveRyAnchorViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRyAnchorViewHolder.java index 87f4f3675..024aeafa5 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRyAnchorViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRyAnchorViewHolder.java @@ -349,7 +349,7 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder { @Override public void onError(String error) { Log.e("PortraitLiveManager", error); - ToastUtil.show( R.string.net_error); + ToastUtil.show( mContext.getString(R.string.net_error)); } }); } diff --git a/live/src/main/java/com/yunbao/live/views/OlineListActivity.java b/live/src/main/java/com/yunbao/live/views/OlineListActivity.java index b7638647b..cd6dec1cd 100644 --- a/live/src/main/java/com/yunbao/live/views/OlineListActivity.java +++ b/live/src/main/java/com/yunbao/live/views/OlineListActivity.java @@ -201,7 +201,7 @@ public class OlineListActivity extends AbsActivity { public void onOlineEvent(OlineEvent event) { IMLoginModel model = IMLoginManager.get(mContext).getUserInfo(); if (TextUtils.equals(String.valueOf(model.getId()), event.getModel().getId())) { - ToastUtil.show(R.string.cannot_yourself); + ToastUtil.show(mContext.getString(R.string.cannot_yourself)); } else { Bus.get().post(new LiveInputEvent().setModel(event.getModel())); finish(); diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index f9f93bc68..742475f5f 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -73,6 +73,7 @@ import com.yunbao.common.utils.RandomUtil; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.formatBigNum; import com.yunbao.common.views.LiveSudGamePopup; import com.yunbao.common.views.weight.LiveFloatView; @@ -720,7 +721,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); //直播间上部轮播【新人特惠】【趣味游戏】【幸运天使】 轮播接口 mLiveRoomViewHolder.showLiveRoomActivityBanner(); } diff --git a/live/src/main/res/layout/dialog_new_guard_list.xml b/live/src/main/res/layout/dialog_new_guard_list.xml index 75ca884bc..30a7adbb7 100644 --- a/live/src/main/res/layout/dialog_new_guard_list.xml +++ b/live/src/main/res/layout/dialog_new_guard_list.xml @@ -160,6 +160,7 @@ android:id="@+id/guard_btn_buy" android:layout_width="110dp" android:layout_height="30dp" + android:singleLine="true" android:layout_alignParentEnd="true" android:layout_centerVertical="true" android:layout_marginEnd="15dp" diff --git a/live/src/main/res/layout/item_fans_group_buy_list.xml b/live/src/main/res/layout/item_fans_group_buy_list.xml index 0630e6c01..fb696788c 100644 --- a/live/src/main/res/layout/item_fans_group_buy_list.xml +++ b/live/src/main/res/layout/item_fans_group_buy_list.xml @@ -51,7 +51,10 @@ @Override public void onError(String error) { - ToastUtil.show( R.string.net_error); + ToastUtil.show( mContext.getString(R.string.net_error)); } }); } diff --git a/main/src/main/java/com/yunbao/main/adapter/SearchResultsAdapter.java b/main/src/main/java/com/yunbao/main/adapter/SearchResultsAdapter.java index 342c4d55f..bf703ad8f 100644 --- a/main/src/main/java/com/yunbao/main/adapter/SearchResultsAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/SearchResultsAdapter.java @@ -61,7 +61,7 @@ public class SearchResultsAdapter extends RecyclerView.Adapter { @Override public void onError(String error) { - ToastUtil.show(com.yunbao.live.R.string.net_error); + ToastUtil.show(R.string.net_error); } }); } diff --git a/main/src/main/java/com/yunbao/main/dialog/OneLoginDialog.java b/main/src/main/java/com/yunbao/main/dialog/OneLoginDialog.java index 23337593e..d3061776e 100644 --- a/main/src/main/java/com/yunbao/main/dialog/OneLoginDialog.java +++ b/main/src/main/java/com/yunbao/main/dialog/OneLoginDialog.java @@ -123,11 +123,11 @@ public class OneLoginDialog extends AbsDialogFragment { }); } else { if (msg.contains("暱稱重複,請重新輸入")) { - ToastUtil.show(R.string.edit_one_5); + ToastUtil.show(mContext.getString(R.string.edit_one_5)); } else if (msg.contains("該邀請碼不存在,請重新輸入")) { - ToastUtil.show(R.string.edit_one_6); + ToastUtil.show(mContext.getString(R.string.edit_one_6)); } else if (msg.contains("暱稱不合法")) { - ToastUtil.show(R.string.edit_one_7); + ToastUtil.show(mContext.getString(R.string.edit_one_7)); } } } diff --git a/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java b/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java index 64741c9d8..a4c5c4517 100644 --- a/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java +++ b/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java @@ -85,7 +85,7 @@ public class SearchRecommendFragment extends BaseFragment { @Override public void onError(String error) { - ToastUtil.show( R.string.net_error); + ToastUtil.show(R.string.net_error); } }); } diff --git a/main/src/main/java/com/yunbao/main/fragment/SearchResultsItemFragment.java b/main/src/main/java/com/yunbao/main/fragment/SearchResultsItemFragment.java index f90df4830..d4295609c 100644 --- a/main/src/main/java/com/yunbao/main/fragment/SearchResultsItemFragment.java +++ b/main/src/main/java/com/yunbao/main/fragment/SearchResultsItemFragment.java @@ -117,7 +117,7 @@ public class SearchResultsItemFragment extends BaseFragment { @Override public void onError(String error) { - ToastUtil.show( R.string.net_error); + ToastUtil.show( R.string.net_error); } }); } diff --git a/main/src/main/java/com/yunbao/main/manager/imrongcloud/ConversationIMListManager.java b/main/src/main/java/com/yunbao/main/manager/imrongcloud/ConversationIMListManager.java index 2c3cf3b0a..83f22268f 100644 --- a/main/src/main/java/com/yunbao/main/manager/imrongcloud/ConversationIMListManager.java +++ b/main/src/main/java/com/yunbao/main/manager/imrongcloud/ConversationIMListManager.java @@ -318,7 +318,7 @@ public class ConversationIMListManager { @Override public void onError(String error) { - ToastUtil.show(com.yunbao.live.R.string.net_error); + } }); } diff --git a/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java b/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java index 268cab03d..410000ee8 100644 --- a/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java @@ -394,7 +394,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple }); getItem(position, mItem1, mItem2, mItem3).setOnClickListener(v -> { if (bean.isHide()) { - ToastUtil.show(R.string.can_not_go); + ToastUtil.show(mContext.getString(R.string.can_not_go)); } else { if (bean.getIslive() == 1) { diff --git a/main/src/main/java/com/yunbao/main/views/CashAccountViewHolder.java b/main/src/main/java/com/yunbao/main/views/CashAccountViewHolder.java index 04600cd11..7ca1d2323 100644 --- a/main/src/main/java/com/yunbao/main/views/CashAccountViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/CashAccountViewHolder.java @@ -124,39 +124,39 @@ public class CashAccountViewHolder extends AbsViewHolder implements View.OnClick if (mKey == Constants.CASH_ACCOUNT_ALI) { account = mEditAliAccount.getText().toString().trim(); if (TextUtils.isEmpty(account)) { - ToastUtil.show(R.string.cash_input_ali_account); + ToastUtil.show(mContext.getString(R.string.cash_input_ali_account)); return; } mEditAliAccount.setText(""); name = mEditAliName.getText().toString().trim(); if (TextUtils.isEmpty(name)) { - ToastUtil.show(R.string.cash_input_ali_name); + ToastUtil.show(mContext.getString(R.string.cash_input_ali_name)); return; } mEditAliName.setText(""); } else if (mKey == Constants.CASH_ACCOUNT_WX) { account = mEditWxAccount.getText().toString().trim(); if (TextUtils.isEmpty(account)) { - ToastUtil.show(R.string.cash_input_wx_account); + ToastUtil.show(mContext.getString(R.string.cash_input_wx_account)); return; } mEditWxAccount.setText(""); } else { account = mEditBankAccount.getText().toString().trim(); if (TextUtils.isEmpty(account)) { - ToastUtil.show(R.string.cash_input_bank_account); + ToastUtil.show(mContext.getString(R.string.cash_input_bank_account)); return; } mEditBankAccount.setText(""); name = mEditBankUserName.getText().toString().trim(); if (TextUtils.isEmpty(account)) { - ToastUtil.show(R.string.cash_input_bank_user_name); + ToastUtil.show(mContext.getString(R.string.cash_input_bank_user_name)); return; } mEditBankUserName.setText(""); bank = mEditBankName.getText().toString().trim(); if (TextUtils.isEmpty(account)) { - ToastUtil.show(R.string.cash_input_bank_name); + ToastUtil.show(mContext.getString(R.string.cash_input_bank_name)); return; } mEditBankName.setText(""); diff --git a/video/src/main/java/com/yunbao/video/dialog/VideoInputDialogFragment.java b/video/src/main/java/com/yunbao/video/dialog/VideoInputDialogFragment.java index 2f6b64334..9d62a5786 100644 --- a/video/src/main/java/com/yunbao/video/dialog/VideoInputDialogFragment.java +++ b/video/src/main/java/com/yunbao/video/dialog/VideoInputDialogFragment.java @@ -265,7 +265,7 @@ public class VideoInputDialogFragment extends AbsDialogFragment implements View. } String content = mInput.getText().toString().trim(); if (TextUtils.isEmpty(content)) { - ToastUtil.show(R.string.content_empty); + ToastUtil.show(mContext.getString(R.string.content_empty)); return; } String toUid = mVideoUid; diff --git a/video/src/main/java/com/yunbao/video/views/VideoMusicViewHolder.java b/video/src/main/java/com/yunbao/video/views/VideoMusicViewHolder.java index 1731f69cb..0739f6b28 100644 --- a/video/src/main/java/com/yunbao/video/views/VideoMusicViewHolder.java +++ b/video/src/main/java/com/yunbao/video/views/VideoMusicViewHolder.java @@ -218,7 +218,7 @@ public class VideoMusicViewHolder extends AbsViewHolder implements View.OnClickL } String key = mInput.getText().toString().trim(); if (TextUtils.isEmpty(key)) { - ToastUtil.show(R.string.content_empty); + ToastUtil.show(mContext.getString(R.string.content_empty)); return; } VideoHttpUtil.cancel(VideoHttpConsts.VIDEO_SEARCH_MUSIC);