Bladeren bron

修改IM SDK群聊天输入框限制,增加禁言相关逻辑UI控制

Pq 9 maanden geleden
bovenliggende
commit
ff754aec7c

+ 5 - 3
TUIKit/TUIChat/tuichat/src/main/java/com/tencent/qcloud/tuikit/tuichat/bean/message/TipsMessageBean.java

@@ -1,6 +1,7 @@
 package com.tencent.qcloud.tuikit.tuichat.bean.message;
 
 import android.text.TextUtils;
+
 import com.tencent.imsdk.v2.V2TIMGroupChangeInfo;
 import com.tencent.imsdk.v2.V2TIMGroupInfo;
 import com.tencent.imsdk.v2.V2TIMGroupMemberChangeInfo;
@@ -8,10 +9,10 @@ import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
 import com.tencent.imsdk.v2.V2TIMGroupTipsElem;
 import com.tencent.imsdk.v2.V2TIMMessage;
 import com.tencent.qcloud.tuikit.timcommon.bean.TUIMessageBean;
-import com.tencent.qcloud.tuikit.timcommon.util.DateTimeUtil;
 import com.tencent.qcloud.tuikit.tuichat.R;
 import com.tencent.qcloud.tuikit.tuichat.TUIChatConstants;
 import com.tencent.qcloud.tuikit.tuichat.TUIChatService;
