Explorar o código

1.修改IM聊天页面UI

王鹏鹏 %!s(int64=2) %!d(string=hai) anos
pai
achega
5d51dd280a

+ 0 - 7
tuichat/src/main/java/com/tencent/qcloud/tuikit/tuichat/classicui/interfaces/IChatLayout.java

@@ -42,13 +42,6 @@ public interface IChatLayout extends ILayout {
      */
     MessageRecyclerView getMessageLayout();
 
-    /**
-     * 获取聊天窗口 Notice 区域 Layout
-     *
-     * @return
-     */
-    NoticeLayout getNoticeLayout();
-
     /**
      * 获取当前的会话信息
      */

+ 1 - 103
tuichat/src/main/java/com/tencent/qcloud/tuikit/tuichat/classicui/widget/ChatView.java

@@ -125,14 +125,12 @@ public class ChatView extends LinearLayout implements IChatLayout {
     };
 
     protected FrameLayout mCustomView;
-    protected NoticeLayout mGroupApplyLayout;
     protected View mRecordingGroup;
     protected ImageView mRecordingIcon;
     protected TextView mRecordingTips;
     private TitleBarLayout mTitleBar;
     private MessageRecyclerView mMessageRecyclerView;
     private InputView mInputView;
-    private NoticeLayout mNoticeLayout;
     private LinearLayout mJumpMessageLayout;
     private ImageView mArrowImageView;
     private TextView mJumpMessageTextView;
@@ -140,10 +138,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
     private boolean mJumpGroupAtInfoShow;
     private boolean mClickLastMessageShow;
 
-    private LinearLayout mForwardLayout;
-    private View mForwardOneButton;
-    private View mForwardMergeButton;
-    private View mDeleteButton;
     private long lastTypingTime = 0;
     private boolean isSupportTyping = false;
 
@@ -174,16 +168,9 @@ public class ChatView extends LinearLayout implements IChatLayout {
         mRecordingGroup = findViewById(R.id.voice_recording_view);
         mRecordingIcon = findViewById(R.id.recording_icon);
         mRecordingTips = findViewById(R.id.recording_tips);
-        mGroupApplyLayout = findViewById(R.id.chat_group_apply_layout);
-        mNoticeLayout = findViewById(R.id.chat_notice_layout);
         mCustomView = findViewById(R.id.custom_layout);
         mCustomView.setVisibility(GONE);
 
-        mForwardLayout = findViewById(R.id.forward_layout);
-        mForwardOneButton = findViewById(R.id.forward_one_by_one_button);
-        mForwardMergeButton = findViewById(R.id.forward_merge_button);
-        mDeleteButton = findViewById(R.id.delete_button);
-
         mJumpMessageLayout = findViewById(R.id.jump_message_layout);
         mJumpMessageTextView = findViewById(R.id.jump_message_content);
         mArrowImageView = findViewById(R.id.arrow_icon);
@@ -337,21 +324,9 @@ public class ChatView extends LinearLayout implements IChatLayout {
             return;
         }
         mInputView.setChatInfo(chatInfo);
-        String chatTitle = chatInfo.getChatName();
         setChatName();
         setChatHandler();
 
-        if (!TUIChatUtils.isC2CChat(chatInfo.getType())) {
-            loadApplyList();
-            mGroupApplyLayout.setOnNoticeClickListener(new OnClickListener() {
-                @Override
-                public void onClick(View view) {
-                    Bundle bundle = new Bundle();
-                    bundle.putString(TUIChatConstants.GROUP_ID, chatInfo.getId());
-                    TUICore.startActivity(getContext(), "GroupApplyManagerActivity", bundle);
-                }
-            });
-        }
         mMessageRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
             @Override
             public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
@@ -493,7 +468,7 @@ public class ChatView extends LinearLayout implements IChatLayout {
 
                 @Override
                 public void onApplied(int size) {
-                    ChatView.this.onApplied(size);
+
                 }
 
                 @Override
@@ -516,23 +491,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
         }
     }
 
-    private void loadApplyList() {
-        presenter.loadApplyList(new IUIKitCallback<List<GroupApplyInfo>>() {
-            @Override
-            public void onSuccess(List<GroupApplyInfo> data) {
-                if (data != null && data.size() > 0) {
-                    mGroupApplyLayout.getContent().setText(getContext().getString(R.string.group_apply_tips, data.size()));
-                    mGroupApplyLayout.setVisibility(View.VISIBLE);
-                }
-            }
-
-            @Override
-            public void onError(String module, int errCode, String errMsg) {
-                TUIChatLog.e(TAG, "loadApplyList onError: " + errMsg);
-            }
-        });
-    }
-
     public void onExitChat() {
         if (getContext() instanceof Activity) {
             ((Activity) getContext()).finish();
@@ -547,15 +505,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
         getTitleBar().setTitle(newName, ITitleBarLayout.Position.MIDDLE);
     }
 
-    public void onApplied(int size) {
-        if (size <= 0) {
-            mGroupApplyLayout.setVisibility(View.GONE);
-        } else {
-            mGroupApplyLayout.getContent().setText(getContext().getString(R.string.group_apply_tips, size));
-            mGroupApplyLayout.setVisibility(View.VISIBLE);
-        }
-    }
-
     public void loadMessages(TUIMessageBean lastMessage, int type) {
         if (presenter != null) {
             presenter.loadMessage(type, lastMessage);
@@ -571,22 +520,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
         }
     }
 
-    public LinearLayout getForwardLayout() {
-        return mForwardLayout;
-    }
-
-    public View getForwardOneButton() {
-        return mForwardOneButton;
-    }
-
-    public View getDeleteButton() {
-        return mDeleteButton;
-    }
-
-    public View getForwardMergeButton() {
-        return mForwardMergeButton;
-    }
-
     @Override
     public InputView getInputLayout() {
         return mInputView;
@@ -597,11 +530,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
         return mMessageRecyclerView;
     }
 
-    @Override
-    public NoticeLayout getNoticeLayout() {
-        return mNoticeLayout;
-    }
-
     public FrameLayout getCustomView() {
         return mCustomView;
     }
@@ -1024,8 +952,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
                 }
             }
         });
