修复初始化界面备份失败与NPE问题

This commit is contained in:
HapeLee committed 2025-08-27 14:14:09 +08:00
1 parent 98c2aa6d2b
commit 9b1c155f77
6 files changed
+143 -89

No files matched your search

+52 -32
View File
@@ -1,45 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:paddingHorizontal="16dp">
android:paddingHorizontal="16dp"
android:paddingBottom="8dp">
<LinearLayout
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="@string/privacy_policy"
android:textColor="?attr/colorSecondary"
android:textSize="16sp"
android:textStyle="bold" />
android:orientation="vertical">
<TextView
android:id="@+id/tvPrivacy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="@string/text" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="@string/privacy_policy"
android:textColor="?attr/colorSecondary"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="@string/disclaimer"
android:textColor="?attr/colorSecondary"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvPrivacy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="@string/text" />
<TextView
android:id="@+id/tvDisclaimer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/text" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="@string/disclaimer"
android:textColor="?attr/colorSecondary"
android:textSize="16sp"
android:textStyle="bold" />
</androidx.core.widget.NestedScrollView>
<TextView
android:id="@+id/tvDisclaimer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/text" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<ImageView
android:layout_width="match_parent"
android:layout_height="60dp"
android:src="@drawable/bg_gradient_mask"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -56,20 +56,41 @@
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="@+id/btnRestore"
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
android:layout_width="0dp"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_weight="2"
android:text="获取备份" />
android:layout_marginEnd="8dp"
android:layout_weight="1">
<com.google.android.material.button.MaterialButton
android:id="@+id/btnRestore"
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="获取备份"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.loadingindicator.LoadingIndicator
android:id="@+id/progressRestore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/btnCheck"
style="@style/Widget.Material3Expressive.Button.TonalButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:text="@string/action_save" />