From aff5a178a05e0c7e904cd32cfaf44eb3bb902aba Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 14 Nov 2023 11:31:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=AE=E9=80=9A=E5=85=AC=E5=B1=8F=E8=81=8A?= =?UTF-8?q?=E5=A4=A9=E6=8A=8A=E4=B9=8B=E5=89=8D=E7=9A=84=E9=99=90=E5=88=B6?= =?UTF-8?q?50=E4=B8=AA=E5=AD=97=20=E4=BF=AE=E6=94=B9=E6=88=90=20100?= =?UTF-8?q?=E4=B8=AA=E5=AD=97=E3=80=82=E5=85=B6=E4=BB=96=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E4=B8=AA=E4=B8=8D=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.gradle | 6 +- .../live/dialog/LiveInputDialogFragment.java | 12 ++++ .../res/layout/dialog_live_chat_input.xml | 1 - live/src/main/res/values-en/strings.xml | 2 +- .../main/activity/EditProfileActivity.java | 72 ++++++++++--------- 5 files changed, 55 insertions(+), 38 deletions(-) diff --git a/config.gradle b/config.gradle index 202c5ce57..ed25d20e1 100644 --- a/config.gradle +++ b/config.gradle @@ -5,13 +5,13 @@ ext { minSdkVersion : 21, targetSdkVersion : 33, versionCode : 453, - versionName : "6.6.3" + versionName : "6.6.2" ] manifestPlaceholders = [ //正式、 -// serverHost : "https://napi.yaoulive.com", + serverHost : "https://napi.yaoulive.com", // 测试 - serverHost : " https://ceshi.yaoulive.com", +// serverHost : " https://ceshi.yaoulive.com", 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 d4c77b0c6..85bd56b7b 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java @@ -229,6 +229,10 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O switch (messageType) { case WORLDHORN: if (trumpetNum > 0) { + if (content.length()>50){ + ToastUtil.show(WordUtil.isNewZh()?"超出字數限制":"Exceed word limit"); + return; + } trumpetMsg = content; LiveNetManager.get(getContext()) .nobleUseTrumpet(trumpetMsg, mLiveUid, new HttpCallback>() { @@ -251,9 +255,17 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O break; case POPUPSCREEN: + if (content.length()>50){ + ToastUtil.show(WordUtil.isNewZh()?"超出字數限制":"Exceed word limit"); + return; + } ((LiveActivity) mContext).sendDanmuMessage(content); break; case GENERALMESSAGE: + if (content.length()>100){ + ToastUtil.show(WordUtil.isNewZh()?"超出字數限制":"Exceed word limit"); + return; + } ((LiveActivity) mContext).sendChatMessage(content, atTextWatcher.getAtUserID(), atTextWatcher.getAtUserName()); atTextWatcher.clearMsg(); /* if (imm != null) {//收软键盘 diff --git a/live/src/main/res/layout/dialog_live_chat_input.xml b/live/src/main/res/layout/dialog_live_chat_input.xml index 6e0103429..6f176d5cf 100644 --- a/live/src/main/res/layout/dialog_live_chat_input.xml +++ b/live/src/main/res/layout/dialog_live_chat_input.xml @@ -102,7 +102,6 @@ android:hint="@string/live_say_something" android:imeActionLabel="@string/send" android:imeOptions="actionSend" - android:maxLength="50" android:paddingLeft="10dp" android:paddingRight="10dp" android:singleLine="true" diff --git a/live/src/main/res/values-en/strings.xml b/live/src/main/res/values-en/strings.xml index a931b8288..f7ae4556c 100644 --- a/live/src/main/res/values-en/strings.xml +++ b/live/src/main/res/values-en/strings.xml @@ -46,7 +46,7 @@ No recording has been recognized in over 10 seconds Identity privilege VIP seats - %s applies for connected wheat. Check whether + %s Applies for connected wheat. Check whether The wheat has been kicked off An invitation has been sent and is waiting for the user to accept The request has been agreed and is awaiting acceptance by the user diff --git a/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java b/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java index a31e895e4..e540e924f 100644 --- a/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java @@ -128,46 +128,52 @@ public class EditProfileActivity extends AbsActivity { @Override public void onSuccess(File file) { + if (file != null) { System.err.println("头像---->收到头像文件 file = "+file.getAbsolutePath()+" | length = "+file.length()); - ImgLoader.display(mContext, file, mAvatar); - MainHttpUtil.updateAvatar(file, new HttpCallback() { - @Override - public void onSuccess(int code, String msg, String[] info) { - System.err.println("头像---->上传头像文件成功"); - Log.e("updateAvatar", "code:" + code + " msg:" + msg + " info[0]:" + info[0].toString()); - if (code == 0 && info.length > 0) { - ToastUtil.show(R.string.edit_profile_update_avatar_success); - UserBean bean = CommonAppConfig.getInstance().getUserBean(); - if (bean != null) { - JSONObject obj = JSON.parseObject(info[0]); - bean.setAvatar(obj.getString("avatar")); - bean.setAvatarThumb(obj.getString("avatarThumb")); - mUserBean.setAvatar(obj.getString("avatar")); - mUserBean.setAvatarThumb(obj.getString("avatarThumb")); + if (file.getName().contains(".gif")){ + ToastUtil.show(WordUtil.isNewZh()?"暫不支持該文件":"This file is not supported"); + }else { + ImgLoader.display(mContext, file, mAvatar); + MainHttpUtil.updateAvatar(file, new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + System.err.println("头像---->上传头像文件成功"); + Log.e("updateAvatar", "code:" + code + " msg:" + msg + " info[0]:" + info[0].toString()); + if (code == 0 && info.length > 0) { + ToastUtil.show(R.string.edit_profile_update_avatar_success); + UserBean bean = CommonAppConfig.getInstance().getUserBean(); + if (bean != null) { + JSONObject obj = JSON.parseObject(info[0]); + bean.setAvatar(obj.getString("avatar")); + bean.setAvatarThumb(obj.getString("avatarThumb")); + mUserBean.setAvatar(obj.getString("avatar")); + mUserBean.setAvatarThumb(obj.getString("avatarThumb")); - V2TIMUserFullInfo v2TIMUserFullInfo = new V2TIMUserFullInfo(); - v2TIMUserFullInfo.setFaceUrl(obj.getString("avatarThumb")); - V2TIMManager.getInstance().setSelfInfo(v2TIMUserFullInfo, new V2TIMCallback() { - @Override - public void onError(int code, String desc) { - } + V2TIMUserFullInfo v2TIMUserFullInfo = new V2TIMUserFullInfo(); + v2TIMUserFullInfo.setFaceUrl(obj.getString("avatarThumb")); + V2TIMManager.getInstance().setSelfInfo(v2TIMUserFullInfo, new V2TIMCallback() { + @Override + public void onError(int code, String desc) { + } - @Override - public void onSuccess() { - } - }); + @Override + public void onSuccess() { + } + }); + } + EventBus.getDefault().post(new UpdateFieldEvent()); } - EventBus.getDefault().post(new UpdateFieldEvent()); } - } - @Override - public void onError(Response response) { - super.onError(response); - Log.e("updateAvatar", "onFailure"); - } - }); + @Override + public void onError(Response response) { + super.onError(response); + Log.e("updateAvatar", "onFailure"); + } + }); + } + } }