Skip to content

Commit c4f171d

Browse files
feat: Allow keyboard navigation (#1480)
2 parents 06301c0 + 7514298 commit c4f171d

24 files changed

+69
-27
lines changed

app/src/main/java/com/infomaniak/drive/ui/menu/settings/MediaFoldersAdapter.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,8 @@ class MediaFoldersAdapter(
5454
isChecked = mediaFolder.isSynced
5555
isVisible = true
5656
setOnCheckedChangeListener { _, isChecked ->
57-
if (mediaFolderSwitch.isPressed) {
58-
onSwitchChanged(mediaFolder, isChecked)
59-
mediaFolder.isSynced = isChecked
60-
}
57+
onSwitchChanged(mediaFolder, isChecked)
58+
mediaFolder.isSynced = isChecked
6159
}
6260
}
6361
}

app/src/main/java/com/infomaniak/drive/views/PreviewHeaderView.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ class PreviewHeaderView @JvmOverloads constructor(
106106
}
107107
}
108108

109-
fun setPageNumberVisibility(isVisible: Boolean) {
110-
binding.pageNumberChip.isVisible = isVisible
109+
fun setPageNumberVisibility(isVisible: Boolean) = with(binding.pageNumberChip) {
110+
this.isVisible = isVisible
111+
// Set `isFocusable` here instead of in XML file because setting it in the XML doesn't seem to affect the Chip.
112+
isFocusable = false
111113
}
112114

113115
fun setPageNumberValue(currentPage: Int, totalPage: Int) {

app/src/main/res/layout/activity_sync_settings.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
<com.google.android.material.appbar.AppBarLayout
2626
android:id="@+id/appBar"
2727
android:layout_width="match_parent"
28-
android:layout_height="@dimen/appBarHeight">
28+
android:layout_height="@dimen/appBarHeight"
29+
android:touchscreenBlocksFocus="false">
2930

3031
<com.google.android.material.appbar.CollapsingToolbarLayout
3132
android:layout_width="match_parent"
@@ -37,6 +38,7 @@
3738
android:id="@+id/toolbar"
3839
android:layout_width="match_parent"
3940
android:layout_height="?attr/actionBarSize"
41+
android:touchscreenBlocksFocus="false"
4042
app:layout_collapseMode="pin" />
4143
</com.google.android.material.appbar.CollapsingToolbarLayout>
4244
</com.google.android.material.appbar.AppBarLayout>

app/src/main/res/layout/fragment_bottom_sheet_file_share.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
<com.google.android.material.appbar.AppBarLayout
2727
android:id="@+id/appBar"
2828
android:layout_width="match_parent"
29-
android:layout_height="@dimen/appBarHeight">
29+
android:layout_height="@dimen/appBarHeight"
30+
android:touchscreenBlocksFocus="false">
3031

3132
<com.google.android.material.appbar.CollapsingToolbarLayout
3233
android:id="@+id/collapsingToolbarLayout"
@@ -39,6 +40,7 @@
3940
android:id="@+id/toolbar"
4041
android:layout_width="match_parent"
4142
android:layout_height="?attr/actionBarSize"
43+
android:touchscreenBlocksFocus="false"
4244
app:layout_collapseMode="pin" />
4345
</com.google.android.material.appbar.CollapsingToolbarLayout>
4446
</com.google.android.material.appbar.AppBarLayout>
@@ -80,11 +82,11 @@
8082
android:layout_height="wrap_content"
8183
android:layout_margin="@dimen/marginStandardSmall"
8284
android:backgroundTint="@android:color/transparent"
85+
android:completionThreshold="1"
8386
android:hint="@string/shareFileInputUserAndEmail"
8487
android:imeOptions="actionDone"
8588
android:inputType="textEmailAddress"
8689
android:maxLines="1"
87-
android:completionThreshold="1"
8890
android:textSize="16sp" />
8991
</LinearLayout>
9092
</com.google.android.material.card.MaterialCardView>

app/src/main/res/layout/fragment_bottom_sheet_select_drive.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
<com.google.android.material.appbar.AppBarLayout
2626
android:id="@+id/appBar"
2727
android:layout_width="match_parent"
28-
android:layout_height="@dimen/appBarHeight">
28+
android:layout_height="@dimen/appBarHeight"
29+
android:touchscreenBlocksFocus="false">
2930

3031
<com.google.android.material.appbar.CollapsingToolbarLayout
3132
android:layout_width="match_parent"
@@ -37,6 +38,7 @@
3738
android:id="@+id/toolbar"
3839
android:layout_width="match_parent"
3940
android:layout_height="?attr/actionBarSize"
41+
android:touchscreenBlocksFocus="false"
4042
app:layout_collapseMode="pin" />
4143
</com.google.android.material.appbar.CollapsingToolbarLayout>
4244
</com.google.android.material.appbar.AppBarLayout>

app/src/main/res/layout/fragment_bottom_sheet_select_media_folders.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
<com.google.android.material.appbar.AppBarLayout
2626
android:id="@+id/appBar"
2727
android:layout_width="match_parent"
28-
android:layout_height="@dimen/appBarHeight">
28+
android:layout_height="@dimen/appBarHeight"
29+
android:touchscreenBlocksFocus="false">
2930

3031
<com.google.android.material.appbar.CollapsingToolbarLayout
3132
android:layout_width="match_parent"
@@ -37,6 +38,7 @@
3738
android:id="@+id/toolbar"
3839
android:layout_width="match_parent"
3940
android:layout_height="?attr/actionBarSize"
41+
android:touchscreenBlocksFocus="false"
4042
app:layout_collapseMode="pin" />
4143
</com.google.android.material.appbar.CollapsingToolbarLayout>
4244
</com.google.android.material.appbar.AppBarLayout>

app/src/main/res/layout/fragment_create_folder.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
<com.google.android.material.appbar.AppBarLayout
2525
android:id="@+id/appBar"
2626
android:layout_width="match_parent"
27-
android:layout_height="200dp">
27+
android:layout_height="200dp"
28+
android:touchscreenBlocksFocus="false">
2829

2930
<com.google.android.material.appbar.CollapsingToolbarLayout
3031
android:id="@+id/createFolderCollapsing"
@@ -46,6 +47,7 @@
4647
android:id="@+id/toolbar"
4748
android:layout_width="match_parent"
4849
android:layout_height="?attr/actionBarSize"
50+
android:touchscreenBlocksFocus="false"
4951
app:layout_collapseMode="pin" />
5052

5153
</com.google.android.material.appbar.CollapsingToolbarLayout>

app/src/main/res/layout/fragment_create_or_edit_category.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
<com.google.android.material.appbar.AppBarLayout
2727
android:id="@+id/appBar"
2828
android:layout_width="match_parent"
29-
android:layout_height="@dimen/appBarHeight">
29+
android:layout_height="@dimen/appBarHeight"
30+
android:touchscreenBlocksFocus="false">
3031

3132
<com.google.android.material.appbar.CollapsingToolbarLayout
3233
android:id="@+id/appBarTitle"
@@ -39,6 +40,7 @@
3940
android:id="@+id/toolbar"
4041
android:layout_width="match_parent"
4142
android:layout_height="?attr/actionBarSize"
43+
android:touchscreenBlocksFocus="false"
4244
app:layout_collapseMode="pin" />
4345

4446
</com.google.android.material.appbar.CollapsingToolbarLayout>

app/src/main/res/layout/fragment_file_details.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
<com.google.android.material.appbar.AppBarLayout
2626
android:id="@+id/appBar"
2727
android:layout_width="match_parent"
28-
android:layout_height="wrap_content">
28+
android:layout_height="wrap_content"
29+
android:touchscreenBlocksFocus="false">
2930

3031
<com.google.android.material.appbar.CollapsingToolbarLayout
3132
android:id="@+id/fileDetailsCollapsingToolbar"
@@ -66,6 +67,7 @@
6667
android:id="@+id/toolbar"
6768
android:layout_width="match_parent"
6869
android:layout_height="?attr/actionBarSize"
70+
android:touchscreenBlocksFocus="false"
6971
app:layout_collapseMode="pin"
7072
app:navigationIconTint="@android:color/white" />
7173
</com.google.android.material.appbar.CollapsingToolbarLayout>

app/src/main/res/layout/fragment_file_list.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
<com.google.android.material.appbar.AppBarLayout
2828
android:id="@+id/appBar"
2929
android:layout_width="match_parent"
30-
android:layout_height="@dimen/appBarHeight">
30+
android:layout_height="@dimen/appBarHeight"
31+
android:touchscreenBlocksFocus="false">
3132

3233
<com.google.android.material.appbar.CollapsingToolbarLayout
3334
android:id="@+id/collapsingToolbarLayout"
@@ -40,6 +41,7 @@
4041
android:id="@+id/toolbar"
4142
android:layout_width="match_parent"
4243
android:layout_height="?attr/actionBarSize"
44+
android:touchscreenBlocksFocus="false"
4345
app:layout_collapseMode="pin"
4446
app:menu="@menu/file_list_menu">
4547

0 commit comments

Comments
 (0)