+
 import java.util.List;
 
 public class TipsMessageBean extends TUIMessageBean {
@@ -40,7 +41,7 @@ public class TipsMessageBean extends TUIMessageBean {
      */
     public static final int MSG_TYPE_GROUP_QUITE = 0x104;
     /**
-     * 群成员被踢出群提示消息
+     * 群成员被移除群提示消息
      *
      * Be kicked out of a group (opMember kicks memberList out of the group)
      */
@@ -193,7 +194,8 @@ public class TipsMessageBean extends TUIMessageBean {
                 long shutupTime = modifyList.get(0).getMuteTime();
                 setTipType(TipsMessageBean.MSG_TYPE_GROUP_MODIFY_NOTICE);
                 if (shutupTime > 0) {
-                    tipsMessage = targetUser + TUIChatService.getAppContext().getString(R.string.banned) + "\"" + DateTimeUtil.formatSeconds(shutupTime) + "\"";
+//                    tipsMessage = targetUser + TUIChatService.getAppContext().getString(R.string.banned) + "\"" + DateTimeUtil.formatSeconds(shutupTime) + "\"";
+                    tipsMessage = targetUser + TUIChatService.getAppContext().getString(R.string.banned) ;
                 } else {
                     tipsMessage = targetUser + TUIChatService.getAppContext().getString(R.string.cancle_banned);
                 }

+ 1 - 1
TUIKit/TUIChat/tuichat/src/main/java/com/tencent/qcloud/tuikit/tuichat/classicui/page/TUIGroupChatActivity.java

@@ -14,7 +14,7 @@ import com.tencent.qcloud.tuikit.tuichat.util.TUIChatUtils;
 public class TUIGroupChatActivity extends TUIBaseChatActivity {
     private static final String TAG = TUIGroupChatActivity.class.getSimpleName();
 
-    private TUIGroupChatFragment chatFragment;
+    public TUIGroupChatFragment chatFragment;
     private GroupChatPresenter presenter;
 
     @Override

+ 78 - 34
TUIKit/TUIChat/tuichat/src/main/java/com/tencent/qcloud/tuikit/tuichat/classicui/widget/input/InputView.java

@@ -24,12 +24,11 @@ import android.view.inputmethod.InputMethodManager;
 import android.webkit.MimeTypeMap;
 import android.widget.Button;
 import android.widget.EditText;
+import android.widget.FrameLayout;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
-import androidx.annotation.Nullable;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.fragment.app.FragmentManager;
+
 import com.google.gson.Gson;
 import com.google.gson.JsonSyntaxException;
 import com.tencent.imsdk.v2.V2TIMManager;
@@ -68,6 +67,7 @@ import com.tencent.qcloud.tuikit.tuichat.util.ChatMessageParser;
 import com.tencent.qcloud.tuikit.tuichat.util.PermissionHelper;
 import com.tencent.qcloud.tuikit.tuichat.util.TUIChatLog;
 import com.tencent.qcloud.tuikit.tuichat.util.TUIChatUtils;
+
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -76,9 +76,13 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.fragment.app.FragmentManager;
+
 /**
  * 聊天界面,底部发送图片、拍照、摄像、文件面板
- *
+ * <p>
  * Chat interface, send pictures, take pictures, video, file panels at the bottom
  */
 
@@ -97,7 +101,7 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
 
     /**
      * 语音/文字切换输入控件
-     *
+     * <p>
      * Voice/text switch input controls
      */
     protected ImageView mAudioInputSwitchButton;
@@ -105,7 +109,7 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
 
     /**
      * 表情按钮
-     *
+     * <p>
      * emoji button
      */
     protected ImageView mEmojiInputButton;
@@ -113,7 +117,7 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
 
     /**
      * 更多按钮
-     *
+     * <p>
      * more button
      */
     protected ImageView mMoreInputButton;
@@ -122,21 +126,21 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
 
     /**
      * 消息发送按钮
-     *
+     * <p>
      * message send button
      */
     protected TextView mSendTextButton;
 
     /**
      * 语音长按按钮
-     *
+     * <p>
      * voice send button
      */
     protected Button mSendAudioButton;
 
     /**
      * 文本输入框
-     *
+     * <p>
      * input text
      */
     protected TIMMentionEditText mTextInput;
@@ -184,6 +188,7 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
     private ImageView quoteCloseBtn;
     private boolean isShowCustomFace = true;
     private ChatInputMoreListener chatInputMoreListener;
+    private FrameLayout mFlMute;
 
     public InputView(Context context) {
         super(context);
@@ -222,6 +227,8 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
         quoteTv = quotePreviewBar.findViewById(R.id.reply_text);
         quoteCloseBtn = quotePreviewBar.findViewById(R.id.reply_close_btn);
 
+        mFlMute = findViewById(R.id.fl_mute);
+
         int iconSize = getResources().getDimensionPixelSize(R.dimen.chat_input_icon_size);
         ViewGroup.LayoutParams layoutParams = mEmojiInputButton.getLayoutParams();
         layoutParams.width = iconSize;
@@ -312,7 +319,8 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
                                     }
 
                                     @Override
-                                    public void onVoiceDb(double db) {}
+                                    public void onVoiceDb(double db) {
+                                    }
                                 });
                                 break;
                             case MotionEvent.ACTION_MOVE:
@@ -358,7 +366,7 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
             @Override
             public void onMentionCharacterInput(String tag) {
                 if ((tag.equals(TIMMentionEditText.TIM_MENTION_TAG) || tag.equals(TIMMentionEditText.TIM_MENTION_TAG_FULL))
-                    && TUIChatUtils.isGroupChat(mChatLayout.getChatInfo().getType())) {
+                        && TUIChatUtils.isGroupChat(mChatLayout.getChatInfo().getType())) {
                     if (mOnInputViewListener != null) {
                         mOnInputViewListener.onStartGroupMemberSelectActivity();
                     }
@@ -379,18 +387,27 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
                 exitReply();
             }
         });
+
+        mFlMute.setOnClickListener(this);
     }
 
     public void addInputText(String name, String id) {
         if (id == null || id.isEmpty()) {
             return;
         }
+        if (isMute()) {
+            return;
+        }
 
         ArrayList<String> nameList = new ArrayList<String>() {
-            { add(name); }
+            {
+                add(name);
+            }
         };
         ArrayList<String> idList = new ArrayList<String>() {
-            { add(id); }
+            {
+                add(id);
+            }
         };
 
         updateAtUserInfoMap(nameList, idList);
@@ -508,15 +525,16 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
     protected void startSendPhoto() {
         TUIChatLog.i(TAG, "startSendPhoto");
         ActivityResultResolver.getMultipleContent(mInputMoreFragment.getActivity(),
-            new String[] {ActivityResultResolver.CONTENT_TYPE_IMAGE, ActivityResultResolver.CONTENT_TYPE_VIDEO}, new TUIValueCallback<List<Uri>>() {
-                @Override
-                public void onSuccess(List<Uri> uris) {
-                    ThreadUtils.runOnUiThread(() -> sendPhotoVideoMessage(uris));
-                }
+                new String[]{ActivityResultResolver.CONTENT_TYPE_IMAGE, ActivityResultResolver.CONTENT_TYPE_VIDEO}, new TUIValueCallback<List<Uri>>() {
+                    @Override
+                    public void onSuccess(List<Uri> uris) {
+                        ThreadUtils.runOnUiThread(() -> sendPhotoVideoMessage(uris));
+                    }
 
-                @Override
-                public void onError(int errorCode, String errorMessage) {}
-            });
+                    @Override
+                    public void onError(int errorCode, String errorMessage) {
+                    }
+                });
     }
 
     private void sendPhotoVideoMessage(List<Uri> uris) {
@@ -676,7 +694,8 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
             }
 
             @Override
