Skip to content

Commit

Permalink
Remove warnings when choosing backup location in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
grote committed Sep 13, 2024
1 parent 2802ca6 commit 15a366d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import android.view.View
import android.view.View.INVISIBLE
import android.view.View.VISIBLE
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.ProgressBar
import android.widget.TextView
import androidx.activity.result.contract.ActivityResultContracts.OpenDocumentTree
Expand All @@ -47,8 +46,6 @@ internal class StorageOptionsFragment : Fragment(), StorageOptionClickedListener

private lateinit var viewModel: StorageViewModel
private lateinit var titleView: TextView
private lateinit var warningIcon: ImageView
private lateinit var warningText: TextView
private lateinit var listView: RecyclerView
private lateinit var progressBar: ProgressBar
private lateinit var skipView: TextView
Expand All @@ -63,8 +60,6 @@ internal class StorageOptionsFragment : Fragment(), StorageOptionClickedListener
val v: View = inflater.inflate(R.layout.fragment_storage_options, container, false)

titleView = v.requireViewById(R.id.titleView)
warningIcon = v.requireViewById(R.id.warningIcon)
warningText = v.requireViewById(R.id.warningText)
listView = v.requireViewById(R.id.listView)
progressBar = v.requireViewById(R.id.progressBar)
skipView = v.requireViewById(R.id.skipView)
Expand All @@ -90,12 +85,6 @@ internal class StorageOptionsFragment : Fragment(), StorageOptionClickedListener
requireActivity().setResult(RESULT_FIRST_USER)
requireActivity().finishAfterTransition()
}
} else {
warningIcon.visibility = VISIBLE
if (viewModel.hasStorageSet) {
warningText.setText(R.string.storage_fragment_warning_delete)
}
warningText.visibility = VISIBLE
}

listView.adapter = adapter
Expand Down
30 changes: 1 addition & 29 deletions app/src/main/res/layout/fragment_storage_options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,6 @@
app:layout_constraintTop_toBottomOf="@+id/imageView"
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
android:id="@+id/listView"
style="@style/SudContent"
Expand All @@ -66,7 +38,7 @@
app:layout_constraintBottom_toTopOf="@+id/skipView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/warningText"
app:layout_constraintTop_toBottomOf="@+id/titleView"
app:layout_goneMarginTop="16dp"
tools:listitem="@layout/list_item_storage_root" />

Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@
<!-- Storage Location -->
<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_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_fake_drive_title">USB flash drive</string>
<string name="storage_fake_drive_summary">Needs to be plugged in</string>
Expand Down

0 comments on commit 15a366d

Please sign in to comment.