Browse Source

1.修改IM聊天页面UI

王鹏鹏 2 years ago
parent
commit
dc8db95a5b

+ 3 - 0
.idea/misc.xml

@@ -280,11 +280,14 @@
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res-minimalistui/drawable/chat_minimalist_menu_emoji_list_border.xml" value="0.155" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res-minimalistui/layout/chat_minimalist_pop_menu_layout.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/drawable/action_audio_selector.xml" value="0.155" />
+        <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/drawable/action_face_selector.xml" value="0.158" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/drawable/action_more_selector.xml" value="0.155" />
+        <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/drawable/ic_self_video_call.xml" value="0.158" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/drawable/layer_live_rating_bar.xml" value="0.1615" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/drawable/message_send_border.xml" value="0.155" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/drawable/msg_editor_border.xml" value="0.155" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/drawable/my_cursor.xml" value="0.155" />
+        <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/drawable/voice_btn_selector.xml" value="0.158" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/layout/chat_fragment.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/layout/chat_input_layout.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/layout/chat_inputmore_fragment.xml" value="0.23697916666666666" />

+ 7 - 0
baselib/src/main/java/com/yingyangfly/baselib/db/DoctorBean.java

@@ -109,6 +109,13 @@ public class DoctorBean implements Serializable {
         return departmentName;
     }
 
+    public String getDepartmentNameInfo() {
+        if (TextUtils.isEmpty(getDepartmentName())) {
+            return "";
+        }
+        return " " + getDepartmentName();
+    }
+
     public void setDepartmentName(String departmentName) {
         this.departmentName = departmentName;
     }

+ 1 - 1
healthconsultation/src/main/res/layout/activity_consultation_request.xml

@@ -125,7 +125,7 @@
                     android:layout_height="wrap_content"
                     android:layout_marginStart="@dimen/divider_40px"
                     android:layout_marginTop="@dimen/divider_44px"
-                    android:text='@{data.title+data.departmentName}'
+                    android:text='@{data.title+data.getDepartmentNameInfo()}'
                     android:textColor="@color/color_FF333333"
                     android:textSize="@dimen/divider_24px"
                     app:layout_constraintStart_toEndOf="@+id/tvName"

+ 1 - 1
healthconsultation/src/main/res/layout/activity_doctor_details.xml

@@ -127,7 +127,7 @@
                         android:layout_height="wrap_content"
                         android:layout_marginStart="@dimen/divider_40px"
                         android:layout_marginTop="@dimen/divider_44px"
-                        android:text='@{data.title+data.departmentName}'
+                        android:text='@{data.title+data.getDepartmentNameInfo()}'
                         android:textColor="@color/color_FF333333"
                         android:textSize="@dimen/divider_24px"
                         app:layout_constraintStart_toEndOf="@+id/tvName"

+ 1 - 1
healthconsultation/src/main/res/layout/activity_paid.xml

@@ -188,7 +188,7 @@
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_marginStart="@dimen/divider_32px"
-                            android:text="@{doctor.title+doctor.departmentName}"
+                            android:text="@{doctor.title+doctor.getDepartmentNameInfo()}"
                             android:textColor="@color/color_FF333333"
                             android:textSize="@dimen/divider_24px"
                             app:layout_constraintStart_toEndOf="@+id/imageHead"

+ 1 - 1
healthconsultation/src/main/res/layout/item_consultation.xml

@@ -46,7 +46,7 @@
             android:layout_height="wrap_content"
             android:layout_marginStart="@dimen/divider_16px"
             android:layout_marginTop="@dimen/divider_10px"
-            android:text='@{data.title+":"+data.departmentName}'
+            android:text='@{data.title+data.getDepartmentNameInfo()}'
             android:textColor="@color/color_FF333333"
             android:textSize="@dimen/divider_24px"
             app:layout_constraintStart_toEndOf="@+id/tvName"

+ 1 - 1
healthconsultation/src/main/res/layout/item_consultation_record.xml

@@ -60,7 +60,7 @@
                 android:layout_height="wrap_content"
                 android:layout_marginStart="@dimen/divider_40px"
                 android:layout_marginTop="@dimen/divider_32px"
-                android:text='@{doctor.title+":"+doctor.departmentName}'
+                android:text='@{doctor.title+doctor.getDepartmentNameInfo()}'
                 android:textColor="@color/color_FF333333"
                 android:textSize="@dimen/divider_24px"
                 app:layout_constraintStart_toEndOf="@+id/tvName"

+ 1 - 1
healthconsultation/src/main/res/layout/item_recommend_doctor.xml

