summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AndroidManifest.xml12
-rw-r--r--res/drawable-hdpi/flying_icon_bg_pressed.9.pngbin2098 -> 0 bytes
-rw-r--r--res/drawable-land-xxhdpi/bg_cling1.pngbin0 -> 1850 bytes
-rw-r--r--res/drawable-land-xxhdpi/bg_cling2.pngbin0 -> 1823 bytes
-rw-r--r--res/drawable-land-xxhdpi/bg_cling3.pngbin0 -> 2296 bytes
-rw-r--r--res/drawable-land-xxhdpi/ic_home_voice_search_holo.pngbin0 -> 3990 bytes
-rw-r--r--res/drawable-land-xxhdpi/workspace_bg.9.pngbin0 -> 1117 bytes
-rw-r--r--res/drawable-mdpi/flying_icon_bg_pressed.9.pngbin1749 -> 0 bytes
-rw-r--r--res/drawable-sw600dp-xxhdpi/homescreen_blue_normal_holo.9.pngbin0 -> 1403 bytes
-rw-r--r--res/drawable-sw600dp-xxhdpi/homescreen_blue_strong_holo.9.pngbin0 -> 1452 bytes
-rw-r--r--res/drawable-sw600dp-xxhdpi/ic_allapps.pngbin0 -> 18116 bytes
-rw-r--r--res/drawable-sw600dp-xxhdpi/ic_allapps_pressed.pngbin0 -> 18068 bytes
-rw-r--r--res/drawable-sw600dp-xxhdpi/overscroll_glow_left.9.pngbin0 -> 3390 bytes
-rw-r--r--res/drawable-sw600dp-xxhdpi/overscroll_glow_right.9.pngbin0 -> 3024 bytes
-rw-r--r--res/drawable-sw600dp-xxhdpi/portal_ring_inner_holo.pngbin0 -> 25799 bytes
-rw-r--r--res/drawable-sw600dp-xxhdpi/portal_ring_inner_nolip_holo.pngbin0 -> 10455 bytes
-rw-r--r--res/drawable-sw600dp-xxhdpi/portal_ring_outer_holo.pngbin0 -> 13911 bytes
-rw-r--r--res/drawable-xhdpi/flying_icon_bg_pressed.9.pngbin10692 -> 0 bytes
-rw-r--r--res/drawable-xxhdpi/arrow_dashed.pngbin0 -> 25263 bytes
-rw-r--r--res/drawable-xxhdpi/bg_cling1.pngbin0 -> 2219 bytes
-rw-r--r--res/drawable-xxhdpi/bg_cling2.pngbin0 -> 2075 bytes
-rw-r--r--res/drawable-xxhdpi/bg_cling3.pngbin0 -> 2274 bytes
-rw-r--r--res/drawable-xxhdpi/bg_cling4.pngbin0 -> 2012 bytes
-rw-r--r--res/drawable-xxhdpi/bg_cling_home.pngbin0 -> 2346 bytes
-rw-r--r--res/drawable-xxhdpi/bg_cling_nakasi3.pngbin0 -> 3004 bytes
-rw-r--r--res/drawable-xxhdpi/btn_cling_normal.9.pngbin0 -> 1350 bytes
-rw-r--r--res/drawable-xxhdpi/btn_cling_pressed.9.pngbin0 -> 1551 bytes
-rw-r--r--res/drawable-xxhdpi/cling.pngbin0 -> 133911 bytes
-rw-r--r--res/drawable-xxhdpi/default_widget_preview_holo.9.pngbin0 -> 1342 bytes
-rw-r--r--res/drawable-xxhdpi/grid_focused.9.pngbin0 -> 1075 bytes
-rw-r--r--res/drawable-xxhdpi/grid_pressed.9.pngbin0 -> 1075 bytes
-rw-r--r--res/drawable-xxhdpi/grid_selected.9.pngbin0 -> 1076 bytes
-rw-r--r--res/drawable-xxhdpi/hand.pngbin0 -> 36124 bytes
-rw-r--r--res/drawable-xxhdpi/homescreen_blue_normal_holo.9.pngbin0 -> 1427 bytes
-rw-r--r--res/drawable-xxhdpi/homescreen_blue_strong_holo.9.pngbin0 -> 1503 bytes
-rw-r--r--res/drawable-xxhdpi/hotseat_bg_panel.9.pngbin0 -> 1126 bytes
-rw-r--r--res/drawable-xxhdpi/hotseat_scrubber_holo.9.pngbin0 -> 1088 bytes
-rw-r--r--res/drawable-xxhdpi/hotseat_track_holo.9.pngbin0 -> 1213 bytes
-rw-r--r--res/drawable-xxhdpi/ic_allapps.pngbin0 -> 12916 bytes
-rw-r--r--res/drawable-xxhdpi/ic_allapps_pressed.pngbin0 -> 12701 bytes
-rw-r--r--res/drawable-xxhdpi/ic_home_all_apps_holo_dark.pngbin0 -> 3300 bytes
-rw-r--r--res/drawable-xxhdpi/ic_home_google_logo_normal_holo.pngbin0 -> 13630 bytes
-rw-r--r--res/drawable-xxhdpi/ic_home_google_logo_pressed_holo.pngbin0 -> 20843 bytes
-rw-r--r--res/drawable-xxhdpi/ic_home_search_normal_holo.pngbin0 -> 5046 bytes
-rw-r--r--res/drawable-xxhdpi/ic_home_search_pressed_holo.pngbin0 -> 7909 bytes
-rw-r--r--res/drawable-xxhdpi/ic_home_voice_search_holo.pngbin0 -> 3774 bytes
-rw-r--r--res/drawable-xxhdpi/ic_home_voice_search_pressed_holo.pngbin0 -> 5445 bytes
-rw-r--r--res/drawable-xxhdpi/ic_launcher_clear_active_holo.pngbin0 -> 2357 bytes
-rw-r--r--res/drawable-xxhdpi/ic_launcher_clear_normal_holo.pngbin0 -> 2738 bytes
-rw-r--r--res/drawable-xxhdpi/ic_launcher_info_active_holo.pngbin0 -> 8022 bytes
-rw-r--r--res/drawable-xxhdpi/ic_launcher_info_normal_holo.pngbin0 -> 7833 bytes
-rw-r--r--res/drawable-xxhdpi/ic_launcher_trashcan_active_holo.pngbin0 -> 4493 bytes
-rw-r--r--res/drawable-xxhdpi/ic_launcher_trashcan_normal_holo.pngbin0 -> 4522 bytes
-rw-r--r--res/drawable-xxhdpi/ic_qs_remote_display.pngbin0 -> 1715 bytes
-rw-r--r--res/drawable-xxhdpi/ic_qs_remote_display_connected.pngbin0 -> 1718 bytes
-rw-r--r--res/drawable-xxhdpi/overscroll_glow_left.9.pngbin0 -> 3662 bytes
-rw-r--r--res/drawable-xxhdpi/overscroll_glow_right.9.pngbin0 -> 3598 bytes
-rw-r--r--res/drawable-xxhdpi/page_hover_left_holo.9.pngbin0 -> 2239 bytes
-rw-r--r--res/drawable-xxhdpi/page_hover_right_holo.9.pngbin0 -> 1259 bytes
-rw-r--r--res/drawable-xxhdpi/portal_container_holo.9.pngbin0 -> 3702 bytes
-rw-r--r--res/drawable-xxhdpi/portal_ring_inner_holo.pngbin0 -> 20462 bytes
-rw-r--r--res/drawable-xxhdpi/portal_ring_inner_nolip_holo.pngbin0 -> 8026 bytes
-rw-r--r--res/drawable-xxhdpi/portal_ring_outer_holo.pngbin0 -> 17212 bytes
-rw-r--r--res/drawable-xxhdpi/portal_ring_rest.pngbin0 -> 5595 bytes
-rw-r--r--res/drawable-xxhdpi/search_bg_panel.9.pngbin0 -> 1087 bytes
-rw-r--r--res/drawable-xxhdpi/search_frame.9.pngbin0 -> 1582 bytes
-rw-r--r--res/drawable-xxhdpi/tab_selected_focused_holo.9.pngbin0 -> 1033 bytes
-rw-r--r--res/drawable-xxhdpi/tab_selected_holo.9.pngbin0 -> 1030 bytes
-rw-r--r--res/drawable-xxhdpi/tab_selected_pressed_holo.9.pngbin0 -> 1033 bytes
-rw-r--r--res/drawable-xxhdpi/tab_unselected_focused_holo.9.pngbin0 -> 1035 bytes
-rw-r--r--res/drawable-xxhdpi/tab_unselected_holo.9.pngbin0 -> 1054 bytes
-rw-r--r--res/drawable-xxhdpi/tab_unselected_pressed_holo.9.pngbin0 -> 1035 bytes
-rw-r--r--res/drawable-xxhdpi/widget_container_holo.9.pngbin0 -> 1558 bytes
-rw-r--r--res/drawable-xxhdpi/widget_resize_frame_holo.9.pngbin0 -> 2613 bytes
-rw-r--r--res/drawable-xxhdpi/widget_resize_handle_bottom.pngbin0 -> 3707 bytes
-rw-r--r--res/drawable-xxhdpi/widget_resize_handle_left.pngbin0 -> 3650 bytes
-rw-r--r--res/drawable-xxhdpi/widget_resize_handle_right.pngbin0 -> 3665 bytes
-rw-r--r--res/drawable-xxhdpi/widget_resize_handle_top.pngbin0 -> 3698 bytes
-rw-r--r--res/drawable-xxhdpi/widget_tile_jb.pngbin0 -> 1300 bytes
-rw-r--r--res/drawable-xxhdpi/workspace_bg.9.pngbin0 -> 1126 bytes
-rw-r--r--res/drawable/flying_icon_bg.xml20
-rw-r--r--res/values/strings.xml2
-rw-r--r--res/values/styles.xml6
-rw-r--r--src/com/android/launcher3/CellLayout.java26
-rw-r--r--src/com/android/launcher3/DynamicGrid.java13
-rw-r--r--src/com/android/launcher3/Hotseat.java8
-rw-r--r--src/com/android/launcher3/Launcher.java35
-rw-r--r--src/com/android/launcher3/LauncherModel.java5
-rw-r--r--src/com/android/launcher3/PagedView.java2
-rw-r--r--src/com/android/launcher3/WallpaperCropActivity.java16
-rw-r--r--src/com/android/launcher3/WallpaperPickerActivity.java40
-rw-r--r--src/com/android/launcher3/Workspace.java191
92 files changed, 239 insertions, 137 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 996bef77b..14fb04403 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -104,28 +104,28 @@
<activity
android:name="com.android.launcher3.WallpaperPickerActivity"
- android:theme="@style/Theme.WallpaperPicker"
+ android:theme="@style/Theme.WallpaperCropper"
android:label="@string/pick_wallpaper"
android:icon="@mipmap/ic_launcher_wallpaper"
android:finishOnCloseSystemDialogs="true"
android:process=":wallpaper_chooser">
<intent-filter>
- <action android:name="android.intent.action.CROP_AND_SET_WALLPAPER" />
+ <action android:name="android.intent.action.SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
- <data android:mimeType="image/*" />
</intent-filter>
</activity>
<activity
android:name="com.android.launcher3.WallpaperCropActivity"
- android:theme="@style/Theme.WallpaperPicker"
- android:label="@string/pick_wallpaper"
+ android:theme="@style/Theme.WallpaperCropper"
+ android:label="@string/crop_wallpaper"
android:icon="@mipmap/ic_launcher_wallpaper"
android:finishOnCloseSystemDialogs="true"
android:process=":wallpaper_chooser">
<intent-filter>
- <action android:name="com.android.launcher3.action.CROP_AND_SET_WALLPAPER" />
+ <action android:name="android.service.wallpaper.CROP_AND_SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
+ <data android:mimeType="image/*" />
</intent-filter>
</activity>
diff --git a/res/drawable-hdpi/flying_icon_bg_pressed.9.png b/res/drawable-hdpi/flying_icon_bg_pressed.9.png
deleted file mode 100644
index 700fadc17..000000000
--- a/res/drawable-hdpi/flying_icon_bg_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-land-xxhdpi/bg_cling1.png b/res/drawable-land-xxhdpi/bg_cling1.png
new file mode 100644
index 000000000..78943f01c
--- /dev/null
+++ b/res/drawable-land-xxhdpi/bg_cling1.png
Binary files differ
diff --git a/res/drawable-land-xxhdpi/bg_cling2.png b/res/drawable-land-xxhdpi/bg_cling2.png
new file mode 100644
index 000000000..98b65682b
--- /dev/null
+++ b/res/drawable-land-xxhdpi/bg_cling2.png
Binary files differ
diff --git a/res/drawable-land-xxhdpi/bg_cling3.png b/res/drawable-land-xxhdpi/bg_cling3.png
new file mode 100644
index 000000000..e249fe598
--- /dev/null
+++ b/res/drawable-land-xxhdpi/bg_cling3.png
Binary files differ
diff --git a/res/drawable-land-xxhdpi/ic_home_voice_search_holo.png b/res/drawable-land-xxhdpi/ic_home_voice_search_holo.png
new file mode 100644
index 000000000..6ea7368be
--- /dev/null
+++ b/res/drawable-land-xxhdpi/ic_home_voice_search_holo.png
Binary files differ
diff --git a/res/drawable-land-xxhdpi/workspace_bg.9.png b/res/drawable-land-xxhdpi/workspace_bg.9.png
new file mode 100644
index 000000000..b0b456198
--- /dev/null
+++ b/res/drawable-land-xxhdpi/workspace_bg.9.png
Binary files differ
diff --git a/res/drawable-mdpi/flying_icon_bg_pressed.9.png b/res/drawable-mdpi/flying_icon_bg_pressed.9.png
deleted file mode 100644
index fb74449a2..000000000
--- a/res/drawable-mdpi/flying_icon_bg_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/homescreen_blue_normal_holo.9.png b/res/drawable-sw600dp-xxhdpi/homescreen_blue_normal_holo.9.png
new file mode 100644
index 000000000..c661f68fb
--- /dev/null
+++ b/res/drawable-sw600dp-xxhdpi/homescreen_blue_normal_holo.9.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/homescreen_blue_strong_holo.9.png b/res/drawable-sw600dp-xxhdpi/homescreen_blue_strong_holo.9.png
new file mode 100644
index 000000000..bf6ab97c8
--- /dev/null
+++ b/res/drawable-sw600dp-xxhdpi/homescreen_blue_strong_holo.9.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/ic_allapps.png b/res/drawable-sw600dp-xxhdpi/ic_allapps.png
new file mode 100644
index 000000000..242965605
--- /dev/null
+++ b/res/drawable-sw600dp-xxhdpi/ic_allapps.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/ic_allapps_pressed.png b/res/drawable-sw600dp-xxhdpi/ic_allapps_pressed.png
new file mode 100644
index 000000000..b93a51bea
--- /dev/null
+++ b/res/drawable-sw600dp-xxhdpi/ic_allapps_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/overscroll_glow_left.9.png b/res/drawable-sw600dp-xxhdpi/overscroll_glow_left.9.png
new file mode 100644
index 000000000..472c3f921
--- /dev/null
+++ b/res/drawable-sw600dp-xxhdpi/overscroll_glow_left.9.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/overscroll_glow_right.9.png b/res/drawable-sw600dp-xxhdpi/overscroll_glow_right.9.png
new file mode 100644
index 000000000..e30cc9705
--- /dev/null
+++ b/res/drawable-sw600dp-xxhdpi/overscroll_glow_right.9.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/portal_ring_inner_holo.png b/res/drawable-sw600dp-xxhdpi/portal_ring_inner_holo.png
new file mode 100644
index 000000000..65b254197
--- /dev/null
+++ b/res/drawable-sw600dp-xxhdpi/portal_ring_inner_holo.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/portal_ring_inner_nolip_holo.png b/res/drawable-sw600dp-xxhdpi/portal_ring_inner_nolip_holo.png
new file mode 100644
index 000000000..506864643
--- /dev/null
+++ b/res/drawable-sw600dp-xxhdpi/portal_ring_inner_nolip_holo.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/portal_ring_outer_holo.png b/res/drawable-sw600dp-xxhdpi/portal_ring_outer_holo.png
new file mode 100644
index 000000000..662842560
--- /dev/null
+++ b/res/drawable-sw600dp-xxhdpi/portal_ring_outer_holo.png
Binary files differ
diff --git a/res/drawable-xhdpi/flying_icon_bg_pressed.9.png b/res/drawable-xhdpi/flying_icon_bg_pressed.9.png
deleted file mode 100644
index e678927ff..000000000
--- a/res/drawable-xhdpi/flying_icon_bg_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/arrow_dashed.png b/res/drawable-xxhdpi/arrow_dashed.png
new file mode 100644
index 000000000..b64f4d0fe
--- /dev/null
+++ b/res/drawable-xxhdpi/arrow_dashed.png
Binary files differ
diff --git a/res/drawable-xxhdpi/bg_cling1.png b/res/drawable-xxhdpi/bg_cling1.png
new file mode 100644
index 000000000..077785600
--- /dev/null
+++ b/res/drawable-xxhdpi/bg_cling1.png
Binary files differ
diff --git a/res/drawable-xxhdpi/bg_cling2.png b/res/drawable-xxhdpi/bg_cling2.png
new file mode 100644
index 000000000..1797a1b6c
--- /dev/null
+++ b/res/drawable-xxhdpi/bg_cling2.png
Binary files differ
diff --git a/res/drawable-xxhdpi/bg_cling3.png b/res/drawable-xxhdpi/bg_cling3.png
new file mode 100644
index 000000000..a87be630e
--- /dev/null
+++ b/res/drawable-xxhdpi/bg_cling3.png
Binary files differ
diff --git a/res/drawable-xxhdpi/bg_cling4.png b/res/drawable-xxhdpi/bg_cling4.png
new file mode 100644
index 000000000..cabe919d5
--- /dev/null
+++ b/res/drawable-xxhdpi/bg_cling4.png
Binary files differ
diff --git a/res/drawable-xxhdpi/bg_cling_home.png b/res/drawable-xxhdpi/bg_cling_home.png
new file mode 100644
index 000000000..1ae93e7fe
--- /dev/null
+++ b/res/drawable-xxhdpi/bg_cling_home.png
Binary files differ
diff --git a/res/drawable-xxhdpi/bg_cling_nakasi3.png b/res/drawable-xxhdpi/bg_cling_nakasi3.png
new file mode 100644
index 000000000..f47236cac
--- /dev/null
+++ b/res/drawable-xxhdpi/bg_cling_nakasi3.png
Binary files differ
diff --git a/res/drawable-xxhdpi/btn_cling_normal.9.png b/res/drawable-xxhdpi/btn_cling_normal.9.png
new file mode 100644
index 000000000..f5e80326e
--- /dev/null
+++ b/res/drawable-xxhdpi/btn_cling_normal.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/btn_cling_pressed.9.png b/res/drawable-xxhdpi/btn_cling_pressed.9.png
new file mode 100644
index 000000000..c507dd734
--- /dev/null
+++ b/res/drawable-xxhdpi/btn_cling_pressed.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/cling.png b/res/drawable-xxhdpi/cling.png
new file mode 100644
index 000000000..9446ea4bd
--- /dev/null
+++ b/res/drawable-xxhdpi/cling.png
Binary files differ
diff --git a/res/drawable-xxhdpi/default_widget_preview_holo.9.png b/res/drawable-xxhdpi/default_widget_preview_holo.9.png
new file mode 100644
index 000000000..0f62097a8
--- /dev/null
+++ b/res/drawable-xxhdpi/default_widget_preview_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/grid_focused.9.png b/res/drawable-xxhdpi/grid_focused.9.png
new file mode 100644
index 000000000..a8dff7a11
--- /dev/null
+++ b/res/drawable-xxhdpi/grid_focused.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/grid_pressed.9.png b/res/drawable-xxhdpi/grid_pressed.9.png
new file mode 100644
index 000000000..cbc83d13d
--- /dev/null
+++ b/res/drawable-xxhdpi/grid_pressed.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/grid_selected.9.png b/res/drawable-xxhdpi/grid_selected.9.png
new file mode 100644
index 000000000..f8cd673f6
--- /dev/null
+++ b/res/drawable-xxhdpi/grid_selected.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/hand.png b/res/drawable-xxhdpi/hand.png
new file mode 100644
index 000000000..88c2a882c
--- /dev/null
+++ b/res/drawable-xxhdpi/hand.png
Binary files differ
diff --git a/res/drawable-xxhdpi/homescreen_blue_normal_holo.9.png b/res/drawable-xxhdpi/homescreen_blue_normal_holo.9.png
new file mode 100644
index 000000000..040748a49
--- /dev/null
+++ b/res/drawable-xxhdpi/homescreen_blue_normal_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/homescreen_blue_strong_holo.9.png b/res/drawable-xxhdpi/homescreen_blue_strong_holo.9.png
new file mode 100644
index 000000000..b75b3221b
--- /dev/null
+++ b/res/drawable-xxhdpi/homescreen_blue_strong_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/hotseat_bg_panel.9.png b/res/drawable-xxhdpi/hotseat_bg_panel.9.png
new file mode 100644
index 000000000..40fc076ff
--- /dev/null
+++ b/res/drawable-xxhdpi/hotseat_bg_panel.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/hotseat_scrubber_holo.9.png b/res/drawable-xxhdpi/hotseat_scrubber_holo.9.png
new file mode 100644
index 000000000..8a77536be
--- /dev/null
+++ b/res/drawable-xxhdpi/hotseat_scrubber_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/hotseat_track_holo.9.png b/res/drawable-xxhdpi/hotseat_track_holo.9.png
new file mode 100644
index 000000000..dd2216fb7
--- /dev/null
+++ b/res/drawable-xxhdpi/hotseat_track_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_allapps.png b/res/drawable-xxhdpi/ic_allapps.png
new file mode 100644
index 000000000..0cd0f1409
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_allapps.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_allapps_pressed.png b/res/drawable-xxhdpi/ic_allapps_pressed.png
new file mode 100644
index 000000000..99494d8a1
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_allapps_pressed.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_home_all_apps_holo_dark.png b/res/drawable-xxhdpi/ic_home_all_apps_holo_dark.png
new file mode 100644
index 000000000..0b8e88c16
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_home_all_apps_holo_dark.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_home_google_logo_normal_holo.png b/res/drawable-xxhdpi/ic_home_google_logo_normal_holo.png
new file mode 100644
index 000000000..a47b2ba99
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_home_google_logo_normal_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_home_google_logo_pressed_holo.png b/res/drawable-xxhdpi/ic_home_google_logo_pressed_holo.png
new file mode 100644
index 000000000..75625d120
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_home_google_logo_pressed_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_home_search_normal_holo.png b/res/drawable-xxhdpi/ic_home_search_normal_holo.png
new file mode 100644
index 000000000..a9523d3cc
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_home_search_normal_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_home_search_pressed_holo.png b/res/drawable-xxhdpi/ic_home_search_pressed_holo.png
new file mode 100644
index 000000000..800d99430
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_home_search_pressed_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_home_voice_search_holo.png b/res/drawable-xxhdpi/ic_home_voice_search_holo.png
new file mode 100644
index 000000000..c9c0b50bd
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_home_voice_search_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_home_voice_search_pressed_holo.png b/res/drawable-xxhdpi/ic_home_voice_search_pressed_holo.png
new file mode 100644
index 000000000..27a589782
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_home_voice_search_pressed_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_launcher_clear_active_holo.png b/res/drawable-xxhdpi/ic_launcher_clear_active_holo.png
new file mode 100644
index 000000000..95cf84115
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_launcher_clear_active_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_launcher_clear_normal_holo.png b/res/drawable-xxhdpi/ic_launcher_clear_normal_holo.png
new file mode 100644
index 000000000..b0f5a2702
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_launcher_clear_normal_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_launcher_info_active_holo.png b/res/drawable-xxhdpi/ic_launcher_info_active_holo.png
new file mode 100644
index 000000000..57f332a94
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_launcher_info_active_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_launcher_info_normal_holo.png b/res/drawable-xxhdpi/ic_launcher_info_normal_holo.png
new file mode 100644
index 000000000..94f0955d6
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_launcher_info_normal_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_launcher_trashcan_active_holo.png b/res/drawable-xxhdpi/ic_launcher_trashcan_active_holo.png
new file mode 100644
index 000000000..3bb098c2b
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_launcher_trashcan_active_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_launcher_trashcan_normal_holo.png b/res/drawable-xxhdpi/ic_launcher_trashcan_normal_holo.png
new file mode 100644
index 000000000..550cc5bb8
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_launcher_trashcan_normal_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_qs_remote_display.png b/res/drawable-xxhdpi/ic_qs_remote_display.png
new file mode 100644
index 000000000..25ea9fab2
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_qs_remote_display.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_qs_remote_display_connected.png b/res/drawable-xxhdpi/ic_qs_remote_display_connected.png
new file mode 100644
index 000000000..33a8d2d5a
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_qs_remote_display_connected.png
Binary files differ
diff --git a/res/drawable-xxhdpi/overscroll_glow_left.9.png b/res/drawable-xxhdpi/overscroll_glow_left.9.png
new file mode 100644
index 000000000..ae20624bb
--- /dev/null
+++ b/res/drawable-xxhdpi/overscroll_glow_left.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/overscroll_glow_right.9.png b/res/drawable-xxhdpi/overscroll_glow_right.9.png
new file mode 100644
index 000000000..b083720b5
--- /dev/null
+++ b/res/drawable-xxhdpi/overscroll_glow_right.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/page_hover_left_holo.9.png b/res/drawable-xxhdpi/page_hover_left_holo.9.png
new file mode 100644
index 000000000..cfe5a5327
--- /dev/null
+++ b/res/drawable-xxhdpi/page_hover_left_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/page_hover_right_holo.9.png b/res/drawable-xxhdpi/page_hover_right_holo.9.png
new file mode 100644
index 000000000..481e791fc
--- /dev/null
+++ b/res/drawable-xxhdpi/page_hover_right_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/portal_container_holo.9.png b/res/drawable-xxhdpi/portal_container_holo.9.png
new file mode 100644
index 000000000..2a28f4aa7
--- /dev/null
+++ b/res/drawable-xxhdpi/portal_container_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/portal_ring_inner_holo.png b/res/drawable-xxhdpi/portal_ring_inner_holo.png
new file mode 100644
index 000000000..3b93f8342
--- /dev/null
+++ b/res/drawable-xxhdpi/portal_ring_inner_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/portal_ring_inner_nolip_holo.png b/res/drawable-xxhdpi/portal_ring_inner_nolip_holo.png
new file mode 100644
index 000000000..01f330c13
--- /dev/null
+++ b/res/drawable-xxhdpi/portal_ring_inner_nolip_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/portal_ring_outer_holo.png b/res/drawable-xxhdpi/portal_ring_outer_holo.png
new file mode 100644
index 000000000..281e9b565
--- /dev/null
+++ b/res/drawable-xxhdpi/portal_ring_outer_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/portal_ring_rest.png b/res/drawable-xxhdpi/portal_ring_rest.png
new file mode 100644
index 000000000..947d7dbeb
--- /dev/null
+++ b/res/drawable-xxhdpi/portal_ring_rest.png
Binary files differ
diff --git a/res/drawable-xxhdpi/search_bg_panel.9.png b/res/drawable-xxhdpi/search_bg_panel.9.png
new file mode 100644
index 000000000..85cae17bc
--- /dev/null
+++ b/res/drawable-xxhdpi/search_bg_panel.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/search_frame.9.png b/res/drawable-xxhdpi/search_frame.9.png
new file mode 100644
index 000000000..f297bf19c
--- /dev/null
+++ b/res/drawable-xxhdpi/search_frame.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/tab_selected_focused_holo.9.png b/res/drawable-xxhdpi/tab_selected_focused_holo.9.png
new file mode 100644
index 000000000..2400c65d5
--- /dev/null
+++ b/res/drawable-xxhdpi/tab_selected_focused_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/tab_selected_holo.9.png b/res/drawable-xxhdpi/tab_selected_holo.9.png
new file mode 100644
index 000000000..5067cbbfe
--- /dev/null
+++ b/res/drawable-xxhdpi/tab_selected_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/tab_selected_pressed_holo.9.png b/res/drawable-xxhdpi/tab_selected_pressed_holo.9.png
new file mode 100644
index 000000000..84c246da4
--- /dev/null
+++ b/res/drawable-xxhdpi/tab_selected_pressed_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/tab_unselected_focused_holo.9.png b/res/drawable-xxhdpi/tab_unselected_focused_holo.9.png
new file mode 100644
index 000000000..939e0c3e0
--- /dev/null
+++ b/res/drawable-xxhdpi/tab_unselected_focused_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/tab_unselected_holo.9.png b/res/drawable-xxhdpi/tab_unselected_holo.9.png
new file mode 100644
index 000000000..62ca6cf84
--- /dev/null
+++ b/res/drawable-xxhdpi/tab_unselected_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/tab_unselected_pressed_holo.9.png b/res/drawable-xxhdpi/tab_unselected_pressed_holo.9.png
new file mode 100644
index 000000000..58ac0d649
--- /dev/null
+++ b/res/drawable-xxhdpi/tab_unselected_pressed_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/widget_container_holo.9.png b/res/drawable-xxhdpi/widget_container_holo.9.png
new file mode 100644
index 000000000..8f79920c4
--- /dev/null
+++ b/res/drawable-xxhdpi/widget_container_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/widget_resize_frame_holo.9.png b/res/drawable-xxhdpi/widget_resize_frame_holo.9.png
new file mode 100644
index 000000000..a38e7d502
--- /dev/null
+++ b/res/drawable-xxhdpi/widget_resize_frame_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/widget_resize_handle_bottom.png b/res/drawable-xxhdpi/widget_resize_handle_bottom.png
new file mode 100644
index 000000000..a241c5942
--- /dev/null
+++ b/res/drawable-xxhdpi/widget_resize_handle_bottom.png
Binary files differ
diff --git a/res/drawable-xxhdpi/widget_resize_handle_left.png b/res/drawable-xxhdpi/widget_resize_handle_left.png
new file mode 100644
index 000000000..24046ead0
--- /dev/null
+++ b/res/drawable-xxhdpi/widget_resize_handle_left.png
Binary files differ
diff --git a/res/drawable-xxhdpi/widget_resize_handle_right.png b/res/drawable-xxhdpi/widget_resize_handle_right.png
new file mode 100644
index 000000000..968ffe2e5
--- /dev/null
+++ b/res/drawable-xxhdpi/widget_resize_handle_right.png
Binary files differ
diff --git a/res/drawable-xxhdpi/widget_resize_handle_top.png b/res/drawable-xxhdpi/widget_resize_handle_top.png
new file mode 100644
index 000000000..a2bab293a
--- /dev/null
+++ b/res/drawable-xxhdpi/widget_resize_handle_top.png
Binary files differ
diff --git a/res/drawable-xxhdpi/widget_tile_jb.png b/res/drawable-xxhdpi/widget_tile_jb.png
new file mode 100644
index 000000000..363fe841d
--- /dev/null
+++ b/res/drawable-xxhdpi/widget_tile_jb.png
Binary files differ
diff --git a/res/drawable-xxhdpi/workspace_bg.9.png b/res/drawable-xxhdpi/workspace_bg.9.png
new file mode 100644
index 000000000..efc9b0465
--- /dev/null
+++ b/res/drawable-xxhdpi/workspace_bg.9.png
Binary files differ
diff --git a/res/drawable/flying_icon_bg.xml b/res/drawable/flying_icon_bg.xml
deleted file mode 100644
index 167c3ba27..000000000
--- a/res/drawable/flying_icon_bg.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 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.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true" android:drawable="@drawable/flying_icon_bg_pressed" />
- <item android:drawable="@android:color/transparent" />
-</selector>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index bd803c64e..e04902a16 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -45,6 +45,8 @@
<string name="gallery">Gallery</string>
<!-- Option in "Select wallpaper from" dialog box -->
<string name="pick_wallpaper">Wallpapers</string>
+ <!-- Title of activity for cropping wallpapers -->
+ <string name="crop_wallpaper">Crop wallpaper</string>
<!-- Displayed when user selects a shortcut for an app that was uninstalled [CHAR_LIMIT=none]-->
<string name="activity_not_found">App isn\'t installed.</string>
<!-- Labels for the tabs in the customize drawer -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 6eb044cda..618bb4705 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -18,13 +18,13 @@
-->
<resources>
- <style name="Theme.WallpaperPicker" parent="@android:style/Theme.Holo">
- <item name="android:actionBarStyle">@style/WallpaperPickerActionBar</item>
+ <style name="Theme.WallpaperCropper" parent="@android:style/Theme.Holo">
+ <item name="android:actionBarStyle">@style/WallpaperCropperActionBar</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowActionBarOverlay">true</item>
</style>
- <style name="WallpaperPickerActionBar" parent="android:style/Widget.Holo.ActionBar">
+ <style name="WallpaperCropperActionBar" parent="android:style/Widget.Holo.ActionBar">
<item name="android:displayOptions">showCustom</item>
<item name="android:background">#88000000</item>
</style>
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 682c2ed2e..04f4d8154 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -64,6 +64,8 @@ public class CellLayout extends ViewGroup {
private Launcher mLauncher;
private int mCellWidth;
private int mCellHeight;
+ private int mFixedCellWidth;
+ private int mFixedCellHeight;
private int mCountX;
private int mCountY;
@@ -193,8 +195,8 @@ public class CellLayout extends ViewGroup {
DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CellLayout, defStyle, 0);
- mCellWidth = -1;
- mCellHeight = -1;
+ mCellWidth = mCellHeight = -1;
+ mFixedCellHeight = mFixedCellHeight = -1;
mWidthGap = mOriginalWidthGap = 0;
mHeightGap = mOriginalHeightGap = 0;
mMaxGap = Integer.MAX_VALUE;
@@ -310,8 +312,8 @@ public class CellLayout extends ViewGroup {
}
public void setCellDimensions(int width, int height) {
- mCellWidth = width;
- mCellHeight = height;
+ mFixedCellWidth = mCellWidth = width;
+ mFixedCellHeight = mCellHeight = height;
mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap,
mCountX, mCountY);
}
@@ -947,13 +949,15 @@ public class CellLayout extends ViewGroup {
int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec);
int widthSize = MeasureSpec.getSize(widthMeasureSpec);
int heightSize = MeasureSpec.getSize(heightMeasureSpec);
- int cw = grid.calculateCellWidth(widthSize, mCountX);
- int ch = grid.calculateCellHeight(heightSize, mCountY);
- if (cw != mCellWidth || ch != mCellHeight) {
- mCellWidth = cw;
- mCellHeight = ch;
- mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap,
- mHeightGap, mCountX, mCountY);
+ if (mFixedCellWidth < 0 || mFixedCellHeight < 0) {
+ int cw = grid.calculateCellWidth(widthSize, mCountX);
+ int ch = grid.calculateCellHeight(heightSize, mCountY);
+ if (cw != mCellWidth || ch != mCellHeight) {
+ mCellWidth = cw;
+ mCellHeight = ch;
+ mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap,
+ mHeightGap, mCountX, mCountY);
+ }
}
int newWidth = widthSize;
diff --git a/src/com/android/launcher3/DynamicGrid.java b/src/com/android/launcher3/DynamicGrid.java
index f43af615f..70f000053 100644
--- a/src/com/android/launcher3/DynamicGrid.java
+++ b/src/com/android/launcher3/DynamicGrid.java
@@ -223,17 +223,16 @@ class DeviceProfile {
availableWidthPx = awPx;
availableHeightPx = ahPx;
- if (isLandscape) {
- allAppsNumRows = (int) numRows - 1;
- } else {
- allAppsNumRows = (int) numRows + 1;
- }
Rect padding = getWorkspacePadding(isLandscape ?
CellLayout.LANDSCAPE : CellLayout.PORTRAIT);
int pageIndicatorOffset =
resources.getDimensionPixelSize(R.dimen.apps_customize_page_indicator_offset);
- allAppsNumRows = (availableHeightPx - pageIndicatorOffset - 4 * edgeMarginPx) /
- (iconSizePx + iconTextSizePx + 2 * edgeMarginPx);
+ if (isLandscape) {
+ allAppsNumRows = (availableHeightPx - pageIndicatorOffset - 4 * edgeMarginPx) /
+ (iconSizePx + iconTextSizePx + 2 * edgeMarginPx);
+ } else {
+ allAppsNumRows = (int) numRows + 1;
+ }
allAppsNumCols = (availableWidthPx - padding.left - padding.right - 2 * edgeMarginPx) /
(iconSizePx + 2 * edgeMarginPx);
}
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index ec787614d..fbbb09f51 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -69,6 +69,14 @@ public class Hotseat extends FrameLayout {
CellLayout getLayout() {
return mContent;
}
+
+ /**
+ * Registers the specified listener on the cell layout of the hotseat.
+ */
+ @Override
+ public void setOnLongClickListener(OnLongClickListener l) {
+ mContent.setOnLongClickListener(l);
+ }
private boolean hasVerticalHotseat() {
return (mIsLandscape && mTransposeLayoutWithOrientation);
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 29c4e3eaf..0a92f3563 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -660,9 +660,6 @@ public class Launcher extends Activity
completeAddAppWidget(appWidgetId, args.container, args.screenId, null, null);
result = true;
break;
- case REQUEST_PICK_WALLPAPER:
- // We just wanted the activity result here so we can clear mWaitingForResult
- break;
}
// Before adding this resetAddInfo(), after a shortcut was added to a workspace screen,
// if you turned the screen off and then back while in All Apps, Launcher would not
@@ -686,7 +683,13 @@ public class Launcher extends Activity
addAppWidgetImpl(appWidgetId, mPendingAddInfo, null, mPendingAddWidgetInfo);
}
return;
+ } else if (requestCode == REQUEST_PICK_WALLPAPER) {
+ if (resultCode == RESULT_OK && mWorkspace.isInOverviewMode()) {
+ mWorkspace.exitOverviewMode(false);
+ }
+ return;
}
+
boolean delayExitSpringLoadedMode = false;
boolean isWidgetDrop = (requestCode == REQUEST_PICK_APPWIDGET ||
requestCode == REQUEST_CREATE_APPWIDGET);
@@ -1114,6 +1117,7 @@ public class Launcher extends Activity
mHotseat = (Hotseat) findViewById(R.id.hotseat);
if (mHotseat != null) {
mHotseat.setup(this);
+ mHotseat.setOnLongClickListener(this);
}
mOverviewPanel = findViewById(R.id.overview_panel);
@@ -1630,10 +1634,7 @@ public class Launcher extends Activity
// If we are already on home, then just animate back to the workspace,
// otherwise, just wait until onResume to set the state back to Workspace
if (alreadyOnHome) {
- showWorkspace(true);
- if (mWorkspace.isInOverviewMode()) {
- mWorkspace.exitOverviewMode();
- }
+ showWorkspaceAndExitOverviewMode();
} else {
mOnResumeState = State.WORKSPACE;
}
@@ -1667,6 +1668,13 @@ public class Launcher extends Activity
}
}
+ protected void showWorkspaceAndExitOverviewMode() {
+ showWorkspace(true);
+ if (mWorkspace.isInOverviewMode()) {
+ mWorkspace.exitOverviewMode(true);
+ }
+ }
+
@Override
public void onRestoreInstanceState(Bundle state) {
super.onRestoreInstanceState(state);
@@ -1940,6 +1948,9 @@ public class Launcher extends Activity
}
}
+ protected void moveToCustomContentScreen(boolean animate) {
+ mWorkspace.moveToCustomContentScreen(animate);
+ }
/**
* Process a shortcut drop.
*
@@ -2120,7 +2131,7 @@ public class Launcher extends Activity
if (isAllAppsVisible()) {
showWorkspace(true);
} else if (mWorkspace.isInOverviewMode()) {
- mWorkspace.exitOverviewMode();
+ mWorkspace.exitOverviewMode(true);
} else if (mWorkspace.getOpenFolder() != null) {
Folder openFolder = mWorkspace.getOpenFolder();
if (openFolder.isEditingName()) {
@@ -2170,7 +2181,7 @@ public class Launcher extends Activity
if (v instanceof CellLayout) {
if (mWorkspace.isInOverviewMode()) {
- mWorkspace.exitOverviewMode(mWorkspace.indexOfChild(v));
+ mWorkspace.exitOverviewMode(mWorkspace.indexOfChild(v), true);
}
}
@@ -3560,8 +3571,10 @@ public class Launcher extends Activity
public void bindScreens(ArrayList<Long> orderedScreenIds) {
bindAddScreens(orderedScreenIds);
- // Create the new empty page
- mWorkspace.addExtraEmptyScreen();
+ // If there are no screens, we need to have an empty screen
+ if (orderedScreenIds.size() == 0) {
+ mWorkspace.addExtraEmptyScreen();
+ }
// Create the custom content page (this call updates mDefaultScreen which calls
// setCurrentPage() so ensure that all pages are added before calling this)
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 18e1c85ba..179c8aa76 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -2428,9 +2428,6 @@ public class LauncherModel extends BroadcastReceiver {
private void loadAllApps() {
final long loadTime = DEBUG_LOADERS ? SystemClock.uptimeMillis() : 0;
- // "two variables"?
- // Don't use these two variables in any of the callback runnables.
- // Otherwise we hold a reference to them.
final Callbacks oldCallbacks = mCallbacks.get();
if (oldCallbacks == null) {
// This launcher has exited and nobody bothered to tell us. Just bail.
@@ -2477,7 +2474,6 @@ public class LauncherModel extends BroadcastReceiver {
}
// Huh? Shouldn't this be inside the Runnable below?
- final Callbacks callbacks = tryGetCallbacks(oldCallbacks);
final ArrayList<AppInfo> added = mBgAllAppsList.added;
mBgAllAppsList.added = new ArrayList<AppInfo>();
@@ -2485,6 +2481,7 @@ public class LauncherModel extends BroadcastReceiver {
mHandler.post(new Runnable() {
public void run() {
final long bindTime = SystemClock.uptimeMillis();
+ final Callbacks callbacks = tryGetCallbacks(oldCallbacks);
if (callbacks != null) {
callbacks.bindAllApplications(added);
if (DEBUG_LOADERS) {
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index bdb0d5819..dcb71d274 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -2718,4 +2718,4 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
public boolean onHoverEvent(android.view.MotionEvent event) {
return true;
}
-} \ No newline at end of file
+}
diff --git a/src/com/android/launcher3/WallpaperCropActivity.java b/src/com/android/launcher3/WallpaperCropActivity.java
index dee9fe9ad..f5a6b80b3 100644
--- a/src/com/android/launcher3/WallpaperCropActivity.java
+++ b/src/com/android/launcher3/WallpaperCropActivity.java
@@ -22,6 +22,7 @@ import android.app.WallpaperManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
+import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
@@ -100,6 +101,10 @@ public class WallpaperCropActivity extends Activity {
});
}
+ public static String getSharedPreferencesKey() {
+ return WallpaperCropActivity.class.getName();
+ }
+
// As a ratio of screen height, the total distance we want the parallax effect to span
// horizontally
private static float wallpaperTravelToScreenWidthRatio(int width, int height) {
@@ -145,7 +150,7 @@ public class WallpaperCropActivity extends Activity {
// for the intended
// parallax effects
final int defaultWidth, defaultHeight;
- if (LauncherAppState.isScreenLarge(res)) {
+ if (isScreenLarge(res)) {
defaultWidth = (int) (maxDim * wallpaperTravelToScreenWidthRatio(maxDim, minDim));
defaultHeight = maxDim;
} else {
@@ -200,6 +205,11 @@ public class WallpaperCropActivity extends Activity {
cropTask.execute();
}
+ private static boolean isScreenLarge(Resources res) {
+ Configuration config = res.getConfiguration();
+ return config.smallestScreenWidthDp >= 720;
+ }
+
protected void cropImageAndSetWallpaper(Uri uri,
OnBitmapCroppedHandler onBitmapCroppedHandler, final boolean finishActivityWhenDone) {
// Get the crop
@@ -216,7 +226,7 @@ public class WallpaperCropActivity extends Activity {
int maxDim = Math.max(maxDims.x, maxDims.y);
final int minDim = Math.min(minDims.x, minDims.y);
int defaultWidth;
- if (LauncherAppState.isScreenLarge(getResources())) {
+ if (isScreenLarge(getResources())) {
defaultWidth = (int) (maxDim *
wallpaperTravelToScreenWidthRatio(maxDim, minDim));
} else {
@@ -564,7 +574,7 @@ public class WallpaperCropActivity extends Activity {
}
protected void updateWallpaperDimensions(int width, int height) {
- String spKey = LauncherAppState.getSharedPreferencesKey();
+ String spKey = getSharedPreferencesKey();
SharedPreferences sp = getSharedPreferences(spKey, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
if (width != 0 && height != 0) {
diff --git a/src/com/android/launcher3/WallpaperPickerActivity.java b/src/com/android/launcher3/WallpaperPickerActivity.java
index a0b9e6e7d..fe7525a00 100644
--- a/src/com/android/launcher3/WallpaperPickerActivity.java
+++ b/src/com/android/launcher3/WallpaperPickerActivity.java
@@ -306,27 +306,27 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
// Called when the user selects a contextual menu item
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
- switch (item.getItemId()) {
- case R.id.menu_delete:
- int childCount = mWallpapersView.getChildCount();
- ArrayList<View> viewsToRemove = new ArrayList<View>();
- for (int i = 0; i < childCount; i++) {
- CheckableFrameLayout c =
- (CheckableFrameLayout) mWallpapersView.getChildAt(i);
- if (c.isChecked()) {
- ThumbnailMetaData meta = (ThumbnailMetaData) c.getTag();
- mSavedImages.deleteImage(meta.mSavedWallpaperDbId);
- viewsToRemove.add(c);
- }
- }
- for (View v : viewsToRemove) {
- mWallpapersView.removeView(v);
+ int itemId = item.getItemId();
+ if (itemId == R.id.menu_delete) {
+ int childCount = mWallpapersView.getChildCount();
+ ArrayList<View> viewsToRemove = new ArrayList<View>();
+ for (int i = 0; i < childCount; i++) {
+ CheckableFrameLayout c =
+ (CheckableFrameLayout) mWallpapersView.getChildAt(i);
+ if (c.isChecked()) {
+ ThumbnailMetaData meta = (ThumbnailMetaData) c.getTag();
+ mSavedImages.deleteImage(meta.mSavedWallpaperDbId);
+ viewsToRemove.add(c);
}
- ///xxxxx DESTROYING
- mode.finish(); // Action picked, so close the CAB
- return true;
- default:
- return false;
+ }
+ for (View v : viewsToRemove) {
+ mWallpapersView.removeView(v);
+ }
+ ///xxxxx DESTROYING
+ mode.finish(); // Action picked, so close the CAB
+ return true;
+ } else {
+ return false;
}
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 3f63d743a..1818ade84 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -30,6 +30,7 @@ import android.appwidget.AppWidgetProviderInfo;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
+import android.content.SharedPreferences;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
@@ -51,6 +52,7 @@ import android.view.Display;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
+import android.view.ViewParent;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
import android.widget.TextView;
@@ -111,6 +113,8 @@ public class Workspace extends SmoothPagedView
private int mOriginalDefaultPage;
private int mDefaultPage;
+ private ShortcutAndWidgetContainer mDragSourceInternal;
+
// The screen id used for the empty screen always present to the right.
private final static long EXTRA_EMPTY_SCREEN_ID = -201;
private final static long CUSTOM_CONTENT_SCREEN_ID = -301;
@@ -353,7 +357,7 @@ public class Workspace extends SmoothPagedView
return r;
}
- public void onDragStart(DragSource source, Object info, int dragAction) {
+ public void onDragStart(final DragSource source, Object info, int dragAction) {
mIsDragOccuring = true;
updateChildrenLayersEnabled(false);
mLauncher.lockScreenOrientation();
@@ -361,6 +365,14 @@ public class Workspace extends SmoothPagedView
// Prevent any Un/InstallShortcutReceivers from updating the db while we are dragging
InstallShortcutReceiver.enableInstallQueue();
UninstallShortcutReceiver.enableUninstallQueue();
+ post(new Runnable() {
+ @Override
+ public void run() {
+ if (mIsDragOccuring) {
+ addExtraEmptyScreenOnDrag();
+ }
+ }
+ });
}
public void onDragEnd() {
@@ -371,6 +383,9 @@ public class Workspace extends SmoothPagedView
// Re-enable any Un/InstallShortcutReceiver and now process any queued items
InstallShortcutReceiver.disableAndFlushInstallQueue(getContext());
UninstallShortcutReceiver.disableAndFlushUninstallQueue(getContext());
+
+ removeExtraEmptyScreen();
+ mDragSourceInternal = null;
}
/**
@@ -489,6 +504,10 @@ public class Workspace extends SmoothPagedView
String log = "10249126 - insertNewWorkspaceScreen(" + screenId + ", " + insertIndex + ")";
Launcher.addDumpLog(TAG, log, true);
+ if (mWorkspaceScreens.containsKey(screenId)) {
+ throw new RuntimeException("Screen id " + screenId + " already exists!");
+ }
+
CellLayout newScreen = (CellLayout)
mLauncher.getLayoutInflater().inflate(R.layout.workspace_screen, null);
@@ -539,6 +558,49 @@ public class Workspace extends SmoothPagedView
mCustomContentCallbacks = callbacks;
}
+ public void addExtraEmptyScreenOnDrag() {
+ boolean lastChildOnScreen = false;
+ boolean childOnFinalScreen = false;
+
+ if (mDragSourceInternal != null) {
+ if (mDragSourceInternal.getChildCount() == 1) {
+ lastChildOnScreen = true;
+ }
+ CellLayout cl = (CellLayout) mDragSourceInternal.getParent();
+ if (indexOfChild(cl) == getChildCount() - 1) {
+ childOnFinalScreen = true;
+ }
+ }
+
+ // If this is the last item on the final screen
+ if (lastChildOnScreen && childOnFinalScreen) {
+ return;
+ }
+ if (!mWorkspaceScreens.containsKey(EXTRA_EMPTY_SCREEN_ID)) {
+ insertNewWorkspaceScreen(EXTRA_EMPTY_SCREEN_ID);
+ }
+ }
+
+ public boolean addExtraEmptyScreen() {
+ if (!mWorkspaceScreens.containsKey(EXTRA_EMPTY_SCREEN_ID)) {
+ insertNewWorkspaceScreen(EXTRA_EMPTY_SCREEN_ID);
+ return true;
+ }
+ return false;
+ }
+
+ public void removeExtraEmptyScreen() {
+ int nScreens = getChildCount();
+ nScreens = hasCustomContent() ? nScreens - 1 : nScreens;
+
+ if (mWorkspaceScreens.containsKey(EXTRA_EMPTY_SCREEN_ID) && nScreens > 1) {
+ CellLayout cl = mWorkspaceScreens.get(EXTRA_EMPTY_SCREEN_ID);
+ mWorkspaceScreens.remove(EXTRA_EMPTY_SCREEN_ID);
+ mScreenOrder.remove(EXTRA_EMPTY_SCREEN_ID);
+ removeView(cl);
+ }
+ }
+
public long commitExtraEmptyScreen() {
Launcher.addDumpLog(TAG, "10249126 - commitExtraEmptyScreen()", true);
@@ -554,17 +616,12 @@ public class Workspace extends SmoothPagedView
mWorkspaceScreens.put(newId, cl);
mScreenOrder.add(newId);
- addExtraEmptyScreen();
-
// Update the model for the new screen
mLauncher.getModel().updateWorkspaceScreenOrder(mLauncher, mScreenOrder);
return newId;
}
- public void addExtraEmptyScreen() {
- insertNewWorkspaceScreen(EXTRA_EMPTY_SCREEN_ID);
- }
public CellLayout getScreenWithId(long screenId) {
Launcher.addDumpLog(TAG, "10249126 - getScreenWithId(" + screenId + ")", true);
@@ -629,16 +686,27 @@ public class Workspace extends SmoothPagedView
}
}
+ // We enforce at least one page to add new items to. In the case that we remove the last
+ // such screen, we convert the last screen to the empty screen
+ int minScreens = hasCustomContent() ? 2 : 1;
+
int pageShift = 0;
for (Long id: removeScreens) {
Launcher.addDumpLog(TAG, "10249126 - \tremove(" + id + ")", true);
CellLayout cl = mWorkspaceScreens.get(id);
mWorkspaceScreens.remove(id);
mScreenOrder.remove(id);
- if (indexOfChild(cl) < currentPage) {
- pageShift++;
+
+ if (getChildCount() > minScreens) {
+ if (indexOfChild(cl) < currentPage) {
+ pageShift++;
+ }
+ removeView(cl);
+ } else {
+ // if this is the last non-custom content screen, convert it to the empty screen
+ mWorkspaceScreens.put(EXTRA_EMPTY_SCREEN_ID, cl);
+ mScreenOrder.add(EXTRA_EMPTY_SCREEN_ID);
}
- removeView(cl);
}
if (!removeScreens.isEmpty()) {
@@ -977,8 +1045,10 @@ public class Workspace extends SmoothPagedView
};
protected void setWallpaperDimension() {
+ String spKey = WallpaperCropActivity.getSharedPreferencesKey();
+ SharedPreferences sp = mLauncher.getSharedPreferences(spKey, Context.MODE_PRIVATE);
WallpaperPickerActivity.suggestWallpaperDimension(mLauncher.getResources(),
- mLauncher.getSharedPrefs(), mLauncher.getWindowManager(), mWallpaperManager);
+ sp, mLauncher.getWindowManager(), mWallpaperManager);
}
@@ -1266,9 +1336,10 @@ public class Workspace extends SmoothPagedView
}
private void updateStateForCustomContent(int screenCenter) {
- if (hasCustomContent() && !isSmall() && !isSwitchingState()) {
+ if (hasCustomContent()) {
int index = mScreenOrder.indexOf(CUSTOM_CONTENT_SCREEN_ID);
int scrollDelta = getScrollForPage(index + 1) - getScrollX();
+ float translationX = Math.max(scrollDelta, 0);
float progress = (1.0f * scrollDelta) /
(getScrollForPage(index + 1) - getScrollForPage(index));
progress = Math.max(0, progress);
@@ -1277,28 +1348,13 @@ public class Workspace extends SmoothPagedView
mLastCustomContentScrollProgress = progress;
setBackgroundAlpha(progress * 0.8f);
- float height = getViewportHeight();
- if (getPageIndicator() != null) {
- height -= getPageIndicator().getTop();
- } else if (mLauncher.getHotseat() != null) {
- height -= mLauncher.getHotseat().getTop();
- }
- float transY = progress * height;
if (mLauncher.getHotseat() != null) {
- mLauncher.getHotseat().setTranslationY(transY);
- mLauncher.getHotseat().setAlpha(1 - progress);
+ mLauncher.getHotseat().setTranslationX(translationX);
}
if (getPageIndicator() != null) {
- final float alpha = 1 - progress;
- final View pi = getPageIndicator();
- getPageIndicator().setAlpha(alpha);
- if (alpha < ALPHA_CUTOFF_THRESHOLD && pi.getVisibility() != INVISIBLE) {
- pi.setVisibility(INVISIBLE);
- } else if (alpha > ALPHA_CUTOFF_THRESHOLD && pi.getVisibility() != VISIBLE) {
- pi.setVisibility(VISIBLE);
- }
+ getPageIndicator().setTranslationX(translationX);
}
if (mCustomContentCallbacks != null) {
@@ -1701,35 +1757,37 @@ public class Workspace extends SmoothPagedView
}
public void enterOverviewMode() {
- enableOverviewMode(true, -1);
+ enableOverviewMode(true, -1, true);
}
- public void exitOverviewMode() {
- exitOverviewMode(-1);
+ public void exitOverviewMode(boolean animated) {
+ exitOverviewMode(-1, animated);
}
- public void exitOverviewMode(int snapPage) {
- enableOverviewMode(false, snapPage);
+ public void exitOverviewMode(int snapPage, boolean animated) {
+ enableOverviewMode(false, snapPage, animated);
}
- private void enableOverviewMode(boolean enable, int snapPage) {
+ private void enableOverviewMode(boolean enable, int snapPage, boolean animated) {
State finalState = Workspace.State.OVERVIEW;
if (!enable) {
finalState = Workspace.State.NORMAL;
}
- Animator workspaceAnim = getChangeStateAnimation(finalState, true, 0, snapPage);
- workspaceAnim.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator arg0) {
- mIsSwitchingState = false;
- }
- @Override
- public void onAnimationStart(Animator arg0) {
- mIsSwitchingState = true;
- }
- });
- workspaceAnim.start();
+ Animator workspaceAnim = getChangeStateAnimation(finalState, animated, 0, snapPage);
+ if (workspaceAnim != null) {
+ workspaceAnim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator arg0) {
+ mIsSwitchingState = false;
+ }
+ @Override
+ public void onAnimationStart(Animator arg0) {
+ mIsSwitchingState = true;
+ }
+ });
+ workspaceAnim.start();
+ }
}
Animator getChangeStateAnimation(final State state, boolean animated, int delay, int snapPage) {
@@ -1877,9 +1935,12 @@ public class Workspace extends SmoothPagedView
anim.setStartDelay(delay);
} else {
mLauncher.getOverviewPanel().setAlpha(finalOverviewPanelAlpha);
+ AlphaUpdateListener.updateVisibility(mLauncher.getOverviewPanel());
mLauncher.getHotseat().setAlpha(finalHotseatAndPageIndicatorAlpha);
+ AlphaUpdateListener.updateVisibility(mLauncher.getHotseat());
if (getPageIndicator() != null) {
getPageIndicator().setAlpha(finalHotseatAndPageIndicatorAlpha);
+ AlphaUpdateListener.updateVisibility(getPageIndicator());
}
}
@@ -1896,7 +1957,7 @@ public class Workspace extends SmoothPagedView
return anim;
}
- class AlphaUpdateListener implements AnimatorUpdateListener {
+ static class AlphaUpdateListener implements AnimatorUpdateListener {
View view;
public AlphaUpdateListener(View v) {
view = v;
@@ -1904,6 +1965,10 @@ public class Workspace extends SmoothPagedView
@Override
public void onAnimationUpdate(ValueAnimator arg0) {
+ updateVisibility(view);
+ }
+
+ public static void updateVisibility(View view) {
if (view.getAlpha() < ALPHA_CUTOFF_THRESHOLD && view.getVisibility() != INVISIBLE) {
view.setVisibility(INVISIBLE);
} else if (view.getAlpha() > ALPHA_CUTOFF_THRESHOLD
@@ -2130,6 +2195,11 @@ public class Workspace extends SmoothPagedView
mDragController.startDrag(b, dragLayerX, dragLayerY, source, child.getTag(),
DragController.DRAG_ACTION_MOVE, dragVisualizeOffset, dragRect, scale);
+
+ if (child.getParent() instanceof ShortcutAndWidgetContainer) {
+ mDragSourceInternal = (ShortcutAndWidgetContainer) child.getParent();
+ }
+
b.recycle();
}
@@ -4069,20 +4139,39 @@ public class Workspace extends SmoothPagedView
}
}
- void moveToDefaultScreen(boolean animate) {
+ private void moveToScreen(int page, boolean animate) {
if (!isSmall()) {
if (animate) {
- snapToPage(mDefaultPage);
+ snapToPage(page);
} else {
- setCurrentPage(mDefaultPage);
+ setCurrentPage(page);
}
}
- View child = getChildAt(mDefaultPage);
+ View child = getChildAt(page);
if (child != null) {
child.requestFocus();
}
}
+ void moveToDefaultScreen(boolean animate) {
+ moveToScreen(mDefaultPage, animate);
+ }
+
+ void moveToCustomContentScreen(boolean animate) {
+ if (hasCustomContent()) {
+ int ccIndex = getPageIndexForScreenId(CUSTOM_CONTENT_SCREEN_ID);
+ if (animate) {
+ snapToPage(ccIndex);
+ } else {
+ setCurrentPage(ccIndex);
+ }
+ View child = getChildAt(ccIndex);
+ if (child != null) {
+ child.requestFocus();
+ }
+ }
+ }
+
@Override
protected int getPageIndicatorMarker(int pageIndex) {
if (getScreenIdForPageIndex(pageIndex) == CUSTOM_CONTENT_SCREEN_ID) {