Browse Source

1.修改IM聊天页面UI

王鹏鹏 2 years ago
parent
commit
0ba7c1bd07

+ 3 - 1
.idea/misc.xml

@@ -283,8 +283,10 @@
         <entry key="..\:/workspace/hcp-pad/timcommon/src/main/res/layout/title_bar_layout.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pad/tuibeauty/src/main/res/layout/tuibeauty_view_panel.xml" value="0.22826086956521738" />
         <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_layout.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res-minimalistui/layout/chat_minimalist_message_adapter_content_text.xml" value="0.23697916666666666" />
         <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-minimalistui/layout/chat_minimalist_title_extension_item_layout.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res-minimalistui/layout/minimalist_input_more.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" />
@@ -311,7 +313,7 @@
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/layout/chat_layout.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/layout/chat_menu_face_item_layout.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/layout/chat_menu_recent_face_item_layout.xml" value="0.23697916666666666" />
-        <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/layout/chat_patient_info.xml" value="0.6909090909090909" />
+        <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/layout/chat_patient_info.xml" value="0.72" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/layout/chat_pop_menu_item_layout.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/layout/chat_pop_menu_layout.xml" value="0.264" />
         <entry key="..\:/workspace/hcp-pad/tuichat/src/main/res/layout/chat_reply_quote_merge_layout.xml" value="0.23697916666666666" />

+ 108 - 100
tuichat/src/main/java/com/tencent/qcloud/tuikit/tuichat/minimalistui/widget/ChatView.java

@@ -22,10 +22,12 @@ import android.widget.FrameLayout;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
+
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
+
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.request.RequestOptions;
 import com.google.gson.Gson;
@@ -73,6 +75,8 @@ import com.tencent.qcloud.tuikit.tuichat.presenter.GroupChatPresenter;
 import com.tencent.qcloud.tuikit.tuichat.util.ChatMessageBuilder;
 import com.tencent.qcloud.tuikit.tuichat.util.TUIChatLog;
 import com.tencent.qcloud.tuikit.tuichat.util.TUIChatUtils;
+import com.tencent.qcloud.tuikit.tuichat.util.ViewTool;
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -141,8 +145,8 @@ public class ChatView extends LinearLayout implements IChatLayout {
     }
 
     private void initViews() {
-        inflate(getContext(), R.layout.chat_minimalist_layout, this);
-
+        ViewTool.inflateFragmentPixelsById(getContext(), R.layout.chat_minimalist_layout, this, 1194, 834);
+//        inflate(getContext(), R.layout.chat_minimalist_layout, this);
         mMessageRecyclerView = findViewById(R.id.chat_message_layout);
         mInputView = findViewById(R.id.chat_input_layout);
         mInputView.setChatLayout(this);
@@ -341,7 +345,7 @@ public class ChatView extends LinearLayout implements IChatLayout {
         });
 
         loadMessages(
-            chatInfo.getLocateMessage(), chatInfo.getLocateMessage() == null ? TUIChatConstants.GET_MESSAGE_FORWARD : TUIChatConstants.GET_MESSAGE_TWO_WAY);
+                chatInfo.getLocateMessage(), chatInfo.getLocateMessage() == null ? TUIChatConstants.GET_MESSAGE_FORWARD : TUIChatConstants.GET_MESSAGE_TWO_WAY);
         initHeader();
     }
 