@@ -61,7 +61,7 @@
             android:layout_height="wrap_content"
             android:layout_marginStart="@dimen/divider_40px"
             android:layout_marginTop="@dimen/divider_36px"
-            android:text='@{data.title+data.departmentName}'
+            android:text='@{data.title+data.getDepartmentNameInfo()}'
             android:textColor="@color/color_FF333333"
             android:textSize="@dimen/divider_24px"
             app:layout_constraintStart_toEndOf="@+id/tvName"

+ 1 - 1
healthconsultation/src/main/res/layout/item_search_doctor.xml

@@ -21,7 +21,7 @@
             android:layout_height="wrap_content"
             android:layout_marginStart="@dimen/divider_37px"
             android:layout_marginTop="@dimen/divider_30px"
-            android:text='@{data.userName+" "+data.departmentName}'
+            android:text='@{data.userName+data.getDepartmentNameInfo()}'
             android:textColor="@color/color_FF333333"
             android:textSize="@dimen/divider_28px" />
 

+ 1 - 64
tuichat/src/main/java/com/tencent/qcloud/tuikit/tuichat/classicui/widget/input/InputView.java

@@ -104,14 +104,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
     protected ImageView mAudioInputSwitchButton;
     protected boolean mAudioInputDisable;
 
-    /**
-     * 表情按钮
-     *
-     * emoji button
-     */
-    protected ImageView mEmojiInputButton;
-    protected boolean mEmojiInputDisable;
-
     /**
      * 更多按钮
      *
@@ -212,7 +204,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
         mInputMoreView = findViewById(R.id.more_groups);
         mSendAudioButton = findViewById(R.id.chat_voice_input);
         mAudioInputSwitchButton = findViewById(R.id.voice_input_switch);
-        mEmojiInputButton = findViewById(R.id.face_btn);
         mMoreInputButton = findViewById(R.id.more_btn);
         mSendTextButton = findViewById(R.id.send_btn);
         mTextInput = findViewById(R.id.chat_message_input);
@@ -223,22 +214,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
         quoteTv = quotePreviewBar.findViewById(R.id.reply_text);
         quoteCloseBtn = quotePreviewBar.findViewById(R.id.reply_close_btn);
 
-        int iconSize = getResources().getDimensionPixelSize(R.dimen.chat_input_icon_size);
-        ViewGroup.LayoutParams layoutParams = mEmojiInputButton.getLayoutParams();
-        layoutParams.width = iconSize;
-        layoutParams.height = iconSize;
-        mEmojiInputButton.setLayoutParams(layoutParams);
-
-        layoutParams = mAudioInputSwitchButton.getLayoutParams();
-        layoutParams.width = iconSize;
-        layoutParams.height = iconSize;
-        mAudioInputSwitchButton.setLayoutParams(layoutParams);
-
-        layoutParams = mMoreInputButton.getLayoutParams();
-        layoutParams.width = iconSize;
-        layoutParams.height = iconSize;
-        mMoreInputButton.setLayoutParams(layoutParams);
-
         mIsSending = false;
 
         init();
@@ -247,7 +222,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
     @SuppressLint("ClickableViewAccessibility")
     protected void init() {
         mAudioInputSwitchButton.setOnClickListener(this);
-        mEmojiInputButton.setOnClickListener(this);
         mMoreInputButton.setOnClickListener(this);
         mSendTextButton.setOnClickListener(this);
         mTextInput.addTextChangedListener(this);
@@ -816,13 +790,12 @@ 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
+            "onClick id:" + view.getId() + "|voice_input_switch:" + R.id.voice_input_switch + "|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;
                 mInputMoreView.setVisibility(View.GONE);
-                mEmojiInputButton.setImageResource(R.drawable.action_face_selector);
             } else if (mCurrentState == STATE_SOFT_INPUT) {
                 mCurrentState = STATE_VOICE_INPUT;
             } else {
@@ -840,23 +813,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
                 mTextInput.setVisibility(VISIBLE);
                 showSoftInput();
             }
-        } else if (view.getId() == R.id.face_btn) {
-            mAudioInputSwitchButton.setImageResource(R.drawable.action_audio_selector);
-            if (mCurrentState == STATE_VOICE_INPUT) {
-                mCurrentState = STATE_NONE_INPUT;
-                mSendAudioButton.setVisibility(GONE);
-                mTextInput.setVisibility(VISIBLE);
-            }
-            if (mCurrentState == STATE_FACE_INPUT) {
-                mCurrentState = STATE_SOFT_INPUT;
-                mEmojiInputButton.setImageResource(R.drawable.action_face_selector);
-                mTextInput.setVisibility(VISIBLE);
-                showSoftInput();
-            } else {
-                mCurrentState = STATE_FACE_INPUT;
-                mEmojiInputButton.setImageResource(R.drawable.chat_input_keyboard);
-                showFaceViewGroup();
-            }
         } else if (view.getId() == R.id.more_btn) {
             hideSoftInput();
             if (mMoreInputEvent instanceof View.OnClickListener) {
@@ -871,7 +827,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
                     showInputMoreLayout();
                     mCurrentState = STATE_ACTION_INPUT;
                     mAudioInputSwitchButton.setImageResource(R.drawable.action_audio_selector);
-                    mEmojiInputButton.setImageResource(R.drawable.action_face_selector);
                     mSendAudioButton.setVisibility(GONE);
                     mTextInput.setVisibility(VISIBLE);
                 }
@@ -925,7 +880,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
             public void run() {
                 hideInputMoreLayout();
                 mAudioInputSwitchButton.setImageResource(R.drawable.action_audio_selector);
-                mEmojiInputButton.setImageResource(R.drawable.chat_input_face);
                 mSendAudioButton.setVisibility(GONE);
                 mTextInput.setVisibility(VISIBLE);
                 mTextInput.requestFocus();
@@ -967,7 +921,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
         hideSoftInput();
         mCurrentState = STATE_SOFT_INPUT;
         hideInputMoreLayout();
-        mEmojiInputButton.setImageResource(R.drawable.action_face_selector);
         mAudioInputSwitchButton.setImageResource(R.drawable.action_audio_selector);
         mSendAudioButton.setVisibility(GONE);
         mTextInput.setVisibility(VISIBLE);
@@ -1366,15 +1319,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
         }
     }
 
-    public void disableEmojiInput(boolean disable) {
-        mEmojiInputDisable = disable;
-        if (disable) {
-            mEmojiInputButton.setVisibility(GONE);
-        } else {
-            mEmojiInputButton.setVisibility(VISIBLE);
-        }
-    }
-
     public void disableMoreInput(boolean disable) {
         mMoreInputDisable = disable;
         if (disable) {
@@ -1481,13 +1425,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
         }
     }
 
-    protected void showEmojiInputButton(int visibility) {
-        if (mEmojiInputDisable) {
-            return;
-        }
-        mEmojiInputButton.setVisibility(visibility);
-    }
-
     public void clearCustomActionList() {
         mInputMoreCustomActionList.clear();
     }

BIN
tuichat/src/main/res/drawable-xxhdpi/chat_input_keyboard.png


+ 2 - 5
tuichat/src/main/res/drawable/msg_editor_border.xml

@@ -1,8 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <solid android:color="#fff" />
-    <stroke
-        android:width="1px"
-        android:color="#FFE4E2E2" />
-    <corners android:radius="50dp" />
+    <solid android:color="@color/color_FFECEFF5" />
+    <corners android:radius="@dimen/divider_50px" />
 </shape>

+ 7 - 8
tuichat/src/main/res/drawable/voice_btn_selector.xml

@@ -1,18 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-
     <item android:state_pressed="true">
         <shape>
-            <solid android:color="@color/voice_pressed" />
-            <corners android:radius="3dp" />
+            <solid android:color="@color/color_FFECEFF5" />
+            <stroke android:width="@dimen/divider_1px" android:color="@color/color_FFECEFF5" />
+            <corners android:radius="@dimen/divider_50px" />
         </shape>
     </item>
     <item>
-
         <shape>
-            <solid android:color="@color/voice_normal" />
-            <corners android:radius="3dp" />
+            <stroke android:width="@dimen/divider_1px" android:color="@color/reply_msg_text" />
+            <solid android:color="@android:color/white" />
+            <corners android:radius="@dimen/divider_50px" />
         </shape>
-    </item> <!-- default -->
-
+    </item>
 </selector>

+ 29 - 44
tuichat/src/main/res/layout/chat_input_layout.xml

@@ -1,96 +1,81 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:background="?attr/chat_input_area_bg"
     android:orientation="vertical">
 
-    <View
-        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"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:paddingTop="5dp"
         android:visibility="gone"
-        tools:visibility="visible"/>
+        tools:visibility="visible" />
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:gravity="center_vertical"
         android:orientation="horizontal"
-        android:padding="5dp"
-        android:gravity="center_vertical">
+        android:padding="5dp">
 
         <ImageView
             android:id="@+id/voice_input_switch"
-            android:layout_width="@dimen/chat_input_icon_size"
-            android:layout_height="@dimen/chat_input_icon_size"
-            android:layout_margin="5dp"
+            android:layout_width="@dimen/divider_56px"
+            android:layout_height="@dimen/divider_56px"
+            android:layout_marginStart="@dimen/divider_28px"
             android:scaleType="centerInside"
             android:src="@drawable/action_audio_selector" />
 
         <com.tencent.qcloud.tuikit.tuichat.classicui.widget.input.TIMMentionEditText
             android:id="@+id/chat_message_input"
             android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_margin="5dp"
+            android:layout_height="@dimen/divider_60px"
+            android:layout_margin="@dimen/divider_15px"
             android:layout_weight="1"
             android:background="@drawable/msg_editor_border"
-            android:textSize="@dimen/chat_input_text_size"
-            android:maxHeight="120dp"
-            android:minHeight="@dimen/chat_input_editor_height"
+            android:paddingStart="@dimen/divider_15px"
             android:textCursorDrawable="@drawable/my_cursor"
-            android:padding="5dp" />
+            android:textSize="@dimen/divider_28px" />
 
         <Button
             android:id="@+id/chat_voice_input"
             style="?android:attr/borderlessButtonStyle"
             android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:layout_margin="5dp"
+            android:layout_height="@dimen/divider_60px"
+            android:layout_margin="@dimen/divider_13px"
             android:layout_weight="1"
             android:background="@drawable/voice_btn_selector"
             android:text="@string/hold_say"
             android:textAllCaps="false"
-            android:textColor="@color/text_color_gray"
+            android:textColor="@color/color_FF333333"
+            android:textSize="@dimen/divider_28px"
+            android:textStyle="bold"
             android:visibility="gone" />
 
-        <ImageView
-            android:id="@+id/face_btn"
-            android:layout_width="@dimen/chat_input_icon_size"
-            android:layout_height="@dimen/chat_input_icon_size"
-            android:layout_margin="5dp"
-            android:scaleType="fitXY"
-            android:visibility="gone"
-            android:src="@drawable/action_face_selector" />
-
         <ImageView
             android:id="@+id/more_btn"
-            android:layout_width="@dimen/chat_input_icon_size"
-            android:layout_height="@dimen/chat_input_icon_size"
-            android:layout_margin="5dp"
+            android:layout_width="@dimen/divider_56px"
+            android:layout_height="@dimen/divider_56px"
+            android:layout_marginEnd="@dimen/divider_28px"
             android:scaleType="fitXY"
             android:src="@drawable/action_more_selector" />
 
         <TextView
             android:id="@+id/send_btn"
             android:layout_width="wrap_content"
-            android:layout_height="@dimen/chat_input_icon_size"
+            android:layout_height="@dimen/divider_60px"
             android:background="@drawable/message_send_border"
-            android:text="@string/send"
-            android:paddingStart="4dp"
-            android:paddingEnd="4dp"
             android:gravity="center"
-            android:textColor="#fff"
-            android:textSize="13sp"
-            android:visibility="gone"
             android:maxLines="1"
-            tools:visibility="visible"/>
+            android:paddingStart="@dimen/divider_24px"
+            android:paddingEnd="@dimen/divider_24px"
+            android:text="@string/send"
+            android:textColor="@android:color/white"
+            android:textSize="@dimen/divider_28px"
+            android:visibility="gone"
+            tools:visibility="visible" />
 
     </LinearLayout>
 
@@ -98,9 +83,9 @@
         android:id="@+id/quote_preview_bar"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:visibility="gone"
         android:paddingBottom="9.6dp"
-        tools:visibility="visible"/>
+        android:visibility="gone"
+        tools:visibility="visible" />
 
     <RelativeLayout
         android:id="@+id/more_groups"

+ 6 - 1
tuichat/src/main/res/values/colors.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<resources>
+<resources xmlns:tools="http://schemas.android.com/tools">
     <color name="chat_background_color">#FFFFFF</color>
 
     <color name="chat_bubble_other_color">#ECECEC</color>
@@ -49,4 +49,9 @@
 
     <color name="order_message_color">#FF7201</color>
     <color name="window_background_color">#BF000000</color>
+
+    <color name="color_FF333333">#FF333333</color>
+    <color name="color_FFF2F2F2">#FFF2F2F2</color>
+    <color name="color_FFE4E2E2" tools:ignore="MissingDefaultResource">#FFE4E2E2</color>
+    <color name="color_FFECEFF5">#FFECEFF5</color>
 </resources>