From 5f8afe6280eae34620067696173e71943e1a30a3 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 12 Aug 2013 16:19:28 -0700 Subject: [PATCH] Initial Changes for Dynamic Grid Change-Id: I9e6f1e5167791cf8dc140778dfa447f86424e9bf --- .../{now_page.png => custom_content_page.png} | Bin .../{now_page.png => custom_content_page.png} | Bin .../{now_page.png => custom_content_page.png} | Bin res/layout-land/application.xml | 20 - res/layout-land/folder_icon.xml | 33 -- res/layout-land/hotseat.xml | 36 -- res/layout-land/launcher.xml | 25 +- res/layout-land/search_bar.xml | 2 +- res/layout-port/hotseat.xml | 36 -- res/layout-port/launcher.xml | 21 +- res/layout-port/search_bar.xml | 18 +- res/layout-sw600dp-land/launcher.xml | 108 ---- res/layout-sw720dp/hotseat.xml | 36 -- res/layout-sw720dp/launcher.xml | 22 +- res/layout-sw720dp/search_bar.xml | 16 +- res/layout-sw720dp/workspace.xml | 33 -- res/{layout-port => layout}/application.xml | 2 +- ... custom_content_page_indicator_marker.xml} | 7 +- res/{layout-port => layout}/folder_icon.xml | 6 +- .../{workspace_divider.xml => hotseat.xml} | 15 +- res/layout/page_indicator_marker.xml | 3 +- res/layout/qsb_bar.xml | 14 +- res/layout/user_folder.xml | 10 +- res/layout/workspace_screen.xml | 8 - res/values-land/config.xml | 7 - res/values-land/dimens.xml | 40 -- res/values-land/styles.xml | 13 - res/values-port/dimens.xml | 24 - res/values-sw340dp-land/dimens.xml | 6 - res/values-sw340dp-land/styles.xml | 28 - res/values-sw340dp-port/dimens.xml | 12 - res/values-sw340dp/dimens.xml | 22 - res/values-sw380dp-port/dimens.xml | 35 -- res/values-sw600dp-land/config.xml | 8 - res/values-sw600dp-land/dimens.xml | 15 - res/values-sw600dp-port/dimens.xml | 3 - res/values-sw600dp/config.xml | 16 +- res/values-sw600dp/dimens.xml | 47 -- res/values-sw720dp-port/dimens.xml | 17 - res/values-sw720dp/config.xml | 15 +- res/values-sw720dp/dimens.xml | 69 --- res/values-sw720dp/styles.xml | 50 -- res/values/attrs.xml | 3 - res/values/config.xml | 19 +- res/values/dimens.xml | 75 +-- res/values/styles.xml | 36 -- .../launcher3/AppsCustomizePagedView.java | 10 +- src/com/android/launcher3/BubbleTextView.java | 27 +- src/com/android/launcher3/CellLayout.java | 185 +++---- src/com/android/launcher3/Cling.java | 8 +- src/com/android/launcher3/DragLayer.java | 7 +- src/com/android/launcher3/DynamicGrid.java | 478 ++++++++++++++++++ src/com/android/launcher3/Folder.java | 50 +- src/com/android/launcher3/FolderIcon.java | 28 +- src/com/android/launcher3/Hotseat.java | 19 +- src/com/android/launcher3/Launcher.java | 62 +-- .../android/launcher3/LauncherAppState.java | 28 +- .../launcher3/LauncherAppWidgetHostView.java | 1 + src/com/android/launcher3/LauncherModel.java | 33 ++ .../android/launcher3/LauncherProvider.java | 10 - .../launcher3/PagedViewCellLayout.java | 8 +- .../launcher3/SearchDropTargetBar.java | 4 +- .../launcher3/ShortcutAndWidgetContainer.java | 25 +- src/com/android/launcher3/Utilities.java | 87 +--- .../launcher3/WidgetPreviewLoader.java | 6 +- src/com/android/launcher3/Workspace.java | 95 +--- 66 files changed, 847 insertions(+), 1355 deletions(-) rename res/drawable-hdpi/{now_page.png => custom_content_page.png} (100%) rename res/drawable-mdpi/{now_page.png => custom_content_page.png} (100%) rename res/drawable-xhdpi/{now_page.png => custom_content_page.png} (100%) delete mode 100644 res/layout-land/application.xml delete mode 100644 res/layout-land/folder_icon.xml delete mode 100644 res/layout-land/hotseat.xml delete mode 100644 res/layout-port/hotseat.xml delete mode 100644 res/layout-sw600dp-land/launcher.xml delete mode 100644 res/layout-sw720dp/hotseat.xml delete mode 100644 res/layout-sw720dp/workspace.xml rename res/{layout-port => layout}/application.xml (95%) rename res/layout/{now_page_indicator_marker.xml => custom_content_page_indicator_marker.xml} (86%) rename res/{layout-port => layout}/folder_icon.xml (87%) rename res/layout/{workspace_divider.xml => hotseat.xml} (67%) delete mode 100644 res/values-sw340dp-land/styles.xml delete mode 100644 res/values-sw380dp-port/dimens.xml delete mode 100644 res/values-sw600dp-land/config.xml create mode 100644 src/com/android/launcher3/DynamicGrid.java diff --git a/res/drawable-hdpi/now_page.png b/res/drawable-hdpi/custom_content_page.png similarity index 100% rename from res/drawable-hdpi/now_page.png rename to res/drawable-hdpi/custom_content_page.png diff --git a/res/drawable-mdpi/now_page.png b/res/drawable-mdpi/custom_content_page.png similarity index 100% rename from res/drawable-mdpi/now_page.png rename to res/drawable-mdpi/custom_content_page.png diff --git a/res/drawable-xhdpi/now_page.png b/res/drawable-xhdpi/custom_content_page.png similarity index 100% rename from res/drawable-xhdpi/now_page.png rename to res/drawable-xhdpi/custom_content_page.png diff --git a/res/layout-land/application.xml b/res/layout-land/application.xml deleted file mode 100644 index d20e1be1e7..0000000000 --- a/res/layout-land/application.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - diff --git a/res/layout-land/folder_icon.xml b/res/layout-land/folder_icon.xml deleted file mode 100644 index 32d729802a..0000000000 --- a/res/layout-land/folder_icon.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - diff --git a/res/layout-land/hotseat.xml b/res/layout-land/hotseat.xml deleted file mode 100644 index f2d2b00e71..0000000000 --- a/res/layout-land/hotseat.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml index 3454ad49ff..faf410be51 100644 --- a/res/layout-land/launcher.xml +++ b/res/layout-land/launcher.xml @@ -36,28 +36,13 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" - android:paddingStart="@dimen/workspace_left_padding" - android:paddingEnd="@dimen/workspace_right_padding" - android:paddingTop="@dimen/workspace_top_padding" - android:paddingBottom="@dimen/workspace_bottom_padding" launcher:defaultScreen="@integer/config_workspaceDefaultScreen" - launcher:cellCountX="@integer/cell_count_x" - launcher:cellCountY="@integer/cell_count_y" launcher:pageSpacing="@dimen/workspace_page_spacing" - launcher:scrollIndicatorPaddingLeft="@dimen/qsb_bar_height" - launcher:scrollIndicatorPaddingRight="@dimen/button_bar_height" /> - - + launcher:pageIndicator="@id/page_indicator" /> @@ -84,16 +69,18 @@ android:layout_height="match_parent" android:visibility="gone" /> + diff --git a/res/layout-port/hotseat.xml b/res/layout-port/hotseat.xml deleted file mode 100644 index cab20b2dab..0000000000 --- a/res/layout-port/hotseat.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml index a2e8298197..dd3ad47e4f 100644 --- a/res/layout-port/launcher.xml +++ b/res/layout-port/launcher.xml @@ -35,25 +35,15 @@ android:id="@+id/workspace" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_gravity="center" - android:paddingStart="@dimen/workspace_left_padding" - android:paddingEnd="@dimen/workspace_right_padding" - android:paddingTop="@dimen/workspace_top_padding" - android:paddingBottom="@dimen/workspace_bottom_padding" launcher:defaultScreen="@integer/config_workspaceDefaultScreen" - launcher:cellCountX="@integer/cell_count_x" - launcher:cellCountY="@integer/cell_count_y" launcher:pageSpacing="@dimen/workspace_page_spacing" - launcher:pageIndicator="@id/page_indicator" - launcher:scrollIndicatorPaddingLeft="@dimen/workspace_divider_padding_left" - launcher:scrollIndicatorPaddingRight="@dimen/workspace_divider_padding_right"> + launcher:pageIndicator="@id/page_indicator"> + android:layout_height="match_parent" /> + android:layout_gravity="center_horizontal" /> @@ -51,22 +49,22 @@ style="@style/SearchButton" launcher:sourceImageViewId="@+id/voice_button" android:id="@+id/voice_button_container" - android:layout_width="@dimen/search_bar_height" + android:layout_width="@dimen/app_icon_size" android:layout_height="match_parent" android:layout_gravity="center_vertical" + android:layout_centerVertical="true" android:layout_alignParentEnd="true" - android:layout_alignParentTop="true" android:paddingEnd="8dp" - android:gravity="end" android:onClick="onClickVoiceButton" android:focusable="true" android:clickable="true" android:contentDescription="@string/accessibility_voice_search_button"> diff --git a/res/layout-sw600dp-land/launcher.xml b/res/layout-sw600dp-land/launcher.xml deleted file mode 100644 index 8e45028b87..0000000000 --- a/res/layout-sw600dp-land/launcher.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/res/layout-sw720dp/hotseat.xml b/res/layout-sw720dp/hotseat.xml deleted file mode 100644 index f69f68d95f..0000000000 --- a/res/layout-sw720dp/hotseat.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/res/layout-sw720dp/launcher.xml b/res/layout-sw720dp/launcher.xml index 82f01788a3..fee0198edb 100644 --- a/res/layout-sw720dp/launcher.xml +++ b/res/layout-sw720dp/launcher.xml @@ -35,25 +35,15 @@ android:id="@+id/workspace" android:layout_width="match_parent" android:layout_height="match_parent" - android:paddingStart="@dimen/workspace_left_padding" - android:paddingEnd="@dimen/workspace_right_padding" - android:paddingTop="@dimen/workspace_top_padding" - android:paddingBottom="@dimen/workspace_bottom_padding" - android:layout_gravity="center" launcher:defaultScreen="@integer/config_workspaceDefaultScreen" - launcher:cellCountX="@integer/cell_count_x" - launcher:cellCountY="@integer/cell_count_y" launcher:pageSpacing="@dimen/workspace_page_spacing" - launcher:pageIndicator="@id/page_indicator" - launcher:scrollIndicatorPaddingLeft="@dimen/workspace_divider_padding_left" - launcher:scrollIndicatorPaddingRight="@dimen/workspace_divider_padding_right"> + launcher:pageIndicator="@id/page_indicator"> + android:layout_height="match_parent" /> + android:layout_gravity="center_horizontal" /> @@ -50,21 +49,22 @@ style="@style/SearchButton" launcher:sourceImageViewId="@+id/voice_button" android:id="@+id/voice_button_container" - android:layout_width="@dimen/search_bar_height" + android:layout_width="@dimen/app_icon_size" android:layout_height="match_parent" android:layout_gravity="center_vertical" + android:layout_centerVertical="true" android:layout_alignParentEnd="true" - android:layout_alignParentTop="true" android:paddingEnd="8dp" - android:gravity="end" android:onClick="onClickVoiceButton" android:focusable="true" android:clickable="true" android:contentDescription="@string/accessibility_voice_search_button"> diff --git a/res/layout-sw720dp/workspace.xml b/res/layout-sw720dp/workspace.xml deleted file mode 100644 index 00ed529e09..0000000000 --- a/res/layout-sw720dp/workspace.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - diff --git a/res/layout-port/application.xml b/res/layout/application.xml similarity index 95% rename from res/layout-port/application.xml rename to res/layout/application.xml index 4dcc774d74..e4909ddadd 100644 --- a/res/layout-port/application.xml +++ b/res/layout/application.xml @@ -15,6 +15,6 @@ --> diff --git a/res/layout/now_page_indicator_marker.xml b/res/layout/custom_content_page_indicator_marker.xml similarity index 86% rename from res/layout/now_page_indicator_marker.xml rename to res/layout/custom_content_page_indicator_marker.xml index 7d05627430..1685992668 100644 --- a/res/layout/now_page_indicator_marker.xml +++ b/res/layout/custom_content_page_indicator_marker.xml @@ -17,18 +17,19 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3" android:layout_width="wrap_content" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:layout_gravity="center_vertical"> diff --git a/res/layout-port/folder_icon.xml b/res/layout/folder_icon.xml similarity index 87% rename from res/layout-port/folder_icon.xml rename to res/layout/folder_icon.xml index 686fb170c6..5a9a834155 100644 --- a/res/layout-port/folder_icon.xml +++ b/res/layout/folder_icon.xml @@ -24,10 +24,10 @@ + style="@style/WorkspaceIcon"/> diff --git a/res/layout/workspace_divider.xml b/res/layout/hotseat.xml similarity index 67% rename from res/layout/workspace_divider.xml rename to res/layout/hotseat.xml index 304e532976..dc9ed2a6fc 100644 --- a/res/layout/workspace_divider.xml +++ b/res/layout/hotseat.xml @@ -13,11 +13,12 @@ See the License for the specific language governing permissions and limitations under the License. --> - + xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3"> + + diff --git a/res/layout/page_indicator_marker.xml b/res/layout/page_indicator_marker.xml index 0260e7e4eb..496f3bdc98 100644 --- a/res/layout/page_indicator_marker.xml +++ b/res/layout/page_indicator_marker.xml @@ -17,7 +17,8 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3" android:layout_width="wrap_content" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:layout_gravity="center_vertical"> + android:focusable="false" + android:layout_width="match_parent" + android:layout_height="match_parent"> + layout="@layout/search_bar" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" /> + android:id="@+id/drag_target_bar" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center"> diff --git a/res/layout/user_folder.xml b/res/layout/user_folder.xml index 3eeec35a2a..d790c53886 100644 --- a/res/layout/user_folder.xml +++ b/res/layout/user_folder.xml @@ -30,16 +30,8 @@ android:id="@+id/folder_content" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingStart="@dimen/folder_padding" - android:paddingEnd="@dimen/folder_padding" - android:paddingTop="@dimen/folder_padding" - android:paddingBottom="@dimen/folder_padding" android:cacheColorHint="#ff333333" - android:hapticFeedbackEnabled="false" - launcher:widthGap="@dimen/folder_width_gap" - launcher:heightGap="@dimen/folder_height_gap" - launcher:cellWidth="@dimen/folder_cell_width" - launcher:cellHeight="@dimen/folder_cell_height" /> + android:hapticFeedbackEnabled="false" /> diff --git a/res/values-land/config.xml b/res/values-land/config.xml index da9f9f9828..121bb0c146 100644 --- a/res/values-land/config.xml +++ b/res/values-land/config.xml @@ -20,11 +20,4 @@ false false - - - 6 - -1 - -1 diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml index 5edd14364d..4d94d7e621 100644 --- a/res/values-land/dimens.xml +++ b/res/values-land/dimens.xml @@ -20,39 +20,9 @@ 0dip - 64dp - 58dp -1dp - 0dp - 0dp - 12dp - 12dp - - - @dimen/cell_layout_left_padding_land - @dimen/cell_layout_right_padding_land - @dimen/cell_layout_top_padding_land - @dimen/cell_layout_bottom_padding_land - - @dimen/workspace_left_padding_land - @dimen/workspace_right_padding_land - @dimen/workspace_top_padding_land - @dimen/workspace_bottom_padding_land - - 6dp - - - 68dip - - 8dp - 0dp - 0dp - 0dp - 76dp 80dp @@ -71,14 +41,4 @@ 2 2 1 - - - - 58dp - - - @dimen/workspace_cell_width_land - @dimen/workspace_cell_height_land - @dimen/workspace_width_gap_land - @dimen/workspace_height_gap_land diff --git a/res/values-land/styles.xml b/res/values-land/styles.xml index 6c9fd504ec..ccb5fcb069 100644 --- a/res/values-land/styles.xml +++ b/res/values-land/styles.xml @@ -20,23 +20,10 @@ - diff --git a/res/values-sw340dp-port/dimens.xml b/res/values-sw340dp-port/dimens.xml index 18f28318a9..2dbcb4539c 100644 --- a/res/values-sw340dp-port/dimens.xml +++ b/res/values-sw340dp-port/dimens.xml @@ -18,18 +18,6 @@ 70dp - - 6dp - 6dp - - - 48dp - 54dp - 6dp - 6dp - 48dp - 16dp 20dp diff --git a/res/values-sw340dp/dimens.xml b/res/values-sw340dp/dimens.xml index 93de009db6..69d6e58a3b 100644 --- a/res/values-sw340dp/dimens.xml +++ b/res/values-sw340dp/dimens.xml @@ -17,26 +17,4 @@ 20dp - - - 0dp - 0dp - - 80dip - - 8dp - 8dp - 8dp - 80dp - - - 8dp - 8dp - 8dp - 8dp - 8dp - 8dp - 8dp - 8dp diff --git a/res/values-sw380dp-port/dimens.xml b/res/values-sw380dp-port/dimens.xml deleted file mode 100644 index eef6eb205b..0000000000 --- a/res/values-sw380dp-port/dimens.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - 48dp - 56dp - 8dp - 8dp - 48dp - - 8dp - 8dp - 0dp - 8dp - 0dp - 0dp - - 2dp - diff --git a/res/values-sw600dp-land/config.xml b/res/values-sw600dp-land/config.xml deleted file mode 100644 index 3e8a92b554..0000000000 --- a/res/values-sw600dp-land/config.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - 8 - -1 - -1 - diff --git a/res/values-sw600dp-land/dimens.xml b/res/values-sw600dp-land/dimens.xml index 3d4ba1c80a..7f5594de3f 100644 --- a/res/values-sw600dp-land/dimens.xml +++ b/res/values-sw600dp-land/dimens.xml @@ -15,14 +15,6 @@ --> - 0dp - 0dp - 11sp - - - 14dp - 14dp - 36dp 8dp @@ -30,13 +22,6 @@ 14dp - 82dp 12dip 20dip - - - 12dp - 12dp - 0dp - 0dp diff --git a/res/values-sw600dp-port/dimens.xml b/res/values-sw600dp-port/dimens.xml index 8ad6d2e981..7cc3c79c94 100644 --- a/res/values-sw600dp-port/dimens.xml +++ b/res/values-sw600dp-port/dimens.xml @@ -22,7 +22,4 @@ 24dp 25dp 10dp - - - 54dp diff --git a/res/values-sw600dp/config.xml b/res/values-sw600dp/config.xml index d657d4311a..2ec2f146c2 100644 --- a/res/values-sw600dp/config.xml +++ b/res/values-sw600dp/config.xml @@ -1,8 +1,5 @@ - 6 - 6 - 7 - 3 + true true @@ -11,18 +8,7 @@ -1000 - - 6 - -1 - -1 - 14000 - - - - 80 diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml index bf19e5c889..c261c00efe 100644 --- a/res/values-sw600dp/dimens.xml +++ b/res/values-sw600dp/dimens.xml @@ -16,44 +16,6 @@ 64dp - 64dp - 3dp - 4dp - - - 34dp - 48dp - 16dp - 16dp - - 48dp - - - 70dp - 70dp - -1dp - -1dp - 94dip - 14dp - 20dp - 25dp - 25dp - 104dp - - - - 68dp - 86dp - 90dp - 3dp - 3dp - 6dp - - 12dp - 12dp - 19dp - 19dp 96dp @@ -67,13 +29,4 @@ 8dp @dimen/app_widget_preview_padding_left @dimen/app_widget_preview_padding_right - - 88dp - 96dp - 88dp - 96dp - 32dp - 0dp - 0dp - 24dp diff --git a/res/values-sw720dp-port/dimens.xml b/res/values-sw720dp-port/dimens.xml index fbc0799d3b..9cf37ffee8 100644 --- a/res/values-sw720dp-port/dimens.xml +++ b/res/values-sw720dp-port/dimens.xml @@ -33,26 +33,9 @@ 40dp 24dp - 102dp - 102dp - 72dp - 72dp - - 100dp - 2 2 - - 72dp - 72dp - - - 14dp - 126dp - 126dp - 32dp - 80dp diff --git a/res/values-sw720dp/config.xml b/res/values-sw720dp/config.xml index 03e5f9ce35..4f537a9f40 100644 --- a/res/values-sw720dp/config.xml +++ b/res/values-sw720dp/config.xml @@ -1,25 +1,14 @@ - 8 - 5 - 9 - 4 true - true + true 90 - - 0 - -1 - -1 - - true + false true diff --git a/res/values-sw720dp/dimens.xml b/res/values-sw720dp/dimens.xml index 439709afda..c9639dd9d8 100644 --- a/res/values-sw720dp/dimens.xml +++ b/res/values-sw720dp/dimens.xml @@ -16,38 +16,16 @@ 72dp - 0dp - 72dp - - - 82dp - 12dp - 12dp - 12dp - 12dp - 82dp - 58dp 8dip 8dip - - 60dp - 60dp - 177dp - 177dp - - 230dp - - 52dp - 96dp 96dp -1 -1 - 4dip 196dp @@ -57,51 +35,4 @@ the drag view should be offset from the position of the original view. --> 0dp 0dp - - - 4dp - 4dp - 4dp - 4dp - 12dp - 12dp - 8dp - 8dp - - - - 96dp - 96dp - 70dp - 2dp - 2dp - 4dp - - - 0dp - 0dp - 0dp - 0dp - - @dimen/qsb_bar_height_inset - @dimen/qsb_bar_height_inset - @dimen/button_bar_height_plus_padding - @dimen/button_bar_height_plus_padding - - - 0dp - 177dp - 177dp - 0dp - 0dp - - - 96dp - 96dp - 96dp - 96dp - 50dp - 0dp - 16dp - 70dp diff --git a/res/values-sw720dp/styles.xml b/res/values-sw720dp/styles.xml index 5b24bdf466..77898d158b 100644 --- a/res/values-sw720dp/styles.xml +++ b/res/values-sw720dp/styles.xml @@ -51,43 +51,6 @@ - - - - - @@ -123,23 +86,10 @@ - - - -