summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Flynn <flynn@google.com>2012-02-29 13:33:22 -0800
committerAndrew Flynn <flynn@google.com>2012-02-29 17:30:37 -0800
commit0dca1ec41479a74f8da080224fa0c7eacab674d6 (patch)
treebad4a2d319a11c4da938122bd994485a59d0dc2a
parent79b79dd57911b9f79d4fb872e70d37ee90b0cc64 (diff)
downloadandroid_packages_apps_Trebuchet-0dca1ec41479a74f8da080224fa0c7eacab674d6.tar.gz
android_packages_apps_Trebuchet-0dca1ec41479a74f8da080224fa0c7eacab674d6.tar.bz2
android_packages_apps_Trebuchet-0dca1ec41479a74f8da080224fa0c7eacab674d6.zip
New small/large screen division for Launcher.
Previously the dp division between the two was set at 600dp (7" tablets). This has now been bumped up to 720dp (10" tablets). Change-Id: I1f0419e504fc3bb606156c1cf6fbe03956274184
-rw-r--r--res/drawable-sw600dp-hdpi/ic_allapps.pngbin0 -> 8906 bytes
-rw-r--r--res/drawable-sw600dp-hdpi/ic_allapps_pressed.pngbin0 -> 10451 bytes
-rw-r--r--res/drawable-sw600dp-mdpi/ic_allapps.pngbin0 -> 5271 bytes
-rw-r--r--res/drawable-sw600dp-mdpi/ic_allapps_pressed.pngbin0 -> 9048 bytes
-rw-r--r--res/drawable-sw600dp-xhdpi/ic_allapps.pngbin0 -> 12289 bytes
-rw-r--r--res/drawable-sw600dp-xhdpi/ic_allapps_pressed.pngbin0 -> 13531 bytes
-rw-r--r--res/layout-land/hotseat.xml2
-rw-r--r--res/layout-land/launcher.xml4
-rw-r--r--res/layout-port/hotseat.xml2
-rw-r--r--res/layout-port/launcher.xml4
-rw-r--r--res/layout-sw720dp-land/application.xml (renamed from res/layout-sw600dp-land/application.xml)0
-rw-r--r--res/layout-sw720dp-port/application.xml (renamed from res/layout-sw600dp-port/application.xml)0
-rw-r--r--res/layout-sw720dp-port/folder_cling.xml (renamed from res/layout-sw600dp-port/folder_cling.xml)0
-rw-r--r--res/layout-sw720dp-port/workspace_cling.xml (renamed from res/layout-sw600dp-port/workspace_cling.xml)0
-rw-r--r--res/layout-sw720dp/all_apps_cling.xml (renamed from res/layout-sw600dp/all_apps_cling.xml)0
-rw-r--r--res/layout-sw720dp/external_widget_drop_list_item.xml (renamed from res/layout-sw600dp/external_widget_drop_list_item.xml)0
-rw-r--r--res/layout-sw720dp/folder_cling.xml (renamed from res/layout-sw600dp/folder_cling.xml)0
-rw-r--r--res/layout-sw720dp/launcher.xml (renamed from res/layout-sw600dp/launcher.xml)0
-rw-r--r--res/layout-sw720dp/market_button.xml (renamed from res/layout-sw600dp/market_button.xml)0
-rw-r--r--res/layout-sw720dp/search_bar.xml (renamed from res/layout-sw600dp/search_bar.xml)0
-rw-r--r--res/layout-sw720dp/wallpaper_item.xml (renamed from res/layout-sw600dp/wallpaper_item.xml)0
-rw-r--r--res/layout-sw720dp/workspace.xml (renamed from res/layout-sw600dp/workspace.xml)0
-rw-r--r--res/layout-sw720dp/workspace_cling.xml (renamed from res/layout-sw600dp/workspace_cling.xml)0
-rw-r--r--res/layout-sw720dp/workspace_screen.xml (renamed from res/layout-sw600dp/workspace_screen.xml)0
-rw-r--r--res/values-sw340dp-land/dimens.xml22
-rw-r--r--res/values-sw340dp-port/dimens.xml22
-rw-r--r--res/values-sw340dp/dimens.xml24
-rw-r--r--res/values-sw600dp-land/dimens.xml39
-rw-r--r--res/values-sw600dp-port/dimens.xml34
-rw-r--r--res/values-sw600dp/config.xml26
-rw-r--r--res/values-sw600dp/dimens.xml78
-rw-r--r--res/values-sw720dp-land/dimens.xml29
-rw-r--r--res/values-sw720dp-port/dimens.xml26
-rw-r--r--res/values-sw720dp-port/styles.xml (renamed from res/values-sw600dp-port/styles.xml)0
-rw-r--r--res/values-sw720dp/config.xml22
-rw-r--r--res/values-sw720dp/dimens.xml49
-rw-r--r--res/values-sw720dp/styles.xml (renamed from res/values-sw600dp/styles.xml)0
-rw-r--r--res/values-sw720dp/wallpapers.xml (renamed from res/values-sw600dp/wallpapers.xml)0
-rw-r--r--res/values/colors.xml1
-rw-r--r--res/values/config.xml6
-rw-r--r--res/values/dimens.xml3
-rw-r--r--res/values/styles.xml6
-rw-r--r--src/com/android/launcher2/BubbleTextView.java9
-rw-r--r--src/com/android/launcher2/CellLayout.java70
-rw-r--r--src/com/android/launcher2/Hotseat.java14
-rw-r--r--src/com/android/launcher2/Launcher.java4
-rw-r--r--src/com/android/launcher2/LauncherApplication.java7
-rw-r--r--src/com/android/launcher2/LauncherModel.java3
-rw-r--r--src/com/android/launcher2/LauncherProvider.java6
-rw-r--r--src/com/android/launcher2/Utilities.java1
-rw-r--r--src/com/android/launcher2/Workspace.java9
51 files changed, 322 insertions, 200 deletions
diff --git a/res/drawable-sw600dp-hdpi/ic_allapps.png b/res/drawable-sw600dp-hdpi/ic_allapps.png
new file mode 100644
index 000000000..323d8a214
--- /dev/null
+++ b/res/drawable-sw600dp-hdpi/ic_allapps.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi/ic_allapps_pressed.png b/res/drawable-sw600dp-hdpi/ic_allapps_pressed.png
new file mode 100644
index 000000000..61f644ea6
--- /dev/null
+++ b/res/drawable-sw600dp-hdpi/ic_allapps_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/ic_allapps.png b/res/drawable-sw600dp-mdpi/ic_allapps.png
new file mode 100644
index 000000000..198ffdb7a
--- /dev/null
+++ b/res/drawable-sw600dp-mdpi/ic_allapps.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/ic_allapps_pressed.png b/res/drawable-sw600dp-mdpi/ic_allapps_pressed.png
new file mode 100644
index 000000000..434f10c7d
--- /dev/null
+++ b/res/drawable-sw600dp-mdpi/ic_allapps_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi/ic_allapps.png b/res/drawable-sw600dp-xhdpi/ic_allapps.png
new file mode 100644
index 000000000..776225dbf
--- /dev/null
+++ b/res/drawable-sw600dp-xhdpi/ic_allapps.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi/ic_allapps_pressed.png b/res/drawable-sw600dp-xhdpi/ic_allapps_pressed.png
new file mode 100644
index 000000000..d06c8c3d1
--- /dev/null
+++ b/res/drawable-sw600dp-xhdpi/ic_allapps_pressed.png
Binary files differ
diff --git a/res/layout-land/hotseat.xml b/res/layout-land/hotseat.xml
index c0c87aff7..6802ea007 100644
--- a/res/layout-land/hotseat.xml
+++ b/res/layout-land/hotseat.xml
@@ -18,7 +18,7 @@
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:background="@drawable/hotseat_bg_panel"
launcher:cellCountX="1"
- launcher:cellCountY="5">
+ launcher:cellCountY="@integer/hotseat_cell_count">
<com.android.launcher2.CellLayout
android:id="@+id/layout"
android:layout_width="wrap_content"
diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml
index c11c788d2..0c1a1955a 100644
--- a/res/layout-land/launcher.xml
+++ b/res/layout-land/launcher.xml
@@ -30,8 +30,8 @@
android:paddingLeft="@dimen/qsb_bar_height"
android:paddingRight="@dimen/button_bar_height"
launcher:defaultScreen="2"
- launcher:cellCountX="4"
- launcher:cellCountY="4"
+ 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">
diff --git a/res/layout-port/hotseat.xml b/res/layout-port/hotseat.xml
index 035d95884..b93704339 100644
--- a/res/layout-port/hotseat.xml
+++ b/res/layout-port/hotseat.xml
@@ -17,7 +17,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:background="@drawable/hotseat_bg_panel"
- launcher:cellCountX="5"
+ launcher:cellCountX="@integer/hotseat_cell_count"
launcher:cellCountY="1">
<com.android.launcher2.CellLayout
android:id="@+id/layout"
diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml
index 062656fa2..a50b69686 100644
--- a/res/layout-port/launcher.xml
+++ b/res/layout-port/launcher.xml
@@ -47,8 +47,8 @@
android:paddingTop="@dimen/qsb_bar_height_inset"
android:paddingBottom="@dimen/button_bar_height"
launcher:defaultScreen="2"
- launcher:cellCountX="4"
- launcher:cellCountY="4"
+ launcher:cellCountX="@integer/cell_count_x"
+ launcher:cellCountY="@integer/cell_count_y"
launcher:pageSpacing="@dimen/workspace_page_spacing"
launcher:scrollIndicatorPaddingLeft="@dimen/workspace_divider_padding_left"
launcher:scrollIndicatorPaddingRight="@dimen/workspace_divider_padding_right">
diff --git a/res/layout-sw600dp-land/application.xml b/res/layout-sw720dp-land/application.xml
index 9393f7e40..9393f7e40 100644
--- a/res/layout-sw600dp-land/application.xml
+++ b/res/layout-sw720dp-land/application.xml
diff --git a/res/layout-sw600dp-port/application.xml b/res/layout-sw720dp-port/application.xml
index af7a8a4df..af7a8a4df 100644
--- a/res/layout-sw600dp-port/application.xml
+++ b/res/layout-sw720dp-port/application.xml
diff --git a/res/layout-sw600dp-port/folder_cling.xml b/res/layout-sw720dp-port/folder_cling.xml
index 017d0fde9..017d0fde9 100644
--- a/res/layout-sw600dp-port/folder_cling.xml
+++ b/res/layout-sw720dp-port/folder_cling.xml
diff --git a/res/layout-sw600dp-port/workspace_cling.xml b/res/layout-sw720dp-port/workspace_cling.xml
index 2eae0fc93..2eae0fc93 100644
--- a/res/layout-sw600dp-port/workspace_cling.xml
+++ b/res/layout-sw720dp-port/workspace_cling.xml
diff --git a/res/layout-sw600dp/all_apps_cling.xml b/res/layout-sw720dp/all_apps_cling.xml
index 7079b2107..7079b2107 100644
--- a/res/layout-sw600dp/all_apps_cling.xml
+++ b/res/layout-sw720dp/all_apps_cling.xml
diff --git a/res/layout-sw600dp/external_widget_drop_list_item.xml b/res/layout-sw720dp/external_widget_drop_list_item.xml
index 84f40eddf..84f40eddf 100644
--- a/res/layout-sw600dp/external_widget_drop_list_item.xml
+++ b/res/layout-sw720dp/external_widget_drop_list_item.xml
diff --git a/res/layout-sw600dp/folder_cling.xml b/res/layout-sw720dp/folder_cling.xml
index 4188804c2..4188804c2 100644
--- a/res/layout-sw600dp/folder_cling.xml
+++ b/res/layout-sw720dp/folder_cling.xml
diff --git a/res/layout-sw600dp/launcher.xml b/res/layout-sw720dp/launcher.xml
index 94c69a683..94c69a683 100644
--- a/res/layout-sw600dp/launcher.xml
+++ b/res/layout-sw720dp/launcher.xml
diff --git a/res/layout-sw600dp/market_button.xml b/res/layout-sw720dp/market_button.xml
index 4ccecd92c..4ccecd92c 100644
--- a/res/layout-sw600dp/market_button.xml
+++ b/res/layout-sw720dp/market_button.xml
diff --git a/res/layout-sw600dp/search_bar.xml b/res/layout-sw720dp/search_bar.xml
index ebaf96001..ebaf96001 100644
--- a/res/layout-sw600dp/search_bar.xml
+++ b/res/layout-sw720dp/search_bar.xml
diff --git a/res/layout-sw600dp/wallpaper_item.xml b/res/layout-sw720dp/wallpaper_item.xml
index 9461e3b55..9461e3b55 100644
--- a/res/layout-sw600dp/wallpaper_item.xml
+++ b/res/layout-sw720dp/wallpaper_item.xml
diff --git a/res/layout-sw600dp/workspace.xml b/res/layout-sw720dp/workspace.xml
index 327afaf00..327afaf00 100644
--- a/res/layout-sw600dp/workspace.xml
+++ b/res/layout-sw720dp/workspace.xml
diff --git a/res/layout-sw600dp/workspace_cling.xml b/res/layout-sw720dp/workspace_cling.xml
index 264b1e000..264b1e000 100644
--- a/res/layout-sw600dp/workspace_cling.xml
+++ b/res/layout-sw720dp/workspace_cling.xml
diff --git a/res/layout-sw600dp/workspace_screen.xml b/res/layout-sw720dp/workspace_screen.xml
index 52f9defd9..52f9defd9 100644
--- a/res/layout-sw600dp/workspace_screen.xml
+++ b/res/layout-sw720dp/workspace_screen.xml
diff --git a/res/values-sw340dp-land/dimens.xml b/res/values-sw340dp-land/dimens.xml
index b469ac08e..facbf5669 100644
--- a/res/values-sw340dp-land/dimens.xml
+++ b/res/values-sw340dp-land/dimens.xml
@@ -19,30 +19,8 @@
<dimen name="folderClingMarginTop">50dp</dimen>
<!-- Workspace -->
- <dimen name="workspace_width_gap">0dp</dimen>
- <dimen name="workspace_height_gap">0dp</dimen>
- <dimen name="workspace_top_padding">8dp</dimen>
- <dimen name="workspace_bottom_padding">8dp</dimen>
- <dimen name="workspace_left_padding">8dp</dimen>
- <dimen name="workspace_right_padding">8dp</dimen>
<dimen name="workspace_divider_padding_top">6dp</dimen>
<dimen name="workspace_divider_padding_bottom">6dp</dimen>
- <dimen name="hotseat_width_gap">0dp</dimen>
- <dimen name="hotseat_height_gap">0dp</dimen>
- <dimen name="hotseat_top_padding">-1dp</dimen>
- <dimen name="hotseat_bottom_padding">-1dp</dimen>
- <dimen name="hotseat_left_padding">-1dp</dimen>
- <dimen name="hotseat_right_padding">-1dp</dimen>
-
<dimen name="qsb_bar_height">48dp</dimen>
- <!-- height of the bottom row of controls -->
- <dimen name="button_bar_height">80dip</dimen>
- <!-- Because portal animations go beyond the bounds of an icon, we need
- to make the dock layout slightly larger than the button_bar_height -->
- <dimen name="button_bar_height_top_padding">8dp</dimen>
- <dimen name="button_bar_height_bottom_padding">8dp</dimen>
- <dimen name="button_bar_width_left_padding">8dp</dimen>
- <dimen name="button_bar_width_right_padding">8dp</dimen>
- <dimen name="button_bar_height_plus_padding">80dp</dimen>
</resources>
diff --git a/res/values-sw340dp-port/dimens.xml b/res/values-sw340dp-port/dimens.xml
index bf7ebc3d5..18f28318a 100644
--- a/res/values-sw340dp-port/dimens.xml
+++ b/res/values-sw340dp-port/dimens.xml
@@ -19,22 +19,9 @@
<dimen name="folderClingMarginTop">70dp</dimen>
<!-- Workspace -->
- <dimen name="workspace_width_gap">0dp</dimen>
- <dimen name="workspace_height_gap">0dp</dimen>
- <dimen name="workspace_top_padding">8dp</dimen>
- <dimen name="workspace_bottom_padding">8dp</dimen>
- <dimen name="workspace_left_padding">8dp</dimen>
- <dimen name="workspace_right_padding">8dp</dimen>
<dimen name="workspace_divider_padding_left">6dp</dimen>
<dimen name="workspace_divider_padding_right">6dp</dimen>
- <dimen name="hotseat_width_gap">0dp</dimen>
- <dimen name="hotseat_height_gap">0dp</dimen>
- <dimen name="hotseat_top_padding">-1dp</dimen>
- <dimen name="hotseat_bottom_padding">-1dp</dimen>
- <dimen name="hotseat_left_padding">-1dp</dimen>
- <dimen name="hotseat_right_padding">-1dp</dimen>
-
<!-- qsb_bar_height_inset represents qsb_bar_height minus the padding
that we put on each page for allowing folders to draw out of bounds -->
<dimen name="qsb_bar_height_inset">48dp</dimen>
@@ -42,15 +29,6 @@
<dimen name="qsb_padding_left">6dp</dimen>
<dimen name="qsb_padding_right">6dp</dimen>
<dimen name="search_bar_height">48dp</dimen>
- <!-- height of the bottom row of controls -->
- <dimen name="button_bar_height">80dip</dimen>
- <!-- Because portal animations go beyond the bounds of an icon, we need
- to make the dock layout slightly larger than the button_bar_height -->
- <dimen name="button_bar_height_top_padding">8dp</dimen>
- <dimen name="button_bar_height_bottom_padding">8dp</dimen>
- <dimen name="button_bar_width_left_padding">8dp</dimen>
- <dimen name="button_bar_width_right_padding">8dp</dimen>
- <dimen name="button_bar_height_plus_padding">80dp</dimen>
<!-- AppsCustomize -->
<dimen name="apps_customize_pageLayoutPaddingTop">16dp</dimen>
diff --git a/res/values-sw340dp/dimens.xml b/res/values-sw340dp/dimens.xml
index 69d6e58a3..d26156922 100644
--- a/res/values-sw340dp/dimens.xml
+++ b/res/values-sw340dp/dimens.xml
@@ -17,4 +17,28 @@
<resources>
<!-- Drag padding to add to the bottom of drop targets -->
<dimen name="drop_target_drag_padding">20dp</dimen>
+
+<!-- Workspace -->
+ <dimen name="workspace_width_gap">0dp</dimen>
+ <dimen name="workspace_height_gap">0dp</dimen>
+ <dimen name="workspace_top_padding">8dp</dimen>
+ <dimen name="workspace_bottom_padding">8dp</dimen>
+ <dimen name="workspace_left_padding">8dp</dimen>
+ <dimen name="workspace_right_padding">8dp</dimen>
+
+<!-- Hotseat -->
+ <dimen name="hotseat_width_gap">0dp</dimen>
+ <dimen name="hotseat_height_gap">0dp</dimen>
+ <dimen name="hotseat_top_padding">-1dp</dimen>
+ <dimen name="hotseat_bottom_padding">-1dp</dimen>
+ <dimen name="hotseat_left_padding">-1dp</dimen>
+ <dimen name="hotseat_right_padding">-1dp</dimen>
+ <!-- height of the bottom row of controls -->
+ <dimen name="button_bar_height">80dip</dimen>
+ <!-- Because portal animations go beyond the bounds of an icon, we need
+ to make the dock layout slightly larger than the button_bar_height -->
+ <dimen name="button_bar_height_bottom_padding">8dp</dimen>
+ <dimen name="button_bar_width_left_padding">8dp</dimen>
+ <dimen name="button_bar_width_right_padding">8dp</dimen>
+ <dimen name="button_bar_height_plus_padding">80dp</dimen>
</resources>
diff --git a/res/values-sw600dp-land/dimens.xml b/res/values-sw600dp-land/dimens.xml
index 42c435379..0e7d63cd2 100644
--- a/res/values-sw600dp-land/dimens.xml
+++ b/res/values-sw600dp-land/dimens.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source Project
+<!-- Copyright (C) 2009 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.
@@ -15,33 +15,28 @@
-->
<resources>
+ <dimen name="app_icon_size">65dp</dimen>
+ <dimen name="app_icon_padding_top">2dp</dimen>
+
+<!-- Hotseat -->
+ <dimen name="hotseat_cell_width">75dp</dimen>
+ <dimen name="hotseat_cell_height">85dp</dimen>
+
<!-- Workspace -->
- <dimen name="workspace_left_padding">24dip</dimen>
- <dimen name="workspace_right_padding">24dip</dimen>
- <!-- We need padding on the screens for portals to look right -->
- <dimen name="workspace_top_padding">12dip</dimen>
- <dimen name="workspace_bottom_padding">12dip</dimen>
+ <dimen name="workspace_cell_width">96dp</dimen>
+ <dimen name="workspace_cell_height">86dp</dimen>
<dimen name="workspace_width_gap">32dp</dimen>
- <dimen name="workspace_height_gap">2dp</dimen>
- <dimen name="workspace_page_spacing">50dp</dimen>
+ <dimen name="workspace_height_gap">0dp</dimen>
- <!-- the area at the edge of the screen that makes the workspace go left
- or right while you're dragging. -->
- <dimen name="scroll_zone">100dip</dimen>
+<!-- Folders -->
+ <!-- The size of the image which sits behind the preview of the folder contents -->
+ <dimen name="folder_preview_size">70dp</dimen>
+ <dimen name="folder_cell_width">86dp</dimen>
+ <dimen name="folder_cell_height">86dp</dimen>
+<!-- AppsCustomize -->
<dimen name="apps_customize_pageLayoutWidthGap">36dp</dimen>
<dimen name="apps_customize_pageLayoutHeightGap">8dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingTop">20dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingBottom">14dp</dimen>
- <dimen name="apps_customize_pageLayoutPaddingLeft">30dp</dimen>
- <dimen name="apps_customize_pageLayoutPaddingRight">30dp</dimen>
- <integer name="apps_customize_widget_cell_count_x">3</integer>
- <integer name="apps_customize_widget_cell_count_y">2</integer>
- <integer name="apps_customize_cling_focused_x">4</integer>
- <integer name="apps_customize_cling_focused_y">2</integer>
-
-<!-- Cling -->
- <!-- The offset for the text in the cling -->
- <dimen name="cling_text_block_offset_x">140dp</dimen>
- <dimen name="cling_text_block_offset_y">80dp</dimen>
</resources>
diff --git a/res/values-sw600dp-port/dimens.xml b/res/values-sw600dp-port/dimens.xml
index 5de73b641..8e8455d0e 100644
--- a/res/values-sw600dp-port/dimens.xml
+++ b/res/values-sw600dp-port/dimens.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source Project
+<!-- Copyright (C) 2009 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.
@@ -15,36 +15,20 @@
-->
<resources>
-<!-- AppsCustomize -->
- <dimen name="apps_customize_cell_width">96dp</dimen>
- <dimen name="apps_customize_cell_height">96dp</dimen>
-
<!-- Workspace -->
- <!-- the area at the edge of the screen that makes the workspace go left
- or right while you're dragging. -->
- <dimen name="scroll_zone">40dp</dimen>
-
- <dimen name="workspace_left_padding">15dip</dimen>
- <dimen name="workspace_right_padding">15dip</dimen>
- <dimen name="workspace_top_padding">25dip</dimen>
- <dimen name="workspace_bottom_padding">25dip</dimen>
<dimen name="workspace_width_gap">0dp</dimen>
<dimen name="workspace_height_gap">32dp</dimen>
- <dimen name="workspace_page_spacing">16dp</dimen>
+<!-- AppsCustomize -->
+ <dimen name="apps_customize_cell_width">96dp</dimen>
+ <dimen name="apps_customize_cell_height">96dp</dimen>
<dimen name="apps_customize_pageLayoutWidthGap">24dp</dimen>
<dimen name="apps_customize_pageLayoutHeightGap">36dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingTop">25dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingBottom">10dp</dimen>
- <dimen name="apps_customize_pageLayoutPaddingLeft">30dp</dimen>
- <dimen name="apps_customize_pageLayoutPaddingRight">30dp</dimen>
- <integer name="apps_customize_widget_cell_count_x">2</integer>
- <integer name="apps_customize_widget_cell_count_y">3</integer>
- <integer name="apps_customize_cling_focused_x">2</integer>
- <integer name="apps_customize_cling_focused_y">2</integer>
-<!-- Cling -->
- <!-- The offset for the text in the cling -->
- <dimen name="cling_text_block_offset_x">80dp</dimen>
- <dimen name="cling_text_block_offset_y">160dp</dimen>
-</resources> \ No newline at end of file
+<!-- Hotseat -->
+ <dimen name="hotseat_cell_width">75dp</dimen>
+ <dimen name="hotseat_cell_height">75dp</dimen>
+
+</resources>
diff --git a/res/values-sw600dp/config.xml b/res/values-sw600dp/config.xml
index 7a0789839..a701e69d1 100644
--- a/res/values-sw600dp/config.xml
+++ b/res/values-sw600dp/config.xml
@@ -1,26 +1,12 @@
<resources>
- <bool name="config_largeHeap">true</bool>
-
-<!-- AllApps/Customize/AppsCustomize -->
- <!-- Out of 100, the percent to shrink the workspace during spring loaded mode. -->
- <integer name="config_workspaceSpringLoadShrinkPercentage">90</integer>
-
-<!-- Workspace -->
- <!-- Whether or not the drop targets drop down as opposed to fade in -->
- <bool name="config_useDropTargetDownTransition">true</bool>
- <!-- Whether or not to fade the side pages -->
- <bool name="config_workspaceFadeAdjacentScreens">true</bool>
-
- <!-- When dragging items on the workspace, how much bigger (in pixels) the dragged view
- should be, as compared to the original view. If 0, it will not be scaled at all.
- Should be an even number, for pixel alignment. -->
- <integer name="config_dragViewExtraPixels">0</integer>
-
- <!-- When shrinking the workspace, this is the percentage of its original size. -->
- <integer name="config_workspaceShrinkPercent">17</integer>
+ <integer name="cell_count_x">6</integer>
+ <integer name="cell_count_y">6</integer>
+ <integer name="hotseat_cell_count">7</integer>
+ <integer name="hotseat_all_apps_index">3</integer>
+<!-- Folders -->
<!-- Folder max bounds and max number of items. Note: folder_max_count_x * folder_max_count_y
- >= folder_max_num_items. When these are set to -1, they are automatically determined. -->
+ >= folder_max_num_items. When these are set to -1, they are automatically determined. -->
<integer name="folder_max_count_x">-1</integer>
<integer name="folder_max_count_y">-1</integer>
<integer name="folder_max_num_items">-1</integer>
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
index d265c369c..a0d7ec86f 100644
--- a/res/values-sw600dp/dimens.xml
+++ b/res/values-sw600dp/dimens.xml
@@ -15,67 +15,39 @@
-->
<resources>
-<!-- QSB -->
- <dimen name="toolbar_button_vertical_padding">12dip</dimen>
- <dimen name="toolbar_button_horizontal_padding">12dip</dimen>
+ <dimen name="app_icon_size">72dp</dimen>
+ <integer name="app_icon_hotseat_scale_percent">78</integer>
+ <dimen name="app_icon_drawable_padding">3dp</dimen>
+ <dimen name="app_icon_padding_top">4dp</dimen>
<!-- Workspace -->
- <dimen name="qsb_bar_height">56dp</dimen>
- <!-- This should be @dimen/qsb_bar_height - @dimen/workspace_top_padding
- to fix the extra space given to draw portals -->
- <dimen name="workspace_content_large_only_top_margin">36dp</dimen>
- <dimen name="workspace_cell_width">96dip</dimen>
- <dimen name="workspace_cell_height">96dip</dimen>
+ <dimen name="workspace_cell_width">96dp</dimen>
+ <dimen name="workspace_cell_height">96dp</dimen>
+
+<!-- Hotseat -->
+ <dimen name="hotseat_width_gap">-1dp</dimen>
+ <dimen name="hotseat_height_gap">-1dp</dimen>
+ <dimen name="button_bar_height">94dip</dimen>
+ <dimen name="button_bar_height_bottom_padding">9dp</dimen>
+ <dimen name="button_bar_height_top_padding">9dp</dimen>
+ <dimen name="button_bar_width_left_padding">9dp</dimen>
+ <dimen name="button_bar_width_right_padding">9dp</dimen>
+ <dimen name="button_bar_height_plus_padding">94dp</dimen>
+
+<!-- Folders -->
+ <!-- The size of the image which sits behind the preview of the folder contents -->
+ <dimen name="folder_preview_size">75dp</dimen>
<dimen name="folder_cell_width">96dp</dimen>
<dimen name="folder_cell_height">96dp</dimen>
-
- <dimen name="app_icon_padding_top">4dp</dimen>
+ <dimen name="folder_icon_padding_top">0dp</dimen>
<!-- AppsCustomize -->
- <dimen name="apps_customize_tab_bar_height">60dp</dimen>
- <dimen name="apps_customize_tab_bar_margin_top">8dp</dimen>
<dimen name="apps_customize_cell_width">96dp</dimen>
<dimen name="apps_customize_cell_height">98dp</dimen>
+ <dimen name="apps_customize_pageLayoutPaddingLeft">10dp</dimen>
+ <dimen name="apps_customize_pageLayoutPaddingRight">10dp</dimen>
+ <dimen name="apps_customize_tab_bar_height">60dp</dimen>
+ <dimen name="apps_customize_tab_bar_margin_top">8dp</dimen>
<dimen name="apps_customize_widget_cell_width_gap">36dp</dimen>
<dimen name="apps_customize_widget_cell_height_gap">36dp</dimen>
-
- <!-- The corner radius to draw the external drop icon rounded rect -->
- <dimen name="external_drop_icon_rect_radius">10dp</dimen>
-
- <!-- Size of icons in workspace -->
- <dimen name="app_icon_size">72dp</dimen>
-
- <!-- extra horizontal spacing between mini screen thumbnails ie. in all
- apps and in customization mode -->
- <dimen name="smallScreenExtraSpacing">0dip</dimen>
-
- <!-- Vertical spacing between edge of screen and mini cell layouts when they
- are minimized to the bottom in all apps -->
- <dimen name="allAppsSmallScreenVerticalMarginLandscape">30dip</dimen>
- <dimen name="allAppsSmallScreenVerticalMarginPortrait">60dip</dimen>
-
- <dimen name="all_apps_button_vertical_padding">4dip</dimen>
-
- <!-- roughly a status bar (for determining how many rows of icons are in home) -->
- <dimen name="status_bar_height">48dip</dimen>
-
- <!-- dimensions for the wallpaper picker wallpaper thumbnail width -->
- <dimen name="wallpaper_chooser_grid_width">196dp</dimen>
- <dimen name="wallpaper_chooser_grid_height">140dp</dimen>
- <dimen name="live_wallpaper_grid_item_padding">8dip</dimen>
-
- <!-- How much the content view of an alert dialog should be inset (currently used
- for the WallpaperChooser in XLarge mode) -->
- <dimen name="alert_dialog_content_inset">0dp</dimen>
-
- <!-- When dragging items on the workspace, the number of dps by which the position of
- the drag view should be offset from the position of the original view. -->
- <dimen name="dragViewOffsetX">0dp</dimen>
- <dimen name="dragViewOffsetY">-12dp</dimen>
-
-<!-- Folders -->
- <!-- The size of the image which sits behind the preview of the folder contents -->
- <dimen name="folder_preview_size">78dp</dimen>
- <!-- The amount that the preview contents are inset from the preview background -->
- <dimen name="folder_preview_padding">4dp</dimen>
</resources>
diff --git a/res/values-sw720dp-land/dimens.xml b/res/values-sw720dp-land/dimens.xml
index 239bdf5c1..e7fe32cb6 100644
--- a/res/values-sw720dp-land/dimens.xml
+++ b/res/values-sw720dp-land/dimens.xml
@@ -15,12 +15,33 @@
-->
<resources>
- <integer name="apps_customize_widget_cell_count_x">4</integer>
- <integer name="apps_customize_widget_cell_count_y">2</integer>
-
<!-- AppsCustomize -->
<dimen name="apps_customize_pageLayoutWidthGap">28dp</dimen>
<dimen name="apps_customize_pageLayoutHeightGap">16dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingLeft">16dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingRight">16dp</dimen>
-</resources> \ No newline at end of file
+
+<!-- Workspace -->
+ <dimen name="workspace_left_padding">24dip</dimen>
+ <dimen name="workspace_right_padding">24dip</dimen>
+ <!-- We need padding on the screens for portals to look right -->
+ <dimen name="workspace_top_padding">12dip</dimen>
+ <dimen name="workspace_bottom_padding">12dip</dimen>
+ <dimen name="workspace_width_gap">32dp</dimen>
+ <dimen name="workspace_height_gap">2dp</dimen>
+ <dimen name="workspace_page_spacing">50dp</dimen>
+
+ <!-- the area at the edge of the screen that makes the workspace go left
+ or right while you're dragging. -->
+ <dimen name="scroll_zone">100dip</dimen>
+
+ <integer name="apps_customize_widget_cell_count_x">4</integer>
+ <integer name="apps_customize_widget_cell_count_y">2</integer>
+ <integer name="apps_customize_cling_focused_x">4</integer>
+ <integer name="apps_customize_cling_focused_y">2</integer>
+
+<!-- Cling -->
+ <!-- The offset for the text in the cling -->
+ <dimen name="cling_text_block_offset_x">140dp</dimen>
+ <dimen name="cling_text_block_offset_y">80dp</dimen>
+</resources>
diff --git a/res/values-sw720dp-port/dimens.xml b/res/values-sw720dp-port/dimens.xml
index 52c105d1b..2e0d74a3c 100644
--- a/res/values-sw720dp-port/dimens.xml
+++ b/res/values-sw720dp-port/dimens.xml
@@ -15,9 +15,6 @@
-->
<resources>
-<!-- Workspace -->
- <dimen name="workspace_page_spacing">24dp</dimen>
-
<!-- AppsCustomize -->
<integer name="apps_customize_maxCellCountX">-1</integer>
<integer name="apps_customize_maxCellCountY">7</integer>
@@ -29,4 +26,25 @@
xlarge -->
<integer name="apps_customize_widget_cell_count_x">3</integer>
<integer name="apps_customize_widget_cell_count_y">3</integer>
-</resources> \ No newline at end of file
+
+<!-- Workspace -->
+ <!-- the area at the edge of the screen that makes the workspace go left
+ or right while you're dragging. -->
+ <dimen name="scroll_zone">40dp</dimen>
+
+ <dimen name="workspace_left_padding">15dip</dimen>
+ <dimen name="workspace_right_padding">15dip</dimen>
+ <dimen name="workspace_top_padding">25dip</dimen>
+ <dimen name="workspace_bottom_padding">25dip</dimen>
+ <dimen name="workspace_width_gap">0dp</dimen>
+ <dimen name="workspace_height_gap">32dp</dimen>
+ <dimen name="workspace_page_spacing">24dp</dimen>
+
+ <integer name="apps_customize_cling_focused_x">2</integer>
+ <integer name="apps_customize_cling_focused_y">2</integer>
+
+<!-- Cling -->
+ <!-- The offset for the text in the cling -->
+ <dimen name="cling_text_block_offset_x">80dp</dimen>
+ <dimen name="cling_text_block_offset_y">160dp</dimen>
+</resources>
diff --git a/res/values-sw600dp-port/styles.xml b/res/values-sw720dp-port/styles.xml
index 57f07acaf..57f07acaf 100644
--- a/res/values-sw600dp-port/styles.xml
+++ b/res/values-sw720dp-port/styles.xml
diff --git a/res/values-sw720dp/config.xml b/res/values-sw720dp/config.xml
new file mode 100644
index 000000000..8141283b8
--- /dev/null
+++ b/res/values-sw720dp/config.xml
@@ -0,0 +1,22 @@
+<resources>
+ <bool name="config_largeHeap">true</bool>
+ <bool name="is_large_screen">true</bool>
+
+<!-- AllApps/Customize/AppsCustomize -->
+ <!-- Out of 100, the percent to shrink the workspace during spring loaded mode. -->
+ <integer name="config_workspaceSpringLoadShrinkPercentage">90</integer>
+
+<!-- Workspace -->
+ <!-- Whether or not the drop targets drop down as opposed to fade in -->
+ <bool name="config_useDropTargetDownTransition">true</bool>
+ <!-- Whether or not to fade the side pages -->
+ <bool name="config_workspaceFadeAdjacentScreens">true</bool>
+
+ <!-- When dragging items on the workspace, how much bigger (in pixels) the dragged view
+ should be, as compared to the original view. If 0, it will not be scaled at all.
+ Should be an even number, for pixel alignment. -->
+ <integer name="config_dragViewExtraPixels">0</integer>
+
+ <!-- When shrinking the workspace, this is the percentage of its original size. -->
+ <integer name="config_workspaceShrinkPercent">17</integer>
+</resources>
diff --git a/res/values-sw720dp/dimens.xml b/res/values-sw720dp/dimens.xml
index 48faf9ab7..d5f411ce1 100644
--- a/res/values-sw720dp/dimens.xml
+++ b/res/values-sw720dp/dimens.xml
@@ -15,9 +15,56 @@
-->
<resources>
+<!-- QSB -->
+ <dimen name="toolbar_button_vertical_padding">12dip</dimen>
+ <dimen name="toolbar_button_horizontal_padding">12dip</dimen>
+
+<!-- Workspace -->
+ <dimen name="qsb_bar_height">56dp</dimen>
+ <!-- This should be @dimen/qsb_bar_height - @dimen/workspace_top_padding
+ to fix the extra space given to draw portals -->
+ <dimen name="workspace_content_large_only_top_margin">36dp</dimen>
+ <dimen name="workspace_cell_width">96dip</dimen>
+ <dimen name="workspace_cell_height">96dip</dimen>
+
<!-- AppsCustomize -->
<integer name="apps_customize_maxCellCountX">-1</integer>
<integer name="apps_customize_maxCellCountY">-1</integer>
<dimen name="app_widget_preview_padding_left">0dp</dimen>
<dimen name="app_widget_preview_padding_top">10dp</dimen>
-</resources> \ No newline at end of file
+
+ <!-- The corner radius to draw the external drop icon rounded rect -->
+ <dimen name="external_drop_icon_rect_radius">10dp</dimen>
+
+ <!-- Size of icons in workspace -->
+ <dimen name="app_icon_size">72dp</dimen>
+ <integer name="app_icon_hotseat_scale_percent">-1</integer>
+
+ <!-- extra horizontal spacing between mini screen thumbnails ie. in all
+ apps and in customization mode -->
+ <dimen name="smallScreenExtraSpacing">0dip</dimen>
+
+ <!-- Vertical spacing between edge of screen and mini cell layouts when they
+ are minimized to the bottom in all apps -->
+ <dimen name="allAppsSmallScreenVerticalMarginLandscape">30dip</dimen>
+ <dimen name="allAppsSmallScreenVerticalMarginPortrait">60dip</dimen>
+
+ <dimen name="all_apps_button_vertical_padding">4dip</dimen>
+
+ <!-- roughly a status bar (for determining how many rows of icons are in home) -->
+ <dimen name="status_bar_height">48dip</dimen>
+
+ <!-- dimensions for the wallpaper picker wallpaper thumbnail width -->
+ <dimen name="wallpaper_chooser_grid_width">196dp</dimen>
+ <dimen name="wallpaper_chooser_grid_height">140dp</dimen>
+ <dimen name="live_wallpaper_grid_item_padding">8dip</dimen>
+
+ <!-- How much the content view of an alert dialog should be inset (currently used
+ for the WallpaperChooser in XLarge mode) -->
+ <dimen name="alert_dialog_content_inset">0dp</dimen>
+
+ <!-- When dragging items on the workspace, the number of dps by which the position of
+ the drag view should be offset from the position of the original view. -->
+ <dimen name="dragViewOffsetX">0dp</dimen>
+ <dimen name="dragViewOffsetY">-12dp</dimen>
+</resources>
diff --git a/res/values-sw600dp/styles.xml b/res/values-sw720dp/styles.xml
index 87110da9f..87110da9f 100644
--- a/res/values-sw600dp/styles.xml
+++ b/res/values-sw720dp/styles.xml
diff --git a/res/values-sw600dp/wallpapers.xml b/res/values-sw720dp/wallpapers.xml
index fb386f491..fb386f491 100644
--- a/res/values-sw600dp/wallpapers.xml
+++ b/res/values-sw720dp/wallpapers.xml
diff --git a/res/values/colors.xml b/res/values/colors.xml
index ece0fd895..9c1206902 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -32,4 +32,5 @@
<color name="workspace_all_apps_and_delete_zone_text_color">#CCFFFFFF</color>
<color name="workspace_all_apps_and_delete_zone_text_shadow_color">#A0000000</color>
+ <color name="workspace_icon_text_color">#FFF</color>
</resources>
diff --git a/res/values/config.xml b/res/values/config.xml
index 7ab98707c..9ea7b9ad3 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -1,6 +1,7 @@
<resources>
<bool name="config_hardwareAccelerated">true</bool>
<bool name="config_largeHeap">false</bool>
+ <bool name="is_large_screen">false</bool>
<!-- AllApps/Customize/AppsCustomize -->
<!-- The alpha of the AppsCustomize bg in spring loaded mode -->
@@ -90,4 +91,9 @@
<integer name="folder_max_count_x">4</integer>
<integer name="folder_max_count_y">4</integer>
<integer name="folder_max_num_items">16</integer>
+
+ <integer name="cell_count_x">4</integer>
+ <integer name="cell_count_y">4</integer>
+ <integer name="hotseat_cell_count">5</integer>
+ <integer name="hotseat_all_apps_index">2</integer>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index fe0cb00fa..4ed16893e 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -37,6 +37,7 @@
<dimen name="workspace_max_gap">16dp</dimen>
<dimen name="folder_cell_width">74dp</dimen>
<dimen name="folder_cell_height">82dp</dimen>
+ <dimen name="folder_icon_padding_top">2dp</dimen>
<dimen name="workspace_divider_padding_left">3dp</dimen>
<dimen name="workspace_divider_padding_right">3dp</dimen>
<dimen name="workspace_divider_padding_top">0dp</dimen>
@@ -47,6 +48,7 @@
<dimen name="hotseat_height_gap">-1dp</dimen>
<dimen name="workspace_overscroll_drawable_padding">0dp</dimen>
+ <dimen name="app_icon_drawable_padding">6dp</dimen>
<dimen name="app_icon_padding_top">8dp</dimen>
<!-- QSB -->
@@ -64,6 +66,7 @@
<dimen name="apps_customize_tab_bar_height">52dp</dimen>
<dimen name="apps_customize_tab_bar_margin_top">0dp</dimen>
<dimen name="app_icon_size">48dp</dimen>
+ <integer name="app_icon_hotseat_scale_percent">-1</integer>
<!-- The width can be 72dp because we don't have L/R padding -->
<dimen name="apps_customize_cell_width">74dp</dimen>
<dimen name="apps_customize_cell_height">82dp</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 909887c44..f5224d2eb 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -63,13 +63,13 @@
<item name="android:singleLine">true</item>
<item name="android:ellipsize">marquee</item>
<item name="android:textSize">12sp</item>
- <item name="android:textColor">#FFF</item>
+ <item name="android:textColor">@color/workspace_icon_text_color</item>
<item name="android:shadowRadius">2.0</item>
<item name="android:shadowColor">#B0000000</item>
</style>
<style name="WorkspaceIcon.Portrait">
- <item name="android:drawablePadding">8dp</item>
+ <item name="android:drawablePadding">@dimen/app_icon_drawable_padding</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:paddingRight">4dp</item>
<item name="android:paddingTop">@dimen/app_icon_padding_top</item>
@@ -86,7 +86,7 @@
<style name="WorkspaceIcon.Portrait.Folder">
<item name="android:drawablePadding">0dp</item>
- <item name="android:paddingTop">2dp</item>
+ <item name="android:paddingTop">@dimen/folder_icon_padding_top</item>
</style>
<style name="WorkspaceIcon.Landscape.Folder">
<item name="android:drawablePadding">0dp</item>
diff --git a/src/com/android/launcher2/BubbleTextView.java b/src/com/android/launcher2/BubbleTextView.java
index dc498a403..ad3954124 100644
--- a/src/com/android/launcher2/BubbleTextView.java
+++ b/src/com/android/launcher2/BubbleTextView.java
@@ -176,6 +176,7 @@ public class BubbleTextView extends TextView {
// The translate of scrollX and scrollY is necessary when drawing TextViews, because
// they set scrollX and scrollY to large values to achieve centered text
destCanvas.save();
+ destCanvas.scale(getScaleX(), getScaleY(), getWidth() / 2, getHeight() / 2);
destCanvas.translate(-getScrollX() + padding / 2, -getScrollY() + padding / 2);
destCanvas.clipRect(clipRect, Op.REPLACE);
draw(destCanvas);
@@ -286,6 +287,14 @@ public class BubbleTextView extends TextView {
canvas.translate(-scrollX, -scrollY);
}
}
+
+ // If text is transparent, don't draw any shadow
+ if (getCurrentTextColor() == android.R.color.transparent) {
+ getPaint().clearShadowLayer();
+ super.draw(canvas);
+ return;
+ }
+
// We enhance the shadow by drawing the shadow twice
getPaint().setShadowLayer(SHADOW_LARGE_RADIUS, 0.0f, SHADOW_Y_OFFSET, SHADOW_LARGE_COLOUR);
super.draw(canvas);
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 8aae809b9..a6c2c5f75 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -28,6 +28,7 @@ import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.PointF;
@@ -135,6 +136,9 @@ public class CellLayout extends ViewGroup {
private TimeInterpolator mEaseOutInterpolator;
private CellLayoutChildren mChildren;
+ private boolean mIsHotseat = false;
+ private final int mBubbleScalePercent;
+
public CellLayout(Context context) {
this(context, null);
}
@@ -180,6 +184,8 @@ public class CellLayout extends ViewGroup {
mNormalBackground.setFilterBitmap(true);
mActiveGlowBackground.setFilterBitmap(true);
+ mBubbleScalePercent = res.getInteger(R.integer.app_icon_hotseat_scale_percent);
+
// Initialize the data structures used for the drag visualization.
mCrosshairsDrawable = res.getDrawable(R.drawable.gardening_crosshairs);
@@ -492,6 +498,25 @@ public class CellLayout extends ViewGroup {
@Override
protected void dispatchDraw(Canvas canvas) {
+ // Debug drawing for hit space
+ if (false) {
+ final Rect frame = mRect;
+ for (int i = mChildren.getChildCount() - 1; i >= 0; i--) {
+ final View child = mChildren.getChildAt(i);
+ final LayoutParams lp = (LayoutParams) child.getLayoutParams();
+
+ if ((child.getVisibility() == VISIBLE || child.getAnimation() != null) &&
+ lp.isLockedToGrid) {
+ child.getHitRect(frame);
+ frame.offset(mPaddingLeft, mPaddingTop);
+
+ Paint p = new Paint();
+ p.setColor(Color.GREEN);
+ canvas.drawRect(frame, p);
+ }
+ }
+ }
+
super.dispatchDraw(canvas);
if (mForegroundAlpha > 0) {
mOverScrollForegroundDrawable.setBounds(mForegroundRect);
@@ -554,10 +579,55 @@ public class CellLayout extends ViewGroup {
return mCountY;
}
+ public void setIsHotseat(boolean isHotseat) {
+ mIsHotseat = isHotseat;
+ }
+
public boolean addViewToCellLayout(
View child, int index, int childId, LayoutParams params, boolean markCells) {
+ return addViewToCellLayout(child, index, childId, params, markCells, false);
+ }
+
+ public boolean addViewToCellLayout(View child, int index, int childId, LayoutParams params,
+ boolean markCells, boolean allApps) {
final LayoutParams lp = params;
+ // Hotseat icons - scale down and remove text
+ // Don't scale the all apps button
+ // scale percent set to -1 means do not scale
+ // Only scale BubbleTextViews
+ if (child instanceof BubbleTextView) {
+ BubbleTextView bubbleChild = (BubbleTextView) child;
+
+ if (mIsHotseat && !allApps && mBubbleScalePercent >= 0) {
+ // If we haven't measured the child yet, do it now
+ // (this happens if we're being dropped from all-apps
+ if ((bubbleChild.getMeasuredWidth() | bubbleChild.getMeasuredHeight()) == 0) {
+ getChildrenLayout().measureChild(bubbleChild);
+ }
+ int measuredWidth = bubbleChild.getMeasuredWidth();
+ int measuredHeight = bubbleChild.getMeasuredHeight();
+
+ float bubbleScale = mBubbleScalePercent / 100f;
+ bubbleChild.setPivotX(0);
+ bubbleChild.setPivotY(0);
+ bubbleChild.setScaleX(bubbleScale);
+ bubbleChild.setScaleY(bubbleScale);
+ bubbleChild.setTranslationX(measuredWidth * (1 - bubbleScale) / 2);
+ bubbleChild.setTranslationY(measuredHeight * (1 - bubbleScale) / 2);
+
+ bubbleChild.setTextColor(android.R.color.transparent);
+ } else {
+ bubbleChild.setScaleX(1f);
+ bubbleChild.setScaleY(1f);
+ bubbleChild.setTranslationX(0f);
+ bubbleChild.setTranslationY(0f);
+
+ bubbleChild.setTextColor(
+ getResources().getColor(R.color.workspace_icon_text_color));
+ }
+ }
+
// Generate an id for each view, this assumes we have at most 256x256 cells
// per workspace screen
if (lp.cellX >= 0 && lp.cellX <= mCountX - 1 && lp.cellY >= 0 && lp.cellY <= mCountY - 1) {
diff --git a/src/com/android/launcher2/Hotseat.java b/src/com/android/launcher2/Hotseat.java
index f7fa38007..add62c004 100644
--- a/src/com/android/launcher2/Hotseat.java
+++ b/src/com/android/launcher2/Hotseat.java
@@ -29,13 +29,13 @@ import com.android.launcher.R;
public class Hotseat extends FrameLayout {
private static final String TAG = "Hotseat";
- private static final int sAllAppsButtonRank = 2; // In the middle of the dock
private Launcher mLauncher;
private CellLayout mContent;
private int mCellCountX;
private int mCellCountY;
+ private int mAllAppsButtonRank;
private boolean mIsLandscape;
public Hotseat(Context context) {
@@ -53,6 +53,7 @@ public class Hotseat extends FrameLayout {
R.styleable.Hotseat, defStyle, 0);
mCellCountX = a.getInt(R.styleable.Hotseat_cellCountX, -1);
mCellCountY = a.getInt(R.styleable.Hotseat_cellCountY, -1);
+ mAllAppsButtonRank = context.getResources().getInteger(R.integer.hotseat_all_apps_index);
mIsLandscape = context.getResources().getConfiguration().orientation ==
Configuration.ORIENTATION_LANDSCAPE;
}
@@ -77,8 +78,8 @@ public class Hotseat extends FrameLayout {
int getCellYFromOrder(int rank) {
return mIsLandscape ? (mContent.getCountY() - (rank + 1)) : 0;
}
- public static boolean isAllAppsButtonRank(int rank) {
- return rank == sAllAppsButtonRank;
+ public boolean isAllAppsButtonRank(int rank) {
+ return rank == mAllAppsButtonRank;
}
@Override
@@ -88,6 +89,7 @@ public class Hotseat extends FrameLayout {
if (mCellCountY < 0) mCellCountY = LauncherModel.getCellCountY();
mContent = (CellLayout) findViewById(R.id.layout);
mContent.setGridSize(mCellCountX, mCellCountY);
+ mContent.setIsHotseat(true);
resetLayout();
}
@@ -126,9 +128,9 @@ public class Hotseat extends FrameLayout {
// Note: We do this to ensure that the hotseat is always laid out in the orientation of
// the hotseat in order regardless of which orientation they were added
- int x = getCellXFromOrder(sAllAppsButtonRank);
- int y = getCellYFromOrder(sAllAppsButtonRank);
+ int x = getCellXFromOrder(mAllAppsButtonRank);
+ int y = getCellYFromOrder(mAllAppsButtonRank);
mContent.addViewToCellLayout(allAppsButton, -1, 0, new CellLayout.LayoutParams(x,y,1,1),
- true);
+ true, true);
}
}
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 8e074b53f..63fb12cf1 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -2129,6 +2129,10 @@ public final class Launcher extends Activity
return (mState == State.APPS_CUSTOMIZE);
}
+ public boolean isAllAppsButtonRank(int rank) {
+ return mHotseat.isAllAppsButtonRank(rank);
+ }
+
// AllAppsView.Watcher
public void zoomed(float zoom) {
if (zoom == 1.0f) {
diff --git a/src/com/android/launcher2/LauncherApplication.java b/src/com/android/launcher2/LauncherApplication.java
index 9936ca682..29c93bef2 100644
--- a/src/com/android/launcher2/LauncherApplication.java
+++ b/src/com/android/launcher2/LauncherApplication.java
@@ -26,6 +26,8 @@ import android.content.res.Configuration;
import android.database.ContentObserver;
import android.os.Handler;
+import com.android.launcher.R;
+
import java.lang.ref.WeakReference;
public class LauncherApplication extends Application {
@@ -40,10 +42,7 @@ public class LauncherApplication extends Application {
super.onCreate();
// set sIsScreenXLarge and sScreenDensity *before* creating icon cache
- final int screenSize = getResources().getConfiguration().screenLayout &
- Configuration.SCREENLAYOUT_SIZE_MASK;
- sIsScreenLarge = screenSize == Configuration.SCREENLAYOUT_SIZE_LARGE ||
- screenSize == Configuration.SCREENLAYOUT_SIZE_XLARGE;
+ sIsScreenLarge = getResources().getBoolean(R.bool.is_large_screen);
sScreenDensity = getResources().getDisplayMetrics().density;
mIconCache = new IconCache(this);
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java
index 7da55db6d..159ddb016 100644
--- a/src/com/android/launcher2/LauncherModel.java
+++ b/src/com/android/launcher2/LauncherModel.java
@@ -138,6 +138,7 @@ public class LauncherModel extends BroadcastReceiver {
public void bindAppsRemoved(ArrayList<ApplicationInfo> apps, boolean permanent);
public void bindPackagesUpdated();
public boolean isAllAppsVisible();
+ public boolean isAllAppsButtonRank(int rank);
public void bindSearchablesChanged();
}
@@ -920,7 +921,7 @@ public class LauncherModel extends BroadcastReceiver {
int containerIndex = item.screen;
if (item.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
// Return early if we detect that an item is under the hotseat button
- if (Hotseat.isAllAppsButtonRank(item.screen)) {
+ if (mCallbacks == null || mCallbacks.get().isAllAppsButtonRank(item.screen)) {
return false;
}
diff --git a/src/com/android/launcher2/LauncherProvider.java b/src/com/android/launcher2/LauncherProvider.java
index a01cc479b..de9a9b2de 100644
--- a/src/com/android/launcher2/LauncherProvider.java
+++ b/src/com/android/launcher2/LauncherProvider.java
@@ -706,6 +706,8 @@ public class LauncherProvider extends ContentProvider {
ContentValues values = new ContentValues();
PackageManager packageManager = mContext.getPackageManager();
+ int allAppsButtonRank =
+ mContext.getResources().getInteger(R.integer.hotseat_all_apps_index);
int i = 0;
try {
XmlResourceParser parser = mContext.getResources().getXml(workspaceResourceId);
@@ -739,8 +741,8 @@ public class LauncherProvider extends ContentProvider {
// If we are adding to the hotseat, the screen is used as the position in the
// hotseat. This screen can't be at position 0 because AllApps is in the
// zeroth position.
- if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT &&
- Hotseat.isAllAppsButtonRank(Integer.valueOf(screen))) {
+ if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT
+ && Integer.valueOf(screen) == allAppsButtonRank) {
throw new RuntimeException("Invalid screen position for hotseat item");
}
diff --git a/src/com/android/launcher2/Utilities.java b/src/com/android/launcher2/Utilities.java
index d7562a947..0387011a4 100644
--- a/src/com/android/launcher2/Utilities.java
+++ b/src/com/android/launcher2/Utilities.java
@@ -113,7 +113,6 @@ final class Utilities {
}
int sourceWidth = icon.getIntrinsicWidth();
int sourceHeight = icon.getIntrinsicHeight();
-
if (sourceWidth > 0 && sourceHeight > 0) {
// There are intrinsic sizes.
if (width < sourceWidth || height < sourceHeight) {
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 7ba395058..a6a1ed535 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -658,7 +658,7 @@ public class Workspace extends SmoothPagedView
return;
} else if (theta > START_DAMPING_TOUCH_SLOP_ANGLE) {
// Above START_DAMPING_TOUCH_SLOP_ANGLE and below MAX_SWIPE_ANGLE, we want to
- // increase the touch slop to make it harder to begin scrolling the workspace. This
+ // increase the touch slop to make it harder to begin scrolling the workspace. This
// results in vertically scrolling widgets to more easily. The higher the angle, the
// more we increase touch slop.
theta -= START_DAMPING_TOUCH_SLOP_ANGLE;
@@ -1444,7 +1444,7 @@ public class Workspace extends SmoothPagedView
* This interpolator emulates the rate at which the perceived scale of an object changes
* as its distance from a camera increases. When this interpolator is applied to a scale
* animation on a view, it evokes the sense that the object is shrinking due to moving away
- * from the camera.
+ * from the camera.
*/
static class ZInterpolator implements TimeInterpolator {
private float focalLength;
@@ -1621,7 +1621,7 @@ public class Workspace extends SmoothPagedView
setLayoutScale(1.0f);
}
- final int duration = zoomIn ?
+ final int duration = zoomIn ?
getResources().getInteger(R.integer.config_workspaceUnshrinkTime) :
getResources().getInteger(R.integer.config_appsCustomizeWorkspaceShrinkTime);
for (int i = 0; i < getChildCount(); i++) {
@@ -2056,7 +2056,7 @@ public class Workspace extends SmoothPagedView
// is full
if (mTargetCell != null && mLauncher.isHotseatLayout(mDragTargetLayout)) {
Hotseat hotseat = mLauncher.getHotseat();
- if (Hotseat.isAllAppsButtonRank(
+ if (hotseat.isAllAppsButtonRank(
hotseat.getOrderInHotseat(mTargetCell[0], mTargetCell[1]))) {
return false;
}
@@ -3043,6 +3043,7 @@ public class Workspace extends SmoothPagedView
CellLayout.LayoutParams lp = (CellLayout.LayoutParams) view.getLayoutParams();
cellLayout.getChildrenLayout().measureChild(view);
+
LauncherModel.addOrMoveItemInDatabase(mLauncher, info, container, screen,
lp.cellX, lp.cellY);