|
@@ -1,6 +1,7 @@
|
|
|
package com.tencent.qcloud.tim.uikit.modules.chat.layout.input;
|
|
|
|
|
|
import android.annotation.SuppressLint;
|
|
|
+import android.app.Dialog;
|
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
import android.graphics.Bitmap;
|
|
@@ -30,6 +31,7 @@ import com.tencent.qcloud.tim.uikit.R;
|
|
|
import com.tencent.qcloud.tim.uikit.TUIKit;
|
|
|
import com.tencent.qcloud.tim.uikit.base.IUIKitCallBack;
|
|
|
import com.tencent.qcloud.tim.uikit.component.AudioPlayer;
|
|
|
+import com.tencent.qcloud.tim.uikit.component.dialog.TUIKitDialog;
|
|
|
import com.tencent.qcloud.tim.uikit.component.face.Emoji;
|
|
|
import com.tencent.qcloud.tim.uikit.component.face.FaceFragment;
|
|
|
import com.tencent.qcloud.tim.uikit.component.face.FaceManager;
|
|
@@ -40,6 +42,7 @@ import com.tencent.qcloud.tim.uikit.modules.chat.base.ChatInfo;
|
|
|
import com.tencent.qcloud.tim.uikit.modules.chat.interfaces.IChatLayout;
|
|
|
import com.tencent.qcloud.tim.uikit.modules.chat.layout.inputmore.InputMoreFragment;
|
|
|
import com.tencent.qcloud.tim.uikit.modules.conversation.base.DraftInfo;
|
|
|
+import com.tencent.qcloud.tim.uikit.modules.forward.ForwardSelectActivity;
|
|
|
import com.tencent.qcloud.tim.uikit.modules.message.MessageInfo;
|
|
|
import com.tencent.qcloud.tim.uikit.modules.message.MessageInfoUtil;
|
|
|
import com.tencent.qcloud.tim.uikit.utils.FileUtil;
|
|
@@ -541,19 +544,24 @@ public class InputLayout extends InputLayoutUI implements View.OnClickListener,
|
|
|
if (UserInfo.INSTANCE.getUserInfo().getPrivate_msg_status()==1){
|
|
|
Toast.makeText(AppContext.getContext(), AppContext.getContext().getResources().getString(R.string.you_are_been_forbid), Toast.LENGTH_SHORT).show();
|
|
|
}else {
|
|
|
- if (mMessageHandler != null) {
|
|
|
- if(mChatLayout.getChatInfo().getType() == V2TIMConversation.V2TIM_GROUP && !atUserInfoMap.isEmpty()) {
|
|
|
- //发送时通过获取输入框匹配上@的昵称list,去从map中获取ID list。
|
|
|
- List<String> atUserList = updateAtUserList(mTextInput.getMentionList(true));
|
|
|
- if (atUserList == null || atUserList.isEmpty()) {
|
|
|
- mMessageHandler.sendMessage(MessageInfoUtil.buildTextMessage(mTextInput.getText().toString().trim()));
|
|
|
+ if (Integer.parseInt(UserInfo.INSTANCE.getUserInfo().getUser_level()) >=5 || Integer.parseInt(UserInfo.INSTANCE.getUserInfo().getUser_wealth_level()) >=5 || UserInfo.INSTANCE.getUserInfo().getIs_recharge() ==1){
|
|
|
+ if (mMessageHandler != null) {
|
|
|
+ if(mChatLayout.getChatInfo().getType() == V2TIMConversation.V2TIM_GROUP && !atUserInfoMap.isEmpty()) {
|
|
|
+ //发送时通过获取输入框匹配上@的昵称list,去从map中获取ID list。
|
|
|
+ List<String> atUserList = updateAtUserList(mTextInput.getMentionList(true));
|
|
|
+ if (atUserList == null || atUserList.isEmpty()) {
|
|
|
+ mMessageHandler.sendMessage(MessageInfoUtil.buildTextMessage(mTextInput.getText().toString().trim()));
|
|
|
+ }else {
|
|
|
+ mMessageHandler.sendMessage(MessageInfoUtil.buildTextAtMessage(atUserList, mTextInput.getText().toString().trim()));
|
|
|
+ }
|
|
|
}else {
|
|
|
- mMessageHandler.sendMessage(MessageInfoUtil.buildTextAtMessage(atUserList, mTextInput.getText().toString().trim()));
|
|
|
+ mMessageHandler.sendMessage(MessageInfoUtil.buildTextMessage(mTextInput.getText().toString().trim()));
|
|
|
}
|
|
|
- }else {
|
|
|
- mMessageHandler.sendMessage(MessageInfoUtil.buildTextMessage(mTextInput.getText().toString().trim()));
|
|
|
}
|
|
|
+ } else {
|
|
|
+ showLevelDialog();
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}else {
|
|
|
if (mMessageHandler != null) {
|
|
@@ -575,6 +583,29 @@ public class InputLayout extends InputLayoutUI implements View.OnClickListener,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void showLevelDialog() {
|
|
|
+ TUIKitDialog tipsDialog = new TUIKitDialog(getContext())
|
|
|
+ .builder()
|
|
|
+ .setCancelable(true)
|
|
|
+ .setCancelOutside(true)
|
|
|
+ .setTitle(getContext().getString(R.string.use_chats_fulfilment_of_one_condition))
|
|
|
+ .setDialogWidth(0.75f)
|
|
|
+ .setContentButton(getContext().getString(R.string.use_chats_condition_content))
|
|
|
+ .setPositiveButton(getContext().getString(R.string.recharge), new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .setNegativeButton(getContext().getString(R.string.ok), new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ tipsDialog.show();
|
|
|
+ }
|
|
|
+
|
|
|
private List<String> updateAtUserList(List<String> atMentionList){
|
|
|
if (atMentionList == null || atMentionList.isEmpty()){
|
|
|
return null;
|