Browse Source

添加列表基础样式

Frankensteinly 1 year ago
parent
commit
09809f10b2

+ 54 - 0
app/src/main/res/layout/item_rv_sop.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_margin="@dimen/rv_item_margin"
+    android:orientation="horizontal">
+
+    <TextView
+        android:id="@+id/tv_number"
+        style="@style/CommonTextView"
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:text="@string/sop_number" />
+
+    <TextView
+        android:id="@+id/tv_name"
+        style="@style/CommonTextView"
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:text="@string/sop_name" />
+
+    <TextView
+        android:id="@+id/tv_type"
+        style="@style/CommonTextView"
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:text="@string/sop_type" />
+
+    <TextView
+        android:id="@+id/tv_start_time"
+        style="@style/CommonTextView"
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:text="@string/start_time" />
+
+    <TextView
+        android:id="@+id/tv_end_time"
+        style="@style/CommonTextView"
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:text="@string/end_time" />
+
+    <TextView
+        style="@style/CommonTextView"
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1" />
+
+</LinearLayout>

+ 3 - 0
app/src/main/res/values/dimens.xml

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
     <dimen name="common_text_size">20sp</dimen>
+    <dimen name="common_radius">3px</dimen>
 
     <dimen name="title_bar_height">150px</dimen>
     <dimen name="title_bar_padding">20px</dimen>
@@ -17,4 +18,6 @@
     <dimen name="selectable_input_min_height">70px</dimen>
     <dimen name="selectable_input_spinner_arrow_size">30px</dimen>
     <dimen name="selectable_input_spinner_arrow_margin">10px</dimen>
+
+    <dimen name="rv_item_margin">2px</dimen>
 </resources>

+ 6 - 0
app/src/main/res/values/strings.xml

@@ -15,4 +15,10 @@
     <string name="auth_fail">认证失败,请重试!</string>
 
     <string name="selectable_input_prefix">*</string>
+
+    <string name="sop_number">作业编号</string>
+    <string name="sop_name">作业名称</string>
+    <string name="sop_type">作业类型</string>
+    <string name="start_time">开始时间</string>
+    <string name="end_time">结束时间</string>
 </resources>

+ 18 - 0
app/src/main/res/values/styles.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <style name="CommonTextView">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:gravity">center</item>
+        <item name="android:textColor">@color/white</item>
+        <item name="android:textSize">@dimen/common_text_size</item>
+    </style>
+
+    <style name="CommonRecyclerView">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">match_parent</item>
+        <item name="android:overScrollMode">never</item>
+        <item name="android:scrollbars">none</item>
+        <item name="layoutManager">LinearLayoutManager</item>
+    </style>
+</resources>