@@ -463,11 +467,11 @@ public class ChatView extends LinearLayout implements IChatLayout {
 
     private void loadFace(String faceUrl) {
         Glide.with(this)
-            .load(faceUrl)
-            .apply(new RequestOptions()
-                       .error(com.tencent.qcloud.tuikit.timcommon.R.drawable.core_default_user_icon_light)
-                       .placeholder(com.tencent.qcloud.tuikit.timcommon.R.drawable.core_default_user_icon_light))
-            .into(chatAvatar);
+                .load(faceUrl)
+                .apply(new RequestOptions()
+                        .error(com.tencent.qcloud.tuikit.timcommon.R.drawable.core_default_user_icon_light)
+                        .placeholder(com.tencent.qcloud.tuikit.timcommon.R.drawable.core_default_user_icon_light))
+                .into(chatAvatar);
     }
 
     private void onHeaderUserClick(View v) {
@@ -514,9 +518,9 @@ public class ChatView extends LinearLayout implements IChatLayout {
     private void startCall(int callActionType) {
         if (callActionType == TUIConstants.TUICalling.ACTION_ID_AUDIO_CALL || callActionType == TUIConstants.TUICalling.ACTION_ID_VIDEO_CALL) {
             String type =
-                callActionType == TUIConstants.TUICalling.ACTION_ID_AUDIO_CALL ? TUIConstants.TUICalling.TYPE_AUDIO : TUIConstants.TUICalling.TYPE_VIDEO;
+                    callActionType == TUIConstants.TUICalling.ACTION_ID_AUDIO_CALL ? TUIConstants.TUICalling.TYPE_AUDIO : TUIConstants.TUICalling.TYPE_VIDEO;
             String title = callActionType == TUIConstants.TUICalling.ACTION_ID_AUDIO_CALL ? getResources().getString(R.string.chat_start_audio_call)
-                                                                                          : getResources().getString(R.string.chat_start_video_call);
+                    : getResources().getString(R.string.chat_start_video_call);
             if (TUIChatUtils.isGroupChat(getChatInfo().getType())) {
                 Bundle bundle = new Bundle();
                 bundle.putString(TUIConstants.TUICalling.GROUP_ID, getChatInfo().getId());
@@ -528,7 +532,7 @@ public class ChatView extends LinearLayout implements IChatLayout {
                 TUICore.startActivity(getContext(), "StartGroupMemberSelectMinimalistActivity", bundle, 11);
             } else {
                 Map<String, Object> map = new HashMap<>();
-                map.put(TUIConstants.TUICalling.PARAM_NAME_USERIDS, new String[] {getChatInfo().getId()});
+                map.put(TUIConstants.TUICalling.PARAM_NAME_USERIDS, new String[]{getChatInfo().getId()});
                 map.put(TUIConstants.TUICalling.PARAM_NAME_TYPE, type);
                 TUICore.callService(TUIConstants.TUICalling.SERVICE_NAME, TUIConstants.TUICalling.METHOD_NAME_CALL, map);
             }
@@ -542,7 +546,8 @@ public class ChatView extends LinearLayout implements IChatLayout {
         List<TUIMessageBean> tuiMessageBeans = mAdapter.getItemList(firstPosition, lastPosition);
         presenter.sendMessageReadReceipt(tuiMessageBeans, new IUIKitCallback<Void>() {
             @Override
-            public void onSuccess(Void data) {}
+            public void onSuccess(Void data) {
+            }
 
             @Override
             public void onError(String module, int errCode, String errMsg) {
@@ -606,11 +611,11 @@ public class ChatView extends LinearLayout implements IChatLayout {
                         return;
                     }
                     Glide.with(getContext())
-                        .load(faceUrl)
-                        .apply(new RequestOptions()
-                                   .error(com.tencent.qcloud.tuikit.timcommon.R.drawable.core_default_user_icon_light)
-                                   .placeholder(com.tencent.qcloud.tuikit.timcommon.R.drawable.core_default_user_icon_light))
-                        .into(chatAvatar);
+                            .load(faceUrl)
+                            .apply(new RequestOptions()
+                                    .error(com.tencent.qcloud.tuikit.timcommon.R.drawable.core_default_user_icon_light)
+                                    .placeholder(com.tencent.qcloud.tuikit.timcommon.R.drawable.core_default_user_icon_light))
+                            .into(chatAvatar);
                 }
 
                 @Override
@@ -644,11 +649,11 @@ public class ChatView extends LinearLayout implements IChatLayout {
                         return;
                     }
                     Glide.with(getContext())
-                        .load(faceUrl)
-                        .apply(new RequestOptions()
-                                   .error(com.tencent.qcloud.tuikit.timcommon.R.drawable.core_default_user_icon_light)
-                                   .placeholder(com.tencent.qcloud.tuikit.timcommon.R.drawable.core_default_user_icon_light))
-                        .into(chatAvatar);
+                            .load(faceUrl)
+                            .apply(new RequestOptions()
+                                    .error(com.tencent.qcloud.tuikit.timcommon.R.drawable.core_default_user_icon_light)
+                                    .placeholder(com.tencent.qcloud.tuikit.timcommon.R.drawable.core_default_user_icon_light))
+                            .into(chatAvatar);
                 }
             });
         }
@@ -769,22 +774,23 @@ public class ChatView extends LinearLayout implements IChatLayout {
             @Override
             public void onDeleteMessageClick(TUIMessageBean msg) {
                 TUIKitDialog tipsDialog = new TUIKitDialog(getContext())
-                                              .builder()
-                                              .setCancelable(true)
-                                              .setCancelOutside(true)
-                                              .setTitle(getContext().getString(R.string.chat_delete_msg_tip))
-                                              .setDialogWidth(0.75f)
-                                              .setPositiveButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.sure),
-                                                  new OnClickListener() {
-                                                      @Override
-                                                      public void onClick(View v) {
-                                                          deleteMessage(msg);
-                                                      }
-                                                  })
-                                              .setNegativeButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.cancel), new OnClickListener() {
-                                                  @Override
-                                                  public void onClick(View v) {}
-                                              });
+                        .builder()
+                        .setCancelable(true)
+                        .setCancelOutside(true)
+                        .setTitle(getContext().getString(R.string.chat_delete_msg_tip))
+                        .setDialogWidth(0.75f)
+                        .setPositiveButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.sure),
+                                new OnClickListener() {
+                                    @Override
+                                    public void onClick(View v) {
+                                        deleteMessage(msg);
+                                    }
+                                })
+                        .setNegativeButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.cancel), new OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                            }
+                        });
                 tipsDialog.show();
             }
 
