Skip to content

Commit

Permalink
feat: Allow keyboard navigation (#1480)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasBourdin88 authored Feb 27, 2025
2 parents 06301c0 + 7514298 commit c4f171d
Show file tree
Hide file tree
Showing 24 changed files with 69 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ class MediaFoldersAdapter(
isChecked = mediaFolder.isSynced
isVisible = true
setOnCheckedChangeListener { _, isChecked ->
if (mediaFolderSwitch.isPressed) {
onSwitchChanged(mediaFolder, isChecked)
mediaFolder.isSynced = isChecked
}
onSwitchChanged(mediaFolder, isChecked)
mediaFolder.isSynced = isChecked
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ class PreviewHeaderView @JvmOverloads constructor(
}
}

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

fun setPageNumberValue(currentPage: Int, totalPage: Int) {
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/activity_sync_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/appBarHeight">
android:layout_height="@dimen/appBarHeight"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
Expand All @@ -37,6 +38,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/res/layout/fragment_bottom_sheet_file_share.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/appBarHeight">
android:layout_height="@dimen/appBarHeight"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsingToolbarLayout"
Expand All @@ -39,6 +40,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
Expand Down Expand Up @@ -80,11 +82,11 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/marginStandardSmall"
android:backgroundTint="@android:color/transparent"
android:completionThreshold="1"
android:hint="@string/shareFileInputUserAndEmail"
android:imeOptions="actionDone"
android:inputType="textEmailAddress"
android:maxLines="1"
android:completionThreshold="1"
android:textSize="16sp" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/appBarHeight">
android:layout_height="@dimen/appBarHeight"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
Expand All @@ -37,6 +38,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/appBarHeight">
android:layout_height="@dimen/appBarHeight"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
Expand All @@ -37,6 +38,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_create_folder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="200dp">
android:layout_height="200dp"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/createFolderCollapsing"
Expand All @@ -46,6 +47,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin" />

</com.google.android.material.appbar.CollapsingToolbarLayout>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_create_or_edit_category.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/appBarHeight">
android:layout_height="@dimen/appBarHeight"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/appBarTitle"
Expand All @@ -39,6 +40,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin" />

</com.google.android.material.appbar.CollapsingToolbarLayout>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_file_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/fileDetailsCollapsingToolbar"
Expand Down Expand Up @@ -66,6 +67,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin"
app:navigationIconTint="@android:color/white" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_file_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/appBarHeight">
android:layout_height="@dimen/appBarHeight"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsingToolbarLayout"
Expand All @@ -40,6 +41,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin"
app:menu="@menu/file_list_menu">

Expand Down
6 changes: 4 additions & 2 deletions app/src/main/res/layout/fragment_file_share_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/appBarHeight">
android:layout_height="@dimen/appBarHeight"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/fileShareCollapsingToolbarLayout"
Expand All @@ -37,6 +38,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
Expand Down Expand Up @@ -64,10 +66,10 @@
android:id="@+id/userAutoCompleteTextView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:completionThreshold="1"
android:imeOptions="actionDone"
android:inputType="textEmailAddress"
android:maxLines="1"
android:completionThreshold="1"
android:textSize="16sp" />

</com.google.android.material.textfield.TextInputLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/appBarHeight">
android:layout_height="@dimen/appBarHeight"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
Expand All @@ -38,6 +39,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsingToolbarLayout"
Expand All @@ -42,6 +43,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin"
app:menu="@menu/file_list_menu"
app:navigationIcon="@null" />
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_manage_dropbox.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/appBarHeight">
android:layout_height="@dimen/appBarHeight"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/fileShareCollapsingToolbarLayout"
Expand All @@ -38,6 +39,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_new_folder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/appBarHeight">
android:layout_height="@dimen/appBarHeight"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
Expand All @@ -37,6 +38,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/fragment_preview_slider.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:touchscreenBlocksFocus="true"
android:saveEnabled="false" />

<com.infomaniak.drive.views.PreviewHeaderView
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_root_files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/appBarHeight">
android:layout_height="@dimen/appBarHeight"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsingToolbarLayout"
Expand All @@ -45,6 +46,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin"
app:menu="@menu/file_list_menu"
app:navigationIcon="@null" />
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_search_filters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/appBarHeight">
android:layout_height="@dimen/appBarHeight"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/appBarTitle"
Expand All @@ -39,6 +40,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin" />

</com.google.android.material.appbar.CollapsingToolbarLayout>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_select_categories.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/appBarHeight">
android:layout_height="@dimen/appBarHeight"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
Expand All @@ -38,6 +39,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin"
app:menu="@menu/add_category_menu" />

Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_select_permission.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/appBarHeight">
android:layout_height="@dimen/appBarHeight"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
Expand All @@ -37,6 +38,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/appBarHeight">
android:layout_height="@dimen/appBarHeight"
android:touchscreenBlocksFocus="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
Expand All @@ -36,6 +37,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
Expand Down
Loading

0 comments on commit c4f171d

Please sign in to comment.