From b856782d33b67cd5f89953116811437d18a942c3 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Thu, 23 Jun 2022 11:43:25 -0300 Subject: [PATCH] [storage] Make backup content selection work better with screen readers --- .../calyxos/backup/storage/ui/backup/BackupContentFragment.kt | 4 ++-- storage/lib/src/main/res/layout/item_custom.xml | 3 +++ storage/lib/src/main/res/layout/item_media.xml | 2 ++ storage/lib/src/main/res/values/strings.xml | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/storage/lib/src/main/java/org/calyxos/backup/storage/ui/backup/BackupContentFragment.kt b/storage/lib/src/main/java/org/calyxos/backup/storage/ui/backup/BackupContentFragment.kt index dae0ed1c..44809e3f 100644 --- a/storage/lib/src/main/java/org/calyxos/backup/storage/ui/backup/BackupContentFragment.kt +++ b/storage/lib/src/main/java/org/calyxos/backup/storage/ui/backup/BackupContentFragment.kt @@ -57,9 +57,9 @@ public abstract class BackupContentFragment : Fragment(), ContentClickListener { val adapter = BackupContentAdapter(this) list.adapter = adapter - viewModel.content.observe(viewLifecycleOwner, { + viewModel.content.observe(viewLifecycleOwner) { adapter.setItems(it) - }) + } v.findViewById(R.id.fab).setOnClickListener { addRequest.launch(DocumentsContract.buildRootsUri(EXTERNAL_STORAGE_PROVIDER_AUTHORITY)) } diff --git a/storage/lib/src/main/res/layout/item_custom.xml b/storage/lib/src/main/res/layout/item_custom.xml index 3e841db2..60633704 100644 --- a/storage/lib/src/main/res/layout/item_custom.xml +++ b/storage/lib/src/main/res/layout/item_custom.xml @@ -5,6 +5,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="8dp" + android:screenReaderFocusable="true" app:cardCornerRadius="8dp"> Videos Audio files Downloads + Options Add Storage backup