@@ -1184,24 +1190,25 @@ public class ChatView extends LinearLayout implements IChatLayout {
                     return;
                 }
                 TUIKitDialog tipsDialog = new TUIKitDialog(getContext())
-                                              .builder()
-                                              .setCancelable(true)
-                                              .setCancelOutside(true)
-                                              .setTitle(getContext().getString(R.string.chat_delete_msg_tip))
-                                              .setDialogWidth(0.75f)
-                                              .setPositiveButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.sure),
-                                                  new OnClickListener() {
-                                                      @Override
-                                                      public void onClick(View v) {
-                                                          final List<TUIMessageBean> messageInfoList = mAdapter.getSelectedItem();
-                                                          deleteMessageInfos(messageInfoList);
-                                                          resetForwardState();
-                                                      }
-                                                  })
-                                              .setNegativeButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.cancel), new OnClickListener() {
-                                                  @Override
-                                                  public void onClick(View v) {}
-                                              });
+                        .builder()
+                        .setCancelable(true)
+                        .setCancelOutside(true)
+                        .setTitle(getContext().getString(R.string.chat_delete_msg_tip))
+                        .setDialogWidth(0.75f)
+                        .setPositiveButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.sure),
+                                new OnClickListener() {
+                                    @Override
+                                    public void onClick(View v) {
+                                        final List<TUIMessageBean> messageInfoList = mAdapter.getSelectedItem();
+                                        deleteMessageInfos(messageInfoList);
+                                        resetForwardState();
+                                    }
+                                })
+                        .setNegativeButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.cancel), new OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                            }
+                        });
                 tipsDialog.show();
             }
         });
@@ -1243,23 +1250,24 @@ public class ChatView extends LinearLayout implements IChatLayout {
 
     private void showForwardLimitDialog(final List<TUIMessageBean> messageInfoList) {
         TUIKitDialog tipsDialog = new TUIKitDialog(getContext())
-                                      .builder()
-                                      .setCancelable(true)
-                                      .setCancelOutside(true)
-                                      .setTitle(getContext().getString(R.string.forward_oneByOne_limit_number_tip))
-                                      .setDialogWidth(0.75f)
-                                      .setPositiveButton(getContext().getString(R.string.forward_mode_merge),
-                                          new OnClickListener() {
-                                              @Override
-                                              public void onClick(View v) {
-                                                  startSelectForwardActivity(TUIChatConstants.FORWARD_MODE_MERGE, messageInfoList);
-                                                  resetForwardState();
-                                              }
-                                          })
-                                      .setNegativeButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.cancel), new OnClickListener() {
-                                          @Override
-                                          public void onClick(View v) {}
-                                      });
+                .builder()
+                .setCancelable(true)
+                .setCancelOutside(true)
+                .setTitle(getContext().getString(R.string.forward_oneByOne_limit_number_tip))
+                .setDialogWidth(0.75f)
+                .setPositiveButton(getContext().getString(R.string.forward_mode_merge),
+                        new OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                                startSelectForwardActivity(TUIChatConstants.FORWARD_MODE_MERGE, messageInfoList);
+                                resetForwardState();
+                            }
+                        })
+                .setNegativeButton(getContext().getString(com.tencent.qcloud.tuicore.R.string.cancel), new OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                    }
+                });
         tipsDialog.show();
     }
 
