Make list focusable.

Appears to make the filepicker usable in non-touch screen environments
(e.g. D-Pad).

Fixes #44
This commit is contained in:
Jonas Kalderstam 2015-08-20 22:32:56 +02:00
parent 62838b5f70
commit bbc03961ed
3 changed files with 15 additions and 4 deletions

View File

@ -18,10 +18,14 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nnf_item_container"
android:layout_width="match_parent"
android:layout_height="?android:listPreferredItemHeight"
android:background="?android:selectableItemBackground"
android:focusable="true"
android:minHeight="?android:listPreferredItemHeight"
android:nextFocusLeft="@+id/nnf_button_cancel"
android:nextFocusRight="@id/checkbox"
android:orientation="horizontal">
@ -48,12 +52,14 @@
android:maxLines="1"
android:padding="8dp"
android:singleLine="true"
android:text="@string/nnf_name"/>
android:text="@string/nnf_name" />
<CheckBox
android:id="@+id/checkbox"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:nextFocusLeft="@id/nnf_item_container"
android:nextFocusRight="@+id/nnf_button_ok"
android:paddingEnd="8dp"
android:paddingRight="8dp"
tools:ignore="RtlSymmetry" />

View File

@ -18,12 +18,15 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nnf_item_container"
android:layout_width="match_parent"
android:layout_height="?android:listPreferredItemHeight"
android:background="?android:selectableItemBackground"
android:focusable="true"
android:minHeight="?android:listPreferredItemHeight"
android:orientation="horizontal"
>
android:nextFocusLeft="@+id/nnf_button_cancel"
android:nextFocusRight="@+id/nnf_button_ok"
android:orientation="horizontal">
<!--suppress AndroidDomInspection -->
<ImageView
@ -48,5 +51,5 @@
android:maxLines="1"
android:padding="8dp"
android:singleLine="true"
android:text="@string/nnf_name"/>
android:text="@string/nnf_name" />
</LinearLayout>

View File

@ -47,6 +47,8 @@
android:layout_height="wrap_content"
android:layout_above="@+id/nnf_button_container"
android:layout_below="@+id/nnf_picker_toolbar"
android:descendantFocusability="afterDescendants"
android:focusable="true"
tools:listitem="@layout/nnf_filepicker_listitem_dir" />
<LinearLayout