浏览代码

style(ui): 调整喷涂活动界面布局和样式

- 将RecyclerView方向从水平改为垂直
- 为baseRecyclerView添加clipToPadding=false属性
- 为照片列表项添加顶部边距
- 重构照片项目布局结构,使用嵌套LinearLayout实现居中对齐
- 为照片文本添加居中对齐属性
徐勤民 2 天之前
父节点
当前提交
866b80b29f

+ 1 - 1
app/src/main/java/com/nova/brain/glass/ui/SprayingActivity.kt

@@ -17,7 +17,7 @@ class SprayingActivity : BaseListFormLayoutNormalActivity<ItemItem, SprayingVM,
     override fun getLayoutId(): Int = R.layout.activity_spraying
     override fun fullscreen(): Boolean = true
 
-    override fun getRecyclerOrientation(): Int = RecyclerView.HORIZONTAL
+    override fun getRecyclerOrientation(): Int = RecyclerView.VERTICAL
 
     private val listener = object : OfflineCmdListener {
         override fun onOfflineCmd(cmd: String) {

+ 2 - 0
app/src/main/res/layout/activity_spraying.xml

@@ -85,6 +85,7 @@
             android:id="@+id/baseRecyclerView"
             android:layout_width="0dp"
             android:layout_height="88dp"
+            android:clipToPadding="false"
             android:layout_marginTop="12dp"
             android:overScrollMode="never"
             app:layout_constraintEnd_toEndOf="parent"
@@ -93,6 +94,7 @@
         <TextView
             android:layout_width="match_parent"
             android:layout_marginStart="15dp"
+            android:layout_marginTop="10dp"
             android:layout_height="wrap_content"
             app:layout_constraintTop_toBottomOf="@+id/baseRecyclerView"
             android:layout_marginVertical="4dp"

+ 25 - 15
app/src/main/res/layout/item_photo.xml

@@ -1,21 +1,31 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="88dp"
+    android:layout_width="match_parent"
     android:orientation="vertical"
     android:id="@+id/photo"
     android:gravity="center"
-    android:background="@drawable/bg_photo"
-    android:layout_height="88dp">
-    <ImageView
-        android:layout_width="30dp"
-        android:layout_height="24.5dp"
-        android:src="@mipmap/paizhao"/>
-    <TextView
-        android:layout_width="wrap_content"
-        android:textColor="#4AFE59"
-        android:textSize="14sp"
-        android:layout_marginTop="6dp"
-        android:layout_height="wrap_content"
-        android:text="开始任务"/>
+    android:layout_height="88dp"
+    android:layout_gravity="center">
+    <LinearLayout
+        android:layout_width="88dp"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:background="@drawable/bg_photo"
+        android:layout_height="88dp"
+        android:layout_gravity="center">
+        <ImageView
+            android:layout_width="30dp"
+            android:layout_height="24.5dp"
+            android:src="@mipmap/paizhao"/>
+        <TextView
+            android:layout_width="wrap_content"
+            android:gravity="center"
+            android:textColor="#4AFE59"
+            android:textSize="14sp"
+            android:layout_marginTop="6dp"
+            android:layout_height="wrap_content"
+            android:text="开始任务"/>
 
-</LinearLayout>
+    </LinearLayout>
+
+</LinearLayout>