diff --git a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java index 6fcdf9af1..0b00dabcf 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -55,7 +55,12 @@ public class IMLoginManager extends BaseCacheManager { } public Locale getLocaleLanguage() { - if (!getBoolean(KEY_LANGUAGE, false)) { + Locale locale = context.getResources().getConfiguration().locale; + String language = locale.getLanguage(); + if (language.contains("HK") || language.contains("hk") || language.contains("TW") || language.contains("tw")) { + language = "zh"; + } + if (!getBoolean(KEY_LANGUAGE, !TextUtils.equals(language, "zh"))) { return Locale.SIMPLIFIED_CHINESE; } else { return new Locale("en", "rUS"); diff --git a/config.gradle b/config.gradle index b6984158a..367862767 100644 --- a/config.gradle +++ b/config.gradle @@ -26,55 +26,5 @@ ext { isGooglePlay : true, //是否上报异常日志 isUploadLog : true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ] } \ No newline at end of file diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java index ce2690916..260d1707b 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java @@ -19,7 +19,6 @@ import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.MD5Util; import com.yunbao.common.utils.ToastUtil; -import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.http.LiveHttpConsts; @@ -49,6 +48,7 @@ public class LiveRoomCheckLivePresenter { * @param stream */ public LiveRoomCheckLivePresenter(Context context, String liveUid, String stream, NewActionListener actionListener) { + mContext = context; LiveNetManager.get(context) .checkLive(liveUid, stream, new CheckLiveCallBack() { @Override @@ -60,7 +60,7 @@ public class LiveRoomCheckLivePresenter { @Override public void forwardPwdRoom(CheckLiveModel model) { - DialogUitl.showSimpleInputDialog(context,mContext.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback2() { + DialogUitl.showSimpleInputDialog(context, context.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback2() { @Override public void onCancelClick() { if (mContext instanceof Activity) { @@ -110,7 +110,7 @@ public class LiveRoomCheckLivePresenter { @Override public void onError(String error) { - Log.e("直播间异常", "onError: "+error ); + Log.e("直播间异常", "onError: " + error); Bus.get().post(new LiveAudienceEvent() .setType(LiveAudienceEvent.LiveAudienceType.LIVE_ROOM_EXCEPTION)); ToastUtil.show(error); @@ -161,7 +161,7 @@ public class LiveRoomCheckLivePresenter { } } } else { - Log.e("直播间异常", "Error: "+msg ); + Log.e("直播间异常", "Error: " + msg); Bus.get().post(new LiveAudienceEvent() .setType(LiveAudienceEvent.LiveAudienceType.LIVE_ROOM_EXCEPTION)); ToastUtil.show(msg); @@ -190,7 +190,7 @@ public class LiveRoomCheckLivePresenter { * 前往密码房间 */ private void forwardPwdRoom() { - DialogUitl.showSimpleInputDialog(mContext,mContext.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback2() { + DialogUitl.showSimpleInputDialog(mContext, mContext.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback2() { @Override public void onCancelClick() { if (mContext instanceof Activity) {