Remove warnings when choosing backup location in UI

This commit is contained in:
Torsten Grote 2024-09-13 10:19:41 -03:00
parent bfa17fa5ec
commit a268116e06
No known key found for this signature in database
GPG key ID: 3E5F77D92CF891FF
3 changed files with 1 additions and 42 deletions

View file

@ -20,7 +20,6 @@ import android.view.View
import android.view.View.INVISIBLE import android.view.View.INVISIBLE
import android.view.View.VISIBLE import android.view.View.VISIBLE
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ImageView
import android.widget.ProgressBar import android.widget.ProgressBar
import android.widget.TextView import android.widget.TextView
import androidx.activity.result.contract.ActivityResultContracts.OpenDocumentTree import androidx.activity.result.contract.ActivityResultContracts.OpenDocumentTree
@ -47,8 +46,6 @@ internal class StorageOptionsFragment : Fragment(), StorageOptionClickedListener
private lateinit var viewModel: StorageViewModel private lateinit var viewModel: StorageViewModel
private lateinit var titleView: TextView private lateinit var titleView: TextView
private lateinit var warningIcon: ImageView
private lateinit var warningText: TextView
private lateinit var listView: RecyclerView private lateinit var listView: RecyclerView
private lateinit var progressBar: ProgressBar private lateinit var progressBar: ProgressBar
private lateinit var skipView: TextView private lateinit var skipView: TextView
@ -63,8 +60,6 @@ internal class StorageOptionsFragment : Fragment(), StorageOptionClickedListener
val v: View = inflater.inflate(R.layout.fragment_storage_options, container, false) val v: View = inflater.inflate(R.layout.fragment_storage_options, container, false)
titleView = v.requireViewById(R.id.titleView) titleView = v.requireViewById(R.id.titleView)
warningIcon = v.requireViewById(R.id.warningIcon)
warningText = v.requireViewById(R.id.warningText)
listView = v.requireViewById(R.id.listView) listView = v.requireViewById(R.id.listView)
progressBar = v.requireViewById(R.id.progressBar) progressBar = v.requireViewById(R.id.progressBar)
skipView = v.requireViewById(R.id.skipView) skipView = v.requireViewById(R.id.skipView)
@ -90,12 +85,6 @@ internal class StorageOptionsFragment : Fragment(), StorageOptionClickedListener
requireActivity().setResult(RESULT_FIRST_USER) requireActivity().setResult(RESULT_FIRST_USER)
requireActivity().finishAfterTransition() requireActivity().finishAfterTransition()
} }
} else {
warningIcon.visibility = VISIBLE
if (viewModel.hasStorageSet) {
warningText.setText(R.string.storage_fragment_warning_delete)
}
warningText.visibility = VISIBLE
} }
listView.adapter = adapter listView.adapter = adapter

View file

@ -29,34 +29,6 @@
app:layout_constraintTop_toBottomOf="@+id/imageView" app:layout_constraintTop_toBottomOf="@+id/imageView"
tools:text="Choose where to store backup (is a short title, but it can be longer)" /> tools:text="Choose where to store backup (is a short title, but it can be longer)" />
<ImageView
android:id="@+id/warningIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="40dp"
android:src="@drawable/ic_warning"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/warningText"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/warningText"
tools:ignore="ContentDescription"
tools:visibility="visible" />
<TextView
android:id="@+id/warningText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="40dp"
android:text="@string/storage_fragment_warning"
android:textSize="16sp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/warningIcon"
app:layout_constraintTop_toBottomOf="@+id/titleView"
tools:visibility="visible" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/listView" android:id="@+id/listView"
style="@style/SudContent" style="@style/SudContent"
@ -66,7 +38,7 @@
app:layout_constraintBottom_toTopOf="@+id/skipView" app:layout_constraintBottom_toTopOf="@+id/skipView"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/warningText" app:layout_constraintTop_toBottomOf="@+id/titleView"
app:layout_goneMarginTop="16dp" app:layout_goneMarginTop="16dp"
tools:listitem="@layout/list_item_storage_root" /> tools:listitem="@layout/list_item_storage_root" />

View file

@ -78,8 +78,6 @@
<!-- Storage Location --> <!-- Storage Location -->
<string name="storage_fragment_backup_title">Choose where to store backups</string> <string name="storage_fragment_backup_title">Choose where to store backups</string>
<string name="storage_fragment_restore_title">Where to find your backups?</string> <string name="storage_fragment_restore_title">Where to find your backups?</string>
<string name="storage_fragment_warning">People with access to your storage location can learn which apps you use, but do not get access to the apps\' data.</string>
<string name="storage_fragment_warning_delete">Existing backups in this location will be deleted.</string>
<string name="storage_user_selected_location_title">User-chosen location</string> <string name="storage_user_selected_location_title">User-chosen location</string>
<string name="storage_fake_drive_title">USB flash drive</string> <string name="storage_fake_drive_title">USB flash drive</string>
<string name="storage_fake_drive_summary">Needs to be plugged in</string> <string name="storage_fake_drive_summary">Needs to be plugged in</string>