-
-        getForwardLayout().setVisibility(GONE);
         getInputLayout().setVisibility(VISIBLE);
     }
 
@@ -1052,34 +978,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
             }
         });
         getInputLayout().setVisibility(GONE);
-        getForwardLayout().setVisibility(VISIBLE);
-        getForwardOneButton().setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                showForwardDialog(true, true);
-            }
-        });
-        getForwardMergeButton().setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                showForwardDialog(true, false);
-            }
-        });
-        getDeleteButton().setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                List<TUIMessageBean> msgIds = mAdapter.getSelectedItem();
-
-                if (msgIds == null || msgIds.isEmpty()) {
-                    ToastUtil.toastShortMessage("please select message!");
-                    return;
-                }
-
-                deleteMessageInfos(msgIds);
-
-                resetForwardState(leftTitle.toString());
-            }
-        });
     }
 
     private void showForwardDialog(boolean isMultiSelect, boolean isOneByOne) {

+ 1 - 115
tuichat/src/main/res/layout/chat_layout.xml

@@ -12,18 +12,10 @@
         android:layout_width="match_parent"
         android:layout_height="@dimen/divider_108px" />
 
-    <View
-        android:id="@+id/view_line"
-        android:layout_width="match_parent"
-        android:layout_height="0.3dp"
-        android:layout_below="@+id/chat_title_bar"
-        android:background="@color/chat_title_line_color"
-        android:visibility="gone" />
-
     <androidx.cardview.widget.CardView
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_below="@+id/view_line"
+        android:layout_below="@+id/chat_title_bar"
         android:layout_marginStart="@dimen/divider_22px"
         android:layout_marginEnd="@dimen/divider_22px"
         android:layout_marginBottom="@dimen/divider_22px"
@@ -41,27 +33,11 @@
                 android:layout_marginTop="0dp"
                 android:visibility="gone" />
 
-            <com.tencent.qcloud.tuikit.tuichat.classicui.component.noticelayout.NoticeLayout
-                android:id="@+id/chat_group_apply_layout"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_below="@+id/custom_layout"
-                android:visibility="gone" />
-
-            <com.tencent.qcloud.tuikit.tuichat.classicui.component.noticelayout.NoticeLayout
-                android:id="@+id/chat_notice_layout"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_below="@+id/chat_group_apply_layout"
-                android:layout_marginTop="1dp"
-                android:visibility="gone" />
-
             <com.tencent.qcloud.tuikit.tuichat.classicui.widget.message.MessageRecyclerView
                 android:id="@+id/chat_message_layout"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_above="@id/chat_input_layout"
-                android:layout_below="@+id/chat_notice_layout"
                 android:baselineAligned="false"
                 android:clickable="false"
                 android:descendantFocusability="blocksDescendants" />
@@ -70,7 +46,6 @@
                 android:id="@+id/chat_input_layout"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_above="@id/forward_layout"
                 android:layout_alignParentBottom="true" />
 
             <androidx.cardview.widget.CardView
@@ -121,93 +96,6 @@
                 </LinearLayout>
             </androidx.cardview.widget.CardView>
 
-            <LinearLayout
-                android:id="@+id/forward_layout"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_alignParentBottom="true"
-                android:background="#E6E9EB"
-                android:gravity="center_horizontal"
-                android:orientation="horizontal"
-                android:paddingLeft="38.4dp"
-                android:paddingTop="15.36dp"
-                android:paddingRight="38.4dp"
-                android:paddingBottom="46.08dp"
-                android:visibility="gone"
-                tools:visibility="visible">
-
-                <LinearLayout
-                    android:id="@+id/forward_one_by_one_button"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_weight="0.33"
-                    android:gravity="center"
-                    android:orientation="vertical">
-
-                    <ImageView
-                        android:layout_width="38.4dp"
-                        android:layout_height="38.4dp"
-                        android:background="@drawable/multi_select_forward_one" />
-
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="5.76dp"
-                        android:text="@string/forward_mode_onebyone"
-                        android:textColor="#444444"
-                        android:textSize="11.52sp" />
-
-                </LinearLayout>
-
-
-                <LinearLayout
-                    android:id="@+id/forward_merge_button"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_weight="0.33"
-                    android:gravity="center"
-                    android:orientation="vertical">
-
-                    <ImageView
-                        android:layout_width="38.4dp"
-                        android:layout_height="38.4dp"
-                        android:background="@drawable/multi_select_forward_merge" />
-
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="5.76dp"
-                        android:text="@string/forward_mode_merge"
-                        android:textColor="#444444"
-                        android:textSize="11.52sp" />
-
-                </LinearLayout>
-
-
-                <LinearLayout
-                    android:id="@+id/delete_button"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_weight="0.33"
-                    android:gravity="center"
-                    android:orientation="vertical">
-
-                    <ImageView
-                        android:layout_width="38.4dp"
-                        android:layout_height="38.4dp"
-                        android:background="@drawable/multi_select_delete" />
-
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="5.76dp"
-                        android:text="@string/delete_button"
-                        android:textColor="#444444"
-                        android:textSize="11.52sp" />
-                </LinearLayout>
-
-            </LinearLayout>
-
             <RelativeLayout
                 android:id="@+id/voice_recording_view"
                 android:layout_width="150dp"
@@ -240,8 +128,6 @@
 
                 </LinearLayout>
             </RelativeLayout>
-
-
         </RelativeLayout>
     </androidx.cardview.widget.CardView>
 </RelativeLayout>

+ 2 - 2
tuicore/src/main/res/values/strings.xml

@@ -2,8 +2,8 @@
 <resources>
     <string name="open_file_tips">Select an app to open the file</string>
 
-    <string name="cancel">Cancel</string>
-    <string name="sure">Confirm</string>
+    <string name="cancel">取消</string>
+    <string name="sure">确定</string>
     <string name="core_permission_dialog_title">Authorization Request</string>
     <string name="core_permission_dialog_positive_setting_text">Settings</string>
     <string name="date_yesterday">Yesterday</string>