重新修改了 配置页面的内容,增加修改背景图片的按钮和修改状态栏的颜色的布局,具体功能没有完成。

This commit is contained in:
2024-10-01 20:55:04 +08:00
parent c9da1a08e1
commit 5b9964ece7
3 changed files with 45 additions and 9 deletions

View File

@@ -132,7 +132,7 @@ class SecondActivity : AppCompatActivity() {
// 获取并设置 URL 的 TextView 前景色和背景色 // 获取并设置 URL 的 TextView 前景色和背景色
val tvUrl = configView.findViewById<TextView>(R.id.tvUrl) val tvUrl = configView.findViewById<TextView>(R.id.tvUrl)
tvUrl.text = "URL: ${config.url}" tvUrl.text = "URL: ${config.url.take(32)}..."
tvUrl.setTextColor(Color.BLACK) tvUrl.setTextColor(Color.BLACK)
// 获取并设置 Key 的 TextView 前景色和背景色 // 获取并设置 Key 的 TextView 前景色和背景色
@@ -140,7 +140,6 @@ class SecondActivity : AppCompatActivity() {
tvKey.text = "Key: ${config.key.take(4)}..." tvKey.text = "Key: ${config.key.take(4)}..."
tvKey.setTextColor(Color.BLACK) tvKey.setTextColor(Color.BLACK)
// 获取并设置 SecretKey 的 TextView 前景色和背景色 // 获取并设置 SecretKey 的 TextView 前景色和背景色
val tvSecretKey = configView.findViewById<TextView>(R.id.tvSecretKey) val tvSecretKey = configView.findViewById<TextView>(R.id.tvSecretKey)
tvSecretKey.text = "Secret Key: ${config.secretKey.take(4)}..." tvSecretKey.text = "Secret Key: ${config.secretKey.take(4)}..."

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res - app"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@@ -16,6 +17,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/back_to_main" /> android:text="@string/back_to_main" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="30dp"
@@ -75,15 +77,52 @@
android:id="@+id/btnSave" android:id="@+id/btnSave"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/save_config" android:layout_marginTop="16dp"
android:layout_marginTop="16dp" /> android:text="@string/save_config" />
<LinearLayout <LinearLayout
android:id="@+id/llConfigList" android:id="@+id/llConfigList"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:layout_marginTop="16dp"
android:layout_marginTop="16dp" /> android:orientation="vertical" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/choosepictextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="设置主页的背景图片"
android:textSize="16sp" />
<Button
android:id="@+id/choseePicbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/choosepictextView"
android:text="选择图片" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/statustextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="设置状态栏的颜色"
android:textSize="16sp" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/statustextView"
android:text="选择图片" />
</RelativeLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>

View File

@@ -4,9 +4,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:padding="16dp" android:padding="16dp"
android:background="#EEEEEE" android:background="#EEEEEE">
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp">
<TextView <TextView
android:id="@+id/tvName" android:id="@+id/tvName"