@@ -1294,7 +1302,7 @@ public class ChatView extends LinearLayout implements IChatLayout {
                     showNotSupportDialog();
                     if (msg.isNeedReadReceipt()) {
                         toastMsg = getResources().getString(R.string.chat_message_read_receipt)
-                            + getResources().getString(com.tencent.qcloud.tuicore.R.string.TUIKitErrorUnsupporInterfaceSuffix);
+                                + getResources().getString(com.tencent.qcloud.tuicore.R.string.TUIKitErrorUnsupporInterfaceSuffix);
                     }
                 }
                 ToastUtil.toastLongMessage(toastMsg);
@@ -1338,7 +1346,7 @@ public class ChatView extends LinearLayout implements IChatLayout {
                     showNotSupportDialog();
                     if (msg.isNeedReadReceipt()) {
                         toastMsg = getResources().getString(R.string.chat_message_read_receipt)
-                            + getResources().getString(com.tencent.qcloud.tuicore.R.string.TUIKitErrorUnsupporInterfaceSuffix);
+                                + getResources().getString(com.tencent.qcloud.tuicore.R.string.TUIKitErrorUnsupporInterfaceSuffix);
                     }
                 }
                 ToastUtil.toastLongMessage(toastMsg);
@@ -1434,31 +1442,31 @@ public class ChatView extends LinearLayout implements IChatLayout {
         };
         spannedString.setSpan(clickableSpan2, buyingGuidelinesIndex, buyingGuidelinesIndex + buyingGuidelines.length(), Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
         TUIKitDialog.TUIIMUpdateDialog.getInstance()
-            .createDialog(getContext())
-            .setShowOnlyDebug(true)
-            .setMovementMethod(LinkMovementMethod.getInstance())
-            .setHighlightColor(Color.TRANSPARENT)
-            .setCancelable(true)
-            .setCancelOutside(true)
-            .setTitle(spannedString)
-            .setDialogWidth(0.75f)
-            .setDialogFeatureName(TUIConstants.BuyingFeature.BUYING_FEATURE_MESSAGE_RECEIPT)
-            .setPositiveButton(getResources().getString(R.string.chat_no_more_reminders),
-                new OnClickListener() {
-                    @Override
-                    public void onClick(View v) {
-                        TUIKitDialog.TUIIMUpdateDialog.getInstance().dismiss();
-                        TUIKitDialog.TUIIMUpdateDialog.getInstance().setNeverShow(true);
-                    }
-                })
-            .setNegativeButton(getResources().getString(R.string.chat_i_know),
-                new OnClickListener() {
-                    @Override
-                    public void onClick(View v) {
-                        TUIKitDialog.TUIIMUpdateDialog.getInstance().dismiss();
-                    }
-                })
-            .show();
+                .createDialog(getContext())
+                .setShowOnlyDebug(true)
+                .setMovementMethod(LinkMovementMethod.getInstance())
+                .setHighlightColor(Color.TRANSPARENT)
+                .setCancelable(true)
+                .setCancelOutside(true)
+                .setTitle(spannedString)
+                .setDialogWidth(0.75f)
+                .setDialogFeatureName(TUIConstants.BuyingFeature.BUYING_FEATURE_MESSAGE_RECEIPT)
+                .setPositiveButton(getResources().getString(R.string.chat_no_more_reminders),
+                        new OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                                TUIKitDialog.TUIIMUpdateDialog.getInstance().dismiss();
+                                TUIKitDialog.TUIIMUpdateDialog.getInstance().setNeverShow(true);
+                            }
+                        })
+                .setNegativeButton(getResources().getString(R.string.chat_i_know),
+                        new OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                                TUIKitDialog.TUIIMUpdateDialog.getInstance().dismiss();
+                            }
+                        })
+                .show();
     }
 
     private void openWebUrl(String url) {

+ 4 - 1
tuichat/src/main/java/com/tencent/qcloud/tuikit/tuichat/minimalistui/widget/message/ChatReplyDialogFragment.java

@@ -30,6 +30,8 @@ import com.tencent.qcloud.tuikit.tuichat.minimalistui.page.TUIForwardChatMinimal
 import com.tencent.qcloud.tuikit.tuichat.minimalistui.widget.message.reply.ReplyDetailsView;
 import com.tencent.qcloud.tuikit.tuichat.minimalistui.widget.message.viewholder.MessageViewHolderFactory;
 import com.tencent.qcloud.tuikit.tuichat.presenter.ReplyPresenter;
+import com.tencent.qcloud.tuikit.tuichat.util.ViewTool;
+
 import java.util.Map;
 
 public class ChatReplyDialogFragment extends DialogFragment implements IReplyMessageHandler {
@@ -66,7 +68,8 @@ public class ChatReplyDialogFragment extends DialogFragment implements IReplyMes
         if (originMessage == null) {
             return super.onCreateView(inflater, container, savedInstanceState);
         }
-        View view = inflater.inflate(R.layout.chat_reply_dialog_layout, container);
+        View view = ViewTool.inflateFragmentPixels(getActivity(), R.layout.chat_reply_dialog_layout, container,1194, 834);
+//        View view = inflater.inflate(R.layout.chat_reply_dialog_layout, container);
         cancelBtn = view.findViewById(R.id.cancel_btn);
         title = view.findViewById(R.id.title);
         messageContent = view.findViewById(R.id.message_content);

+ 73 - 0
tuichat/src/main/java/com/tencent/qcloud/tuikit/tuichat/util/ViewTool.java

@@ -337,6 +337,79 @@ public class ViewTool {
         return views;
     }
 
+    public static View inflateFragmentPixelsById(Context context, int layoutId, ViewGroup container,
+                                             int width, int height) {
+        View views = LayoutInflater.from(context).inflate(layoutId, container);
+        if (views == null) {
+            return null;
+        }
+        DisplayMetrics dm2 = new DisplayMetrics();
+        ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE))
+                .getDefaultDisplay().getMetrics(dm2);
+        if (heightPixels <= 0) {
+            heightPixels = dm2.heightPixels;
+            widthPixels = dm2.widthPixels;
+            Class<?> c = null;
+            Object obj = null;
+            Field field = null;
+            int x = 0, sbar = 0;
+            try {
+                c = Class.forName("com.android.internal.R$dimen");
+                obj = c.newInstance();
+                field = c.getField("status_bar_height");
+                x = Integer.parseInt(field.get(obj).toString());
+                sbar = context.getResources().getDimensionPixelSize(x);
+            } catch (Exception e1) {
+                e1.printStackTrace();
+            }
+            heightPixels = heightPixels - sbar;
+        }
+
+        Resources resources = context.getResources();
+
+        float heightPixelsN, widthPixelsN;
+        heightPixelsN = heightPixels;
+        widthPixelsN = widthPixels;
+        int rid = resources.getIdentifier("config_showNavigationBar", "bool",
+                "android");
+        if (resources.getBoolean(rid)) {
+            // ��ȡ�������Ƿ���ʾtrue or false
+
+            int resourceId = resources.getIdentifier("navigation_bar_height",
+                    "dimen", "android");
+            if (resourceId > 0) {
+
+                if (isScreenChange(context)) {
+                    widthPixelsN += resources.getDimensionPixelSize(resourceId);
+                } else {
+                    heightPixelsN += resources
+                            .getDimensionPixelSize(resourceId);
+                }
+            }
+
+        }
+
+        if (widthPixelsN / heightPixelsN == 9.0 / 16.0) {
+            width = (int) ((9.0 / 16.0) * height);
+
+        } else if (widthPixelsN / heightPixelsN == 10.0 / 16.0) {
+            width = (int) ((10.0 / 16.0) * height);
+        }
+        initPixels(views, width, height);
+        ViewGroup.LayoutParams lp = views.getLayoutParams();
+        if (lp != null) {
+
+            if (lp.height > 0) {
+                lp.height = (int) (((float) lp.height) / height * heightPixels);
+            }
+            if (lp.width > 0) {
+                lp.width = (int) (((float) lp.width) / width * widthPixels);
+            }
+            views.setLayoutParams(lp);
+        }
+        return views;
+    }
+
     public static View inflateFragmentPixels(Context context, View views, int width, int height) {
         if (views == null) {
             return null;

+ 3 - 2
tuichat/src/main/res/layout/chat_end_consultation.xml

@@ -10,7 +10,7 @@
         android:layout_height="wrap_content"
         android:text="问诊结束"
         android:textColor="@color/color_FF333333"
-        android:textSize="@dimen/divider_24px" />
+        android:textSize="@dimen/divider_32px" />
 
     <TextView
         android:id="@+id/tvEvaluate"
@@ -19,7 +19,8 @@
         android:layout_marginTop="@dimen/divider_24px"
         android:text="请您对我的服务做出评价"
         android:textColor="@color/color_FF4A76FF"
-        android:textSize="@dimen/divider_24px" />
+        android:textSize="@dimen/divider_28px"
+        android:textStyle="bold" />
 
 
 </LinearLayout>

+ 24 - 51
tuichat/src/main/res/layout/chat_patient_info.xml

@@ -1,118 +1,91 @@
 <?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
+<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"
     android:orientation="vertical"
+    android:paddingStart="@dimen/divider_32px"
+    android:paddingEnd="@dimen/divider_32px"
     android:paddingBottom="@dimen/divider_24px">
 
     <TextView
         android:id="@+id/tvTitle"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginStart="@dimen/divider_32px"
         android:layout_marginTop="@dimen/divider_24px"
-        android:layout_marginEnd="@dimen/divider_233px"
         android:text="图文问诊"
         android:textColor="@color/color_FF333333"
-        android:textSize="@dimen/divider_24px"
-        android:textStyle="bold"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
+        android:textSize="@dimen/divider_34px"
+        android:textStyle="bold" />
 
     <TextView
         android:id="@+id/tvPatientInfo"
-        android:layout_width="0dp"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="@dimen/divider_12px"
         android:textColor="@color/color_FF333333"
-        android:textSize="@dimen/divider_20px"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="@+id/tvTitle"
-        app:layout_constraintTop_toBottomOf="@+id/tvTitle"
+        android:textSize="@dimen/divider_30px"
         tools:text="@string/accept_call" />
 
     <TextView
         android:id="@+id/tvDescriptionInfo"
-        android:layout_width="0dp"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="@dimen/divider_12px"
         android:layout_marginEnd="@dimen/divider_233px"
         android:text="病情描述"
         android:textColor="@color/color_FF333333"
-        android:textSize="@dimen/divider_20px"
-        android:textStyle="bold"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="@+id/tvTitle"
-        app:layout_constraintTop_toBottomOf="@+id/tvPatientInfo" />
+        android:textSize="@dimen/divider_30px"
+        android:textStyle="bold" />
 
     <TextView
         android:id="@+id/tvDescription"
-        android:layout_width="0dp"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="@dimen/divider_12px"
         android:layout_marginEnd="@dimen/divider_233px"
         android:textColor="@color/color_FF333333"
-        android:textSize="@dimen/divider_20px"
-        android:textStyle="bold"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="@+id/tvTitle"
-        app:layout_constraintTop_toBottomOf="@+id/tvDescriptionInfo" />
+        android:textSize="@dimen/divider_30px" />
 
     <TextView
         android:id="@+id/tvTimeIllnessInfo"
-        android:layout_width="0dp"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="@dimen/divider_12px"
         android:layout_marginEnd="@dimen/divider_233px"
         android:text="患病时间"
         android:textColor="@color/color_FF333333"
-        android:textSize="@dimen/divider_20px"
-        android:textStyle="bold"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="@+id/tvTitle"
-        app:layout_constraintTop_toBottomOf="@+id/tvDescription" />
+        android:textSize="@dimen/divider_30px"
+        android:textStyle="bold" />
 
     <TextView
         android:id="@+id/tvTimeIllness"
-        android:layout_width="0dp"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="@dimen/divider_12px"
         android:layout_marginEnd="@dimen/divider_233px"
         android:textColor="@color/color_FF333333"
-        android:textSize="@dimen/divider_20px"
-        android:textStyle="bold"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="@+id/tvTitle"
-        app:layout_constraintTop_toBottomOf="@+id/tvTimeIllnessInfo" />
+        android:textSize="@dimen/divider_30px" />
 
     <TextView
         android:id="@+id/tvSeekMedicalInfo"
-        android:layout_width="0dp"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="@dimen/divider_12px"
         android:layout_marginEnd="@dimen/divider_233px"
+        android:maxLines="1"
         android:text="是否就诊过"
         android:textColor="@color/color_FF333333"
-        android:textSize="@dimen/divider_20px"
-        android:textStyle="bold"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="@+id/tvTitle"
-        app:layout_constraintTop_toBottomOf="@+id/tvTimeIllness" />
+        android:textSize="@dimen/divider_30px"
+        android:textStyle="bold" />
 
     <TextView
         android:id="@+id/tvSeekMedical"
-        android:layout_width="0dp"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="@dimen/divider_12px"
         android:layout_marginEnd="@dimen/divider_233px"
         android:textColor="@color/color_FF333333"
-        android:textSize="@dimen/divider_20px"
-        android:textStyle="bold"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="@+id/tvTitle"
-        app:layout_constraintTop_toBottomOf="@+id/tvSeekMedicalInfo" />
+        android:textSize="@dimen/divider_30px" />
 
-</androidx.constraintlayout.widget.ConstraintLayout>
+</LinearLayout>