From 38e94747e788768003ac9f910685b53883fca611 Mon Sep 17 00:00:00 2001 From: Ben Kwa Date: Thu, 5 Nov 2015 11:27:56 -0800 Subject: [PATCH] Clean up/fix some minor focus-related code. - Cleanup: Set the focusable flag in xml rather than in java. - Add a border for the currently focused item in grid mode. BUG=24326989 Change-Id: Ib17e93c377fb6b16bf8a7eccfb213f521d9596f0 --- .../res/color/item_doc_grid_border.xml | 23 +++++++++++++++++++ .../res/drawable/item_doc_grid_border.xml | 22 ++++++++++++++++++ .../res/layout-sw720dp-land/item_doc_list.xml | 3 ++- .../DocumentsUI/res/layout/item_doc_grid.xml | 4 +++- .../DocumentsUI/res/layout/item_doc_list.xml | 3 ++- .../dirlist/DirectoryFragment.java | 4 ---- 6 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 packages/DocumentsUI/res/color/item_doc_grid_border.xml create mode 100644 packages/DocumentsUI/res/drawable/item_doc_grid_border.xml diff --git a/packages/DocumentsUI/res/color/item_doc_grid_border.xml b/packages/DocumentsUI/res/color/item_doc_grid_border.xml new file mode 100644 index 0000000000000..e144af8a2c4a4 --- /dev/null +++ b/packages/DocumentsUI/res/color/item_doc_grid_border.xml @@ -0,0 +1,23 @@ + + + + + + + diff --git a/packages/DocumentsUI/res/drawable/item_doc_grid_border.xml b/packages/DocumentsUI/res/drawable/item_doc_grid_border.xml new file mode 100644 index 0000000000000..db66094fc2ec0 --- /dev/null +++ b/packages/DocumentsUI/res/drawable/item_doc_grid_border.xml @@ -0,0 +1,22 @@ + + + + + + diff --git a/packages/DocumentsUI/res/layout-sw720dp-land/item_doc_list.xml b/packages/DocumentsUI/res/layout-sw720dp-land/item_doc_list.xml index 231e110fa09d9..381e1c89b4281 100644 --- a/packages/DocumentsUI/res/layout-sw720dp-land/item_doc_list.xml +++ b/packages/DocumentsUI/res/layout-sw720dp-land/item_doc_list.xml @@ -18,7 +18,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/item_doc_list_background" - android:orientation="horizontal"> + android:orientation="horizontal" + android:focusable="true"> + android:background="@color/item_doc_grid_background" + android:focusable="true"> + android:orientation="horizontal" + android:focusable="true">