diff --git a/app/src/main/java/com/coldmint/rust/pro/adapters/CodeTableAdapter.kt b/app/src/main/java/com/coldmint/rust/pro/adapters/CodeTableAdapter.kt
index cf7eec7..a4b6170 100644
--- a/app/src/main/java/com/coldmint/rust/pro/adapters/CodeTableAdapter.kt
+++ b/app/src/main/java/com/coldmint/rust/pro/adapters/CodeTableAdapter.kt
@@ -142,6 +142,11 @@ class CodeTableAdapter(
resultView.titleView.setOnClickListener {
GlobalMethod.copyText(context, codeInfo.translate, it)
}
+
+ val demo = codeInfo.demo
+ resultView.demoView.isVisible = demo.isNotBlank()
+ resultView.demoView.text = demo
+
resultView.subTitleView.text = codeInfo.code
resultView.subTitleView.setOnClickListener {
GlobalMethod.copyText(context, codeInfo.code, it)
@@ -156,7 +161,7 @@ class CodeTableAdapter(
val chip = Chip(context)
chip.text = text
chip.setOnClickListener {
- labelFunction?.invoke(lineNum, it, text )
+ labelFunction?.invoke(lineNum, it, text)
}
resultView.chipGroup.addView(chip)
true
diff --git a/app/src/main/res/layout/code_table_item.xml b/app/src/main/res/layout/code_table_item.xml
index 9da7c9a..cc1ddfd 100644
--- a/app/src/main/res/layout/code_table_item.xml
+++ b/app/src/main/res/layout/code_table_item.xml
@@ -32,18 +32,29 @@
android:layout_marginTop="5dp"
android:text="描述" />
+
+