diff options
author | Rohan Shah <shahrk@google.com> | 2014-08-20 14:50:38 -0700 |
---|---|---|
committer | Rohan Shah <shahrk@google.com> | 2014-08-20 16:16:38 -0700 |
commit | cc2e1ee5ea19d1b166a7542ea03f4fd4e5c807e3 (patch) | |
tree | 73d45021e65fefb5c545a28dce7127d5713792d8 | |
parent | da2e3b2f07225c8c183c3d3890ad575e18d1b6d0 (diff) | |
download | android_packages_apps_UnifiedEmail-cc2e1ee5ea19d1b166a7542ea03f4fd4e5c807e3.tar.gz android_packages_apps_UnifiedEmail-cc2e1ee5ea19d1b166a7542ea03f4fd4e5c807e3.tar.bz2 android_packages_apps_UnifiedEmail-cc2e1ee5ea19d1b166a7542ea03f4fd4e5c807e3.zip |
Change Move To Dialog (Quantum)
Added folder label drawables to move to dialog (single
folder selection) and removed dividers out.
Bug: 17073025
Change-Id: I491577d126d9d4d6a328e1392b6f1975217397eb
-rw-r--r-- | res/layout/single_folders_view.xml | 22 | ||||
-rw-r--r-- | res/values-ldrtl/styles-ldrtl.xml | 4 | ||||
-rw-r--r-- | res/values/dimen.xml | 3 | ||||
-rw-r--r-- | res/values/styles.xml | 8 | ||||
-rw-r--r-- | src/com/android/mail/ui/FolderSelectorAdapter.java | 9 | ||||
-rw-r--r-- | src/com/android/mail/ui/MultiFoldersSelectionDialog.java | 1 | ||||
-rw-r--r-- | src/com/android/mail/ui/SingleFolderSelectionDialog.java | 1 |
7 files changed, 39 insertions, 9 deletions
diff --git a/res/layout/single_folders_view.xml b/res/layout/single_folders_view.xml index 3f048da01..ebb4adb9d 100644 --- a/res/layout/single_folders_view.xml +++ b/res/layout/single_folders_view.xml @@ -19,19 +19,25 @@ <!-- Describes an individual toggleable folder entry to be displayed in a list of folders in a folder selection UI. --> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/folders" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="@dimen/single_folder_list_item_height" + android:layout_gravity="center_vertical" android:minHeight="?android:attr/listPreferredItemHeight"> <!-- Note: the checkbox is not focusable because the parent list item itself handles the toggling --> - <TextView android:id="@+id/folder_name" - style="@style/FolderSelectionItemStyle" /> + <ImageView + android:id="@+id/folder_icon" + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_gravity="center_vertical" + style="@style/SingleFolderListIconStyle" /> - <View - android:id="@+id/color_block" - style="@style/FolderColorBoxStyle" /> + <TextView android:id="@+id/folder_name" + android:layout_width="0dp" + android:layout_weight="1" + style="@style/SingleFolderSelectionItemStyle" /> -</FrameLayout> +</LinearLayout> diff --git a/res/values-ldrtl/styles-ldrtl.xml b/res/values-ldrtl/styles-ldrtl.xml index a6b45b1c9..96b541093 100644 --- a/res/values-ldrtl/styles-ldrtl.xml +++ b/res/values-ldrtl/styles-ldrtl.xml @@ -200,6 +200,10 @@ <item name="android:paddingEnd">@dimen/snack_bar_margin_horizontal</item> </style> + <style name="SingleFolderListIconStyle"> + <item name="android:layout_marginStart">@dimen/single_folder_list_item_start_margin</item> + </style> + <style name="FolderSelectionItemStyle" parent="AbstractFolderSelectionItemStyle"> <item name="android:layout_marginStart">@dimen/folder_selection_margin_start</item> <item name="android:layout_marginEnd">@dimen/folder_selection_margin_end</item> diff --git a/res/values/dimen.xml b/res/values/dimen.xml index e8496497d..d664e8bc1 100644 --- a/res/values/dimen.xml +++ b/res/values/dimen.xml @@ -88,6 +88,9 @@ <dimen name="folder_list_item_start_margin">16dp</dimen> <dimen name="folder_list_item_text_start_margin">32dp</dimen> <dimen name="folder_list_item_end_margin">8dp</dimen> + <dimen name="single_folder_list_item_height">48sp</dimen> + <dimen name="single_folder_list_item_start_margin">24dp</dimen> + <dimen name="single_folder_list_item_padding">0dp</dimen> <!-- Let's try to keep this consistent with color_block_height above, unless there's a good reason not to. --> <dimen name="folder_swatch_height">6dip</dimen> <dimen name="folder_list_popup_width">200dip</dimen> diff --git a/res/values/styles.xml b/res/values/styles.xml index cf2ea1c64..f6aac9559 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -421,6 +421,10 @@ <item name="android:layout_marginRight">@dimen/folder_selection_margin_end</item> </style> + <style name="SingleFolderSelectionItemStyle" parent="FolderSelectionItemStyle"> + <item name="android:padding">@dimen/single_folder_list_item_padding</item> + </style> + <!-- Widget styles --> <style name="WidgetTitle" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"> <item name="android:singleLine">true</item> @@ -610,6 +614,10 @@ <item name="android:paddingRight">20dp</item> </style> + <style name="SingleFolderListIconStyle"> + <item name="android:layout_marginLeft">@dimen/single_folder_list_item_start_margin</item> + </style> + <style name="FolderListItemStartStyle"> <item name="android:layout_marginLeft">@dimen/folder_list_item_text_start_margin</item> </style> diff --git a/src/com/android/mail/ui/FolderSelectorAdapter.java b/src/com/android/mail/ui/FolderSelectorAdapter.java index 677c01ab5..4857b222b 100644 --- a/src/com/android/mail/ui/FolderSelectorAdapter.java +++ b/src/com/android/mail/ui/FolderSelectorAdapter.java @@ -330,8 +330,15 @@ public class FolderSelectorAdapter extends BaseAdapter { if (display != null) { display.setText(folderDisplay); } + final View colorBlock = view.findViewById(R.id.color_block); - Folder.setFolderBlockColor(folder, colorBlock); + if (colorBlock != null) { + Folder.setFolderBlockColor(folder, colorBlock); + } + final ImageView folderIcon = (ImageView) view.findViewById(R.id.folder_icon); + if (folderIcon != null) { + Folder.setIcon(folder, folderIcon); + } return view; } } diff --git a/src/com/android/mail/ui/MultiFoldersSelectionDialog.java b/src/com/android/mail/ui/MultiFoldersSelectionDialog.java index e708756b2..0a29de8be 100644 --- a/src/com/android/mail/ui/MultiFoldersSelectionDialog.java +++ b/src/com/android/mail/ui/MultiFoldersSelectionDialog.java @@ -104,6 +104,7 @@ public class MultiFoldersSelectionDialog extends FolderSelectionDialog { // The number of view types changes here, so we have to reset the listview's // adapter. dialog.getListView().setAdapter(null); + dialog.getListView().setDivider(null); final HashSet<String> checked = new HashSet<String>(); for (final Conversation conversation : mTarget) { diff --git a/src/com/android/mail/ui/SingleFolderSelectionDialog.java b/src/com/android/mail/ui/SingleFolderSelectionDialog.java index a61ded0ff..9220cc122 100644 --- a/src/com/android/mail/ui/SingleFolderSelectionDialog.java +++ b/src/com/android/mail/ui/SingleFolderSelectionDialog.java @@ -80,6 +80,7 @@ public class SingleFolderSelectionDialog extends FolderSelectionDialog { // The number of view types changes here, so we have to reset the ListView's // adapter. dialog.getListView().setAdapter(null); + dialog.getListView().setDivider(null); mAdapter.clearSections(); |