refactor(fragment): DbInspectFragment 改用嵌套 RecyclerView 展示字段,优化已删除记录视觉样式

This commit is contained in:
2026-05-07 18:13:17 +08:00
parent c17402c3c2
commit 0648f458a7
4 changed files with 138 additions and 79 deletions
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tvField"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10sp"
android:fontFamily="monospace"
android:gravity="start"
android:paddingBottom="4dp" />
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/cardRecord"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
@@ -9,13 +10,28 @@
app:cardElevation="1dp"
app:cardBackgroundColor="#FFFFFF">
<TextView
android:id="@+id/tvContent"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:textSize="11sp"
android:lineSpacingMultiplier="1.3"
android:fontFamily="monospace" />
android:orientation="horizontal">
<!-- 已删除标记条:isDel=1 时显示红色左边框 -->
<View
android:id="@+id/vDelMark"
android:layout_width="4dp"
android:layout_height="match_parent"
android:background="#E53935"
android:visibility="gone" />
<!-- 字段由内层 RecyclerViewGridLayoutManager)填充 -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvFields"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false"
android:padding="8dp"
android:clipToPadding="false" />
</LinearLayout>
</androidx.cardview.widget.CardView>