diff options
author | Jeff Sharkey <jsharkey@android.com> | 2014-07-28 16:38:52 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@google.com> | 2014-07-29 23:19:45 +0000 |
commit | f52773fd62fc2fec40c2e17230b644dfbee6cf2d (patch) | |
tree | f1cfd567aa9ae0639f962e7c3d23dd7e728775b2 /packages/DocumentsUI/res/layout | |
parent | 1561fd3b066bef822dce69e26bdd7aaa41ca3a84 (diff) | |
download | frameworks_base-f52773fd62fc2fec40c2e17230b644dfbee6cf2d.zip frameworks_base-f52773fd62fc2fec40c2e17230b644dfbee6cf2d.tar.gz frameworks_base-f52773fd62fc2fec40c2e17230b644dfbee6cf2d.tar.bz2 |
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
Diffstat (limited to 'packages/DocumentsUI/res/layout')
-rw-r--r-- | packages/DocumentsUI/res/layout/activity.xml | 45 | ||||
-rw-r--r-- | packages/DocumentsUI/res/layout/fragment_directory.xml | 2 | ||||
-rw-r--r-- | packages/DocumentsUI/res/layout/fragment_pick.xml | 34 | ||||
-rw-r--r-- | packages/DocumentsUI/res/layout/fragment_roots.xml | 3 | ||||
-rw-r--r-- | packages/DocumentsUI/res/layout/fragment_save.xml | 87 | ||||
-rw-r--r-- | packages/DocumentsUI/res/layout/item_doc_grid.xml | 2 | ||||
-rw-r--r-- | packages/DocumentsUI/res/layout/item_doc_list.xml | 2 | ||||
-rw-r--r-- | packages/DocumentsUI/res/layout/item_root.xml | 32 | ||||
-rw-r--r-- | packages/DocumentsUI/res/layout/item_root_spacer.xml | 12 | ||||
-rw-r--r-- | packages/DocumentsUI/res/layout/item_subdir.xml (renamed from packages/DocumentsUI/res/layout/item_title.xml) | 7 | ||||
-rw-r--r-- | packages/DocumentsUI/res/layout/item_subdir_title.xml | 33 |
11 files changed, 162 insertions, 97 deletions
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"> + <Toolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="?android:attr/actionBarSize" + android:background="?android:attr/colorPrimary" + android:elevation="8dp" + android:theme="?android:attr/actionBarTheme"> + + <Spinner + android:id="@+id/stack" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="4dp" + android:overlapAnchor="true" /> + + </Toolbar> + <com.android.documentsui.DirectoryContainerView android:id="@+id/container_directory" android:layout_width="match_parent" @@ -33,15 +50,35 @@ <FrameLayout android:id="@+id/container_save" android:layout_width="match_parent" - android:layout_height="wrap_content" /> + android:layout_height="wrap_content" + android:background="@*android:color/material_grey_50" + android:elevation="8dp" /> </LinearLayout> - <FrameLayout - android:id="@+id/container_roots" + <LinearLayout + android:id="@+id/drawer_roots" android:layout_width="250dp" android:layout_height="match_parent" android:layout_gravity="start" - android:background="#fff" /> + android:orientation="vertical" + android:elevation="16dp" + android:background="@*android:color/white"> + + <Toolbar + android:id="@+id/roots_toolbar" + android:layout_width="match_parent" + android:layout_height="?android:attr/actionBarSize" + android:background="?android:attr/colorPrimary" + android:elevation="8dp" + android:theme="?android:attr/actionBarTheme" /> + + <FrameLayout + android:id="@+id/container_roots" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" /> + + </LinearLayout> </android.support.v4.widget.DrawerLayout> 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 @@ <com.android.documentsui.DirectoryView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@drawable/ic_dir_shadow"> + android:background="@*android:color/material_grey_50"> <TextView android:id="@android:id/empty" diff --git a/packages/DocumentsUI/res/layout/fragment_pick.xml b/packages/DocumentsUI/res/layout/fragment_pick.xml index 4a2fd03..5735871 100644 --- a/packages/DocumentsUI/res/layout/fragment_pick.xml +++ b/packages/DocumentsUI/res/layout/fragment_pick.xml @@ -17,32 +17,16 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical"> + android:orientation="horizontal" + android:baselineAligned="false" + android:gravity="center_vertical" + android:minHeight="?android:attr/listPreferredItemHeightSmall"> - <!-- Le sigh, this really should be an asset --> - <View + <Button + android:id="@android:id/button1" android:layout_width="match_parent" - android:layout_height="1dp" - android:background="#ccc" /> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:baselineAligned="false" - android:gravity="center_vertical" - android:background="#ddd" - android:minHeight="?android:attr/listPreferredItemHeightSmall"> - - <Button - android:id="@android:id/button1" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="?android:attr/selectableItemBackground" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textAllCaps="false" - android:padding="8dp" /> - - </LinearLayout> + android:layout_height="match_parent" + android:textAllCaps="false" + style="?android:attr/buttonBarPositiveButtonStyle" /> </LinearLayout> diff --git a/packages/DocumentsUI/res/layout/fragment_roots.xml b/packages/DocumentsUI/res/layout/fragment_roots.xml index c3a3da0..2d624d8 100644 --- a/packages/DocumentsUI/res/layout/fragment_roots.xml +++ b/packages/DocumentsUI/res/layout/fragment_roots.xml @@ -18,4 +18,5 @@ android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="match_parent" - android:divider="@drawable/ic_drawer_hairline_divider" /> + android:paddingTop="8dp" + android:divider="@null" /> diff --git a/packages/DocumentsUI/res/layout/fragment_save.xml b/packages/DocumentsUI/res/layout/fragment_save.xml index d601194..7aac620 100644 --- a/packages/DocumentsUI/res/layout/fragment_save.xml +++ b/packages/DocumentsUI/res/layout/fragment_save.xml @@ -17,66 +17,55 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical"> + android:paddingStart="@dimen/list_item_padding" + android:orientation="horizontal" + android:baselineAligned="false" + android:gravity="center_vertical" + android:minHeight="?android:attr/listPreferredItemHeightSmall"> - <!-- Le sigh, this really should be an asset --> - <View - android:layout_width="match_parent" - android:layout_height="1dp" - android:background="#ccc" /> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:baselineAligned="false" - android:gravity="center_vertical" - android:background="#ddd" - android:minHeight="?android:attr/listPreferredItemHeightSmall"> + <FrameLayout + android:layout_width="@dimen/icon_size" + android:layout_height="@dimen/icon_size" + android:layout_marginEnd="16dp"> <ImageView android:id="@android:id/icon" - android:layout_width="24dp" - android:layout_height="24dp" - android:layout_marginStart="8dp" - android:layout_marginEnd="8dp" + android:layout_width="@dimen/root_icon_size" + android:layout_height="match_parent" android:scaleType="centerInside" android:contentDescription="@null" /> - <EditText - android:id="@android:id/title" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:singleLine="true" - android:selectAllOnFocus="true" /> + </FrameLayout> - <FrameLayout - android:layout_width="wrap_content" - android:layout_height="match_parent"> + <EditText + android:id="@android:id/title" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:singleLine="true" + android:selectAllOnFocus="true" /> - <Button - android:id="@android:id/button1" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:background="?android:attr/selectableItemBackground" - android:text="@string/menu_save" - android:textAllCaps="true" - android:textAppearance="?android:attr/textAppearanceSmall" - android:padding="8dp" /> + <FrameLayout + android:layout_width="wrap_content" + android:layout_height="match_parent"> - <ProgressBar - android:id="@android:id/progress" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:visibility="gone" - android:indeterminate="true" - android:padding="8dp" - style="?android:attr/progressBarStyle" /> + <Button + android:id="@android:id/button1" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:text="@string/menu_save" + style="?android:attr/buttonBarPositiveButtonStyle" /> - </FrameLayout> + <ProgressBar + android:id="@android:id/progress" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:visibility="gone" + android:indeterminate="true" + android:padding="8dp" + style="?android:attr/progressBarStyle" /> - </LinearLayout> + </FrameLayout> </LinearLayout> diff --git a/packages/DocumentsUI/res/layout/item_doc_grid.xml b/packages/DocumentsUI/res/layout/item_doc_grid.xml index 0fc606d..4482d72 100644 --- a/packages/DocumentsUI/res/layout/item_doc_grid.xml +++ b/packages/DocumentsUI/res/layout/item_doc_grid.xml @@ -19,7 +19,7 @@ android:layout_height="@dimen/grid_item_height" android:orientation="vertical" android:background="@color/grid_item_background" - android:foreground="@drawable/item_activated"> + android:foreground="@drawable/item_activated_overlay"> <ImageView android:id="@+id/icon_thumb" diff --git a/packages/DocumentsUI/res/layout/item_doc_list.xml b/packages/DocumentsUI/res/layout/item_doc_list.xml index 50ed2d6..c5f1842 100644 --- a/packages/DocumentsUI/res/layout/item_doc_list.xml +++ b/packages/DocumentsUI/res/layout/item_doc_list.xml @@ -17,7 +17,7 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:foreground="@drawable/item_activated"> + android:background="@drawable/item_activated"> <LinearLayout android:layout_width="match_parent" diff --git a/packages/DocumentsUI/res/layout/item_root.xml b/packages/DocumentsUI/res/layout/item_root.xml index f17c261..266b9b0 100644 --- a/packages/DocumentsUI/res/layout/item_root.xml +++ b/packages/DocumentsUI/res/layout/item_root.xml @@ -17,25 +17,33 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:minHeight="?android:attr/listPreferredItemHeightSmall" - android:paddingStart="?android:attr/listPreferredItemPaddingStart" - android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:minHeight="48dp" + android:paddingStart="@dimen/list_item_padding" + android:paddingEnd="@dimen/list_item_padding" android:gravity="center_vertical" android:orientation="horizontal" android:baselineAligned="false" - android:background="@drawable/item_root"> + android:background="@drawable/item_activated"> - <ImageView - android:id="@android:id/icon" + <FrameLayout android:layout_width="@dimen/icon_size" android:layout_height="@dimen/icon_size" - android:layout_marginEnd="8dp" - android:scaleType="centerInside" - android:contentDescription="@null" /> + android:layout_marginEnd="16dp"> + + <ImageView + android:id="@android:id/icon" + android:layout_width="@dimen/root_icon_size" + android:layout_height="match_parent" + android:scaleType="centerInside" + android:contentDescription="@null" /> + + </FrameLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" + android:paddingTop="8dp" + android:paddingBottom="8dp" android:orientation="vertical"> <TextView @@ -45,7 +53,8 @@ android:singleLine="true" android:ellipsize="end" android:textAlignment="viewStart" - style="@style/TextAppearance.Medium" /> + android:textAppearance="@android:style/TextAppearance.Material.Body1" + android:textColor="?android:attr/textColorPrimary" /> <TextView android:id="@android:id/summary" @@ -54,7 +63,8 @@ android:singleLine="true" android:ellipsize="end" android:textAlignment="viewStart" - style="@style/TextAppearance.Small" /> + android:textAppearance="@android:style/TextAppearance.Material.Body1" + android:textColor="?android:attr/textColorSecondary" /> </LinearLayout> diff --git a/packages/DocumentsUI/res/layout/item_root_spacer.xml b/packages/DocumentsUI/res/layout/item_root_spacer.xml index 7d96ac8..b3beced 100644 --- a/packages/DocumentsUI/res/layout/item_root_spacer.xml +++ b/packages/DocumentsUI/res/layout/item_root_spacer.xml @@ -14,7 +14,15 @@ limitations under the License. --> -<View xmlns:android="http://schemas.android.com/apk/res/android" +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/ic_drawer_tall_divider" /> + android:paddingTop="8dp" + android:paddingBottom="8dp"> + + <View + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="?android:attr/listDivider" /> + +</FrameLayout> diff --git a/packages/DocumentsUI/res/layout/item_title.xml b/packages/DocumentsUI/res/layout/item_subdir.xml index 6e96fb5..b2a739a 100644 --- a/packages/DocumentsUI/res/layout/item_title.xml +++ b/packages/DocumentsUI/res/layout/item_subdir.xml @@ -28,6 +28,7 @@ android:id="@+id/subdir" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:paddingEnd="8dp" android:scaleType="centerInside" android:visibility="gone" android:src="@drawable/ic_subdirectory_arrow" @@ -35,11 +36,13 @@ <TextView android:id="@android:id/title" - android:layout_width="match_parent" + android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_weight="1" android:singleLine="true" android:ellipsize="middle" android:textAlignment="viewStart" - style="@style/TextAppearance.Medium" /> + android:textAppearance="@android:style/TextAppearance.Material.Subhead" + android:textColor="?android:attr/textColorPrimary" /> </LinearLayout> diff --git a/packages/DocumentsUI/res/layout/item_subdir_title.xml b/packages/DocumentsUI/res/layout/item_subdir_title.xml new file mode 100644 index 0000000..4c839d0 --- /dev/null +++ b/packages/DocumentsUI/res/layout/item_subdir_title.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2013 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingEnd="8dp" + android:orientation="horizontal" + android:baselineAligned="false"> + + <TextView + android:id="@android:id/title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:singleLine="true" + android:ellipsize="middle" + android:textAlignment="viewStart" + android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title" /> + +</LinearLayout> |