From f52773fd62fc2fec40c2e17230b644dfbee6cf2d Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Mon, 28 Jul 2014 16:38:52 -0700 Subject: More DocumentsUI material iteration. Move to using Toolbar for all actions. Drawer contains its own Toolbar with separate title, and hamburger is always visible. Change drawer items to match spec. Switching to Toolbar allows us to remove nasty dialog-on-tablet hacks, yay! This also means we can finally get real IME resizing support. Move to using elevation for all shadows; this removes more nasty hacks around drawing directory shadows. Bug: 15836082 Change-Id: Iba70b898f385a7debd8aabfc98ff39d20bca860d --- packages/DocumentsUI/AndroidManifest.xml | 2 +- .../res/drawable-hdpi/ic_dir_shadow_am.9.png | Bin 184 -> 216 bytes .../res/drawable-mdpi/ic_dir_shadow_am.9.png | Bin 163 -> 197 bytes .../res/drawable-xhdpi/ic_dir_shadow_am.9.png | Bin 193 -> 223 bytes .../res/drawable-xxhdpi/ic_dir_shadow_am.9.png | Bin 233 -> 260 bytes .../DocumentsUI/res/drawable/item_activated.xml | 8 +- .../res/drawable/item_activated_overlay.xml | 25 +++ packages/DocumentsUI/res/drawable/item_root.xml | 22 --- .../res/layout-sw720dp-land/item_doc_list.xml | 2 +- .../DocumentsUI/res/layout-sw720dp/activity.xml | 69 +++++--- packages/DocumentsUI/res/layout/activity.xml | 45 ++++- .../DocumentsUI/res/layout/fragment_directory.xml | 2 +- packages/DocumentsUI/res/layout/fragment_pick.xml | 34 +--- packages/DocumentsUI/res/layout/fragment_roots.xml | 3 +- packages/DocumentsUI/res/layout/fragment_save.xml | 87 +++++----- packages/DocumentsUI/res/layout/item_doc_grid.xml | 2 +- packages/DocumentsUI/res/layout/item_doc_list.xml | 2 +- packages/DocumentsUI/res/layout/item_root.xml | 32 ++-- .../DocumentsUI/res/layout/item_root_spacer.xml | 12 +- packages/DocumentsUI/res/layout/item_subdir.xml | 48 ++++++ .../DocumentsUI/res/layout/item_subdir_title.xml | 33 ++++ packages/DocumentsUI/res/layout/item_title.xml | 45 ----- packages/DocumentsUI/res/values-sw720dp/dimens.xml | 2 +- packages/DocumentsUI/res/values-sw720dp/styles.xml | 25 --- packages/DocumentsUI/res/values/colors.xml | 8 +- packages/DocumentsUI/res/values/dimens.xml | 2 + packages/DocumentsUI/res/values/styles.xml | 33 ++-- .../documentsui/DirectoryContainerView.java | 8 - .../src/com/android/documentsui/DirectoryView.java | 19 +-- .../com/android/documentsui/DocumentsActivity.java | 181 ++++++++++----------- 30 files changed, 399 insertions(+), 352 deletions(-) create mode 100644 packages/DocumentsUI/res/drawable/item_activated_overlay.xml delete mode 100644 packages/DocumentsUI/res/drawable/item_root.xml create mode 100644 packages/DocumentsUI/res/layout/item_subdir.xml create mode 100644 packages/DocumentsUI/res/layout/item_subdir_title.xml delete mode 100644 packages/DocumentsUI/res/layout/item_title.xml delete mode 100644 packages/DocumentsUI/res/values-sw720dp/styles.xml (limited to 'packages') diff --git a/packages/DocumentsUI/AndroidManifest.xml b/packages/DocumentsUI/AndroidManifest.xml index 3861cc1..915e2f9 100644 --- a/packages/DocumentsUI/AndroidManifest.xml +++ b/packages/DocumentsUI/AndroidManifest.xml @@ -11,7 +11,7 @@ diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_dir_shadow_am.9.png b/packages/DocumentsUI/res/drawable-hdpi/ic_dir_shadow_am.9.png index 904d525..d4ffd45 100644 Binary files a/packages/DocumentsUI/res/drawable-hdpi/ic_dir_shadow_am.9.png and b/packages/DocumentsUI/res/drawable-hdpi/ic_dir_shadow_am.9.png differ diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_dir_shadow_am.9.png b/packages/DocumentsUI/res/drawable-mdpi/ic_dir_shadow_am.9.png index 068619b..4a81b6b 100644 Binary files a/packages/DocumentsUI/res/drawable-mdpi/ic_dir_shadow_am.9.png and b/packages/DocumentsUI/res/drawable-mdpi/ic_dir_shadow_am.9.png differ diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_dir_shadow_am.9.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_dir_shadow_am.9.png index e38a868..f387132 100644 Binary files a/packages/DocumentsUI/res/drawable-xhdpi/ic_dir_shadow_am.9.png and b/packages/DocumentsUI/res/drawable-xhdpi/ic_dir_shadow_am.9.png differ diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_dir_shadow_am.9.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dir_shadow_am.9.png index 0b332e4..c475e47 100644 Binary files a/packages/DocumentsUI/res/drawable-xxhdpi/ic_dir_shadow_am.9.png and b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dir_shadow_am.9.png differ diff --git a/packages/DocumentsUI/res/drawable/item_activated.xml b/packages/DocumentsUI/res/drawable/item_activated.xml index 6ffefdb..1b3f44a 100644 --- a/packages/DocumentsUI/res/drawable/item_activated.xml +++ b/packages/DocumentsUI/res/drawable/item_activated.xml @@ -15,7 +15,11 @@ --> - - + + + + + + diff --git a/packages/DocumentsUI/res/drawable/item_activated_overlay.xml b/packages/DocumentsUI/res/drawable/item_activated_overlay.xml new file mode 100644 index 0000000..83e4d7e --- /dev/null +++ b/packages/DocumentsUI/res/drawable/item_activated_overlay.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + diff --git a/packages/DocumentsUI/res/drawable/item_root.xml b/packages/DocumentsUI/res/drawable/item_root.xml deleted file mode 100644 index 60d4ab0..0000000 --- a/packages/DocumentsUI/res/drawable/item_root.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - 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 5f1e432..95af7e9 100644 --- a/packages/DocumentsUI/res/layout-sw720dp-land/item_doc_list.xml +++ b/packages/DocumentsUI/res/layout-sw720dp-land/item_doc_list.xml @@ -17,7 +17,7 @@ + android:background="@drawable/item_activated"> + android:orientation="vertical"> - + + + + + + + - + android:layout_weight="1" + android:orientation="vertical" + android:elevation="8dp" + android:background="@*android:color/material_grey_50"> - + - + - - - + diff --git a/packages/DocumentsUI/res/layout/activity.xml b/packages/DocumentsUI/res/layout/activity.xml index 2ef7e9c..3ba82e1 100644 --- a/packages/DocumentsUI/res/layout/activity.xml +++ b/packages/DocumentsUI/res/layout/activity.xml @@ -24,6 +24,23 @@ android:layout_height="match_parent" android:orientation="vertical"> + + + + + + + android:layout_height="wrap_content" + android:background="@*android:color/material_grey_50" + android:elevation="8dp" /> - + android:orientation="vertical" + android:elevation="16dp" + android:background="@*android:color/white"> + + + + + + diff --git a/packages/DocumentsUI/res/layout/fragment_directory.xml b/packages/DocumentsUI/res/layout/fragment_directory.xml index 09b50c0..ffbd3f0 100644 --- a/packages/DocumentsUI/res/layout/fragment_directory.xml +++ b/packages/DocumentsUI/res/layout/fragment_directory.xml @@ -17,7 +17,7 @@ + android:background="@*android:color/material_grey_50"> + android:orientation="horizontal" + android:baselineAligned="false" + android:gravity="center_vertical" + android:minHeight="?android:attr/listPreferredItemHeightSmall"> - - - - - -