浏览代码

1、增加标题 控制返回按钮显示隐藏的状态;2、聊天消息弹窗增加标题;

yzs 4 年之前
父节点
当前提交
0d9a1ecb2c

+ 3 - 0
uchat_common/src/main/java/com/shanp/youqi/common/widget/UChatTitleBar.java

@@ -55,6 +55,7 @@ public class UChatTitleBar extends FrameLayout {
         int rightDrawableId = attributes.getResourceId(R.styleable.UChatTitleBar_uc_tb_right_ic_drawable, 0);
         boolean right = attributes.getBoolean(R.styleable.UChatTitleBar_uc_tb_right_ic_visible, false);
         boolean fitStatusBar = attributes.getBoolean(R.styleable.UChatTitleBar_uc_tb_fit_status_bar, true);
+        boolean ivBackVisible = attributes.getBoolean(R.styleable.UChatTitleBar_uc_tb_back_ic_visible, true);
 
         attributes.recycle();
 
@@ -77,6 +78,8 @@ public class UChatTitleBar extends FrameLayout {
 
         layout.setBackgroundColor(barBg);
 
+        mIvBarBack.setVisibility(ivBackVisible ? View.VISIBLE : View.GONE);
+
     }
 
     public TextView getTitleView() {

+ 1 - 0
uchat_common/src/main/res/values/attrs.xml

@@ -23,6 +23,7 @@
 
     <declare-styleable name="UChatTitleBar">
         <attr name="uc_tb_back_ic_drawable" format="reference" />
+        <attr name="uc_tb_back_ic_visible" format="boolean" />
         <attr name="uc_tb_title" format="string" />
         <attr name="uc_tb_right_ic_drawable" format="reference" />
         <attr name="uc_tb_bg_color" format="color" />

+ 15 - 1
uchat_im/src/main/res/layout/im_fragment_message_list_only_user.xml

@@ -6,10 +6,24 @@
     android:layout_height="match_parent"
     android:background="@drawable/bg_white_radius_top_13">
 
+    <com.shanp.youqi.common.widget.UChatTitleBar
+        android:id="@+id/uchat_title_bar_layout"
+        android:layout_width="match_parent"
+        android:layout_height="50dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:uc_tb_back_ic_visible="false"
+        app:uc_tb_bg_color="@color/transparent"
+        app:uc_tb_bottom_line="false"
+        app:uc_tb_fit_status_bar="false"
+        app:uc_tb_title="私聊" />
+
+
     <com.scwang.smartrefresh.layout.SmartRefreshLayout
         android:id="@+id/srl"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
+        android:layout_height="0dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/uchat_title_bar_layout"
         app:srlEnableRefresh="false">
 
         <androidx.recyclerview.widget.RecyclerView