Эх сурвалжийг харах

优化ExpandableTabLayout显示效果

Frankensteinly 8 сар өмнө
parent
commit
0d47e40a28

+ 0 - 1
app/src/main/java/com/grkj/iscs_mc/view/fragment/MaterialFetchReturnFragment.kt

@@ -1,6 +1,5 @@
 package com.grkj.iscs_mc.view.fragment
 
-import android.widget.ImageView
 import com.bumptech.glide.Glide
 import com.grkj.iscs_mc.R
 import com.grkj.iscs_mc.databinding.FragmentMaterialFetchReturnBinding

+ 44 - 31
app/src/main/res/layout/layout_expandable_tab_layout.xml

@@ -1,40 +1,53 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:id="@+id/root"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:background="#3e6aa5">
+    android:layout_height="wrap_content">
 
-    <ImageView
-        android:id="@+id/iv_action"
-        android:layout_width="@dimen/common_icon_size"
-        android:layout_height="@dimen/common_icon_size"
-        android:layout_alignParentRight="true"
-        android:layout_marginVertical="@dimen/common_spacing"
-        android:layout_marginRight="@dimen/common_spacing_small"
-        android:background="@mipmap/expand" />
-
-    <LinearLayout
-        android:id="@+id/ll_container"
+    <com.google.android.material.card.MaterialCardView
+        app:cardBackgroundColor="#3e6aa5"
+        app:cardCornerRadius="@dimen/common_radius_big"
+        app:strokeColor="@color/common_transparent"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_toLeftOf="@id/iv_action"
-        android:orientation="horizontal">
+        android:layout_height="wrap_content">
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <ImageView
+                android:id="@+id/iv_action"
+                android:layout_width="@dimen/common_icon_size"
+                android:layout_height="@dimen/common_icon_size"
+                android:layout_alignParentRight="true"
+                android:layout_marginVertical="@dimen/common_spacing"
+                android:layout_marginRight="@dimen/common_spacing"
+                android:background="@mipmap/expand" />
+
+            <LinearLayout
+                android:id="@+id/ll_container"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_toLeftOf="@id/iv_action"
+                android:orientation="horizontal">
 
-        <TextView
-            android:id="@+id/tv_title"
-            style="@style/CommonTextView"
-            android:layout_marginLeft="@dimen/common_spacing_small"
-            android:layout_marginTop="12dp"
-            android:layout_marginBottom="@dimen/common_spacing_small" />
+                <TextView
+                    android:id="@+id/tv_title"
+                    style="@style/CommonTextView"
+                    android:layout_marginLeft="@dimen/common_spacing_small"
+                    android:layout_marginTop="12dp"
+                    android:layout_marginBottom="@dimen/common_spacing_small" />
 
-        <androidx.recyclerview.widget.RecyclerView
-            android:id="@+id/rv_tab"
-            style="@style/CommonRecyclerView"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="@dimen/common_spacing_small"
-            android:layout_marginTop="@dimen/common_spacing_small"
-            android:layout_marginRight="@dimen/common_spacing"
-            android:orientation="horizontal" />
-    </LinearLayout>
+                <androidx.recyclerview.widget.RecyclerView
+                    android:id="@+id/rv_tab"
+                    style="@style/CommonRecyclerView"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/common_spacing_small"
+                    android:layout_marginTop="@dimen/common_spacing_small"
+                    android:layout_marginRight="@dimen/common_spacing"
+                    android:orientation="horizontal" />
+            </LinearLayout>
+        </RelativeLayout>
+    </com.google.android.material.card.MaterialCardView>
 </RelativeLayout>