-            public void onError(int errorCode, String errorMessage) {}
+            public void onError(int errorCode, String errorMessage) {
+            }
         });
     }
 
@@ -749,7 +768,8 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
             }
 
             @Override
-            public void onError(int errorCode, String errorMessage) {}
+            public void onError(int errorCode, String errorMessage) {
+            }
         });
     }
 
@@ -766,7 +786,7 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
             if (videoUri != null) {
                 List list = new ArrayList();
                 list.add(videoUri);
-                sendPhotoVideoMessage(list);
+                ThreadUtils.runOnUiThread(() -> sendPhotoVideoMessage(list));
             }
         });
     }
@@ -791,7 +811,8 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
             }
 
             @Override
-            public void onError(int errorCode, String errorMessage) {}
+            public void onError(int errorCode, String errorMessage) {
+            }
         });
     }
 
@@ -814,8 +835,8 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
     @Override
     public void onClick(View view) {
         TUIChatLog.i(TAG,
-            "onClick id:" + view.getId() + "|voice_input_switch:" + R.id.voice_input_switch + "|face_btn:" + R.id.face_btn + "|more_btn:" + R.id.more_btn
-                + "|send_btn:" + R.id.send_btn + "|mCurrentState:" + mCurrentState + "|mSendEnable:" + mSendEnable + "|mMoreInputEvent:" + mMoreInputEvent);
+                "onClick id:" + view.getId() + "|voice_input_switch:" + R.id.voice_input_switch + "|face_btn:" + R.id.face_btn + "|more_btn:" + R.id.more_btn
+                        + "|send_btn:" + R.id.send_btn + "|mCurrentState:" + mCurrentState + "|mSendEnable:" + mSendEnable + "|mMoreInputEvent:" + mMoreInputEvent);
         if (view.getId() == R.id.voice_input_switch) {
             if (mCurrentState == STATE_FACE_INPUT || mCurrentState == STATE_ACTION_INPUT) {
                 mCurrentState = STATE_VOICE_INPUT;
@@ -857,8 +878,8 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
             }
         } else if (view.getId() == R.id.more_btn) {
             hideSoftInput();
-            if (mMoreInputEvent instanceof View.OnClickListener) {
-                ((View.OnClickListener) mMoreInputEvent).onClick(view);
+            if (mMoreInputEvent instanceof OnClickListener) {
+                ((OnClickListener) mMoreInputEvent).onClick(view);
             } else if (mMoreInputEvent instanceof BaseInputFragment) {
                 showCustomInputMoreFragment();
             } else {
@@ -884,7 +905,7 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
                             if (TUIChatUtils.isGroupChat(mChatLayout.getChatInfo().getType()) && !mTextInput.getMentionIdList().isEmpty()) {
                                 List<String> atUserList = new ArrayList<>(mTextInput.getMentionIdList());
                                 mMessageHandler.sendMessage(
-                                    ChatMessageBuilder.buildAtReplyMessage(mTextInput.getText().toString(), atUserList, replyPreviewBean));
+                                        ChatMessageBuilder.buildAtReplyMessage(mTextInput.getText().toString(), atUserList, replyPreviewBean));
                             } else {
                                 mMessageHandler.sendMessage(ChatMessageBuilder.buildReplyMessage(mTextInput.getText().toString(), replyPreviewBean));
                             }
@@ -1136,7 +1157,8 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
     }
 
     @Override
-    public void onTextChanged(CharSequence s, int start, int before, int count) {}
+    public void onTextChanged(CharSequence s, int start, int before, int count) {
+    }
 
     @Override
     public void afterTextChanged(Editable s) {
@@ -1318,7 +1340,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
 
         Map<String, Object> param = new HashMap<>();
         param.put(TUIConstants.TUIChat.Extension.InputMore.CONTEXT, getContext());
-        param.put(TUIConstants.TUIChat.FRAGMENT, mInputMoreFragment);
         if (ChatInfo.TYPE_C2C == mChatInfo.getType()) {
             param.put(TUIConstants.TUIChat.Extension.InputMore.USER_ID, mChatInfo.getId());
         } else {
@@ -1433,6 +1454,9 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
     }
 
     public void showReplyPreview(ReplyPreviewBean previewBean) {
+        if (isMute()) {
+            return;
+        }
         exitReply();
         replyPreviewBean = previewBean;
         String replyMessageAbstract = previewBean.getMessageAbstract();
@@ -1487,6 +1511,25 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
         mEmojiInputButton.setVisibility(visibility);
     }
 
+    public ViewGroup getInputMuteContainer() {
+        return mFlMute;
+    }
+
+    public void controlMuteViewVisibility(int visibility) {
+        if (mFlMute != null) {
+            mFlMute.setVisibility(visibility);
+            if (visibility == View.VISIBLE) {
+                mTextInput.setText("");
+                exitReply();
+                onEmptyClick();
+            }
+        }
+    }
+
+    public boolean isMute() {
+        return mFlMute.getVisibility() == View.VISIBLE;
+    }
+
     public void clearCustomActionList() {
         mInputMoreCustomActionList.clear();
     }
@@ -1498,7 +1541,8 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
     public interface MessageHandler {
         void sendMessage(TUIMessageBean msg);
 
-        default void sendMessages(List<TUIMessageBean> messageBeans) {}
+        default void sendMessages(List<TUIMessageBean> messageBeans) {
+        }
 
         void scrollToEnd();
     }

+ 22 - 2
TUIKit/TUIChat/tuichat/src/main/res/layout/chat_input_layout.xml

@@ -1,18 +1,22 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     xmlns:tools="http://schemas.android.com/tools"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:background="?attr/chat_input_area_bg"
     android:orientation="vertical">
 
     <View
+        android:id="@+id/view_line"
         android:layout_width="match_parent"
         android:layout_height="1px"
         android:background="@color/input_title_line_color" />
 
     <com.tencent.qcloud.tuikit.tuichat.classicui.widget.input.ReplyPreviewBar
         android:id="@+id/reply_preview_bar"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/view_line"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:paddingTop="5dp"
@@ -20,6 +24,9 @@
         tools:visibility="visible"/>
 
     <LinearLayout
+        android:id="@+id/ll_input"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/reply_preview_bar"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:orientation="horizontal"
@@ -95,6 +102,8 @@
 
     <com.tencent.qcloud.tuikit.tuichat.classicui.widget.input.ReplyPreviewBar
         android:id="@+id/quote_preview_bar"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/ll_input"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:visibility="gone"
@@ -102,9 +111,20 @@
         tools:visibility="visible"/>
 
     <RelativeLayout
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/quote_preview_bar"
         android:id="@+id/more_groups"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:visibility="gone" />
 
-</LinearLayout>
+    <FrameLayout
+        android:visibility="gone"
+        android:background="@color/white"
+        android:id="@+id/fl_mute"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        android:layout_width="match_parent"
+        android:layout_height="0dp">
+    </FrameLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 11 - 8
TUIKit/TUISearch/tuisearch/src/main/java/com/tencent/qcloud/tuikit/tuisearch/util/MessageInfoUtil.java

@@ -3,6 +3,7 @@ package com.tencent.qcloud.tuikit.tuisearch.util;
 import android.content.Context;
 import android.net.Uri;
 import android.text.TextUtils;
+
 import com.google.gson.Gson;
 import com.google.gson.JsonSyntaxException;
 import com.tencent.imsdk.v2.V2TIMCustomElem;
@@ -33,6 +34,7 @@ import com.tencent.qcloud.tuikit.tuisearch.bean.CallModel;
 import com.tencent.qcloud.tuikit.tuisearch.bean.MessageInfo;
 import com.tencent.qcloud.tuikit.tuisearch.message.MessageCustom;
 import com.tencent.qcloud.tuikit.tuisearch.message.MessageTyping;
+
 import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -58,7 +60,7 @@ public class MessageInfoUtil {
 
     public static MessageInfo convertTIMMessage2MessageInfo(V2TIMMessage timMessage) {
         if (timMessage == null || timMessage.getStatus() == V2TIMMessage.V2TIM_MSG_STATUS_HAS_DELETED
-            || timMessage.getElemType() == V2TIMMessage.V2TIM_ELEM_TYPE_NONE) {
+                || timMessage.getElemType() == V2TIMMessage.V2TIM_ELEM_TYPE_NONE) {
             return null;
         }
         return createMessageInfo(timMessage);
@@ -80,7 +82,7 @@ public class MessageInfoUtil {
 
     public static MessageInfo createMessageInfo(V2TIMMessage timMessage) {
         if (timMessage == null || timMessage.getStatus() == V2TIMMessage.V2TIM_MSG_STATUS_HAS_DELETED
-            || timMessage.getElemType() == V2TIMMessage.V2TIM_ELEM_TYPE_NONE) {
+                || timMessage.getElemType() == V2TIMMessage.V2TIM_ELEM_TYPE_NONE) {
             TUISearchLog.e(TAG, "ele2MessageInfo parameters error");
             return null;
         }
@@ -184,7 +186,7 @@ public class MessageInfoUtil {
             }
 
             if (TextUtils.equals(businessId, TUIConstants.TUICalling.CUSTOM_MESSAGE_BUSINESS_ID)
-                || Math.abs(businessIdForTimeout - TUIConstants.TUICalling.CALL_TIMEOUT_BUSINESS_ID) < 0.000001) {
+                    || Math.abs(businessIdForTimeout - TUIConstants.TUICalling.CALL_TIMEOUT_BUSINESS_ID) < 0.000001) {
                 boolean isGroup = !TextUtils.isEmpty(timMessage.getGroupID());
                 if (isGroup) {
                     msgInfo.setMsgType(MessageInfo.MSG_TYPE_TIPS);
@@ -249,7 +251,7 @@ public class MessageInfoUtil {
                 break;
             case CallModel.VIDEO_CALL_ACTION_SPONSOR_TIMEOUT:
                 if (isGroup && callModel.invitedList != null && callModel.invitedList.size() == 1
-                    && callModel.invitedList.get(0).equals(timMessage.getSender())) {
+                        && callModel.invitedList.get(0).equals(timMessage.getSender())) {
                     content = "\"" + senderShowName + "\"" + context.getString(R.string.no_response_call);
                 } else {
                     StringBuilder inviteeShowStringBuilder = new StringBuilder();
@@ -262,7 +264,7 @@ public class MessageInfoUtil {
                         }
                     }
                     content = isGroup ? ("\"" + inviteeShowStringBuilder.toString() + "\"" + context.getString(R.string.no_response_call))
-                                      : context.getString(R.string.no_response_call);
+                            : context.getString(R.string.no_response_call);
                 }
                 break;
             case CallModel.VIDEO_CALL_ACTION_ACCEPT:
@@ -270,7 +272,7 @@ public class MessageInfoUtil {
                 break;
             case CallModel.VIDEO_CALL_ACTION_HANGUP:
                 content = isGroup ? context.getString(R.string.stop_group_call)
-                                  : context.getString(R.string.stop_call_tip) + DateTimeUtil.formatSecondsTo00(callModel.duration);
+                        : context.getString(R.string.stop_call_tip) + DateTimeUtil.formatSecondsTo00(callModel.duration);
                 break;
             default:
                 content = context.getString(R.string.invalid_command);
@@ -411,7 +413,7 @@ public class MessageInfoUtil {
                         tipsMessage = operationUser + context.getString(R.string.move_owner) + "\"" + targetUser + "\"";
                     } else {
                         tipsMessage =
-                            operationUser + context.getString(R.string.move_owner) + "\"" + TUISearchConstants.covert2HTMLString(modifyInfo.getValue()) + "\"";
+                                operationUser + context.getString(R.string.move_owner) + "\"" + TUISearchConstants.covert2HTMLString(modifyInfo.getValue()) + "\"";
                     }
                 } else if (modifyType == V2TIMGroupChangeInfo.V2TIM_GROUP_INFO_CHANGE_TYPE_FACE_URL) {
                     msgInfo.setMsgType(MessageInfo.MSG_TYPE_GROUP_MODIFY_NOTICE);
@@ -439,7 +441,8 @@ public class MessageInfoUtil {
                 long shutupTime = modifyList.get(0).getMuteTime();
                 msgInfo.setMsgType(MessageInfo.MSG_TYPE_GROUP_MODIFY_NOTICE);
                 if (shutupTime > 0) {
-                    tipsMessage = targetUser + context.getString(R.string.banned) + "\"" + DateTimeUtil.formatSeconds(shutupTime) + "\"";
+//                    tipsMessage = targetUser + context.getString(R.string.banned) + "\"" + DateTimeUtil.formatSeconds(shutupTime) + "\"";
+                    tipsMessage = targetUser + context.getString(R.string.banned);
                 } else {
                     tipsMessage = targetUser + context.getString(R.string.cancle_banned);
                 }