summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Android.mk5
-rw-r--r--AndroidManifest.xml51
-rw-r--r--CleanSpec.mk12
-rwxr-xr-xfill_screens.py4
-rwxr-xr-xprint_db.py2
-rw-r--r--proguard.flags20
-rw-r--r--res/drawable-hdpi/ic_launcher_edit_active_holo.pngbin0 -> 3112 bytes
-rw-r--r--res/drawable-hdpi/ic_launcher_edit_normal_holo.pngbin0 -> 1767 bytes
-rw-r--r--res/drawable-hdpi/ic_menu_overflow.pngbin0 -> 526 bytes
-rw-r--r--res/drawable-hdpi/page_hover_left_holo.9.pngbin255 -> 248 bytes
-rw-r--r--res/drawable-mdpi/ic_launcher_edit_active_holo.pngbin0 -> 1721 bytes
-rw-r--r--res/drawable-mdpi/ic_launcher_edit_normal_holo.pngbin0 -> 999 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_overflow.pngbin0 -> 445 bytes
-rw-r--r--res/drawable-mdpi/page_hover_left_holo.9.pngbin206 -> 177 bytes
-rw-r--r--res/drawable-xhdpi/ic_launcher_edit_active_holo.pngbin0 -> 4340 bytes
-rw-r--r--res/drawable-xhdpi/ic_launcher_edit_normal_holo.pngbin0 -> 4130 bytes
-rw-r--r--res/drawable-xhdpi/ic_menu_overflow.pngbin0 -> 554 bytes
-rw-r--r--res/drawable-xhdpi/page_hover_left_holo.9.pngbin304 -> 277 bytes
-rw-r--r--res/drawable/edit_target_selector.xml24
-rw-r--r--res/layout-land/all_apps_cling.xml6
-rw-r--r--res/layout-land/all_apps_sort_cling.xml48
-rw-r--r--res/layout-land/application.xml2
-rw-r--r--res/layout-land/apps_customize_application.xml4
-rw-r--r--res/layout-land/folder_cling.xml6
-rw-r--r--res/layout-land/folder_icon.xml6
-rw-r--r--res/layout-land/hotseat.xml36
-rw-r--r--res/layout-land/hotseat_page.xml33
-rw-r--r--res/layout-land/launcher.xml35
-rw-r--r--res/layout-land/search_bar.xml4
-rw-r--r--res/layout-land/workspace_cling.xml6
-rw-r--r--res/layout-port/all_apps_cling.xml6
-rw-r--r--res/layout-port/all_apps_sort_cling.xml48
-rw-r--r--res/layout-port/application.xml2
-rw-r--r--res/layout-port/apps_customize_application.xml4
-rw-r--r--res/layout-port/folder_cling.xml6
-rw-r--r--res/layout-port/folder_icon.xml6
-rw-r--r--res/layout-port/hotseat.xml36
-rw-r--r--res/layout-port/hotseat_page.xml33
-rw-r--r--res/layout-port/launcher.xml69
-rw-r--r--res/layout-port/search_bar.xml10
-rw-r--r--res/layout-port/workspace_cling.xml6
-rw-r--r--res/layout-sw600dp-port/all_apps_cling.xml6
-rw-r--r--res/layout-sw600dp-port/folder_cling.xml6
-rw-r--r--res/layout-sw600dp/all_apps_sort_cling.xml46
-rw-r--r--res/layout-sw720dp-port/folder_cling.xml6
-rw-r--r--res/layout-sw720dp/all_apps_cling.xml6
-rw-r--r--res/layout-sw720dp/folder_cling.xml6
-rw-r--r--res/layout-sw720dp/hotseat.xml36
-rw-r--r--res/layout-sw720dp/launcher.xml67
-rw-r--r--res/layout-sw720dp/search_bar.xml10
-rw-r--r--res/layout-sw720dp/workspace.xml13
-rw-r--r--res/layout-sw720dp/workspace_cling.xml6
-rw-r--r--res/layout/apps_customize_pane.xml45
-rw-r--r--res/layout/apps_customize_widget.xml8
-rw-r--r--res/layout/custom_workspace_cling.xml6
-rw-r--r--res/layout/dialog_edit.xml31
-rwxr-xr-xres/layout/double_number_picker_dialog.xml64
-rw-r--r--res/layout/drop_target_bar.xml15
-rw-r--r--res/layout/hidden_apps_list.xml8
-rw-r--r--res/layout/hidden_apps_list_item.xml34
-rw-r--r--res/layout/hotseat.xml (renamed from res/values-sw340dp-port/config.xml)10
-rw-r--r--res/layout/number_picker_dialog.xml28
-rw-r--r--res/layout/overflow_menu_button.xml32
-rw-r--r--res/layout/preference_header_item.xml66
-rw-r--r--res/layout/qsb_bar.xml4
-rw-r--r--res/layout/scroll_indicator.xml1
-rw-r--r--res/layout/seekbar_dialog.xml36
-rw-r--r--res/layout/tab_widget_indicator.xml2
-rw-r--r--res/layout/user_folder.xml10
-rw-r--r--res/layout/wallpaper_chooser.xml2
-rw-r--r--res/layout/wallpaper_chooser_base.xml2
-rw-r--r--res/layout/workspace_screen.xml4
-rw-r--r--res/menu/apps_tab.xml15
-rwxr-xr-x[-rw-r--r--]res/mipmap-hdpi/ic_launcher_home.pngbin4048 -> 23597 bytes
-rwxr-xr-x[-rw-r--r--]res/mipmap-mdpi/ic_launcher_home.pngbin3116 -> 12053 bytes
-rwxr-xr-x[-rw-r--r--]res/mipmap-xhdpi/ic_launcher_home.pngbin7810 -> 39749 bytes
-rw-r--r--res/values-af-land/strings.xml25
-rw-r--r--res/values-af/strings.xml1
-rw-r--r--res/values-am-land/strings.xml25
-rw-r--r--res/values-am/strings.xml1
-rw-r--r--res/values-ar-land/strings.xml25
-rw-r--r--res/values-ar/strings.xml1
-rw-r--r--res/values-be/strings.xml1
-rw-r--r--res/values-bg-land/strings.xml25
-rw-r--r--res/values-bg/strings.xml1
-rw-r--r--res/values-ca-land/strings.xml25
-rw-r--r--res/values-ca/strings.xml1
-rw-r--r--res/values-cs-land/strings.xml25
-rw-r--r--res/values-cs/strings.xml48
-rw-r--r--res/values-da-land/strings.xml25
-rw-r--r--res/values-da/strings.xml128
-rw-r--r--res/values-de-land/strings.xml25
-rw-r--r--res/values-de/arrays.xml70
-rw-r--r--res/values-de/strings.xml161
-rw-r--r--res/values-el-land/strings.xml25
-rw-r--r--res/values-el/strings.xml112
-rw-r--r--res/values-en-rGB-land/strings.xml25
-rw-r--r--res/values-en-rGB/strings.xml1
-rw-r--r--res/values-es-land/strings.xml25
-rw-r--r--res/values-es-rUS-land/strings.xml25
-rw-r--r--res/values-es-rUS/strings.xml1
-rw-r--r--res/values-es/arrays.xml66
-rw-r--r--res/values-es/strings.xml94
-rw-r--r--res/values-et/strings.xml1
-rw-r--r--res/values-fa-land/strings.xml25
-rw-r--r--res/values-fa/strings.xml1
-rw-r--r--res/values-fi-land/strings.xml25
-rw-r--r--res/values-fi/arrays.xml66
-rw-r--r--res/values-fi/strings.xml89
-rw-r--r--res/values-fr-land/strings.xml25
-rw-r--r--res/values-fr/arrays.xml66
-rw-r--r--res/values-fr/strings.xml118
-rw-r--r--res/values-hi/strings.xml1
-rw-r--r--res/values-hr-land/strings.xml25
-rw-r--r--res/values-hr/strings.xml1
-rw-r--r--res/values-hu-land/strings.xml25
-rw-r--r--res/values-hu/arrays.xml66
-rw-r--r--res/values-hu/strings.xml124
-rw-r--r--res/values-in-land/strings.xml25
-rw-r--r--res/values-in/strings.xml1
-rw-r--r--res/values-it-land/strings.xml25
-rw-r--r--res/values-it/arrays.xml57
-rw-r--r--res/values-it/strings.xml92
-rw-r--r--res/values-iw-land/strings.xml25
-rw-r--r--res/values-iw/strings.xml1
-rw-r--r--res/values-ja-land/strings.xml25
-rw-r--r--res/values-ja/strings.xml114
-rw-r--r--res/values-ko-land/strings.xml25
-rw-r--r--res/values-ko/strings.xml1
-rw-r--r--res/values-land/config.xml2
-rw-r--r--res/values-land/dimens.xml5
-rw-r--r--res/values-lt-land/strings.xml25
-rw-r--r--res/values-lt/strings.xml83
-rw-r--r--res/values-lv-land/strings.xml25
-rw-r--r--res/values-lv/strings.xml1
-rw-r--r--res/values-ms-land/strings.xml25
-rw-r--r--res/values-ms/strings.xml1
-rw-r--r--res/values-nb-land/strings.xml25
-rw-r--r--res/values-nb/strings.xml1
-rw-r--r--res/values-nl-land/strings.xml25
-rw-r--r--res/values-nl/arrays.xml64
-rw-r--r--res/values-nl/strings.xml174
-rw-r--r--res/values-pl-land/strings.xml25
-rw-r--r--res/values-pl/strings.xml1
-rw-r--r--res/values-port/dimens.xml5
-rw-r--r--res/values-pt-land/strings.xml25
-rw-r--r--res/values-pt-rPT-land/strings.xml25
-rw-r--r--res/values-pt-rPT/strings.xml1
-rwxr-xr-xres/values-pt/arrays.xml66
-rwxr-xr-x[-rw-r--r--]res/values-pt/strings.xml91
-rw-r--r--res/values-rm-land/strings.xml25
-rw-r--r--res/values-rm/strings.xml1
-rw-r--r--res/values-ro-land/strings.xml25
-rw-r--r--res/values-ro/arrays.xml66
-rw-r--r--res/values-ro/strings.xml95
-rw-r--r--res/values-ru-land/strings.xml25
-rw-r--r--res/values-ru/arrays.xml66
-rw-r--r--res/values-ru/strings.xml106
-rw-r--r--res/values-sk-land/strings.xml25
-rw-r--r--res/values-sk/strings.xml1
-rw-r--r--res/values-sl-land/strings.xml25
-rw-r--r--res/values-sl/strings.xml1
-rw-r--r--res/values-sr-land/strings.xml25
-rw-r--r--res/values-sr/strings.xml1
-rw-r--r--res/values-sv-land/strings.xml25
-rw-r--r--res/values-sv/strings.xml1
-rw-r--r--res/values-sw-land/strings.xml25
-rw-r--r--res/values-sw/strings.xml1
-rw-r--r--res/values-sw340dp/dimens.xml6
-rw-r--r--res/values-sw600dp/config.xml8
-rw-r--r--res/values-sw720dp/config.xml6
-rw-r--r--res/values-sw720dp/dimens.xml3
-rw-r--r--res/values-th-land/strings.xml25
-rw-r--r--res/values-th/strings.xml1
-rw-r--r--res/values-tl-land/strings.xml25
-rw-r--r--res/values-tl/strings.xml1
-rw-r--r--res/values-tr-land/strings.xml25
-rw-r--r--res/values-tr/strings.xml72
-rw-r--r--res/values-ug/strings.xml103
-rw-r--r--res/values-uk-land/strings.xml25
-rw-r--r--res/values-uk/strings.xml1
-rw-r--r--res/values-vi-land/strings.xml25
-rw-r--r--res/values-vi/strings.xml1
-rw-r--r--res/values-zh-rCN-land/strings.xml25
-rw-r--r--res/values-zh-rCN/arrays.xml67
-rw-r--r--res/values-zh-rCN/strings.xml121
-rw-r--r--res/values-zh-rTW-land/strings.xml25
-rw-r--r--res/values-zh-rTW/strings.xml1
-rw-r--r--res/values-zu-land/strings.xml25
-rw-r--r--res/values-zu/strings.xml1
-rw-r--r--res/values/arrays.xml111
-rw-r--r--res/values/attrs.xml59
-rw-r--r--res/values/colors.xml1
-rw-r--r--res/values/config.xml23
-rw-r--r--res/values/dimens.xml22
-rw-r--r--res/values/strings.xml129
-rw-r--r--res/xml-sw600dp/default_workspace.xml15
-rw-r--r--res/xml-sw720dp/default_workspace.xml39
-rw-r--r--res/xml/default_workspace.xml13
-rw-r--r--res/xml/preferences_dock.xml59
-rw-r--r--res/xml/preferences_drawer.xml69
-rw-r--r--res/xml/preferences_general.xml26
-rw-r--r--res/xml/preferences_headers.xml43
-rw-r--r--res/xml/preferences_homescreen.xml105
-rw-r--r--res/xml/update_workspace.xml16
-rw-r--r--src/com/android/launcher2/HandleView.java76
-rw-r--r--src/com/android/launcher2/Hotseat.java147
-rw-r--r--src/com/android/launcher2/SmoothPagedView.java188
-rw-r--r--src/com/android/launcher2/SymmetricalLinearTween.java118
-rw-r--r--src/com/android/launcher2/TweenCallback.java24
-rw-r--r--src/com/cyanogenmod/trebuchet/AccessibleTabView.java (renamed from src/com/android/launcher2/AccessibleTabView.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/AddAdapter.java (renamed from src/com/android/launcher2/AddAdapter.java)4
-rw-r--r--src/com/cyanogenmod/trebuchet/Alarm.java (renamed from src/com/android/launcher2/Alarm.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/AllAppsList.java (renamed from src/com/android/launcher2/AllAppsList.java)10
-rw-r--r--src/com/cyanogenmod/trebuchet/AppWidgetResizeFrame.java (renamed from src/com/android/launcher2/AppWidgetResizeFrame.java)20
-rw-r--r--src/com/cyanogenmod/trebuchet/ApplicationInfo.java (renamed from src/com/android/launcher2/ApplicationInfo.java)4
-rw-r--r--src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java (renamed from src/com/android/launcher2/AppsCustomizePagedView.java)1046
-rw-r--r--src/com/cyanogenmod/trebuchet/AppsCustomizeTabHost.java (renamed from src/com/android/launcher2/AppsCustomizeTabHost.java)208
-rw-r--r--src/com/cyanogenmod/trebuchet/BubbleTextView.java (renamed from src/com/android/launcher2/BubbleTextView.java)29
-rw-r--r--src/com/cyanogenmod/trebuchet/ButtonDropTarget.java (renamed from src/com/android/launcher2/ButtonDropTarget.java)10
-rw-r--r--src/com/cyanogenmod/trebuchet/CellLayout.java (renamed from src/com/android/launcher2/CellLayout.java)103
-rw-r--r--src/com/cyanogenmod/trebuchet/CheckLongPressHelper.java (renamed from src/com/android/launcher2/CheckLongPressHelper.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/Cling.java (renamed from src/com/android/launcher2/Cling.java)36
-rw-r--r--src/com/cyanogenmod/trebuchet/DeferredHandler.java (renamed from src/com/android/launcher2/DeferredHandler.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/DeleteDropTarget.java (renamed from src/com/android/launcher2/DeleteDropTarget.java)238
-rw-r--r--src/com/cyanogenmod/trebuchet/DragController.java (renamed from src/com/android/launcher2/DragController.java)20
-rw-r--r--src/com/cyanogenmod/trebuchet/DragLayer.java (renamed from src/com/android/launcher2/DragLayer.java)88
-rw-r--r--src/com/cyanogenmod/trebuchet/DragScroller.java (renamed from src/com/android/launcher2/DragScroller.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/DragSource.java (renamed from src/com/android/launcher2/DragSource.java)4
-rw-r--r--src/com/cyanogenmod/trebuchet/DragView.java (renamed from src/com/android/launcher2/DragView.java)4
-rw-r--r--src/com/cyanogenmod/trebuchet/DrawableStateProxyView.java (renamed from src/com/android/launcher2/DrawableStateProxyView.java)4
-rw-r--r--src/com/cyanogenmod/trebuchet/DropTarget.java (renamed from src/com/android/launcher2/DropTarget.java)5
-rw-r--r--src/com/cyanogenmod/trebuchet/EditDropTarget.java125
-rw-r--r--src/com/cyanogenmod/trebuchet/FastBitmapDrawable.java (renamed from src/com/android/launcher2/FastBitmapDrawable.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/FocusHelper.java (renamed from src/com/android/launcher2/FocusHelper.java)27
-rw-r--r--src/com/cyanogenmod/trebuchet/FocusOnlyTabWidget.java (renamed from src/com/android/launcher2/FocusOnlyTabWidget.java)6
-rw-r--r--src/com/cyanogenmod/trebuchet/Folder.java (renamed from src/com/android/launcher2/Folder.java)44
-rw-r--r--src/com/cyanogenmod/trebuchet/FolderEditText.java (renamed from src/com/android/launcher2/FolderEditText.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/FolderIcon.java (renamed from src/com/android/launcher2/FolderIcon.java)60
-rw-r--r--src/com/cyanogenmod/trebuchet/FolderInfo.java (renamed from src/com/android/launcher2/FolderInfo.java)18
-rw-r--r--src/com/cyanogenmod/trebuchet/HideFromAccessibilityHelper.java (renamed from src/com/android/launcher2/HideFromAccessibilityHelper.java)4
-rw-r--r--src/com/cyanogenmod/trebuchet/HolographicImageView.java (renamed from src/com/android/launcher2/HolographicImageView.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/HolographicLinearLayout.java (renamed from src/com/android/launcher2/HolographicLinearLayout.java)4
-rw-r--r--src/com/cyanogenmod/trebuchet/HolographicOutlineHelper.java (renamed from src/com/android/launcher2/HolographicOutlineHelper.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/HolographicViewHelper.java (renamed from src/com/android/launcher2/HolographicViewHelper.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/Hotseat.java246
-rw-r--r--src/com/cyanogenmod/trebuchet/IconCache.java (renamed from src/com/android/launcher2/IconCache.java)8
-rw-r--r--src/com/cyanogenmod/trebuchet/InfoDropTarget.java (renamed from src/com/android/launcher2/InfoDropTarget.java)9
-rw-r--r--src/com/cyanogenmod/trebuchet/InstallShortcutReceiver.java (renamed from src/com/android/launcher2/InstallShortcutReceiver.java)39
-rw-r--r--src/com/cyanogenmod/trebuchet/InstallWidgetReceiver.java (renamed from src/com/android/launcher2/InstallWidgetReceiver.java)14
-rw-r--r--src/com/cyanogenmod/trebuchet/InterruptibleInOutAnimator.java (renamed from src/com/android/launcher2/InterruptibleInOutAnimator.java)4
-rw-r--r--src/com/cyanogenmod/trebuchet/ItemInfo.java (renamed from src/com/android/launcher2/ItemInfo.java)19
-rw-r--r--src/com/cyanogenmod/trebuchet/Launcher.java (renamed from src/com/android/launcher2/Launcher.java)567
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherAnimUtils.java (renamed from src/com/android/launcher2/LauncherAnimUtils.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherAnimatorUpdateListener.java (renamed from src/com/android/launcher2/LauncherAnimatorUpdateListener.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherAppWidgetHost.java (renamed from src/com/android/launcher2/LauncherAppWidgetHost.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherAppWidgetHostView.java (renamed from src/com/android/launcher2/LauncherAppWidgetHostView.java)9
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherAppWidgetInfo.java (renamed from src/com/android/launcher2/LauncherAppWidgetInfo.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherApplication.java (renamed from src/com/android/launcher2/LauncherApplication.java)6
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherModel.java (renamed from src/com/android/launcher2/LauncherModel.java)441
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherProvider.java (renamed from src/com/android/launcher2/LauncherProvider.java)344
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherSettings.java (renamed from src/com/android/launcher2/LauncherSettings.java)56
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherViewPropertyAnimator.java (renamed from src/com/android/launcher2/LauncherViewPropertyAnimator.java)13
-rw-r--r--src/com/cyanogenmod/trebuchet/PagedView.java (renamed from src/com/android/launcher2/PagedView.java)698
-rw-r--r--src/com/cyanogenmod/trebuchet/PagedViewCellLayout.java (renamed from src/com/android/launcher2/PagedViewCellLayout.java)10
-rw-r--r--src/com/cyanogenmod/trebuchet/PagedViewCellLayoutChildren.java (renamed from src/com/android/launcher2/PagedViewCellLayoutChildren.java)4
-rw-r--r--src/com/cyanogenmod/trebuchet/PagedViewGridLayout.java (renamed from src/com/android/launcher2/PagedViewGridLayout.java)4
-rw-r--r--src/com/cyanogenmod/trebuchet/PagedViewIcon.java (renamed from src/com/android/launcher2/PagedViewIcon.java)4
-rw-r--r--src/com/cyanogenmod/trebuchet/PagedViewIconCache.java (renamed from src/com/android/launcher2/PagedViewIconCache.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/PagedViewWidget.java (renamed from src/com/android/launcher2/PagedViewWidget.java)12
-rw-r--r--src/com/cyanogenmod/trebuchet/PagedViewWidgetImageView.java (renamed from src/com/android/launcher2/PagedViewWidgetImageView.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/PagedViewWithDraggableItems.java (renamed from src/com/android/launcher2/PagedViewWithDraggableItems.java)2
-rw-r--r--src/com/cyanogenmod/trebuchet/PendingAddItemInfo.java (renamed from src/com/android/launcher2/PendingAddItemInfo.java)3
-rw-r--r--src/com/cyanogenmod/trebuchet/PreloadReceiver.java (renamed from src/com/android/launcher2/PreloadReceiver.java)6
-rw-r--r--src/com/cyanogenmod/trebuchet/SearchDropTargetBar.java (renamed from src/com/android/launcher2/SearchDropTargetBar.java)59
-rw-r--r--src/com/cyanogenmod/trebuchet/ShortcutAndWidgetContainer.java (renamed from src/com/android/launcher2/ShortcutAndWidgetContainer.java)4
-rw-r--r--src/com/cyanogenmod/trebuchet/ShortcutInfo.java (renamed from src/com/android/launcher2/ShortcutInfo.java)37
-rw-r--r--src/com/cyanogenmod/trebuchet/SpringLoadedDragController.java (renamed from src/com/android/launcher2/SpringLoadedDragController.java)12
-rw-r--r--src/com/cyanogenmod/trebuchet/StrokedTextView.java (renamed from src/com/android/launcher2/StrokedTextView.java)16
-rw-r--r--src/com/cyanogenmod/trebuchet/UninstallShortcutReceiver.java (renamed from src/com/android/launcher2/UninstallShortcutReceiver.java)6
-rw-r--r--src/com/cyanogenmod/trebuchet/UserInitializeReceiver.java (renamed from src/com/android/launcher2/UserInitializeReceiver.java)7
-rw-r--r--src/com/cyanogenmod/trebuchet/Utilities.java (renamed from src/com/android/launcher2/Utilities.java)31
-rw-r--r--src/com/cyanogenmod/trebuchet/WallpaperChooser.java (renamed from src/com/android/launcher2/WallpaperChooser.java)6
-rw-r--r--src/com/cyanogenmod/trebuchet/WallpaperChooserDialogFragment.java (renamed from src/com/android/launcher2/WallpaperChooserDialogFragment.java)26
-rw-r--r--src/com/cyanogenmod/trebuchet/Workspace.java (renamed from src/com/android/launcher2/Workspace.java)1354
-rw-r--r--src/com/cyanogenmod/trebuchet/preference/DoubleNumberPickerPreference.java186
-rw-r--r--src/com/cyanogenmod/trebuchet/preference/HiddenAppsActivity.java234
-rw-r--r--src/com/cyanogenmod/trebuchet/preference/NumberPickerPreference.java104
-rw-r--r--src/com/cyanogenmod/trebuchet/preference/Preferences.java257
-rw-r--r--src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java216
-rw-r--r--src/com/cyanogenmod/trebuchet/preference/SeekBarDialogPreference.java82
-rw-r--r--src/com/cyanogenmod/trebuchet/widget/CheckableLinearLayout.java50
-rw-r--r--src/com/cyanogenmod/trebuchet/widget/CustomAbsSpinner.java507
-rw-r--r--src/com/cyanogenmod/trebuchet/widget/CustomAdapterView.java1130
-rw-r--r--src/com/cyanogenmod/trebuchet/widget/EcoGallery.java1363
-rw-r--r--src/com/cyanogenmod/trebuchet/widget/InertCheckBox.java69
-rw-r--r--tests/stress/Android.mk4
-rw-r--r--tests/stress/AndroidManifest.xml2
-rw-r--r--tests/stress/src/com/cyanogenmod/trebuchet/stress/LauncherRotationStressTest.java (renamed from tests/stress/src/com/android/launcher2/stress/LauncherRotationStressTest.java)8
299 files changed, 12344 insertions, 4403 deletions
diff --git a/Android.mk b/Android.mk
index 351954130..2a427c2db 100644
--- a/Android.mk
+++ b/Android.mk
@@ -22,12 +22,11 @@ LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_JAVA_LIBRARIES := android-common android-support-v13
LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
-LOCAL_SDK_VERSION := current
-LOCAL_PACKAGE_NAME := Launcher2
+LOCAL_PACKAGE_NAME := Trebuchet
LOCAL_CERTIFICATE := shared
-LOCAL_OVERRIDES_PACKAGES := Home
+LOCAL_OVERRIDES_PACKAGES := Home Launcher2
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index c14b63ed8..78e4db744 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -19,9 +19,10 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.launcher">
+ package="com.cyanogenmod.trebuchet"
+ android:versionName="@string/application_version">
- <original-package android:name="com.android.launcher2" />
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="17" />
<permission
android:name="com.android.launcher.permission.PRELOAD_WORKSPACE"
@@ -38,19 +39,19 @@
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="dangerous"
android:label="@string/permlab_uninstall_shortcut"
- android:description="@string/permdesc_uninstall_shortcut"/>
+ android:description="@string/permdesc_uninstall_shortcut" />
<permission
android:name="com.android.launcher.permission.READ_SETTINGS"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_read_settings"
- android:description="@string/permdesc_read_settings"/>
+ android:description="@string/permdesc_read_settings" />
<permission
android:name="com.android.launcher.permission.WRITE_SETTINGS"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_write_settings"
- android:description="@string/permdesc_write_settings"/>
+ android:description="@string/permdesc_write_settings" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
@@ -62,30 +63,29 @@
<uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS" />
<application
- android:name="com.android.launcher2.LauncherApplication"
+ android:name="com.cyanogenmod.trebuchet.LauncherApplication"
android:label="@string/application_name"
android:icon="@mipmap/ic_launcher_home"
android:hardwareAccelerated="true"
android:largeHeap="@bool/config_largeHeap"
android:supportsRtl="true">
<activity
- android:name="com.android.launcher2.Launcher"
+ android:name="com.cyanogenmod.trebuchet.Launcher"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:theme="@style/Theme"
- android:windowSoftInputMode="adjustPan"
- android:screenOrientation="nosensor">
+ android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
- <category android:name="android.intent.category.MONKEY"/>
+ <category android:name="android.intent.category.MONKEY" />
</intent-filter>
</activity>
<activity
- android:name="com.android.launcher2.WallpaperChooser"
+ android:name="com.cyanogenmod.trebuchet.WallpaperChooser"
android:theme="@style/Theme.WallpaperPicker"
android:label="@string/pick_wallpaper"
android:icon="@mipmap/ic_launcher_wallpaper"
@@ -101,16 +101,27 @@
<!-- Intent received used to prepopulate the default workspace. -->
<receiver
- android:name="com.android.launcher2.PreloadReceiver"
+ android:name="com.cyanogenmod.trebuchet.PreloadReceiver"
android:permission="com.android.launcher.permission.PRELOAD_WORKSPACE">
<intent-filter>
<action android:name="com.android.launcher.action.PRELOAD_WORKSPACE" />
</intent-filter>
</receiver>
+ <activity android:name="com.cyanogenmod.trebuchet.preference.Preferences"
+ android:label="@string/preferences_title">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="com.cyanogenmod.category.LAUNCHER_PREFERENCES" />
+ </intent-filter>
+ </activity>
+
+ <activity android:name="com.cyanogenmod.trebuchet.preference.HiddenAppsActivity"
+ android:label="@string/hidden_apps_title" />
+
<!-- Intent received used to install shortcuts from other applications -->
<receiver
- android:name="com.android.launcher2.InstallShortcutReceiver"
+ android:name="com.cyanogenmod.trebuchet.InstallShortcutReceiver"
android:permission="com.android.launcher.permission.INSTALL_SHORTCUT">
<intent-filter>
<action android:name="com.android.launcher.action.INSTALL_SHORTCUT" />
@@ -119,7 +130,7 @@
<!-- Intent received used to uninstall shortcuts from other applications -->
<receiver
- android:name="com.android.launcher2.UninstallShortcutReceiver"
+ android:name="com.cyanogenmod.trebuchet.UninstallShortcutReceiver"
android:permission="com.android.launcher.permission.UNINSTALL_SHORTCUT">
<intent-filter>
<action android:name="com.android.launcher.action.UNINSTALL_SHORTCUT" />
@@ -128,22 +139,22 @@
<!-- New user initialization; set up initial wallpaper -->
<receiver
- android:name="com.android.launcher2.UserInitializeReceiver"
+ android:name="com.cyanogenmod.trebuchet.UserInitializeReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.USER_INITIALIZE" />
</intent-filter>
</receiver>
-
+
<!-- The settings provider contains Home's data, like the workspace favorites -->
<provider
- android:name="com.android.launcher2.LauncherProvider"
- android:authorities="com.android.launcher2.settings"
- android:exported="true"
+ android:name="com.cyanogenmod.trebuchet.LauncherProvider"
+ android:authorities="com.cyanogenmod.trebuchet.settings"
android:writePermission="com.android.launcher.permission.WRITE_SETTINGS"
+ android:exported="true"
android:readPermission="com.android.launcher.permission.READ_SETTINGS" />
<meta-data android:name="android.nfc.disable_beam_default"
- android:value="true" />
+ android:value="true" />
</application>
</manifest>
diff --git a/CleanSpec.mk b/CleanSpec.mk
index c1323951b..9ffad607e 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -44,12 +44,12 @@
#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
-$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Launcher2_intermediates)
-$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Launcher2_intermediates)
-$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Launcher2_intermediates)
-$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Launcher2_intermediates)
-$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Launcher2_intermediates)
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/Launcher2.apk)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Trebuchet_intermediates)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Trebuchet_intermediates)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Trebuchet_intermediates)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Trebuchet_intermediates)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Trebuchet_intermediates)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/Trebuchet.apk)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
diff --git a/fill_screens.py b/fill_screens.py
index 5841b8e49..c4badb9f6 100755
--- a/fill_screens.py
+++ b/fill_screens.py
@@ -34,7 +34,7 @@ def make_dir():
def pull_file(fn):
print "pull_file: " + fn
rv = os.system("adb pull"
- + " /data/data/com.android.launcher/databases/launcher.db"
+ + " /data/data/com.cyanogenmod.trebuchet/databases/launcher.db"
+ " " + fn);
if rv != 0:
print "adb pull failed"
@@ -44,7 +44,7 @@ def push_file(fn):
print "push_file: " + fn
rv = os.system("adb push"
+ " " + fn
- + " /data/data/com.android.launcher/databases/launcher.db")
+ + " /data/data/com.cyanogenmod.trebuchet/databases/launcher.db")
if rv != 0:
print "adb push failed"
sys.exit(1)
diff --git a/print_db.py b/print_db.py
index 4f90f94f1..b5bb8d4a5 100755
--- a/print_db.py
+++ b/print_db.py
@@ -32,7 +32,7 @@ def make_dir():
def pull_file(fn):
print "pull_file: " + fn
rv = os.system("adb pull"
- + " /data/data/com.android.launcher/databases/launcher.db"
+ + " /data/data/com.cyanogenmod.trebuchet/databases/launcher.db"
+ " " + fn);
if rv != 0:
print "adb pull failed"
diff --git a/proguard.flags b/proguard.flags
index 0cde28ec1..8936a458c 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -1,4 +1,4 @@
--keep class com.android.launcher2.Launcher {
+-keep class com.cyanogenmod.trebuchet.Launcher {
public void previousScreen(android.view.View);
public void nextScreen(android.view.View);
public void launchHotSeat(android.view.View);
@@ -7,11 +7,13 @@
public void onClickConfigureButton(android.view.View);
public void onClickAllAppsButton(android.view.View);
public void onClickAppMarketButton(android.view.View);
+ public void onClickOverflowMenuButton(android.view.View);
public void dismissWorkspaceCling(android.view.View);
public void dismissAllAppsCling(android.view.View);
+ public void dismissAllAppsSortCling(android.view.View);
}
--keep class com.android.launcher2.CellLayout {
+-keep class com.cyanogenmod.trebuchet.CellLayout {
public float getBackgroundAlpha();
public void setBackgroundAlpha(float);
public float getDimmableProgress();
@@ -22,7 +24,7 @@
public void setHoverAlpha(float);
}
--keep class com.android.launcher2.DragLayer$LayoutParams {
+-keep class com.cyanogenmod.trebuchet.DragLayer$LayoutParams {
public void setWidth(int);
public int getWidth();
public void setHeight(int);
@@ -33,7 +35,7 @@
public int getY();
}
--keep class com.android.launcher2.CellLayout$LayoutParams {
+-keep class com.cyanogenmod.trebuchet.CellLayout$LayoutParams {
public void setWidth(int);
public int getWidth();
public void setHeight(int);
@@ -44,7 +46,7 @@
public int getY();
}
--keep class com.android.launcher2.Workspace {
+-keep class com.cyanogenmod.trebuchet.Workspace {
public float getBackgroundAlpha();
public void setBackgroundAlpha(float);
public float getChildrenOutlineAlpha();
@@ -55,10 +57,4 @@
public float getHorizontalWallpaperOffset();
}
--keep class com.android.launcher2.AllApps3D$Defines {
- *;
-}
-
--keep class com.android.launcher2.ClippedImageView {
- *;
-}
+-keep class com.cyanogenmod.trebuchet.preference.Preferences$*Fragment
diff --git a/res/drawable-hdpi/ic_launcher_edit_active_holo.png b/res/drawable-hdpi/ic_launcher_edit_active_holo.png
new file mode 100644
index 000000000..7efd048d5
--- /dev/null
+++ b/res/drawable-hdpi/ic_launcher_edit_active_holo.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_launcher_edit_normal_holo.png b/res/drawable-hdpi/ic_launcher_edit_normal_holo.png
new file mode 100644
index 000000000..6d2071d32
--- /dev/null
+++ b/res/drawable-hdpi/ic_launcher_edit_normal_holo.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_menu_overflow.png b/res/drawable-hdpi/ic_menu_overflow.png
new file mode 100644
index 000000000..a12aedfaf
--- /dev/null
+++ b/res/drawable-hdpi/ic_menu_overflow.png
Binary files differ
diff --git a/res/drawable-hdpi/page_hover_left_holo.9.png b/res/drawable-hdpi/page_hover_left_holo.9.png
index 2ac2c39b6..833828b64 100644
--- a/res/drawable-hdpi/page_hover_left_holo.9.png
+++ b/res/drawable-hdpi/page_hover_left_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_launcher_edit_active_holo.png b/res/drawable-mdpi/ic_launcher_edit_active_holo.png
new file mode 100644
index 000000000..54e971689
--- /dev/null
+++ b/res/drawable-mdpi/ic_launcher_edit_active_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_launcher_edit_normal_holo.png b/res/drawable-mdpi/ic_launcher_edit_normal_holo.png
new file mode 100644
index 000000000..d70376b92
--- /dev/null
+++ b/res/drawable-mdpi/ic_launcher_edit_normal_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_menu_overflow.png b/res/drawable-mdpi/ic_menu_overflow.png
new file mode 100644
index 000000000..4a3bde3b1
--- /dev/null
+++ b/res/drawable-mdpi/ic_menu_overflow.png
Binary files differ
diff --git a/res/drawable-mdpi/page_hover_left_holo.9.png b/res/drawable-mdpi/page_hover_left_holo.9.png
index e1e84c934..0d73ec212 100644
--- a/res/drawable-mdpi/page_hover_left_holo.9.png
+++ b/res/drawable-mdpi/page_hover_left_holo.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_launcher_edit_active_holo.png b/res/drawable-xhdpi/ic_launcher_edit_active_holo.png
new file mode 100644
index 000000000..d9adc90ee
--- /dev/null
+++ b/res/drawable-xhdpi/ic_launcher_edit_active_holo.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_launcher_edit_normal_holo.png b/res/drawable-xhdpi/ic_launcher_edit_normal_holo.png
new file mode 100644
index 000000000..9315f0f10
--- /dev/null
+++ b/res/drawable-xhdpi/ic_launcher_edit_normal_holo.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menu_overflow.png b/res/drawable-xhdpi/ic_menu_overflow.png
new file mode 100644
index 000000000..715cff8c8
--- /dev/null
+++ b/res/drawable-xhdpi/ic_menu_overflow.png
Binary files differ
diff --git a/res/drawable-xhdpi/page_hover_left_holo.9.png b/res/drawable-xhdpi/page_hover_left_holo.9.png
index b00d367ee..0dcd5b738 100644
--- a/res/drawable-xhdpi/page_hover_left_holo.9.png
+++ b/res/drawable-xhdpi/page_hover_left_holo.9.png
Binary files differ
diff --git a/res/drawable/edit_target_selector.xml b/res/drawable/edit_target_selector.xml
new file mode 100644
index 000000000..3a70300f6
--- /dev/null
+++ b/res/drawable/edit_target_selector.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 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.
+*/
+-->
+
+<transition xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/ic_launcher_edit_normal_holo" />
+ <item android:drawable="@drawable/ic_launcher_edit_active_holo" />
+</transition> \ No newline at end of file
diff --git a/res/layout-land/all_apps_cling.xml b/res/layout-land/all_apps_cling.xml
index e89d4c178..e8bd5fa02 100644
--- a/res/layout-land/all_apps_cling.xml
+++ b/res/layout-land/all_apps_cling.xml
@@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.Cling
+<com.cyanogenmod.trebuchet.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
launcher:drawIdentifier="all_apps_landscape">
<FrameLayout
android:layout_width="match_parent"
@@ -45,4 +45,4 @@
android:layout_marginRight="10dp"
android:layout_gravity="bottom|right"
android:onClick="dismissAllAppsCling" />
-</com.android.launcher2.Cling>
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout-land/all_apps_sort_cling.xml b/res/layout-land/all_apps_sort_cling.xml
new file mode 100644
index 000000000..6076a59a5
--- /dev/null
+++ b/res/layout-land/all_apps_sort_cling.xml
@@ -0,0 +1,48 @@
+<?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.
+-->
+<com.cyanogenmod.trebuchet.Cling
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
+ launcher:drawIdentifier="all_apps_sort_landscape">
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="60dp"
+ android:layout_marginTop="50dp">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+ <TextView
+ style="@style/ClingTitleText"
+ android:id="@+id/all_apps_sort_cling_title"
+ android:text="@string/all_apps_sort_cling_title" />
+ <TextView
+ style="@style/ClingText"
+ android:id="@+id/all_apps_sort_cling_add_item"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/all_apps_sort_cling_add_item" />
+ </LinearLayout>
+ </FrameLayout>
+ <Button
+ style="@style/ClingButton"
+ android:id="@+id/cling_dismiss"
+ android:layout_marginBottom="15dp"
+ android:layout_marginRight="10dp"
+ android:layout_gravity="bottom|right"
+ android:onClick="dismissAllAppsSortCling" />
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout-land/application.xml b/res/layout-land/application.xml
index 9ed1fa115..422ecbf4a 100644
--- a/res/layout-land/application.xml
+++ b/res/layout-land/application.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<com.android.launcher2.BubbleTextView xmlns:android="http://schemas.android.com/apk/res/android"
+<com.cyanogenmod.trebuchet.BubbleTextView xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/WorkspaceIcon.Landscape"
android:focusable="true"
android:background="@drawable/focusable_view_bg" />
diff --git a/res/layout-land/apps_customize_application.xml b/res/layout-land/apps_customize_application.xml
index ba95b27a6..e79ab75e4 100644
--- a/res/layout-land/apps_customize_application.xml
+++ b/res/layout-land/apps_customize_application.xml
@@ -14,9 +14,9 @@
limitations under the License.
-->
-<com.android.launcher2.PagedViewIcon
+<com.cyanogenmod.trebuchet.PagedViewIcon
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
style="@style/WorkspaceIcon.Landscape.AppsCustomize"
diff --git a/res/layout-land/folder_cling.xml b/res/layout-land/folder_cling.xml
index 3d7f4f459..2fa73fe26 100644
--- a/res/layout-land/folder_cling.xml
+++ b/res/layout-land/folder_cling.xml
@@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.Cling
+<com.cyanogenmod.trebuchet.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
launcher:drawIdentifier="folder_landscape">
<FrameLayout
android:layout_width="match_parent"
@@ -45,4 +45,4 @@
android:layout_marginRight="10dp"
android:layout_gravity="bottom|right"
android:onClick="dismissFolderCling" />
-</com.android.launcher2.Cling>
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout-land/folder_icon.xml b/res/layout-land/folder_icon.xml
index 808ff5e7b..5e4126f72 100644
--- a/res/layout-land/folder_icon.xml
+++ b/res/layout-land/folder_icon.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<com.android.launcher2.FolderIcon
+<com.cyanogenmod.trebuchet.FolderIcon
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -27,7 +27,7 @@
android:layout_width="@dimen/folder_preview_size"
android:layout_height="@dimen/folder_preview_size"
android:src="@drawable/portal_ring_inner_holo"/>
- <com.android.launcher2.BubbleTextView
+ <com.cyanogenmod.trebuchet.BubbleTextView
android:id="@+id/folder_icon_name"
style="@style/WorkspaceIcon.Landscape.Folder"/>
-</com.android.launcher2.FolderIcon>
+</com.cyanogenmod.trebuchet.FolderIcon>
diff --git a/res/layout-land/hotseat.xml b/res/layout-land/hotseat.xml
deleted file mode 100644
index d75919671..000000000
--- a/res/layout-land/hotseat.xml
+++ /dev/null
@@ -1,36 +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.
--->
-<com.android.launcher2.Hotseat
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
- launcher:cellCountX="1"
- launcher:cellCountY="@integer/hotseat_cell_count">
- <com.android.launcher2.CellLayout
- android:id="@+id/layout"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:paddingTop="@dimen/button_bar_width_left_padding"
- android:paddingBottom="@dimen/button_bar_width_right_padding"
- android:paddingLeft="@dimen/button_bar_height_top_padding"
- android:paddingRight="@dimen/button_bar_height_bottom_padding"
-
- launcher:cellWidth="@dimen/hotseat_cell_width"
- launcher:cellHeight="@dimen/hotseat_cell_height"
- launcher:widthGap="@dimen/hotseat_width_gap"
- launcher:heightGap="@dimen/hotseat_height_gap"
- launcher:maxGap="@dimen/workspace_max_gap" />
-</com.android.launcher2.Hotseat>
diff --git a/res/layout-land/hotseat_page.xml b/res/layout-land/hotseat_page.xml
new file mode 100644
index 000000000..5371a09f6
--- /dev/null
+++ b/res/layout-land/hotseat_page.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<com.cyanogenmod.trebuchet.CellLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
+
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:paddingTop="@dimen/button_bar_width_left_padding"
+ android:paddingBottom="@dimen/button_bar_width_right_padding"
+ android:paddingLeft="@dimen/button_bar_height_top_padding"
+ android:paddingRight="@dimen/button_bar_height_bottom_padding"
+
+ launcher:cellWidth="@dimen/hotseat_cell_width"
+ launcher:cellHeight="@dimen/hotseat_cell_height"
+ launcher:widthGap="@dimen/hotseat_width_gap"
+ launcher:heightGap="@dimen/hotseat_height_gap"
+ launcher:maxGap="@dimen/workspace_max_gap" />
diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml
index 051d8b25c..c6156c163 100644
--- a/res/layout-land/launcher.xml
+++ b/res/layout-land/launcher.xml
@@ -17,21 +17,20 @@
<!-- Full screen view projects under the status bar and contains the background -->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
-
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
android:id="@+id/launcher"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/workspace_bg">
- <com.android.launcher2.DragLayer
+ <com.cyanogenmod.trebuchet.DragLayer
android:id="@+id/drag_layer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<!-- The workspace contains 5 screens of cells -->
- <com.android.launcher2.Workspace
+ <com.cyanogenmod.trebuchet.Workspace
android:id="@+id/workspace"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -39,20 +38,12 @@
android:paddingRight="@dimen/workspace_right_padding"
android:paddingTop="@dimen/workspace_top_padding"
android:paddingBottom="@dimen/workspace_bottom_padding"
- launcher:defaultScreen="2"
- launcher:cellCountX="@integer/cell_count_x"
- launcher:cellCountY="@integer/cell_count_y"
+ launcher:cellCountX="@integer/target_cell_count_x"
+ launcher:cellCountY="@integer/target_cell_count_y"
launcher:pageSpacing="@dimen/workspace_page_spacing"
launcher:scrollIndicatorPaddingLeft="@dimen/qsb_bar_height"
- launcher:scrollIndicatorPaddingRight="@dimen/button_bar_height">
-
- <include android:id="@+id/cell1" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell2" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell3" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell4" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell5" layout="@layout/workspace_screen" />
- </com.android.launcher2.Workspace>
-
+ launcher:scrollIndicatorPaddingRight="@dimen/button_bar_height" />
+
<include
android:id="@+id/qsb_divider"
layout="@layout/workspace_divider"
@@ -60,7 +51,6 @@
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/qsb_bar_height"
android:layout_gravity="left" />
-
<include
android:id="@+id/dock_divider"
layout="@layout/workspace_divider"
@@ -68,9 +58,8 @@
android:layout_height="match_parent"
android:layout_marginRight="@dimen/button_bar_height"
android:layout_gravity="right" />
-
<include
- android:id="@+id/paged_view_indicator"
+ android:id="@+id/paged_view_indicator_horizontal"
layout="@layout/scroll_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -81,7 +70,6 @@
android:layout_width="@dimen/button_bar_height_plus_padding"
android:layout_height="match_parent"
android:layout_gravity="right" />
-
<include
android:id="@+id/qsb_bar"
layout="@layout/qsb_bar" />
@@ -101,7 +89,7 @@
android:layout_height="match_parent"
android:visibility="gone" />
- <com.android.launcher2.DrawableStateProxyView
+ <com.cyanogenmod.trebuchet.DrawableStateProxyView
android:id="@+id/voice_button_proxy"
android:layout_width="@dimen/qsb_bar_height"
android:layout_height="@dimen/app_icon_size"
@@ -117,5 +105,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible" />
- </com.android.launcher2.DragLayer>
-</FrameLayout> \ No newline at end of file
+
+ </com.cyanogenmod.trebuchet.DragLayer>
+</FrameLayout>
diff --git a/res/layout-land/search_bar.xml b/res/layout-land/search_bar.xml
index af1670bc8..51c6f65da 100644
--- a/res/layout-land/search_bar.xml
+++ b/res/layout-land/search_bar.xml
@@ -19,7 +19,7 @@
android:layout_height="match_parent"
android:orientation="vertical">
<!-- Global search icon -->
- <com.android.launcher2.HolographicImageView
+ <com.cyanogenmod.trebuchet.HolographicImageView
style="@style/SearchButton"
android:id="@+id/search_button"
android:layout_width="match_parent"
@@ -33,7 +33,7 @@
android:contentDescription="@string/accessibility_search_button" />
<!-- Voice search icon -->
- <com.android.launcher2.HolographicImageView
+ <com.cyanogenmod.trebuchet.HolographicImageView
style="@style/SearchButton"
android:id="@+id/voice_button"
android:layout_width="match_parent"
diff --git a/res/layout-land/workspace_cling.xml b/res/layout-land/workspace_cling.xml
index b035aa1d4..488edceef 100644
--- a/res/layout-land/workspace_cling.xml
+++ b/res/layout-land/workspace_cling.xml
@@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.Cling
+<com.cyanogenmod.trebuchet.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
android:layout_width="match_parent"
android:layout_height="match_parent"
launcher:drawIdentifier="workspace_landscape">
@@ -56,4 +56,4 @@
android:layout_marginRight="10dp"
android:layout_gravity="bottom|right"
android:onClick="dismissWorkspaceCling" />
-</com.android.launcher2.Cling>
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout-port/all_apps_cling.xml b/res/layout-port/all_apps_cling.xml
index 09414ce53..ed188e7cf 100644
--- a/res/layout-port/all_apps_cling.xml
+++ b/res/layout-port/all_apps_cling.xml
@@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.Cling
+<com.cyanogenmod.trebuchet.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
launcher:drawIdentifier="all_apps_portrait">
<FrameLayout
android:layout_width="match_parent"
@@ -45,4 +45,4 @@
android:layout_marginRight="10dp"
android:layout_gravity="bottom|right"
android:onClick="dismissAllAppsCling" />
-</com.android.launcher2.Cling>
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout-port/all_apps_sort_cling.xml b/res/layout-port/all_apps_sort_cling.xml
new file mode 100644
index 000000000..b53e82589
--- /dev/null
+++ b/res/layout-port/all_apps_sort_cling.xml
@@ -0,0 +1,48 @@
+<?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.
+-->
+<com.cyanogenmod.trebuchet.Cling
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
+ launcher:drawIdentifier="all_apps_sort_portrait">
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="30dp"
+ android:layout_marginTop="100dp">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+ <TextView
+ style="@style/ClingTitleText"
+ android:id="@+id/all_apps_sort_cling_title"
+ android:text="@string/all_apps_sort_cling_title" />
+ <TextView
+ style="@style/ClingText"
+ android:id="@+id/all_apps_sort_cling_add_item"
+ android:layout_width="285dp"
+ android:layout_height="wrap_content"
+ android:text="@string/all_apps_sort_cling_add_item" />
+ </LinearLayout>
+ </FrameLayout>
+ <Button
+ style="@style/ClingButton"
+ android:id="@+id/cling_dismiss"
+ android:layout_marginBottom="15dp"
+ android:layout_marginRight="10dp"
+ android:layout_gravity="bottom|right"
+ android:onClick="dismissAllAppsSortCling" />
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout-port/application.xml b/res/layout-port/application.xml
index ddc835420..6e2e756d5 100644
--- a/res/layout-port/application.xml
+++ b/res/layout-port/application.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<com.android.launcher2.BubbleTextView xmlns:android="http://schemas.android.com/apk/res/android"
+<com.cyanogenmod.trebuchet.BubbleTextView xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/WorkspaceIcon.Portrait"
android:focusable="true"
android:background="@drawable/focusable_view_bg" />
diff --git a/res/layout-port/apps_customize_application.xml b/res/layout-port/apps_customize_application.xml
index 84a8712d7..213fe21f7 100644
--- a/res/layout-port/apps_customize_application.xml
+++ b/res/layout-port/apps_customize_application.xml
@@ -14,9 +14,9 @@
limitations under the License.
-->
-<com.android.launcher2.PagedViewIcon
+<com.cyanogenmod.trebuchet.PagedViewIcon
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
style="@style/WorkspaceIcon.Portrait.AppsCustomize"
diff --git a/res/layout-port/folder_cling.xml b/res/layout-port/folder_cling.xml
index d2796a0e5..c107a5a35 100644
--- a/res/layout-port/folder_cling.xml
+++ b/res/layout-port/folder_cling.xml
@@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.Cling
+<com.cyanogenmod.trebuchet.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
launcher:drawIdentifier="folder_portrait">
<FrameLayout
android:layout_width="match_parent"
@@ -46,4 +46,4 @@
android:layout_marginRight="10dp"
android:layout_gravity="bottom|right"
android:onClick="dismissFolderCling" />
-</com.android.launcher2.Cling>
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout-port/folder_icon.xml b/res/layout-port/folder_icon.xml
index 5ee1327a3..523edf93c 100644
--- a/res/layout-port/folder_icon.xml
+++ b/res/layout-port/folder_icon.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<com.android.launcher2.FolderIcon
+<com.cyanogenmod.trebuchet.FolderIcon
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -27,7 +27,7 @@
android:layout_width="@dimen/folder_preview_size"
android:layout_height="@dimen/folder_preview_size"
android:src="@drawable/portal_ring_inner_holo"/>
- <com.android.launcher2.BubbleTextView
+ <com.cyanogenmod.trebuchet.BubbleTextView
android:id="@+id/folder_icon_name"
style="@style/WorkspaceIcon.Portrait.Folder"/>
-</com.android.launcher2.FolderIcon>
+</com.cyanogenmod.trebuchet.FolderIcon>
diff --git a/res/layout-port/hotseat.xml b/res/layout-port/hotseat.xml
deleted file mode 100644
index 376173ae9..000000000
--- a/res/layout-port/hotseat.xml
+++ /dev/null
@@ -1,36 +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.
--->
-<com.android.launcher2.Hotseat
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
- launcher:cellCountX="@integer/hotseat_cell_count"
- launcher:cellCountY="1">
- <com.android.launcher2.CellLayout
- android:id="@+id/layout"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:paddingTop="@dimen/button_bar_height_top_padding"
- android:paddingBottom="@dimen/button_bar_height_bottom_padding"
- android:paddingLeft="@dimen/button_bar_width_left_padding"
- android:paddingRight="@dimen/button_bar_width_right_padding"
-
- launcher:cellWidth="@dimen/hotseat_cell_width"
- launcher:cellHeight="@dimen/hotseat_cell_height"
- launcher:widthGap="@dimen/hotseat_width_gap"
- launcher:heightGap="@dimen/hotseat_height_gap"
- launcher:maxGap="@dimen/workspace_max_gap" />
-</com.android.launcher2.Hotseat>
diff --git a/res/layout-port/hotseat_page.xml b/res/layout-port/hotseat_page.xml
new file mode 100644
index 000000000..9c1e87c11
--- /dev/null
+++ b/res/layout-port/hotseat_page.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<com.cyanogenmod.trebuchet.CellLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
+
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_gravity="center"
+ android:paddingTop="@dimen/button_bar_height_top_padding"
+ android:paddingBottom="@dimen/button_bar_height_bottom_padding"
+ android:paddingLeft="@dimen/button_bar_width_left_padding"
+ android:paddingRight="@dimen/button_bar_width_right_padding"
+
+ launcher:cellWidth="@dimen/hotseat_cell_width"
+ launcher:cellHeight="@dimen/hotseat_cell_height"
+ launcher:widthGap="@dimen/hotseat_width_gap"
+ launcher:heightGap="@dimen/hotseat_height_gap"
+ launcher:maxGap="@dimen/workspace_max_gap" />
diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml
index 445c85ea4..dbfcfcef9 100644
--- a/res/layout-port/launcher.xml
+++ b/res/layout-port/launcher.xml
@@ -17,25 +17,33 @@
<!-- Full screen view projects under the status bar and contains the background -->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
-
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
android:id="@+id/launcher"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/workspace_bg">
- <com.android.launcher2.DragLayer
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
-
+ <com.cyanogenmod.trebuchet.DragLayer
android:id="@+id/drag_layer"
- android:background="@drawable/workspace_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
- <!-- Keep these behind the workspace so that they are not visible when
- we go into AllApps -->
+ <!-- The workspace contains 5 screens of cells -->
+ <com.cyanogenmod.trebuchet.Workspace
+ android:id="@+id/workspace"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingLeft="@dimen/workspace_left_padding"
+ android:paddingRight="@dimen/workspace_right_padding"
+ android:paddingTop="@dimen/workspace_top_padding"
+ android:paddingBottom="@dimen/workspace_bottom_padding"
+ launcher:cellCountX="@integer/target_cell_count_x"
+ launcher:cellCountY="@integer/target_cell_count_y"
+ launcher:pageSpacing="@dimen/workspace_page_spacing"
+ launcher:scrollIndicatorPaddingLeft="@dimen/workspace_divider_padding_left"
+ launcher:scrollIndicatorPaddingRight="@dimen/workspace_divider_padding_right" />
+
<include
android:id="@+id/dock_divider"
layout="@layout/workspace_divider"
@@ -43,37 +51,27 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/button_bar_height"
android:layout_gravity="bottom" />
-
<include
- android:id="@+id/paged_view_indicator"
+ android:id="@+id/paged_view_indicator_dock"
layout="@layout/scroll_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/button_bar_height" />
- <!-- The workspace contains 5 screens of cells -->
- <com.android.launcher2.Workspace
- android:id="@+id/workspace"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingLeft="@dimen/workspace_left_padding"
- android:paddingRight="@dimen/workspace_right_padding"
- android:paddingTop="@dimen/workspace_top_padding"
- android:paddingBottom="@dimen/workspace_bottom_padding"
- launcher:defaultScreen="2"
- 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">
+ <include
+ android:id="@+id/paged_view_indicator_top"
+ layout="@layout/scroll_indicator"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top" />
- <include android:id="@+id/cell1" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell2" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell3" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell4" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell5" layout="@layout/workspace_screen" />
- </com.android.launcher2.Workspace>
+ <include
+ android:id="@+id/paged_view_indicator_bottom"
+ layout="@layout/scroll_indicator"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom" />
<include layout="@layout/hotseat"
android:id="@+id/hotseat"
@@ -100,7 +98,7 @@
android:layout_height="match_parent"
android:visibility="gone" />
- <com.android.launcher2.DrawableStateProxyView
+ <com.cyanogenmod.trebuchet.DrawableStateProxyView
android:id="@+id/voice_button_proxy"
android:layout_width="80dp"
android:layout_height="@dimen/qsb_bar_height"
@@ -115,5 +113,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible" />
- </com.android.launcher2.DragLayer>
-</FrameLayout> \ No newline at end of file
+
+ </com.cyanogenmod.trebuchet.DragLayer>
+</FrameLayout>
diff --git a/res/layout-port/search_bar.xml b/res/layout-port/search_bar.xml
index 8f58fe61f..e979eac8f 100644
--- a/res/layout-port/search_bar.xml
+++ b/res/layout-port/search_bar.xml
@@ -15,14 +15,14 @@
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
style="@style/SearchDropTargetBar"
android:layout_width="match_parent"
android:layout_height="@dimen/search_bar_height"
android:layout_gravity="bottom|center_horizontal"
android:background="@drawable/search_frame">
<!-- Global search icon -->
- <com.android.launcher2.HolographicLinearLayout
+ <com.cyanogenmod.trebuchet.HolographicLinearLayout
style="@style/SearchButton"
launcher:sourceImageViewId="@+id/search_button"
android:id="@+id/search_button_container"
@@ -43,10 +43,10 @@
android:layout_height="match_parent"
android:src="@drawable/ic_home_search_normal_holo"
android:adjustViewBounds="true" />
- </com.android.launcher2.HolographicLinearLayout>
+ </com.cyanogenmod.trebuchet.HolographicLinearLayout>
<!-- Voice search icon -->
- <com.android.launcher2.HolographicLinearLayout
+ <com.cyanogenmod.trebuchet.HolographicLinearLayout
style="@style/SearchButton"
launcher:sourceImageViewId="@+id/voice_button"
android:id="@+id/voice_button_container"
@@ -67,5 +67,5 @@
android:layout_height="match_parent"
android:src="@drawable/ic_home_voice_search_holo"
android:adjustViewBounds="true" />
- </com.android.launcher2.HolographicLinearLayout>
+ </com.cyanogenmod.trebuchet.HolographicLinearLayout>
</RelativeLayout>
diff --git a/res/layout-port/workspace_cling.xml b/res/layout-port/workspace_cling.xml
index 738e2c571..10b046d79 100644
--- a/res/layout-port/workspace_cling.xml
+++ b/res/layout-port/workspace_cling.xml
@@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.Cling
+<com.cyanogenmod.trebuchet.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
android:layout_width="match_parent"
android:layout_height="match_parent"
launcher:drawIdentifier="workspace_portrait">
@@ -59,4 +59,4 @@
android:layout_marginRight="10dp"
android:layout_gravity="bottom|right"
android:onClick="dismissWorkspaceCling" />
-</com.android.launcher2.Cling>
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout-sw600dp-port/all_apps_cling.xml b/res/layout-sw600dp-port/all_apps_cling.xml
index 049822408..4ae4a0a4c 100644
--- a/res/layout-sw600dp-port/all_apps_cling.xml
+++ b/res/layout-sw600dp-port/all_apps_cling.xml
@@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.Cling
+<com.cyanogenmod.trebuchet.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
launcher:drawIdentifier="all_apps_portrait">
<FrameLayout
android:layout_width="match_parent"
@@ -47,4 +47,4 @@
android:layout_marginRight="36dp"
android:layout_gravity="top|right"
android:onClick="dismissAllAppsCling" />
-</com.android.launcher2.Cling>
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout-sw600dp-port/folder_cling.xml b/res/layout-sw600dp-port/folder_cling.xml
index e3a9caa22..5f9495b57 100644
--- a/res/layout-sw600dp-port/folder_cling.xml
+++ b/res/layout-sw600dp-port/folder_cling.xml
@@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.Cling
+<com.cyanogenmod.trebuchet.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
launcher:drawIdentifier="folder_portrait">
<FrameLayout
android:layout_width="match_parent"
@@ -48,4 +48,4 @@
android:layout_marginRight="36dp"
android:layout_gravity="bottom|right"
android:onClick="dismissFolderCling" />
-</com.android.launcher2.Cling>
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout-sw600dp/all_apps_sort_cling.xml b/res/layout-sw600dp/all_apps_sort_cling.xml
new file mode 100644
index 000000000..365432b57
--- /dev/null
+++ b/res/layout-sw600dp/all_apps_sort_cling.xml
@@ -0,0 +1,46 @@
+<?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.
+-->
+<com.cyanogenmod.trebuchet.Cling
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
+ launcher:drawIdentifier="all_apps_sort_large">
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="@dimen/cling_text_block_offset_x"
+ android:layout_marginTop="@dimen/cling_text_block_offset_y">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+ <TextView
+ style="@style/ClingTitleText"
+ android:id="@+id/all_apps_sort_cling_title"
+ android:text="@string/all_apps_sort_cling_title" />
+ <TextView
+ style="@style/ClingText"
+ android:id="@+id/all_apps_sort_cling_add_item"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/all_apps_sort_cling_add_item" />
+ <Button
+ style="@style/ClingButton"
+ android:id="@+id/cling_dismiss"
+ android:layout_marginTop="15dp"
+ android:onClick="dismissAllAppsSortCling" />
+ </LinearLayout>
+ </FrameLayout>
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout-sw720dp-port/folder_cling.xml b/res/layout-sw720dp-port/folder_cling.xml
index 017d0fde9..3a11dff77 100644
--- a/res/layout-sw720dp-port/folder_cling.xml
+++ b/res/layout-sw720dp-port/folder_cling.xml
@@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.Cling
+<com.cyanogenmod.trebuchet.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
launcher:drawIdentifier="folder_large">
<FrameLayout
android:layout_width="match_parent"
@@ -43,4 +43,4 @@
android:onClick="dismissFolderCling" />
</LinearLayout>
</FrameLayout>
-</com.android.launcher2.Cling>
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout-sw720dp/all_apps_cling.xml b/res/layout-sw720dp/all_apps_cling.xml
index 7079b2107..b2f0f6f05 100644
--- a/res/layout-sw720dp/all_apps_cling.xml
+++ b/res/layout-sw720dp/all_apps_cling.xml
@@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.Cling
+<com.cyanogenmod.trebuchet.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
launcher:drawIdentifier="all_apps_large">
<FrameLayout
android:layout_width="match_parent"
@@ -43,4 +43,4 @@
android:onClick="dismissAllAppsCling" />
</LinearLayout>
</FrameLayout>
-</com.android.launcher2.Cling>
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout-sw720dp/folder_cling.xml b/res/layout-sw720dp/folder_cling.xml
index 4188804c2..7ab4cb1d5 100644
--- a/res/layout-sw720dp/folder_cling.xml
+++ b/res/layout-sw720dp/folder_cling.xml
@@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.Cling
+<com.cyanogenmod.trebuchet.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
launcher:drawIdentifier="folder_large">
<FrameLayout
android:layout_width="match_parent"
@@ -43,4 +43,4 @@
android:onClick="dismissFolderCling" />
</LinearLayout>
</FrameLayout>
-</com.android.launcher2.Cling>
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout-sw720dp/hotseat.xml b/res/layout-sw720dp/hotseat.xml
deleted file mode 100644
index bcd5b9d82..000000000
--- a/res/layout-sw720dp/hotseat.xml
+++ /dev/null
@@ -1,36 +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.
--->
-<com.android.launcher2.Hotseat
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
- launcher:cellCountX="@integer/hotseat_cell_count"
- launcher:cellCountY="1">
- <com.android.launcher2.CellLayout
- android:id="@+id/layout"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:paddingTop="@dimen/button_bar_height_top_padding"
- android:paddingBottom="@dimen/button_bar_height_bottom_padding"
- android:paddingLeft="@dimen/button_bar_width_left_padding"
- android:paddingRight="@dimen/button_bar_width_right_padding"
-
- launcher:cellWidth="@dimen/hotseat_cell_width"
- launcher:cellHeight="@dimen/hotseat_cell_height"
- launcher:widthGap="@dimen/hotseat_width_gap"
- launcher:heightGap="@dimen/hotseat_height_gap"
- launcher:maxGap="@dimen/hotseat_width_gap" />
-</com.android.launcher2.Hotseat>
diff --git a/res/layout-sw720dp/launcher.xml b/res/layout-sw720dp/launcher.xml
index 81a8f37da..443db2e4c 100644
--- a/res/layout-sw720dp/launcher.xml
+++ b/res/layout-sw720dp/launcher.xml
@@ -17,25 +17,34 @@
<!-- Full screen view projects under the status bar and contains the background -->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
android:id="@+id/launcher"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/workspace_bg">
- <com.android.launcher2.DragLayer
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
-
+ <com.cyanogenmod.trebuchet.DragLayer
android:id="@+id/drag_layer"
- android:background="@drawable/workspace_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
- <!-- Keep these behind the workspace so that they are not visible when
- we go into AllApps -->
+ <!-- The workspace contains 5 screens of cells -->
+ <com.cyanogenmod.trebuchet.Workspace
+ android:id="@+id/workspace"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingLeft="@dimen/workspace_left_padding"
+ android:paddingRight="@dimen/workspace_right_padding"
+ android:paddingTop="@dimen/workspace_top_padding"
+ android:paddingBottom="@dimen/workspace_bottom_padding"
+ launcher:cellCountX="@integer/target_cell_count_x"
+ launcher:cellCountY="@integer/target_cell_count_y"
+ launcher:pageSpacing="@dimen/workspace_page_spacing"
+ launcher:scrollIndicatorPaddingLeft="@dimen/workspace_divider_padding_left"
+ launcher:scrollIndicatorPaddingRight="@dimen/workspace_divider_padding_right" />
+
<include
android:id="@+id/dock_divider"
layout="@layout/workspace_divider"
@@ -43,37 +52,27 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/button_bar_height_plus_padding"
android:layout_gravity="bottom|center_horizontal" />
-
<include
- android:id="@+id/paged_view_indicator"
+ android:id="@+id/paged_view_indicator_dock"
layout="@layout/scroll_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/button_bar_height_plus_padding" />
- <!-- The workspace contains 5 screens of cells -->
- <com.android.launcher2.Workspace
- android:id="@+id/workspace"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingLeft="@dimen/workspace_left_padding"
- android:paddingRight="@dimen/workspace_right_padding"
- android:paddingTop="@dimen/workspace_top_padding"
- android:paddingBottom="@dimen/workspace_bottom_padding"
- launcher:defaultScreen="2"
- 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">
+ <include
+ android:id="@+id/paged_view_indicator_top"
+ layout="@layout/scroll_indicator"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top" />
- <include android:id="@+id/cell1" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell2" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell3" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell4" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell5" layout="@layout/workspace_screen" />
- </com.android.launcher2.Workspace>
+ <include
+ android:id="@+id/paged_view_indicator_bottom"
+ layout="@layout/scroll_indicator"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom" />
<include layout="@layout/hotseat"
android:id="@+id/hotseat"
@@ -100,7 +99,7 @@
android:layout_height="match_parent"
android:visibility="gone" />
- <com.android.launcher2.DrawableStateProxyView
+ <com.cyanogenmod.trebuchet.DrawableStateProxyView
android:id="@+id/voice_button_proxy"
android:layout_width="80dp"
android:layout_height="@dimen/qsb_bar_height"
@@ -116,5 +115,5 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible" />
- </com.android.launcher2.DragLayer>
-</FrameLayout> \ No newline at end of file
+ </com.cyanogenmod.trebuchet.DragLayer>
+</FrameLayout>
diff --git a/res/layout-sw720dp/search_bar.xml b/res/layout-sw720dp/search_bar.xml
index 8f58fe61f..e979eac8f 100644
--- a/res/layout-sw720dp/search_bar.xml
+++ b/res/layout-sw720dp/search_bar.xml
@@ -15,14 +15,14 @@
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
style="@style/SearchDropTargetBar"
android:layout_width="match_parent"
android:layout_height="@dimen/search_bar_height"
android:layout_gravity="bottom|center_horizontal"
android:background="@drawable/search_frame">
<!-- Global search icon -->
- <com.android.launcher2.HolographicLinearLayout
+ <com.cyanogenmod.trebuchet.HolographicLinearLayout
style="@style/SearchButton"
launcher:sourceImageViewId="@+id/search_button"
android:id="@+id/search_button_container"
@@ -43,10 +43,10 @@
android:layout_height="match_parent"
android:src="@drawable/ic_home_search_normal_holo"
android:adjustViewBounds="true" />
- </com.android.launcher2.HolographicLinearLayout>
+ </com.cyanogenmod.trebuchet.HolographicLinearLayout>
<!-- Voice search icon -->
- <com.android.launcher2.HolographicLinearLayout
+ <com.cyanogenmod.trebuchet.HolographicLinearLayout
style="@style/SearchButton"
launcher:sourceImageViewId="@+id/voice_button"
android:id="@+id/voice_button_container"
@@ -67,5 +67,5 @@
android:layout_height="match_parent"
android:src="@drawable/ic_home_voice_search_holo"
android:adjustViewBounds="true" />
- </com.android.launcher2.HolographicLinearLayout>
+ </com.cyanogenmod.trebuchet.HolographicLinearLayout>
</RelativeLayout>
diff --git a/res/layout-sw720dp/workspace.xml b/res/layout-sw720dp/workspace.xml
index 5658a4b4f..db2c3a62d 100644
--- a/res/layout-sw720dp/workspace.xml
+++ b/res/layout-sw720dp/workspace.xml
@@ -16,18 +16,11 @@
<!-- The workspace contains 5 screens of cells -->
-<com.android.launcher2.Workspace
+<com.cyanogenmod.trebuchet.Workspace
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
android:paddingLeft="@dimen/workspace_left_padding"
android:paddingRight="@dimen/workspace_right_padding"
android:paddingTop="@dimen/workspace_top_padding"
android:paddingBottom="@dimen/workspace_bottom_padding"
- launcher:defaultScreen="2"
- launcher:pageSpacing="@dimen/workspace_page_spacing">
- <include android:id="@+id/cell1" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell2" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell3" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell4" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell5" layout="@layout/workspace_screen" />
-</com.android.launcher2.Workspace> \ No newline at end of file
+ launcher:pageSpacing="@dimen/workspace_page_spacing" />
diff --git a/res/layout-sw720dp/workspace_cling.xml b/res/layout-sw720dp/workspace_cling.xml
index 738e2c571..10b046d79 100644
--- a/res/layout-sw720dp/workspace_cling.xml
+++ b/res/layout-sw720dp/workspace_cling.xml
@@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.Cling
+<com.cyanogenmod.trebuchet.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
android:layout_width="match_parent"
android:layout_height="match_parent"
launcher:drawIdentifier="workspace_portrait">
@@ -59,4 +59,4 @@
android:layout_marginRight="10dp"
android:layout_gravity="bottom|right"
android:onClick="dismissWorkspaceCling" />
-</com.android.launcher2.Cling>
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout/apps_customize_pane.xml b/res/layout/apps_customize_pane.xml
index 41ba9e21e..bee51d750 100644
--- a/res/layout/apps_customize_pane.xml
+++ b/res/layout/apps_customize_pane.xml
@@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.AppsCustomizeTabHost
+<com.cyanogenmod.trebuchet.AppsCustomizeTabHost
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
android:background="#FF000000">
<LinearLayout
android:id="@+id/apps_customize_content"
@@ -32,7 +32,7 @@
android:layout_height="@dimen/apps_customize_tab_bar_height"
android:layout_marginTop="@dimen/apps_customize_tab_bar_margin_top"
android:layout_gravity="center_horizontal">
- <com.android.launcher2.FocusOnlyTabWidget
+ <com.cyanogenmod.trebuchet.FocusOnlyTabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -41,6 +41,12 @@
android:tabStripEnabled="false"
android:divider="@null" />
<include
+ android:id="@+id/overflow_menu_button"
+ layout="@layout/overflow_menu_button"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_gravity="right" />
+ <include
android:id="@+id/market_button"
layout="@layout/market_button"
android:layout_width="wrap_content"
@@ -51,7 +57,7 @@
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent">
- <com.android.launcher2.AppsCustomizePagedView
+ <com.cyanogenmod.trebuchet.AppsCustomizePagedView
android:id="@+id/apps_customize_pane_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -78,7 +84,28 @@
android:visibility="gone" />
<include
- android:id="@+id/paged_view_indicator"
+ android:id="@+id/paged_view_indicator_left"
+ layout="@layout/scroll_indicator"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="left" />
+
+ <include
+ android:id="@+id/paged_view_indicator_top"
+ layout="@layout/scroll_indicator"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top" />
+
+ <include
+ android:id="@+id/paged_view_indicator_right"
+ layout="@layout/scroll_indicator"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="right" />
+
+ <include
+ android:id="@+id/paged_view_indicator_bottom"
layout="@layout/scroll_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -91,4 +118,10 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
-</com.android.launcher2.AppsCustomizeTabHost>
+
+ <include layout="@layout/all_apps_sort_cling"
+ android:id="@+id/all_apps_sort_cling"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:visibility="gone" />
+</com.cyanogenmod.trebuchet.AppsCustomizeTabHost>
diff --git a/res/layout/apps_customize_widget.xml b/res/layout/apps_customize_widget.xml
index abb7508b5..76bcd773b 100644
--- a/res/layout/apps_customize_widget.xml
+++ b/res/layout/apps_customize_widget.xml
@@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.PagedViewWidget
+<com.cyanogenmod.trebuchet.PagedViewWidget
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -26,7 +26,7 @@
android:focusable="true">
<!-- The preview of the widget or shortcut. -->
- <com.android.launcher2.PagedViewWidgetImageView
+ <com.cyanogenmod.trebuchet.PagedViewWidgetImageView
android:id="@+id/widget_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -74,4 +74,4 @@
</LinearLayout>
-</com.android.launcher2.PagedViewWidget>
+</com.cyanogenmod.trebuchet.PagedViewWidget>
diff --git a/res/layout/custom_workspace_cling.xml b/res/layout/custom_workspace_cling.xml
index 0fdb57509..807234394 100644
--- a/res/layout/custom_workspace_cling.xml
+++ b/res/layout/custom_workspace_cling.xml
@@ -14,9 +14,9 @@
limitations under the License.
-->
<!-- dummy layout, to be replaced in overlays -->
-<com.android.launcher2.Cling
+<com.cyanogenmod.trebuchet.Cling
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
android:layout_width="match_parent"
android:layout_height="match_parent"
launcher:drawIdentifier="workspace_custom">
@@ -29,4 +29,4 @@
android:gravity="left"
android:layout_gravity="bottom|left"
/>
-</com.android.launcher2.Cling>
+</com.cyanogenmod.trebuchet.Cling>
diff --git a/res/layout/dialog_edit.xml b/res/layout/dialog_edit.xml
new file mode 100644
index 000000000..40dfd62cd
--- /dev/null
+++ b/res/layout/dialog_edit.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:layout_height="wrap_content"
+ android:paddingBottom="5dp"
+ android:paddingLeft="8dp"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+ <ImageButton
+ android:padding="5dp"
+ android:layout_width="@android:dimen/app_icon_size"
+ style="?android:attr/borderlessButtonStyle"
+ android:id="@+id/dialog_edit_icon"
+ android:layout_height="@android:dimen/app_icon_size" />
+ <View
+ android:layout_width="2dp"
+ android:layout_height="match_parent"
+ android:layout_marginTop="5dp"
+ android:layout_marginBottom="5dp"
+ android:layout_marginRight="5dp"
+ android:layout_marginLeft="5dp"
+ android:background="@android:drawable/divider_horizontal_dark" />
+ <EditText
+ android:layout_width="match_parent"
+ android:gravity="left|center_vertical"
+ android:paddingLeft="5dp"
+ android:layout_height="wrap_content"
+ android:id="@+id/dialog_edit_text" />
+</LinearLayout> \ No newline at end of file
diff --git a/res/layout/double_number_picker_dialog.xml b/res/layout/double_number_picker_dialog.xml
new file mode 100755
index 000000000..8c9fb8ef8
--- /dev/null
+++ b/res/layout/double_number_picker_dialog.xml
@@ -0,0 +1,64 @@
+<?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.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:gravity="center_horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:gravity="center"
+ android:orientation="vertical"
+ android:layout_height="fill_parent"
+ android:layout_width="0dp"
+ android:layout_weight="1">
+
+ <TextView
+ android:id="@+id/picker_title_1"
+ android:textAppearance="?android:textAppearanceMedium"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ <NumberPicker
+ android:id="@+id/number_picker_1"
+ android:layout_centerInParent="true"
+ android:layout_width="50dip"
+ android:layout_height="match_parent" />
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:gravity="center"
+ android:orientation="vertical"
+ android:layout_height="fill_parent"
+ android:layout_width="0dp"
+ android:layout_weight="1">
+
+ <TextView
+ android:id="@+id/picker_title_2"
+ android:textAppearance="?android:textAppearanceMedium"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ <NumberPicker
+ android:id="@+id/number_picker_2"
+ android:layout_centerInParent="true"
+ android:layout_width="50dip"
+ android:layout_height="match_parent" />
+
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/res/layout/drop_target_bar.xml b/res/layout/drop_target_bar.xml
index 5fcddc9a0..8951b3f57 100644
--- a/res/layout/drop_target_bar.xml
+++ b/res/layout/drop_target_bar.xml
@@ -19,7 +19,7 @@
style="@style/DropTargetButtonContainer"
android:layout_weight="1">
<!-- Delete target -->
- <com.android.launcher2.DeleteDropTarget
+ <com.cyanogenmod.trebuchet.DeleteDropTarget
style="@style/DropTargetButton"
android:id="@+id/delete_target_text"
android:text="@string/delete_zone_label_workspace"
@@ -30,10 +30,21 @@
style="@style/DropTargetButtonContainer"
android:layout_weight="1">
<!-- Info target -->
- <com.android.launcher2.InfoDropTarget
+ <com.cyanogenmod.trebuchet.InfoDropTarget
style="@style/DropTargetButton"
android:id="@+id/info_target_text"
android:text="@string/info_target_label"
android:drawableLeft="@drawable/info_target_selector" />
</FrameLayout>
+ <FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/DropTargetButtonContainer"
+ android:layout_weight="1">
+ <!-- Edit target -->
+ <com.cyanogenmod.trebuchet.EditDropTarget
+ style="@style/DropTargetButton"
+ android:id="@+id/edit_target_text"
+ android:text="@string/edit_target_label"
+ android:drawableLeft="@drawable/edit_target_selector" />
+ </FrameLayout>
</merge> \ No newline at end of file
diff --git a/res/layout/hidden_apps_list.xml b/res/layout/hidden_apps_list.xml
new file mode 100644
index 000000000..cc9447210
--- /dev/null
+++ b/res/layout/hidden_apps_list.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ListView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@android:id/list"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="5dp"
+ android:choiceMode="multipleChoice"
+ android:layout_alignParentTop="true"/> \ No newline at end of file
diff --git a/res/layout/hidden_apps_list_item.xml b/res/layout/hidden_apps_list_item.xml
new file mode 100644
index 000000000..88fa8b034
--- /dev/null
+++ b/res/layout/hidden_apps_list_item.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.cyanogenmod.trebuchet.widget.CheckableLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="48dp"
+ android:gravity="center_vertical"
+ android:paddingRight="?android:attr/scrollbarSize"
+ android:background="?android:attr/actionBarItemBackground">
+
+ <ImageView android:id="@+id/icon"
+ android:layout_width="40dp"
+ android:layout_height="40dp"
+ android:layout_gravity="center"/>
+
+ <TextView android:id="@+id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="15dip"
+ android:layout_marginRight="6dip"
+ android:layout_marginTop="6dip"
+ android:layout_marginBottom="6dip"
+ android:layout_weight="1"
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal"/>
+
+ <com.cyanogenmod.trebuchet.widget.InertCheckBox android:id="@+id/checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:gravity="center_vertical"/>
+
+</com.cyanogenmod.trebuchet.widget.CheckableLinearLayout> \ No newline at end of file
diff --git a/res/values-sw340dp-port/config.xml b/res/layout/hotseat.xml
index d31ee5969..dfe0c50a5 100644
--- a/res/values-sw340dp-port/config.xml
+++ b/res/layout/hotseat.xml
@@ -13,9 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-<resources>
-<!-- Workspace -->
- <!-- Whether or not to fade the side pages -->
- <bool name="config_workspaceFadeAdjacentScreens">false</bool>
-</resources>
+<com.cyanogenmod.trebuchet.Hotseat
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
+ launcher:cellCount="@integer/hotseat_cell_count" />
diff --git a/res/layout/number_picker_dialog.xml b/res/layout/number_picker_dialog.xml
new file mode 100644
index 000000000..2f87bc86f
--- /dev/null
+++ b/res/layout/number_picker_dialog.xml
@@ -0,0 +1,28 @@
+<?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.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:gravity="center_horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+
+ <NumberPicker
+ android:id="@+id/number_picker"
+ android:layout_centerInParent="true"
+ android:layout_width="100dip"
+ android:layout_height="match_parent" />
+
+</LinearLayout>
diff --git a/res/layout/overflow_menu_button.xml b/res/layout/overflow_menu_button.xml
new file mode 100644
index 000000000..9438cc6c6
--- /dev/null
+++ b/res/layout/overflow_menu_button.xml
@@ -0,0 +1,32 @@
+<?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.
+-->
+<TextView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
+ style="@style/MarketButton"
+ android:onClick="onClickOverflowMenuButton"
+ android:drawableLeft="@drawable/ic_menu_overflow"
+ android:gravity="center"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:background="@drawable/tab_widget_indicator_selector"
+ android:contentDescription="@string/menu"
+ android:shadowColor="@color/workspace_all_apps_and_delete_zone_text_shadow_color"
+ android:shadowDx="0.0"
+ android:shadowDy="0.0"
+ android:shadowRadius="2.0"
+ android:focusable="true"
+ android:clickable="true" />
diff --git a/res/layout/preference_header_item.xml b/res/layout/preference_header_item.xml
new file mode 100644
index 000000000..75536afc4
--- /dev/null
+++ b/res/layout/preference_header_item.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 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.
+-->
+
+<!-- Layout of a header item in PreferenceActivity. -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="48dp"
+ android:background="?android:attr/activatedBackgroundIndicator"
+ android:gravity="center_vertical"
+ android:paddingEnd="?android:attr/scrollbarSize">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_marginStart="6dip"
+ android:layout_marginEnd="6dip"
+ android:layout_height="wrap_content">
+ <ImageView
+ android:id="@+id/icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center" />
+ </LinearLayout>
+
+ <RelativeLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="2dip"
+ android:layout_marginEnd="6dip"
+ android:layout_marginTop="6dip"
+ android:layout_marginBottom="6dip"
+ android:layout_weight="1">
+
+ <TextView android:id="@+android:id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal" />
+
+ <TextView android:id="@+android:id/summary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@android:id/title"
+ android:layout_alignStart="@android:id/title"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:ellipsize="end"
+ android:maxLines="2" />
+
+ </RelativeLayout>
+
+</LinearLayout>
diff --git a/res/layout/qsb_bar.xml b/res/layout/qsb_bar.xml
index 322dc006f..563026df1 100644
--- a/res/layout/qsb_bar.xml
+++ b/res/layout/qsb_bar.xml
@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.launcher2.SearchDropTargetBar
+<com.cyanogenmod.trebuchet.SearchDropTargetBar
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/QSBBar"
android:focusable="false">
@@ -30,4 +30,4 @@
<include
layout="@layout/drop_target_bar" />
</LinearLayout>
-</com.android.launcher2.SearchDropTargetBar>
+</com.cyanogenmod.trebuchet.SearchDropTargetBar>
diff --git a/res/layout/scroll_indicator.xml b/res/layout/scroll_indicator.xml
index 4ea312b6d..9ce30355d 100644
--- a/res/layout/scroll_indicator.xml
+++ b/res/layout/scroll_indicator.xml
@@ -15,6 +15,7 @@
-->
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/paged_view_indicator"
android:visibility="gone"
android:alpha="0"
android:scaleType="fitXY"
diff --git a/res/layout/seekbar_dialog.xml b/res/layout/seekbar_dialog.xml
new file mode 100644
index 000000000..254a4ec41
--- /dev/null
+++ b/res/layout/seekbar_dialog.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:gravity="center_horizontal">
+
+ <TextView android:id="@+id/value"
+ android:layout_centerInParent="true"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingTop="5dip"
+ android:textAppearance="?android:textAppearanceLarge" />
+
+ <SeekBar android:id="@+id/seekbar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:padding="20dip"
+ android:paddingTop="5dip" />
+
+</LinearLayout>
diff --git a/res/layout/tab_widget_indicator.xml b/res/layout/tab_widget_indicator.xml
index df43d3ddd..9a14032b2 100644
--- a/res/layout/tab_widget_indicator.xml
+++ b/res/layout/tab_widget_indicator.xml
@@ -14,6 +14,6 @@
limitations under the License.
-->
-<com.android.launcher2.AccessibleTabView
+<com.cyanogenmod.trebuchet.AccessibleTabView
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/TabIndicator.AppsCustomize" />
diff --git a/res/layout/user_folder.xml b/res/layout/user_folder.xml
index af1725062..9aae1acc1 100644
--- a/res/layout/user_folder.xml
+++ b/res/layout/user_folder.xml
@@ -14,15 +14,15 @@
limitations under the License.
-->
-<com.android.launcher2.Folder
+<com.cyanogenmod.trebuchet.Folder
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/portal_container_holo">
- <com.android.launcher2.CellLayout
+ <com.cyanogenmod.trebuchet.CellLayout
android:id="@+id/folder_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -37,7 +37,7 @@
launcher:cellWidth="@dimen/folder_cell_width"
launcher:cellHeight="@dimen/folder_cell_height" />
- <com.android.launcher2.FolderEditText
+ <com.cyanogenmod.trebuchet.FolderEditText
android:id="@+id/folder_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -52,4 +52,4 @@
android:gravity="center_horizontal"
android:singleLine="true"
android:imeOptions="flagNoExtractUi"/>
-</com.android.launcher2.Folder>
+</com.cyanogenmod.trebuchet.Folder>
diff --git a/res/layout/wallpaper_chooser.xml b/res/layout/wallpaper_chooser.xml
index 49930769c..62f22ee73 100644
--- a/res/layout/wallpaper_chooser.xml
+++ b/res/layout/wallpaper_chooser.xml
@@ -29,7 +29,7 @@
android:layout_alignParentBottom="true"
android:background="@drawable/wallpaper_gallery_background">
- <Gallery android:id="@+id/gallery"
+ <com.cyanogenmod.trebuchet.widget.EcoGallery android:id="@+id/gallery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:spacing="-4dp" />
diff --git a/res/layout/wallpaper_chooser_base.xml b/res/layout/wallpaper_chooser_base.xml
index fa8ea9372..cf149c0db 100644
--- a/res/layout/wallpaper_chooser_base.xml
+++ b/res/layout/wallpaper_chooser_base.xml
@@ -21,7 +21,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
- <fragment class="com.android.launcher2.WallpaperChooserDialogFragment"
+ <fragment class="com.cyanogenmod.trebuchet.WallpaperChooserDialogFragment"
android:id="@+id/wallpaper_chooser_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
diff --git a/res/layout/workspace_screen.xml b/res/layout/workspace_screen.xml
index d6e66f69d..37b11dea5 100644
--- a/res/layout/workspace_screen.xml
+++ b/res/layout/workspace_screen.xml
@@ -14,9 +14,9 @@
limitations under the License.
-->
-<com.android.launcher2.CellLayout
+<com.cyanogenmod.trebuchet.CellLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/res/menu/apps_tab.xml b/res/menu/apps_tab.xml
new file mode 100644
index 000000000..05573d9db
--- /dev/null
+++ b/res/menu/apps_tab.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <group android:checkableBehavior="single">
+ <item android:id="@+id/apps_sort_title"
+ android:title="@string/menu_apps_sort_title" />
+ <item android:id="@+id/apps_sort_install_date"
+ android:title="@string/menu_apps_sort_install_date" />
+ </group>
+ <group android:checkableBehavior="all">
+ <item android:id="@+id/apps_filter_system"
+ android:title="@string/menu_apps_filter_system" />
+ <item android:id="@+id/apps_filter_downloaded"
+ android:title="@string/menu_apps_filter_downloaded" />
+ </group>
+</menu>
diff --git a/res/mipmap-hdpi/ic_launcher_home.png b/res/mipmap-hdpi/ic_launcher_home.png
index 8945ada34..33d36b0dc 100644..100755
--- a/res/mipmap-hdpi/ic_launcher_home.png
+++ b/res/mipmap-hdpi/ic_launcher_home.png
Binary files differ
diff --git a/res/mipmap-mdpi/ic_launcher_home.png b/res/mipmap-mdpi/ic_launcher_home.png
index 72bd80a2f..5ab889c9a 100644..100755
--- a/res/mipmap-mdpi/ic_launcher_home.png
+++ b/res/mipmap-mdpi/ic_launcher_home.png
Binary files differ
diff --git a/res/mipmap-xhdpi/ic_launcher_home.png b/res/mipmap-xhdpi/ic_launcher_home.png
index 7bef13ca7..70ec47580 100644..100755
--- a/res/mipmap-xhdpi/ic_launcher_home.png
+++ b/res/mipmap-xhdpi/ic_launcher_home.png
Binary files differ
diff --git a/res/values-af-land/strings.xml b/res/values-af-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-af-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-af/strings.xml b/res/values-af/strings.xml
index 72ba85526..8922b651d 100644
--- a/res/values-af/strings.xml
+++ b/res/values-af/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Lanseerpoort"</string>
<string name="home" msgid="5921706419368316758">"Tuis"</string>
<string name="uid_name" msgid="3371120195364560632">"Android Kernprogramme"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-am-land/strings.xml b/res/values-am-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-am-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-am/strings.xml b/res/values-am/strings.xml
index a1bfb2eab..4aac17704 100644
--- a/res/values-am/strings.xml
+++ b/res/values-am/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"አስነሺ"</string>
<string name="home" msgid="5921706419368316758">"መነሻ"</string>
<string name="uid_name" msgid="3371120195364560632">"የAndroid ኮር ትግበራዎች"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-ar-land/strings.xml b/res/values-ar-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-ar-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-ar/strings.xml b/res/values-ar/strings.xml
index 0ddd36970..dd047208e 100644
--- a/res/values-ar/strings.xml
+++ b/res/values-ar/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"المشغل"</string>
<string name="home" msgid="5921706419368316758">"المنزل"</string>
<string name="uid_name" msgid="3371120195364560632">"تطبيقات Android المركزية"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-be/strings.xml b/res/values-be/strings.xml
index 150434f40..333bfc889 100644
--- a/res/values-be/strings.xml
+++ b/res/values-be/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Панэль запуску"</string>
<string name="home" msgid="5921706419368316758">"На галоўную старонку"</string>
<string name="uid_name" msgid="3371120195364560632">"Асноўныя прыкладанні для Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-bg-land/strings.xml b/res/values-bg-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-bg-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-bg/strings.xml b/res/values-bg/strings.xml
index f435ff65a..0e5a62076 100644
--- a/res/values-bg/strings.xml
+++ b/res/values-bg/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Стартов панел"</string>
<string name="home" msgid="5921706419368316758">"Начало"</string>
<string name="uid_name" msgid="3371120195364560632">"Основни приложения на Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-ca-land/strings.xml b/res/values-ca-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-ca-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml
index dc1f72fff..de1a995c6 100644
--- a/res/values-ca/strings.xml
+++ b/res/values-ca/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Menú d\'aplicacions"</string>
<string name="home" msgid="5921706419368316758">"Casa"</string>
<string name="uid_name" msgid="3371120195364560632">"Aplicacions principals d\'Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-cs-land/strings.xml b/res/values-cs-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-cs-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
index dea19f6c5..8569d882f 100644
--- a/res/values-cs/strings.xml
+++ b/res/values-cs/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
<string name="home" msgid="5921706419368316758">"Plocha"</string>
<string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
@@ -111,4 +110,51 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+ <string name="application_copyright">Autorská práva \u00A9 CyanogenMod 2012</string>
+ <string name="cancel_target_label">Zrušit</string>
+ <string name="menu_preferences">Nastavení</string>
+ <string name="menu_apps_sort_title">Jméno</string>
+ <string name="menu_apps_sort_install_date">Datum instalace</string>
+ <string name="all_apps_sort_cling_title">Seřadit aplikace</string>
+ <string name="all_apps_sort_cling_add_item">Přidrž prst na kartě aplikací pro výběr režimu řazení</string>
+ <string name="preferences_title">Předvolby</string>
+ <string name="preferences_interface_title">Rozhraní</string>
+ <string name="preferences_application_title">Aplikace</string>
+ <string name="preferences_interface_homescreen_title">Domovská obrazovka</string>
+ <string name="preferences_interface_homescreen_general_category">Hlavní</string>
+ <string name="preferences_interface_homescreen_general_screens_title">Domácí plochy</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">Počet ploch</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">Výchozí plocha</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">Vybrat výchozí plochu</string>
+ <string name="preferences_interface_homescreen_general_search_title">Vyhledávací lišta</string>
+ <string name="preferences_interface_homescreen_general_grid_title">Velikost mřížky</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">Vyberte počet řádků/sloupců na ploše</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">Řádky</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">Sloupce</string>
+ <string name="preferences_interface_homescreen_general_search_summary">Povolit trvalou vyhledávací lištu</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">Skrýt popisky ikon</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Skrýt popisky ikon na ploše</string>
+ <string name="preferences_interface_homescreen_scrolling_category">Posouvání</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">Posouvání tapety</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Posouvání tapety při posunu plochy</string>
+ <string name="preferences_interface_homescreen_indicator_category">Indikátor</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">Zobrazit indikátor ploch</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">Zobrazit indikátor aktuální plochy v dolní části obrazovky</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">Slábnutí indikátoru</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">Slábnutí indikátoru po změně plochy</string>
+ <string name="preferences_interface_drawer_title">Seznam aplikací</string>
+ <string name="preferences_interface_drawer_widgets_category">Widgety</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">Spojit s aplikacemi</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">Přecházet mezi aplikacemi a widgety bez změny záložek</string>
+ <string name="preferences_interface_drawer_indicator_category">Indikátor</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">Zobrazit indikátor ploch</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">Zobrazit indikátor aktuální plochy v dolní části obrazovky</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">Slábnutí indikátoru</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">Slábnutí indikátoru po změně plochy</string>
+ <string name="preferences_interface_dock_title">Dok aplikací</string>
+ <string name="preferences_interface_dock_divider_title">Zobrazit lištu ploch</string>
+ <string name="preferences_interface_dock_divider_summary">Zobrazit pozadí za indikátorem ploch</string>
+ <string name="preferences_interface_icons_title">Ikony</string>
+ <string name="preferences_interface_general_title">Obecné</string>
+ <string name="preferences_interface_general_orientation_title">Automaticky otáčet displej</string>
</resources>
diff --git a/res/values-da-land/strings.xml b/res/values-da-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-da-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml
index af00d825b..9de2a461f 100644
--- a/res/values-da/strings.xml
+++ b/res/values-da/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
<string name="home" msgid="5921706419368316758">"Startside"</string>
<string name="uid_name" msgid="3371120195364560632">"Android-kerneprogrammer"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
@@ -111,4 +110,131 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+
+ <!-- Trebuchet additional danish translation start -->
+
+ <!-- General -->
+ <!-- Application copyright -->
+ <string name="application_copyright">Copyright \u00A9 CyanogenMod 2012</string>
+
+ <string name="cancel_target_label">Annuller</string>
+
+ <!-- Label for the info icon. [CHAR_LIMIT=30] -->
+ <string name="edit_target_label">Rediger</string>
+
+ <!-- Hidden apps -->
+ <string name="hidden_apps_title">Skjulte apps</string>
+
+ <!-- Menu button text. -->
+ <string name="menu">Menu</string>
+
+ <!-- Menus items: -->
+ <!-- Noun, menu item used to show the launcher preferences -->
+ <string name="menu_preferences">Trebuchet-indstillinger</string>
+ <string name="menu_apps_sort_title">Navn</string>
+ <string name="menu_apps_sort_install_date">Installationsdato</string>
+ <string name="menu_apps_filter_system">System</string>
+ <string name="menu_apps_filter_downloaded">Downloadet</string>
+ <string name="menu_hidden_apps_delete">Nulstil</string>
+
+ <!-- Clings -->
+ <string name="all_apps_sort_cling_title">Sortér dine apps</string>
+ <string name="all_apps_sort_cling_add_item">Tryk på fanen Apps og hold den nede for at vælge sortering</string>
+
+ <!-- Preferences -->
+ <string name="preferences_title">Indstillinger</string>
+ <!-- UI -->
+ <string name="preferences_interface_title">Grænseflade</string>
+ <!-- Application -->
+ <string name="preferences_application_title">Applikation</string>
+
+ <!-- UI -->
+ <!-- Homescreen -->
+ <string name="preferences_interface_homescreen_title">Startskærm</string>
+ <string name="preferences_interface_homescreen_summary">Skærme og tapet</string>
+ <string name="preferences_interface_homescreen_general_category">Generelt</string>
+ <string name="preferences_interface_homescreen_general_screens_title">Startskærme</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">Antallet af skærme på startskærmen</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">Standardskærm</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">Vælg standard-startskærm</string>
+ <string name="preferences_interface_homescreen_general_search_title">Søgefelt</string>
+ <string name="preferences_interface_homescreen_general_grid_title">Gitterstørrelse</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">Vælg antallet af rækker/kolonner på startskærmen</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">Rækker</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">Kolonner</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">Stræk skærme</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">Udvid startskærme til at fylde størrelsen på skærmen</string>
+ <string name="preferences_interface_homescreen_general_search_summary">Aktivér vedvarende søgefelt</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">Skjul ikontekst</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Skjul ikontekster på startskærmene</string>
+ <string name="preferences_interface_homescreen_scrolling_category">Bladring</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">Overgangseffekt</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">Bladringseffekt, når startskærme bladres</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">Rul tapet</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Rul tapetet ved bladring mellem startskærme</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">Hurtig rendering af tapet</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">Brug hack til tapet, der øger glathed på statiske tapetbilleder</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">Tapetets størrelse</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">Hvor mange skærmbredder skal tapetet være</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">Udton sideskærme</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">Udton sideskærme, når startskærme bladres</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">Vis konturer</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">Vis skærmkonturer, når startskærme bladres</string>
+ <string name="preferences_interface_homescreen_indicator_category">Indikator</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">Vis sideindikator</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">Viser den aktuelle side nederst på skærmen</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">Udton indikator</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">Udtoner indikatoren efter skift mellem startskærmene</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">Position for indikator</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">Vælg, hvor indikatoren skal vises på skærmen</string>
+
+ <!-- Drawer -->
+ <string name="preferences_interface_drawer_title">Skuffe</string>
+ <string name="preferences_interface_drawer_summary">Skuffe til apps og widgets</string>
+ <string name="preferences_interface_drawer_orientation_title">Orientering</string>
+ <string name="preferences_interface_drawer_orientation_summary">Vælg hvilken retning, skuffen bladrer</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">Skjulte apps</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">Skjul apps fra skuffen</string>
+ <string name="preferences_interface_drawer_widgets_category">Widgets</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">Sammen med apps</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">Glid fra applikationer til widgets uden at skifte fane</string>
+ <string name="preferences_interface_drawer_scrolling_category">Bladring</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">Overgangseffekt</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">Bladringseffekt, når skærme bladres</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">Udton sider</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">Udton siderne, når skærme bladres</string>
+ <string name="preferences_interface_drawer_indicator_category">Indikator</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">Vis sideindikator</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">Viser den aktuelle side nederst på skærmen</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">Udton indikator</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">Udtoner indikatoren efter skift mellem siderne</string>
+ <string name="preferences_interface_drawer_indicator_position_title">Position for indikator</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">Vælg, hvor indikatoren skal vises på skærmen</string>
+
+ <!-- Dock -->
+ <string name="preferences_interface_dock_title">Startlinjen</string>
+ <string name="preferences_interface_dock_enabled_title">Vis startlinje</string>
+ <string name="preferences_interface_dock_enabled_summary">Vis startlinjen nedenunder hjemmeskærmen</string>
+ <string name="preferences_interface_dock_pages_title">Sider</string>
+ <string name="preferences_interface_dock_pages_summary">Antal sider i startlinjen</string>
+ <string name="preferences_interface_dock_default_page_title">Standardside</string>
+ <string name="preferences_interface_dock_default_page_summary">Vælg standardsiden</string>
+ <string name="preferences_interface_dock_icons_title">Ikoner</string>
+ <string name="preferences_interface_dock_icons_summary">Antal ikoner/kolonner i startlinjen</string>
+ <string name="preferences_interface_dock_icon_scale_title">Ikonstørrelse</string>
+ <string name="preferences_interface_dock_icon_scale_summary">Størrelse på startlinjens ikoner</string>
+ <string name="preferences_interface_dock_divider_title">Vis skillelinje for startlinje</string>
+ <string name="preferences_interface_dock_divider_summary">Vis skillelinje mellem startskærm og startlinje</string>
+
+ <!-- Icons -->
+ <string name="preferences_interface_icons_title">Ikoner</string>
+
+ <!-- General -->
+ <string name="preferences_interface_general_title">Generelt</string>
+ <string name="preferences_interface_general_orientation_title">Rotér skærm automatisk</string>
+ <string name="preferences_interface_general_fullscreen_title">Fuldskærmstilstand</string>
+ <string name="preferences_interface_general_fullscreen_summary">Skjul statuslinjen for at udvide startskærmen</string>
+
+ <!-- Trebuchet additional danish translation end -->
</resources>
+
diff --git a/res/values-de-land/strings.xml b/res/values-de-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-de-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-de/arrays.xml b/res/values-de/arrays.xml
new file mode 100644
index 000000000..b2e7eb2b2
--- /dev/null
+++ b/res/values-de/arrays.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2012 The CyanogenMod 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.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="preferences_interface_homescreen_indicator_position_entries">
+ <item>Oberhalb des Docks</item>
+ <item>Oben</item>
+ <item>Unten</item>
+ </string-array>
+
+ <string-array name="preferences_interface_homescreen_scrolling_transition_effect_entries">
+ <item>Standard</item>
+ <item>Tablett</item>
+ <item>Hineinzoomen</item>
+ <item>Herauszoomen</item>
+ <item>Rotieren oben</item>
+ <item>Rotieren unten</item>
+ <item>Zylinder innen</item>
+ <item>Zylinder außen</item>
+ <item>Würfel innen</item>
+ <item>Würfel außen</item>
+ <item>Wirbeln</item>
+ <item>Blättern</item>
+ <item>Stapeln</item>
+ <item>Akkordeon</item>
+ </string-array>
+
+ <string-array name="preferences_interface_drawer_scrolling_transition_effect_entries">
+ <item>Standard</item>
+ <item>Tablett</item>
+ <item>Hineinzoomen</item>
+ <item>Herauszoomen</item>
+ <item>Rotieren oben</item>
+ <item>Rotieren unten</item>
+ <item>Zylinder innen</item>
+ <item>zylinder außen</item>
+ <item>Würfel innen</item>
+ <item>Würfel außen</item>
+ <item>Wirbeln</item>
+ <item>Blättern</item>
+ <item>Stapeln</item>
+ <item>Akkordeon</item>
+ </string-array>
+
+ <string-array name="preferences_interface_drawer_indicator_position_entries">
+ <item>Oben/Links</item>
+ <item>Unten/Rechts</item>
+ </string-array>
+
+ <string-array name="preferences_interface_drawer_orientation_entries">
+ <item>Horizontal</item>
+ <item>Vertikal</item>
+ </string-array>
+</resources>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 8df155e5c..98f4a36be 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--
+<!--
/*
* Copyright (C) 2008 The Android Open Source Project
*
@@ -15,11 +15,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
- -->
+-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Übersicht"</string>
<string name="home" msgid="5921706419368316758">"Startbildschirm"</string>
<string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
@@ -30,6 +29,8 @@
<string name="widgets_tab_label" msgid="9145860100000983599">"Widgets"</string>
<string name="long_press_widget_to_add" msgid="7395697462851217506">"Zum Hinzufügen Widget berühren und halten"</string>
<string name="market" msgid="2652226429823445833">"Shop"</string>
+ <!-- Menu button text. -->
+ <string name="menu">Menü</string>
<string name="external_drop_widget_error" msgid="2285187188524172774">"Element wurde nicht auf Startbildschirm abgelegt."</string>
<string name="external_drop_widget_pick_title" msgid="7040647073452295370">"Widget zum Erstellen auswählen"</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Ordnername"</string>
@@ -40,6 +41,7 @@
<string name="group_applications" msgid="2103752818818161976">"Apps"</string>
<string name="group_shortcuts" msgid="9133529424900391877">"Verknüpfungen"</string>
<string name="group_widgets" msgid="6704978494073105844">"Widgets"</string>
+ <!-- Options in "Add to Home" dialog box; Title of the group containing the list of all launcher actions -->
<string name="group_wallpapers" msgid="1568191644272224858">"Hintergründe"</string>
<string name="completely_out_of_space" msgid="1759078539443491182">"Auf Ihrem Startbildschirm ist kein Platz mehr vorhanden."</string>
<string name="out_of_space" msgid="8365249326091984698">"Auf dem Startbildschirm ist kein Platz mehr vorhanden."</string>
@@ -55,8 +57,11 @@
<string name="delete_zone_label_workspace" msgid="7153615831493049150">"Entfernen"</string>
<string name="delete_zone_label_all_apps" msgid="6664588234817475108">"Deinstallieren"</string>
<string name="delete_target_label" msgid="665300185123139530">"Entfernen"</string>
+ <string name="cancel_target_label">Abbrechen</string>
<string name="delete_target_uninstall_label" msgid="748894921183769150">"Deinstallieren"</string>
<string name="info_target_label" msgid="4019495079517426980">"App-Info"</string>
+ <!-- Label for the info icon. [CHAR_LIMIT=30] -->
+ <string name="edit_target_label">Bearbeiten</string>
<string name="accessibility_search_button" msgid="816822994629942611">"Suchen"</string>
<string name="accessibility_voice_search_button" msgid="3938249215065842475">"Sprachsuche"</string>
<string name="accessibility_all_apps_button" msgid="8803738611398979849">"Apps"</string>
@@ -68,7 +73,22 @@
<string name="menu_search" msgid="4826514464423239041">"Suchen"</string>
<string name="menu_notifications" msgid="6424587053194766192">"Benachrichtigungen"</string>
<string name="menu_settings" msgid="3946232973327980394">"Systemeinstellungen"</string>
+ <string name="menu_preferences">Trebuchet-Einstellungen</string>
<string name="menu_help" msgid="4901160661634590633">"Hilfe"</string>
+
+ <!-- Noun, menu item used to sort apps by name -->
+ <string name="menu_apps_sort_title">Name</string>
+ <!-- Noun, menu item used to sort apps by install date -->
+ <string name="menu_apps_sort_install_date">Installationsdatum</string>
+
+ <!-- Noun, menu item used to show system apps -->
+ <string name="menu_apps_filter_system">System</string>
+ <!-- Noun, menu item used to show downloaded apps -->
+ <string name="menu_apps_filter_downloaded">Heruntergeladen</string>
+
+ <!-- Noun, menu item used to reset hidden apps list -->
+ <string name="menu_hidden_apps_delete">Zurücksetzen</string>
+
<string name="cab_menu_delete_app" msgid="4089398025537640349">"App deinstallieren"</string>
<string name="cab_menu_app_info" msgid="914548323652698884">"App-Details"</string>
<string name="cab_app_selection_text" msgid="6378522164293415735">"1 App ausgewählt"</string>
@@ -87,28 +107,163 @@
<string name="uninstall_system_app_text" msgid="6429814133777046491">"Dies ist eine Systemanwendung, die nicht deinstalliert werden kann."</string>
<string name="dream_name" msgid="2847171357608437154">"Raketenstartgerät"</string>
<string name="folder_hint_text" msgid="8633351560105748141">"Unbenannter Ordner"</string>
+
+ <!-- The format string for Workspace descriptions [CHAR_LIMIT=none] -->
<string name="workspace_description_format" msgid="2968608205939373034">"Startbildschirm %1$d"</string>
+
+ <!-- The format string for default page scroll text [CHAR_LIMIT=none] -->
<string name="default_scroll_format" msgid="4057140866420001240">"Seite %1$d von %2$d"</string>
+ <!-- The format string for Workspace page scroll text [CHAR_LIMIT=none] -->
<string name="workspace_scroll_format" msgid="1704767047951143301">"Startbildschirm %1$d von %2$d"</string>
+ <!-- The format string for AppsCustomize Apps page scroll text [CHAR_LIMIT=none] -->
<string name="apps_customize_apps_scroll_format" msgid="5494241912377704885">"App-Seite %1$d von %2$d"</string>
+ <!-- The format string for AppsCustomize Apps page scroll text [CHAR_LIMIT=none] -->
<string name="apps_customize_widgets_scroll_format" msgid="5383009742241717437">"Widget-Seite %1$d von %2$d"</string>
+
+ <!-- Clings -->
+ <!-- The title text for the workspace cling [CHAR_LIMIT=none] -->
<string name="workspace_cling_title" msgid="738396473989890567">"Fühlen Sie sich wie zu Hause"</string>
+ <!-- The description of how to use the workspace [CHAR_LIMIT=none] -->
<string name="workspace_cling_move_item" msgid="791013895761065070">"Hier können Sie Ihre Lieblings-Apps ablegen."</string>
+ <!-- The description of how to open all apps from the workspace [CHAR_LIMIT=none] -->
<string name="workspace_cling_open_all_apps" msgid="2459977609848572588">"Berühren Sie den Kreis für eine Übersicht aller Apps."</string>
+ <!-- The title text for the All Apps cling [CHAR_LIMIT=none] -->
<string name="all_apps_cling_title" msgid="2559734712581447107">"Apps auswählen"</string>
+ <!-- The description of how to pick up and add an item to the workspace [CHAR_LIMIT=none] -->
<string name="all_apps_cling_add_item" msgid="5665035103260318891">"Berühren und halten Sie eine App, um sie zum Startbildschirm hinzuzufügen."</string>
+ <!-- The title text for the All Apps Sort cling [CHAR_LIMIT=none] -->
+ <string name="all_apps_sort_cling_title">Apps sortieren</string>
+ <!-- The description of how to pick sort apps in the drawer [CHAR_LIMIT=none] -->
+ <string name="all_apps_sort_cling_add_item">App-Tab gedrückt halten, um die Art der Sortierung zu wählen.</string>
+ <!-- The title text for the Folder cling [CHAR_LIMIT=none] -->
<string name="folder_cling_title" msgid="4308949882377840953">"Apps mit Ordnern organisieren"</string>
+ <!-- The description of how to move an app [CHAR_LIMIT=none] -->
<string name="folder_cling_move_item" msgid="270598675060435169">"Berühren und halten Sie eine App, um sie zu verschieben."</string>
+ <!-- The description of how to create a folder [CHAR_LIMIT=none] -->
<string name="folder_cling_create_folder" msgid="8352867485656129478">"Stapeln Sie Apps übereinander, um einen neuen Ordner auf Ihrem Startbildschirm zu erstellen."</string>
+ <!-- The text on the button to dismiss a cling [CHAR_LIMIT=none] -->
<string name="cling_dismiss" msgid="2780907108735868381">"OK"</string>
+
+ <!-- Folder accessibility -->
+ <!-- The format string for when a folder is opened, speaks the dimensions -->
<string name="folder_opened" msgid="1262064100943801533">"Ordner geöffnet, <xliff:g id="WIDTH">%1$d</xliff:g> x <xliff:g id="HEIGHT">%2$d</xliff:g>"</string>
+ <!-- Instruction that clicking outside will close folder -->
<string name="folder_tap_to_close" msgid="1335478160661137579">"Ordner durch Berühren schließen"</string>
+ <!-- Instruction that clicking outside will commit folder rename -->
<string name="folder_tap_to_rename" msgid="5201612989905472442">"Umbenennung durch Berühren speichern"</string>
+ <!-- Indication that folder closed -->
<string name="folder_closed" msgid="3130534551370511932">"Ordner wurde geschlossen"</string>
+ <!-- Folder renamed format -->
<string name="folder_renamed" msgid="7951233572858053642">"Ordner umbenannt in <xliff:g id="NAME">%1$s</xliff:g>"</string>
+ <!-- Folder name format -->
<string name="folder_name_format" msgid="3051680259794759037">"Ordner: <xliff:g id="NAME">%1$s</xliff:g>"</string>
+
+ <!-- Strings used in device overlays -->
+
+ <!-- Clings -->
+ <!-- Dummy string [CHAR_LIMIT=40] -->
<string name="custom_workspace_cling_title_1" msgid="1433009175359948587"></string>
+ <!-- Dummy string [CHAR_LIMIT=60] -->
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
+ <!-- Dummy string [CHAR_LIMIT=40] -->
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
+ <!-- Dummy string [CHAR_LIMIT=60] -->
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+
+ <!-- Hidden apps -->
+ <string name="hidden_apps_title">Versteckte Apps</string>
+
+ <!-- -->
+ <!-- Preferences -->
+ <!-- -->
+ <string name="preferences_title">Launcher-Einstellungen</string>
+ <!-- UI -->
+ <string name="preferences_interface_title">Oberfläche</string>
+ <!-- Application -->
+ <string name="preferences_application_title">Launcher-Version</string>
+
+ <!-- UI -->
+ <!-- Homescreen -->
+ <string name="preferences_interface_homescreen_title">Bildschirmseiten</string>
+ <string name="preferences_interface_homescreen_summary">Bildschirmseiten und Hintergrundbild</string>
+ <string name="preferences_interface_homescreen_general_category">Allgemein</string>
+ <string name="preferences_interface_homescreen_general_screens_title">Seitenzahl</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">Anzahl der verwendbaren und wechselbaren Bildschirmseiten für Icons und Widgets</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">Standardseite</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">Aktive Bildschirmseite nach Neustart des Geräts</string>
+ <string name="preferences_interface_homescreen_general_grid_title">Rastergröße</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">Anzahl der für Icons verfügbaren Reihen / Spalten</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">Reihen</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">Spalten</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">Seiten ausdehnen</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">Seiten bildschirmfüllend ausdehnen</string>
+ <string name="preferences_interface_homescreen_general_search_title">Suchleiste</string>
+ <string name="preferences_interface_homescreen_general_search_summary">Dauerhafte Anzeige der Suchleiste</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">Beschriftung nicht anzeigen</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Beschriftung unterhalb der Icons nicht anzeigen</string>
+ <string name="preferences_interface_homescreen_scrolling_category">Scrollen</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">Übergangsanimation</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">Animation beim Scrollen zwischen den Seiten</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">Hintergrundbild scrollen</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Hintergrundbild bei Seitenwechsel scrollen</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">Hintergrundbild schneller rendern</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">Flüssigere Darstellung von statischen Hintergrundbildern</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">Hintergrundbildgröße</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">Größe des Hintergrundbilds in Seitenbreiten festlegen</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">Seiten einblenden</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">Beim Scrollen die Seiten einblenden</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">Umriss anzeigen</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">Beim Scrollen den Umriss der Seite anzeigen</string>
+ <string name="preferences_interface_homescreen_indicator_category">Seitenindikator</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">Anzeigen</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">Seitenindikator anzeigen</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">Automatisch ausblenden</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">Indikator nach Seitenwechsel ausblenden</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">Position</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">Anzeigeposition des Indikators auswählen</string>
+
+ <!-- Drawer -->
+ <string name="preferences_interface_drawer_title">Apps</string>
+ <string name="preferences_interface_drawer_summary">Apps und Widgets</string>
+ <string name="preferences_interface_drawer_orientation_title">Ausrichtung</string>
+ <string name="preferences_interface_drawer_orientation_summary">Scrollrichtung der App-Seiten auswählen</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">Versteckte Apps</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">Apps auf den App-Seiten verstecken.</string>
+ <string name="preferences_interface_drawer_widgets_category">Widget-Seiten</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">Mit App-Seiten verbinden</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">Blättern auch zwischen App- und Widget-Seiten</string>
+ <string name="preferences_interface_drawer_scrolling_category">Scrollen</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">Übergangsanimation</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">Animation beim Scrollen zwischen den Seiten</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">Seiten einblenden</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">Beim Scrollen die Seiten einblenden</string>
+ <string name="preferences_interface_drawer_indicator_category">Seitenindikator</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">Anzeigen</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">Seitenindikator anzeigen</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">Automatisch ausblenden</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">Indikator nach Seitenwechsel ausblenden</string>
+ <string name="preferences_interface_drawer_indicator_position_title">Position</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">Anzeigeposition des Indikators auswählen</string>
+
+ <!-- Dock -->
+ <string name="preferences_interface_dock_title">Dock</string>
+ <string name="preferences_interface_dock_pages_title">Seiten</string>
+ <string name="preferences_interface_dock_pages_summary">Anzahl der Seiten im Dock</string>
+ <string name="preferences_interface_dock_default_page_title">Standardseite</string>
+ <string name="preferences_interface_dock_default_page_summary">Die Standardseite festlegen</string>
+ <string name="preferences_interface_dock_icons_title">Icons</string>
+ <string name="preferences_interface_dock_icons_summary">Anzahl der Icons/Spalten des Docks festlegen</string>
+ <string name="preferences_interface_dock_icon_scale_title">Icongröße</string>
+ <string name="preferences_interface_dock_icon_scale_summary">Größe der Icons im Dock</string>
+ <string name="preferences_interface_dock_divider_title">Dock-Abtrennung anzeigen</string>
+ <string name="preferences_interface_dock_divider_summary">Linie als Indikator-Hintergrund anzeigen</string>
+
+ <!-- Icons -->
+ <string name="preferences_interface_icons_title">Icons</string>
+
+ <!-- General -->
+ <string name="preferences_interface_general_title">Allgemein</string>
+ <string name="preferences_interface_general_orientation_title">Automatische Seitenausrichtung</string>
+ <string name="preferences_interface_general_fullscreen_title">Vollbildmodus</string>
+ <string name="preferences_interface_general_fullscreen_summary">Statusleiste für Vollbildansicht ausblenden</string>
</resources>
diff --git a/res/values-el-land/strings.xml b/res/values-el-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-el-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml
index 78e153ab0..1db7b576c 100644
--- a/res/values-el/strings.xml
+++ b/res/values-el/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
<string name="home" msgid="5921706419368316758">"Αρχική σελίδα"</string>
<string name="uid_name" msgid="3371120195364560632">"Βασικές εφαρμογές Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
@@ -30,6 +29,7 @@
<string name="widgets_tab_label" msgid="9145860100000983599">"Γραφικά στοιχεία"</string>
<string name="long_press_widget_to_add" msgid="7395697462851217506">"Αγγίξτε παρατεταμένα για να πάρετε ένα γραφ.στοιχ."</string>
<string name="market" msgid="2652226429823445833">"Αγορές"</string>
+ <string name="menu">Μενού</string>
<string name="external_drop_widget_error" msgid="2285187188524172774">"Αδυναμία τοποθέτησης στοιχείου στην Αρχική οθόνη."</string>
<string name="external_drop_widget_pick_title" msgid="7040647073452295370">"Επιλ. γραφ. στοιχείο για δημιουργία"</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Όνομα φακέλου"</string>
@@ -55,8 +55,10 @@
<string name="delete_zone_label_workspace" msgid="7153615831493049150">"Κατάργηση"</string>
<string name="delete_zone_label_all_apps" msgid="6664588234817475108">"Κατάργηση εγκατάστασης"</string>
<string name="delete_target_label" msgid="665300185123139530">"Κατάργηση"</string>
+ <string name="cancel_target_label">Ακύρωση</string>
<string name="delete_target_uninstall_label" msgid="748894921183769150">"Κατάργηση εγκατάστασης"</string>
<string name="info_target_label" msgid="4019495079517426980">"Πληροφορίες εφαρμογής"</string>
+ <string name="edit_target_label">Επεξεργασία</string>
<string name="accessibility_search_button" msgid="816822994629942611">"Αναζήτηση"</string>
<string name="accessibility_voice_search_button" msgid="3938249215065842475">"Φωνητική αναζήτηση"</string>
<string name="accessibility_all_apps_button" msgid="8803738611398979849">"Εφαρμογές"</string>
@@ -68,7 +70,13 @@
<string name="menu_search" msgid="4826514464423239041">"Αναζήτηση"</string>
<string name="menu_notifications" msgid="6424587053194766192">"Ειδοποιήσεις"</string>
<string name="menu_settings" msgid="3946232973327980394">"Ρυθμίσεις συστήματος"</string>
+ <string name="menu_preferences">Ρυθμίσεις Trebuchet</string>
<string name="menu_help" msgid="4901160661634590633">"Βοήθεια"</string>
+ <string name="menu_apps_sort_title">Όνομα</string>
+ <string name="menu_apps_sort_install_date">Ημερομηνία εγκατάστασης</string>
+ <string name="menu_apps_filter_system">Σύστημα</string>
+ <string name="menu_apps_filter_downloaded">Ληφθέντες</string>
+ <string name="menu_hidden_apps_delete">Επαναφορά</string>
<string name="cab_menu_delete_app" msgid="4089398025537640349">"Κατάργηση εγκατάστασης εφαρμογής"</string>
<string name="cab_menu_app_info" msgid="914548323652698884">"Λεπτομέρειες εφαρμογής"</string>
<string name="cab_app_selection_text" msgid="6378522164293415735">"Επιλέχθηκε 1 εφαρμογή"</string>
@@ -97,6 +105,8 @@
<string name="workspace_cling_open_all_apps" msgid="2459977609848572588">"Για να δείτε όλες τις εφαρμογές σας, αγγίξτε τον κύκλο."</string>
<string name="all_apps_cling_title" msgid="2559734712581447107">"Επιλέξτε κάποιες εφαρμογές"</string>
<string name="all_apps_cling_add_item" msgid="5665035103260318891">"Για να προσθέσετε μια εφαρμογή στην αρχική σας οθόνη, αγγίξτε την παρατεταμένα."</string>
+ <string name="all_apps_sort_cling_title">Ταξινομήστε τις εφαρμογές σας</string>
+ <string name="all_apps_sort_cling_add_item">Αγγίξτε και κρατήστε την καρτέλα Εφαρμογών για να επιλέξετε τη λειτουργία ταξινόμησης</string>
<string name="folder_cling_title" msgid="4308949882377840953">"Οργανώστε τις εφαρμογές σας με φακέλους"</string>
<string name="folder_cling_move_item" msgid="270598675060435169">"Για να μετακινήσετε μια εφαρμογή, αγγίξτε την παρατεταμένα."</string>
<string name="folder_cling_create_folder" msgid="8352867485656129478">"Για να δημιουργήσετε ένα νέο φάκελο στην αρχική οθόνη, τοποθετήστε μια εφαρμογή πάνω σε μια άλλη."</string>
@@ -111,4 +121,104 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+
+ <!-- Hidden apps -->
+ <string name="hidden_apps_title">Κρυμμένες εφαρμογές</string>
+
+ <skip />
+ <!-- -->
+ <!-- Preferences -->
+ <!-- -->
+ <string name="preferences_title">Ρυθμίσεις</string>
+ <!-- UI -->
+ <string name="preferences_interface_title">Διεπαφή</string>
+ <!-- Application -->
+ <string name="preferences_application_title">Εφαρμογή</string>
+
+ <!-- UI -->
+ <!-- Homescreen -->
+ <string name="preferences_interface_homescreen_title">Αρχική οθόνη</string>
+ <string name="preferences_interface_homescreen_summary">Οθόνες και ταπετσαρία</string>
+ <string name="preferences_interface_homescreen_general_category">Γενικά</string>
+ <string name="preferences_interface_homescreen_general_screens_title">Αρχικές οθόνες</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">Αριθμός αρχικών οθονών</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">Προεπιλεγμένη οθόνη</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">Προεπιλεγμένη αρχική οθόνη</string>
+ <string name="preferences_interface_homescreen_general_search_title">Μπάρα αναζήτησης</string>
+ <string name="preferences_interface_homescreen_general_search_summary">Ενεργοποίηση επίμονης μπάρας αναζήτησης</string>
+ <string name="preferences_interface_homescreen_general_grid_title">Μέγεθος πλέγματος</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">Επιλέξτε τον αριθμό των γραμμών/στηλών στην αρχική οθόνη</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">Γραμμές</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">Στήλες</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">Επέκταση αρχικών οθονών</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">Επέκταση αρχικών οθονών για να γεμίζει το μέγεθος της οθόνης</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">Απόκρυψη ετικετών</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Απόκρυψη ετικετών των εικονιδίων στην αρχική σελίδα</string>
+ <string name="preferences_interface_homescreen_scrolling_category">Κύλιση</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">Εφέ μετάβασης</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">Εφέ κύλισης μεταξύ των αρχικών οθονών</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">Κύλιση ταπετσαρίας</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Κύλιση ταπετσαρίας κατά τη μετακίνηση στις αρχικές οθόνες</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">Γρήγορος σχεδιασμός ταπετσαρίας</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">Χρήση του hack ταπετσαρίας που αυξάνει την ομαλότητα στις στατικές ταπετσαρίες</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">Μέγεθος ταπετσαρίας</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">Πόσες οθόνες θα καλύπτει η ταπετσαρία</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">Ξεθώριασμα οθονών</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">Ξεθώριασμα των διπλανών οθονών κατά την κύλιση μεταξύ αρχικών οθονών</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">Εμφάνιση περιγράμματος</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">Εμφάνιση περιγράμματος των οθονών κατά την κύλιση μεταξύ αρχικών οθονών</string>
+ <string name="preferences_interface_homescreen_indicator_category">Ένδειξη</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">Εμφάνιση ένδειξης σελίδας</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">Εμφάνιση ένδειξης τρέχουσας σελίδας στο κάτω μέρος της οθόνης</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">Αυτόματη απόκρυψη ένδειξης</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">Αυτόματη απόκρυψη της ένδειξης μετά την αλλαγή σελίδας</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">Θέση ένδειξης</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">Επιλέξτε πού θα εμφανίζεται η ένδειξη στην οθόνη</string>
+
+ <!-- Drawer -->
+ <string name="preferences_interface_drawer_title">Συρτάρι</string>
+ <string name="preferences_interface_drawer_summary">Συρτάρι εφαρμογών και widget</string>
+ <string name="preferences_interface_drawer_orientation_title">Προσανατολισμός</string>
+ <string name="preferences_interface_drawer_orientation_summary">Επιλέξτε τον τρόπο κύλισης του συρταριού</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">Κρυμμένες εφαρμογές</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">Εφαρμογές που δεν εμφανίζονται στο συρτάρι</string>
+ <string name="preferences_interface_drawer_widgets_category">Widgets</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">Σύνδεση με εφαρμογές</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">Κύλιση από το συρτάρι εφαρμογών στο συρτάρι widgets χωρίς εναλλαγή καρτέλας</string>
+ <string name="preferences_interface_drawer_scrolling_category">Κύλιση</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">Εφέ μετάβασης</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">Εφέ κύλισης μεταξύ των οθονών</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">Ξεθώριασμα σελιδών</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">Ξεθώριασμα των διπλανών σελιδών κατά την κύλιση μεταξύ οθονών</string>
+ <string name="preferences_interface_drawer_indicator_category">Ένδειξη</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">Εμφάνιση ένδειξης σελίδας</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">Εμφάνιση ένδειξης τρέχουσας σελίδας στο κάτω μέρος της οθόνης</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">Αυτόματη απόκρυψη ένδειξης</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">Αυτόματη απόκρυψη της ένδειξης μετά την αλλαγή σελίδας</string>
+ <string name="preferences_interface_drawer_indicator_position_title">Θέση ένδειξης</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">Επιλέξτε πού θα εμφανίζεται η ένδειξη στην οθόνη</string>
+
+ <!-- Dock -->
+ <string name="preferences_interface_dock_title">Μπάρα εφαρμογών</string>
+ <string name="preferences_interface_dock_enabled_title">Εμφάνιση μπάρας</string>
+ <string name="preferences_interface_dock_enabled_summary">Εμφάνιση της μπάρας κάτω από την αρχική οθόνη</string>
+ <string name="preferences_interface_dock_pages_title">Σελίδες</string>
+ <string name="preferences_interface_dock_pages_summary">Αριθμός σελιδών στην μπάρα</string>
+ <string name="preferences_interface_dock_default_page_title">Προεπιλεγμένη σελίδα</string>
+ <string name="preferences_interface_dock_default_page_summary">Επιλέξτε την προεπιλεγμένη σελίδα</string>
+ <string name="preferences_interface_dock_icons_title">Εικονίδια</string>
+ <string name="preferences_interface_dock_icons_summary">Αριθμός εικονιδίων που θα εμφανίζονται στην μπάρα</string>
+ <string name="preferences_interface_dock_icon_scale_title">Κλίμακα εικονιδίων</string>
+ <string name="preferences_interface_dock_icon_scale_summary">Κλίμακα των εικονιδίων στην μπάρα</string>
+ <string name="preferences_interface_dock_divider_title">Εμφάνιση διαχωριστικού</string>
+ <string name="preferences_interface_dock_divider_summary">Εμφάνιση διαχωριστικού μεταξύ της αρχικής οθόνης και της μπάρας</string>
+
+ <!-- Icons -->
+ <string name="preferences_interface_icons_title">Εικονίδια</string>
+
+ <!-- General -->
+ <string name="preferences_interface_general_title">Γενικά</string>
+ <string name="preferences_interface_general_orientation_title">Αυτόματη περιστροφή οθόνης</string>
+ <string name="preferences_interface_general_fullscreen_title">Λειτουργία πλήρους οθόνης</string>
+ <string name="preferences_interface_general_fullscreen_summary">Απόκρυψη της μπάρας ειδοποιήσεων για επέκταση της αρχικής οθόνης</string>
</resources>
diff --git a/res/values-en-rGB-land/strings.xml b/res/values-en-rGB-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-en-rGB-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml
index ceb215a73..4ed5f7a61 100644
--- a/res/values-en-rGB/strings.xml
+++ b/res/values-en-rGB/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
<string name="home" msgid="5921706419368316758">"Home"</string>
<string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-es-land/strings.xml b/res/values-es-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-es-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-es-rUS-land/strings.xml b/res/values-es-rUS-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-es-rUS-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
index bc6566dfb..f7b2cbb6b 100644
--- a/res/values-es-rUS/strings.xml
+++ b/res/values-es-rUS/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
<string name="home" msgid="5921706419368316758">"Casa"</string>
<string name="uid_name" msgid="3371120195364560632">"Aplicaciones del núcleo de Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-es/arrays.xml b/res/values-es/arrays.xml
new file mode 100644
index 000000000..87b254d31
--- /dev/null
+++ b/res/values-es/arrays.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2008 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.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="preferences_interface_homescreen_indicator_position_entries">
+ <item>Estándar</item>
+ <item>Arriba</item>
+ <item>Abajo</item>
+ </string-array>
+ <string-array name="preferences_interface_homescreen_scrolling_transition_effect_entries">
+ <item>Estándar</item>
+ <item>Tablet</item>
+ <item>Zoom entrante</item>
+ <item>Zoom saliente</item>
+ <item>Rotar arriba</item>
+ <item>Rotar abajo</item>
+ <item>Cilíndrico entrante</item>
+ <item>Cilíndrico saliente</item>
+ <item>Cúbico entrante</item>
+ <item>Cúbico saliente</item>
+ <item>Girar</item>
+ <item>Voltear</item>
+ <item>Apilar</item>
+ <item>Acordeón</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_scrolling_transition_effect_entries">
+ <item>Estándar</item>
+ <item>Tablet</item>
+ <item>Zoom entrante</item>
+ <item>Zoom saliente</item>
+ <item>Rotar arriba</item>
+ <item>Rotar abajo</item>
+ <item>Cilíndrico entrante</item>
+ <item>Cilíndrico saliente</item>
+ <item>Cúbico entrante</item>
+ <item>Cúbico saliente</item>
+ <item>Girar</item>
+ <item>Voltear</item>
+ <item>Apilar</item>
+ <item>Acordeón</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_indicator_position_entries">
+ <item>Arriba/Izquierda</item>
+ <item>Abajo/Derecha</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_orientation_entries">
+ <item>Horizontal</item>
+ <item>Vertical</item>
+ </string-array>
+</resources>
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index 2987f3e51..2fafa5560 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
<string name="home" msgid="5921706419368316758">"Casa"</string>
<string name="uid_name" msgid="3371120195364560632">"Aplicaciones básicas de Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
@@ -111,4 +110,97 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+
+ <!-- CYANOGENMOD EDITS START -->
+
+ <string name="cancel_target_label">Cancelar</string>
+ <string name="menu_preferences">Ajustes de Trebuchet</string>
+ <string name="menu_apps_sort_title">Nombre</string>
+ <string name="menu_apps_sort_install_date">Fecha</string>
+ <string name="menu_apps_filter_system">Sistema</string>
+ <string name="menu_apps_filter_downloaded">Descargadas</string>
+ <string name="menu_hidden_apps_delete">Restablecer</string>
+ <string name="all_apps_sort_cling_title">Ordenar aplicaciones</string>
+ <string name="all_apps_sort_cling_add_item">Mantener pulsación sobre la pestaña Aplicaciones para elegir el método de ordenación</string>
+ <string name="hidden_apps_title">Aplicaciones ocultas</string>
+ <string name="edit_target_label">Editar</string>
+ <string name="preferences_title">Preferencias</string>
+ <string name="preferences_interface_title">Interfaz</string>
+ <string name="preferences_application_title">Aplicación</string>
+ <string name="preferences_interface_homescreen_title">Pantalla de inicio</string>
+ <string name="preferences_interface_homescreen_summary">Pantallas y fondo</string>
+ <string name="preferences_interface_homescreen_general_category">General</string>
+ <string name="preferences_interface_homescreen_general_screens_title">Pantallas de inicio</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">Número de pantallas de inicio a mostrar</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">Pantalla por defecto</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">Escoger la pantalla de inicio por defecto</string>
+ <string name="preferences_interface_homescreen_general_search_title">Barra de búsqueda</string>
+ <string name="preferences_interface_homescreen_general_search_summary">Habilitar la barra de búsqueda permanentemente</string>
+ <string name="preferences_interface_homescreen_general_grid_title">Filas y columnas</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">Indicar el número de filas/columnas a mostrar en la pantalla de inicio</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">Filas</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">Columnas</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">Extender pantallas</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">Extender las pantallas de inicio para ocupar toda la pantalla</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">Ocultar etiquetas</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Ocultar las etiquetas de los iconos de la pantalla de inicio</string>
+ <string name="preferences_interface_homescreen_scrolling_category">Desplazamiento</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">Efecto de transición</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">Efecto de transición al desplazarse entre pantallas</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">Desplazar fondo</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Desplazar fondo de escritorio al desplazar las pantallas de inicio</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">Renderizado rápido</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">Usar el renderizado rápido, suaviza los fondos de pantalla con imágenes estáticas</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">Tamaño del fondo</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">Establecer cuantas pantallas ocupará el fondo de pantalla</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">Efecto de fundido</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">Efecto de fundido al desplazarse entre pantallas</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">Bordes de pantalla</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">Mostrar bordes delimitadores al desplazarse entre pantallas</string>
+ <string name="preferences_interface_homescreen_indicator_category">Indicador</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">Mostrar indicador</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">Mostrar indicador de página actual en la pantalla</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">Efecto de fundido</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">Ocultar automáticamente el indicador de página</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">Posición</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">Establecer dónde se mostrará el indicador de página</string>
+ <string name="preferences_interface_drawer_title">Pestañas</string>
+ <string name="preferences_interface_drawer_summary">Aplicaciones y widgets</string>
+ <string name="preferences_interface_drawer_orientation_title">Orientación</string>
+ <string name="preferences_interface_drawer_orientation_summary">Establecer la dirección de desplazamiento</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">Aplicaciones ocultas</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">Establecer las aplicaciones que se ocultarán en la pestaña aplicaciones</string>
+ <string name="preferences_interface_drawer_widgets_category">Widgets</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">Transición pestañas</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">Pasar de pestañas de aplicaciones a pestañas de widgets sin necesidad de cambiar explícitamente de pestaña</string>
+ <string name="preferences_interface_drawer_scrolling_category">Desplazamiento</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">Efecto de transición</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">Efecto de transición al desplazarse entre pantallas</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">Efecto de fundido</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">Efecto de fundido al desplazarse entre pantallas</string>
+ <string name="preferences_interface_drawer_indicator_category">Indicador</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">Mostrar indicador</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">Mostrar indicador de página actual en la pantalla</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">Efecto de fundido</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">Ocultar automáticamente el indicador de página</string>
+ <string name="preferences_interface_drawer_indicator_position_title">Posición</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">Establecer dónde se mostrará el indicador de página</string>
+ <string name="preferences_interface_dock_title">Barra de aplicaciones</string>
+ <string name="preferences_interface_dock_pages_title">Páginas</string>
+ <string name="preferences_interface_dock_pages_summary">Establecer el número de páginas</string>
+ <string name="preferences_interface_dock_default_page_title">Página por defecto</string>
+ <string name="preferences_interface_dock_default_page_summary">Establecer la página por defecto</string>
+ <string name="preferences_interface_dock_icons_title">Número de iconos</string>
+ <string name="preferences_interface_dock_icons_summary">Establecer el número de iconos que se mostrarán</string>
+ <string name="preferences_interface_dock_icon_scale_title">Tamaño de iconos</string>
+ <string name="preferences_interface_dock_icon_scale_summary">Establecer la escala para los iconos</string>
+ <string name="preferences_interface_dock_divider_title">Separador</string>
+ <string name="preferences_interface_dock_divider_summary">Mostrar una línea divisoria sobre la barra de aplicaciones</string>
+ <string name="preferences_interface_icons_title">Iconos</string>
+ <string name="preferences_interface_general_title">General</string>
+ <string name="preferences_interface_general_orientation_title">Rotación automática pantalla</string>
+ <string name="preferences_interface_general_fullscreen_title">Modo pantalla completa</string>
+ <string name="preferences_interface_general_fullscreen_summary">Ocultar la barra de estado para extender la pantalla de inicio</string>
+
+ <!-- CYANOGENMOD ADDITIONS END -->
</resources>
diff --git a/res/values-et/strings.xml b/res/values-et/strings.xml
index 78c983a38..67c30bf78 100644
--- a/res/values-et/strings.xml
+++ b/res/values-et/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Käivitaja"</string>
<string name="home" msgid="5921706419368316758">"Kodu"</string>
<string name="uid_name" msgid="3371120195364560632">"Androidi tuumrakendused"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-fa-land/strings.xml b/res/values-fa-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-fa-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml
index abdb30abe..4cd9ba67e 100644
--- a/res/values-fa/strings.xml
+++ b/res/values-fa/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"راه انداز"</string>
<string name="home" msgid="5921706419368316758">"صفحهٔ اصلی"</string>
<string name="uid_name" msgid="3371120195364560632">"برنامه‌های Android Core"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-fi-land/strings.xml b/res/values-fi-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-fi-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-fi/arrays.xml b/res/values-fi/arrays.xml
new file mode 100644
index 000000000..573fcd66d
--- /dev/null
+++ b/res/values-fi/arrays.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2008 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.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="preferences_interface_homescreen_indicator_position_entries">
+ <item>Yläpalkin yläpuolella</item>
+ <item>Ylhäällä</item>
+ <item>Alhaalla</item>
+ </string-array>
+ <string-array name="preferences_interface_homescreen_scrolling_transition_effect_entries">
+ <item>Normaali</item>
+ <item>Tablet</item>
+ <item>Zoomaa sisään</item>
+ <item>Zoomaa ulos</item>
+ <item>Käännä ylös</item>
+ <item>Käännä alas</item>
+ <item>Sylinteri sisään</item>
+ <item>Sylinteri ulos</item>
+ <item>Kuutio sisään</item>
+ <item>Kuutio ulos</item>
+ <item>Pyöräytä</item>
+ <item>Käännä</item>
+ <item>Pino</item>
+ <item>Harmonikka</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_scrolling_transition_effect_entries">
+ <item>Normaali</item>
+ <item>Tablet</item>
+ <item>Zoomaa sisään</item>
+ <item>Zoomaa ulos</item>
+ <item>Käännä ylös</item>
+ <item>Käännä alas</item>
+ <item>Sylinteri sisään</item>
+ <item>Sylinteri ulos</item>
+ <item>Kuutio sisään</item>
+ <item>Kuutio ulos</item>
+ <item>Pyöräytä</item>
+ <item>Käännä</item>
+ <item>Pino</item>
+ <item>Harmonikka</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_indicator_position_entries">
+ <item>Ylhäällä/Vasemmalla</item>
+ <item>Alhaalla/Oikealla</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_orientation_entries">
+ <item>Vaaka</item>
+ <item>Pysty</item>
+ </string-array>
+</resources>
diff --git a/res/values-fi/strings.xml b/res/values-fi/strings.xml
index 29f38267f..ef0447a95 100644
--- a/res/values-fi/strings.xml
+++ b/res/values-fi/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Käynnistysohjelma"</string>
<string name="home" msgid="5921706419368316758">"Aloitusruutu"</string>
<string name="uid_name" msgid="3371120195364560632">"Android Core -sovellukset"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
@@ -111,4 +110,92 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+ <string name="cancel_target_label">Peruuta</string>
+ <string name="menu_apps_sort_title">Nimi</string>
+ <string name="menu_apps_sort_install_date">Asennuspäivä</string>
+ <string name="preferences_title">Asetukset</string>
+ <string name="preferences_interface_title">Käyttöliittymä</string>
+ <string name="preferences_application_title">Sovellus</string>
+ <string name="preferences_interface_homescreen_title">Kotinäyttö</string>
+ <string name="preferences_interface_homescreen_summary">Näytöt ja taustakuva</string>
+ <string name="preferences_interface_homescreen_general_category">Yleiset</string>
+ <string name="preferences_interface_homescreen_general_screens_title">Kotinäytöt</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">Valitse kotinäyttöjen lukumäärä</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">Oletusnäyttö</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">Valitse oletusnäyttö</string>
+ <string name="preferences_interface_homescreen_general_search_title">Hakupalkki</string>
+ <string name="preferences_interface_homescreen_general_search_summary">Ota pysyvä hakupalkki käyttöön</string>
+ <string name="preferences_interface_homescreen_general_grid_title">Ruudukon koko</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">Valitse rivien/sarakkeiden määrä kotinäytöllä</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">Rivit</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">Sarakkeet</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">Venytä näyttöjä</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">Laajentaa kotinäyttöjä täyttääkseen koko näytön</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">Piilota kuvakkeiden tekstit</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Piilota kuvakkeiden tekstit kotinäytöllä</string>
+ <string name="preferences_interface_homescreen_scrolling_category">Selaaminen</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">Vaihtoefekti</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">Efekti kotinäyttöä vierittäessä</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">Vieritä taustakuvaa</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Vieritä taustakuvaa näytöllä siirryttäessä</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">Taustakuvan nopea esitys</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">Käytä taustakuvan korjausta joka parantaa sulavuutta liikkumattomissa taustakuvissa</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">Taustakuvan koko</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">Monenko näytön levyinen taustakuvan pitäisi olla</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">Häivytä viereiset näytöt</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">Häivytä viereiset näytöt vierittäessä kotinäyttöjä</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">Näytä ulkoreunat</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">Näytä näytön ulkoreunat vierittäessä kotinäyttöjä</string>
+ <string name="preferences_interface_homescreen_indicator_category">Osoitin</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">Näytä sivunosoitin</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">Näyttää tämänhetkisen näytön osoittimen näytön alalaidassa</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">Häivytä osoitin</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">Häivyttää osoittimen kun kotinäyttö on vaihtunut</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">Osoittimen sijainti</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">Valitse missä sivuosoitin sijaitsee kotinäytöllä</string>
+ <string name="preferences_interface_drawer_title">Sovellusvalikko</string>
+ <string name="preferences_interface_drawer_summary">Sovellusten ja widgetien valikko</string>
+ <string name="preferences_interface_drawer_orientation_title">Suunta</string>
+ <string name="preferences_interface_drawer_orientation_summary">Valitse mihin suuntaan sovellusvalikkoa vieritetään</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">Piilotetut sovellukset</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">Piilota sovelluksia sovellusvalikosta</string>
+ <string name="preferences_interface_drawer_widgets_category">Widgetit</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">Sovellusten mukana</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">Vieritä sovellusvalikosta widgeteihin ilman välilehden vaihtoa</string>
+ <string name="preferences_interface_drawer_scrolling_category">Vierittäminen</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">Vaihtoefekti</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">Efekti sivua vierittäessä</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">Häivytä viereiset näytöt</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">Häivytä viereiset näytöt vierittäessä sivuja</string>
+ <string name="preferences_interface_drawer_indicator_category">Osoitin</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">Näytä sivunosoitin</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">Näyttää tämänhetkisen näytön osoittimen näytön alalaidassa</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">Häivytä osoitin</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">Häivyttää osoittimen kun sivu on vaihtunut</string>
+ <string name="preferences_interface_drawer_indicator_position_title">Osoittimen sijainti</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">Valitse missä sivuosoitin sijaitsee näytöllä</string>
+ <string name="preferences_interface_dock_title">Alapalkki</string>
+ <string name="preferences_interface_dock_enabled_title">Näytä alapalkki</string>
+ <string name="preferences_interface_dock_enabled_summary">Näyttää alapalkin sivun alalaidassa</string>
+ <string name="preferences_interface_dock_pages_title">Sivut</string>
+ <string name="preferences_interface_dock_pages_summary">Alapalkkien määrä</string>
+ <string name="preferences_interface_dock_default_page_title">Oletussivu</string>
+ <string name="preferences_interface_dock_default_page_summary">Valitse oletussivu</string>
+ <string name="preferences_interface_dock_icons_title">Kuvakkeet</string>
+ <string name="preferences_interface_dock_icons_summary">Kuvakkeiden/sarakkeiden määrä alapalkissa</string>
+ <string name="preferences_interface_dock_icon_scale_title">Kuvakkeiden skaalaus</string>
+ <string name="preferences_interface_dock_icon_scale_summary">Skaalaa kuvakkeet alapalkissa</string>
+ <string name="preferences_interface_dock_divider_title">Näytä alapalkin jakaja</string>
+ <string name="preferences_interface_dock_divider_summary">Näyttää osoittimen taustan</string>
+ <string name="preferences_interface_icons_title">Kuvakkeet</string>
+ <string name="preferences_interface_general_title">Yleiset</string>
+ <string name="preferences_interface_general_orientation_title">Automaattinen näytön asento</string>
+ <string name="preferences_interface_general_fullscreen_title">Koko näytön tila</string>
+ <string name="preferences_interface_general_fullscreen_summary">Piilota tilapalkki suurentaaksesi kotinäyttöä</string>
+ <string name="menu">Valikko</string>
+ <string name="edit_target_label">Muokkaa</string>
+ <string name="menu_apps_filter_system">Järjestelmä</string>
+ <string name="menu_apps_filter_downloaded">Ladatut</string>
+ <string name="menu_hidden_apps_delete">Nollaa</string>
+ <string name="hidden_apps_title">Piilotetut sovellukset</string>
</resources>
diff --git a/res/values-fr-land/strings.xml b/res/values-fr-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-fr-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-fr/arrays.xml b/res/values-fr/arrays.xml
new file mode 100644
index 000000000..c01bebad6
--- /dev/null
+++ b/res/values-fr/arrays.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2008 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.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="preferences_interface_homescreen_indicator_position_entries">
+ <item>Sous le dock</item>
+ <item>En haut</item>
+ <item>En bas</item>
+ </string-array>
+ <string-array name="preferences_interface_homescreen_scrolling_transition_effect_entries">
+ <item>Standard</item>
+ <item>Tablette</item>
+ <item>Zoom intérieur</item>
+ <item>Zoom extérieur</item>
+ <item>Rotation vers le haut</item>
+ <item>Rotation vers le bas</item>
+ <item>Cylindre intérieur</item>
+ <item>Cylindre extérieur</item>
+ <item>Cube intérieur</item>
+ <item>Cube extérieur</item>
+ <item>Retournement</item>
+ <item>Feuille</item>
+ <item>Empilement</item>
+ <item>Accordéon</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_scrolling_transition_effect_entries">
+ <item>Standard</item>
+ <item>Tablette</item>
+ <item>Zoom intérieur</item>
+ <item>Zoom extérieur</item>
+ <item>Rotation vers le haut</item>
+ <item>Rotation vers le bas</item>
+ <item>Cylindre intérieur</item>
+ <item>Cylindre extérieur</item>
+ <item>Cube intérieur</item>
+ <item>Cube extérieur</item>
+ <item>Retournement</item>
+ <item>Feuille</item>
+ <item>Empilement</item>
+ <item>Accordéon</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_indicator_position_entries">
+ <item>Haut/Gauche</item>
+ <item>Bas/Droite</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_orientation_entries">
+ <item>Horizontale</item>
+ <item>Verticale</item>
+ </string-array>
+</resources>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 43bf8379e..6fd4e1dc0 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -19,17 +19,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Lanceur d\'applications"</string>
<string name="home" msgid="5921706419368316758">"Accueil"</string>
<string name="uid_name" msgid="3371120195364560632">"Applications de base Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
- <string name="chooser_wallpaper" msgid="6063168087625352235">"Sélectionnez un fond d\'écran dans"</string>
+ <string name="chooser_wallpaper" msgid="6063168087625352235">"Sélectionnez un fond d\'écran depuis"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Sélectionner"</string>
<string name="pick_wallpaper" msgid="5630222540525626723">"Fonds d\'écran"</string>
<string name="activity_not_found" msgid="217823393239365967">"L\'application n\'est pas installée."</string>
<string name="widgets_tab_label" msgid="9145860100000983599">"Widgets"</string>
<string name="long_press_widget_to_add" msgid="7395697462851217506">"Appuyez de manière prolongée pour ajouter widget."</string>
- <string name="market" msgid="2652226429823445833">"Acheter"</string>
+ <string name="market" msgid="2652226429823445833">"Google Play Store"</string>
<string name="external_drop_widget_error" msgid="2285187188524172774">"Impossible de déposer élément sur écran d\'accueil."</string>
<string name="external_drop_widget_pick_title" msgid="7040647073452295370">"Sélectionnez le widget à créer"</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Nom du dossier"</string>
@@ -111,4 +110,117 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+
+ <!-- **** CYANOGENMOD EDITS START **** -->
+
+ <string name="menu">Menu</string>
+ <string name="menu_apps_sort_title">Nom</string>
+ <string name="menu_apps_sort_install_date">Date d\'installation</string>
+ <string name="menu_apps_filter_system">Système</string>
+ <string name="menu_apps_filter_downloaded">Téléchargé</string>
+ <string name="menu_hidden_apps_delete">Réinitialiser</string>
+ <string name="menu_preferences">Paramètres de Trebuchet</string>
+ <string name="edit_target_label">Éditer</string>
+ <string name="cancel_target_label">Annuler</string>
+ <string name="all_apps_sort_cling_title">Triez vos applications</string>
+ <string name="all_apps_sort_cling_add_item">Appuyez de manière prolongée sur l\'onglet Application pour sélectionner votre méthode de tri</string>
+
+ <!-- Hidden apps -->
+ <string name="hidden_apps_title">Applications masquées</string>
+
+ <!-- -->
+ <!-- Preferences -->
+ <!-- -->
+ <string name="preferences_title">Paramètres</string>
+ <!-- UI -->
+ <string name="preferences_interface_title">Interface</string>
+ <!-- Application -->
+ <string name="preferences_application_title">Application</string>
+
+ <!-- UI -->
+ <!-- Homescreen -->
+ <string name="preferences_interface_homescreen_title">Écrans d\'accueil</string>
+ <string name="preferences_interface_homescreen_summary">Écrans et fond d\'écrans</string>
+ <string name="preferences_interface_homescreen_general_category">Général</string>
+ <string name="preferences_interface_homescreen_general_grid_title">Taille de la grille</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">Définir le nombre de rangées et de colonnes sur l\'écran d\'accueil</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">Rangées</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">Colonnes</string>
+ <string name="preferences_interface_homescreen_general_screens_title">Écrans d\'accueil</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">Nombre de pages sur l\'écran d\'accueil</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">Écran par défaut</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">Sélectionnez l\'écran par défaut</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">Étendre l\'écran</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">Étendre l\'écran d\'accueil pour remplir la totalité de l\'écran</string>
+ <string name="preferences_interface_homescreen_general_search_title">Barre de recherche</string>
+ <string name="preferences_interface_homescreen_general_search_summary">Activer la barre de recherche persistante</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">Sans libellés</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Cacher le libellé des icônes de l\'écran d\'accueil</string>
+ <string name="preferences_interface_homescreen_scrolling_category">Défilement</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">Effet de transition</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">Définir l\'effet de transition des écrans</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">Défilement du fond d\'écran</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Faire glisser le fond d\'écran avec les écrans</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">Rendu rapide du fond d\'écran</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">Optimiser les images statiques de fond d\'écran en augmentant les adoucissements</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">Taille du fond d\'écran</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">Combien d\'écran doit prendre le fond d\'écran</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">Estomper l\'écran</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">Estomper les écrans lorsque vous les faites défiler</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">Afficher les bordures</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">Afficher les bordures de l\'écran quand les pages défilent</string>
+ <string name="preferences_interface_homescreen_indicator_category">Indicateur</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">Indicateur de page</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">Afficher l\'indicateur de page en bas de l\'écran</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">Fondu</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">Faire disparaître l\'indicateur après le changement d\'écran</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">Position de l\'indicateur</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">Choisir la position de l\'indicateur sur l\'écran</string>
+
+ <!-- Drawer -->
+ <string name="preferences_interface_drawer_title">Applications</string>
+ <string name="preferences_interface_drawer_summary">Menu des applications et widgets</string>
+ <string name="preferences_interface_drawer_orientation_title">Orientation</string>
+ <string name="preferences_interface_drawer_orientation_summary">Définir dans quel sens les applications défilent</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">Applications masquées</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">Masquer les applications dans le menu</string>
+ <string name="preferences_interface_drawer_widgets_category">Widgets</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">Inclure dans les applications</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">Sauter des applications aux widgets sans changer d\'onglet</string>
+ <string name="preferences_interface_drawer_scrolling_category">Défilement</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">Effet de transition</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">Définir l\'effet de transition des écrans</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">Estomper les pages</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">Estomper les pages lorsque vous les faites défiler</string>
+ <string name="preferences_interface_drawer_indicator_category">Indicateur</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">Indicateur de page</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">Afficher l\'indicateur de page</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">Fondu</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">Faire disparaître l\'indicateur après le changement de page</string>
+ <string name="preferences_interface_drawer_indicator_position_title">Position de l\'indicateur</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">Choisir la position de l\'indicateur sur l\'écran</string>
+
+ <!-- Dock -->
+ <string name="preferences_interface_dock_title">Barre de Dock</string>
+ <string name="preferences_interface_dock_enabled_title">Afficher le dock</string>
+ <string name="preferences_interface_dock_enabled_summary">Afficher le dock en dessous de l\écran d\'accueil</string>
+ <string name="preferences_interface_dock_pages_title">Pages</string>
+ <string name="preferences_interface_dock_pages_summary">Nombre de pages dans le dock</string>
+ <string name="preferences_interface_dock_default_page_title">Page par défaut</string>
+ <string name="preferences_interface_dock_default_page_summary">Définir la page par défaut</string>
+ <string name="preferences_interface_dock_icons_title">Icônes</string>
+ <string name="preferences_interface_dock_icons_summary">Nombre d\'icônes/colonnes dans le dock</string>
+ <string name="preferences_interface_dock_icon_scale_title">Échelle des icônes</string>
+ <string name="preferences_interface_dock_icon_scale_summary">Définir l\'échelle des icônes dans le dock</string>
+ <string name="preferences_interface_dock_divider_title">Séparateur horizontal</string>
+ <string name="preferences_interface_dock_divider_summary">Afficher la ligne entre la barre du dock et l\'écran d\'accueil</string>
+
+ <!-- Icons -->
+ <string name="preferences_interface_icons_title">Icônes</string>
+
+ <!-- General -->
+ <string name="preferences_interface_general_title">Général</string>
+ <string name="preferences_interface_general_orientation_title">Rotation auto. de l\'écran</string>
+ <string name="preferences_interface_general_fullscreen_title">Plein écran</string>
+ <string name="preferences_interface_general_fullscreen_summary">Cacher la barre d\'état pour étendre l\'écran d\'accueil</string>
</resources>
diff --git a/res/values-hi/strings.xml b/res/values-hi/strings.xml
index c5ae89a44..f481e41ce 100644
--- a/res/values-hi/strings.xml
+++ b/res/values-hi/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"लॉन्चर"</string>
<string name="home" msgid="5921706419368316758">"मुखपृष्ठ"</string>
<string name="uid_name" msgid="3371120195364560632">"Android मुख्य एप्लिकेशन"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-hr-land/strings.xml b/res/values-hr-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-hr-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-hr/strings.xml b/res/values-hr/strings.xml
index 665d7b3ff..c10e827ed 100644
--- a/res/values-hr/strings.xml
+++ b/res/values-hr/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Pokretač"</string>
<string name="home" msgid="5921706419368316758">"Početna"</string>
<string name="uid_name" msgid="3371120195364560632">"Matične aplikacije za Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-hu-land/strings.xml b/res/values-hu-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-hu-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-hu/arrays.xml b/res/values-hu/arrays.xml
new file mode 100644
index 000000000..1a6bc5901
--- /dev/null
+++ b/res/values-hu/arrays.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2008 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.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="preferences_interface_homescreen_indicator_position_entries">
+ <item>Tálca felett</item>
+ <item>Fent</item>
+ <item>Lent</item>
+ </string-array>
+ <string-array name="preferences_interface_homescreen_scrolling_transition_effect_entries">
+ <item>Csúsztatás</item>
+ <item>Táblagép</item>
+ <item>Nagyítás befelé</item>
+ <item>Nagyítás kifelé</item>
+ <item>Forgatás felfelé</item>
+ <item>Forgatás lefelé</item>
+ <item>Henger belül</item>
+ <item>Henger kívül</item>
+ <item>Kocka belül</item>
+ <item>Kocka kívül</item>
+ <item>Pörgetés</item>
+ <item>Forgatás</item>
+ <item>Kártyapakli</item>
+ <item>Harmónika</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_scrolling_transition_effect_entries">
+ <item>Csúsztatás</item>
+ <item>Táblagép</item>
+ <item>Nagyítás befelé</item>
+ <item>Nagyítás kifelé</item>
+ <item>Forgatás felfelé</item>
+ <item>Forgatás lefelé</item>
+ <item>Henger belül</item>
+ <item>Henger kívül</item>
+ <item>Kocka belül</item>
+ <item>Kocka kívül</item>
+ <item>Pörgetés</item>
+ <item>Forgatás</item>
+ <item>Kártyapakli</item>
+ <item>Harmónika</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_indicator_position_entries">
+ <item>Fent/Bal oldalon</item>
+ <item>Lent/Jobb oldalon</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_orientation_entries">
+ <item>Vízszintes</item>
+ <item>Függőleges</item>
+ </string-array>
+</resources>
diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml
index 761ee7217..c4870716f 100644
--- a/res/values-hu/strings.xml
+++ b/res/values-hu/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Indító"</string>
<string name="home" msgid="5921706419368316758">"Főoldal"</string>
<string name="uid_name" msgid="3371120195364560632">"Alap Android-alkalmazások"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
@@ -30,6 +29,7 @@
<string name="widgets_tab_label" msgid="9145860100000983599">"Modulok"</string>
<string name="long_press_widget_to_add" msgid="7395697462851217506">"Modul felvételéhez érintse meg, és tartsa lenyomva"</string>
<string name="market" msgid="2652226429823445833">"Bolt"</string>
+ <string name="menu">Menü</string>
<string name="external_drop_widget_error" msgid="2285187188524172774">"Nem lehet elemeket dobni erre a Kezdőképernyőre."</string>
<string name="external_drop_widget_pick_title" msgid="7040647073452295370">"A létrehozáshoz válasszon modult"</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Mappa neve"</string>
@@ -55,8 +55,11 @@
<string name="delete_zone_label_workspace" msgid="7153615831493049150">"Eltávolítás"</string>
<string name="delete_zone_label_all_apps" msgid="6664588234817475108">"Eltávolítás"</string>
<string name="delete_target_label" msgid="665300185123139530">"Eltávolítás"</string>
+ <!-- Label for cancel drop target. [CHAR_LIMIT=30] -->
+ <string name="cancel_target_label">Mégsem</string>
<string name="delete_target_uninstall_label" msgid="748894921183769150">"Eltávolítás"</string>
<string name="info_target_label" msgid="4019495079517426980">"Alkalmazásinformáció"</string>
+ <string name="edit_target_label">Szerkesztés</string>
<string name="accessibility_search_button" msgid="816822994629942611">"Keresés"</string>
<string name="accessibility_voice_search_button" msgid="3938249215065842475">"Hangalapú keresés"</string>
<string name="accessibility_all_apps_button" msgid="8803738611398979849">"Alkalmazások"</string>
@@ -68,7 +71,21 @@
<string name="menu_search" msgid="4826514464423239041">"Keresés"</string>
<string name="menu_notifications" msgid="6424587053194766192">"Értesítések"</string>
<string name="menu_settings" msgid="3946232973327980394">"Rendszerbeállítások"</string>
+ <!-- Noun, menu item used to show the launcher preferences -->
+ <string name="menu_preferences">Trebuchet beállítások</string>
<string name="menu_help" msgid="4901160661634590633">"Súgó"</string>
+ <!-- Noun, menu item used to sort apps by name -->
+ <string name="menu_apps_sort_title">Név</string>
+ <!-- Noun, menu item used to sort apps by install date -->
+ <string name="menu_apps_sort_install_date">Telepítés ideje</string>
+ <!-- Noun, menu item used to show system apps -->
+ <string name="menu_apps_filter_system">Rendszer</string>
+ <!-- Noun, menu item used to show downloaded apps -->
+ <string name="menu_apps_filter_downloaded">Letöltött</string>
+
+ <!-- Noun, menu item used to reset hidden apps list -->
+ <string name="menu_hidden_apps_delete">Visszaállítás</string>
+
<string name="cab_menu_delete_app" msgid="4089398025537640349">"Alkalmazás eltávolítása"</string>
<string name="cab_menu_app_info" msgid="914548323652698884">"Az alkalmazás adatai"</string>
<string name="cab_app_selection_text" msgid="6378522164293415735">"1 kiválasztott alkalmazás"</string>
@@ -97,10 +114,15 @@
<string name="workspace_cling_open_all_apps" msgid="2459977609848572588">"Az összes saját alkalmazás megtekintéséhez érintse meg a kört."</string>
<string name="all_apps_cling_title" msgid="2559734712581447107">"Válasszon ki néhány alkalmazást"</string>
<string name="all_apps_cling_add_item" msgid="5665035103260318891">"Ha egy alkalmazást el szeretne helyezni a kezdőképernyőn, érintse meg, és tartsa lenyomva."</string>
+ <!-- The title text for the All Apps Sort cling [CHAR_LIMIT=none] -->
+ <string name="all_apps_sort_cling_title">Rendezze sorba alkalmazásait</string>
+ <!-- The description of how to pick sort apps in the drawer [CHAR_LIMIT=none] -->
+ <string name="all_apps_sort_cling_add_item">"Ha sorba szeretné rendezni alkalmazásait, érintse meg, és tartsa lenyomva az Alkalmazások lapfület."</string>
<string name="folder_cling_title" msgid="4308949882377840953">"Rendezze alkalmazásait mappákba"</string>
<string name="folder_cling_move_item" msgid="270598675060435169">"Ha egy alkalmazást át szeretne helyezni, érintse meg, és tartsa lenyomva."</string>
<string name="folder_cling_create_folder" msgid="8352867485656129478">"Ha egy új mappát szeretne létrehozni a kezdőképernyőn, helyezzen egymásra két alkalmazást."</string>
<string name="cling_dismiss" msgid="2780907108735868381">"OK"</string>
+ <string name="dummy_custom_cling_error_message">Hiba: Egyéni munkaterület elrendezés, de nincs felülírva</string>
<string name="folder_opened" msgid="1262064100943801533">"Mappa megnyitva -- szélesség: <xliff:g id="WIDTH">%1$d</xliff:g>; magasság: <xliff:g id="HEIGHT">%2$d</xliff:g>"</string>
<string name="folder_tap_to_close" msgid="1335478160661137579">"Érintse meg a mappa bezárásához"</string>
<string name="folder_tap_to_rename" msgid="5201612989905472442">"Érintse meg az átnevezés mentéséhez"</string>
@@ -111,4 +133,104 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+
+ <!-- Hidden apps -->
+ <string name="hidden_apps_title">Elrejtett alkalmazások</string>
+
+ <!-- -->
+ <!-- Preferences -->
+ <!-- -->
+ <string name="preferences_title">Beállítások</string>
+ <!-- UI -->
+ <string name="preferences_interface_title">Felület</string>
+ <!-- Application -->
+ <string name="preferences_application_title">Alkalmazás</string>
+
+ <!-- UI -->
+ <!-- Homescreen -->
+ <string name="preferences_interface_homescreen_title">Kezdőképernyő</string>
+ <string name="preferences_interface_homescreen_summary">Kezdőképernyők és háttérkép</string>
+ <string name="preferences_interface_homescreen_general_category">Általános</string>
+ <string name="preferences_interface_homescreen_general_screens_title">Kezdőképernyők</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">Képernyők száma a kezdőképernyőn</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">Alapértelmezett kezdőképernyő</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">Válasszon képernyőt</string>
+ <string name="preferences_interface_homescreen_general_search_title">Keresősáv</string>
+ <string name="preferences_interface_homescreen_general_grid_title">Rács méret</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">A kezdőképernyőn megjelenő sorok és oszlopok számának kiválasztása</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">Sor</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">Oszlop</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">Képernyő kiterjesztése</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">Kezdőképernyők kiterjesztése a kijelző kitöltéséhez</string>
+ <string name="preferences_interface_homescreen_general_search_summary">Állandó keresősáv engedélyezése</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">Ikon feliratok elrejtése</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Elrejti a kezdőképernyőn lévő ikonok neveit</string>
+ <string name="preferences_interface_homescreen_scrolling_category">Kinézet</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">Lapozás</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">Válassza ki, milyen effekttel váltson a kezdőképernyők között</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">Háttérkép görgetése</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Háttérkép görgetése a kezdőképernyők közti váltások során</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">Háttérkép gyors kirajzolása</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">A háttérkép gyors kirajzolásával növelheti a kezdőképernyők közti váltás simaságát</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">Háttérkép mérete</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">Válassza ki, milyen széles legyen a háttérkép</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">Elhalványuló váltás</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">Váltáskor elhalványulnak az egymás melletti kezdőképernyők</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">Körvonal megjelenítése</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">Kezdőképernyő körvonalának megjelenítése váltás közben</string>
+ <string name="preferences_interface_homescreen_indicator_category">Jelzések</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">Aktuális képernyő</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">Aktuális képernyő jelzése az oldal alján</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">Képernyőjelölő</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">Csak képernyőváltáskor látszik</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">Jelölő helye</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">Aktuális kezdőképernyő-jelölő helyének beállítása</string>
+
+ <!-- Drawer -->
+ <string name="preferences_interface_drawer_title">Alkalmazásképernyők</string>
+ <string name="preferences_interface_drawer_summary">Alkalmazások és modulok</string>
+ <string name="preferences_interface_drawer_orientation_title">Tájolás</string>
+ <string name="preferences_interface_drawer_orientation_summary">Válassza ki az alkalmazásképernyők közötti váltás irányát</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">Rejtett alkalmazások</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">Alkalmazások elrejtése az alkalmazásképernyőről</string>
+ <string name="preferences_interface_drawer_widgets_category">Általános</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">Folyamatos lapozás</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">Alkalmazások és modulok között folyamatos lapozással való váltás</string>
+ <string name="preferences_interface_drawer_scrolling_category">Kinézet</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">Lapozás</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">Válassza ki, milyen effekttel váltson az alkalmazásképernyők között</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">Elhalványuló váltás</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">Váltáskor elhalványulnak az egymás melletti alkalmazásképernyők</string>
+ <string name="preferences_interface_drawer_indicator_category">Jelzések</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">Aktuális oldal</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">Aktuális oldal jelölése a lap alján</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">Képernyőjelölő</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">Csak képernyőváltáskor látszik</string>
+ <string name="preferences_interface_drawer_indicator_position_title">Jelölő helye</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">Aktuális alkalmazásképernyő-jelölő helyének beállítása</string>
+
+ <!-- Dock -->
+ <string name="preferences_interface_dock_title">Tálca</string>
+ <string name="preferences_interface_dock_enabled_title">Tálca megjelenítése</string>
+ <string name="preferences_interface_dock_enabled_summary">Tálca megjelenítése a kezdőképernyő alján</string>
+ <string name="preferences_interface_dock_pages_title">Lapok</string>
+ <string name="preferences_interface_dock_pages_summary">Lapok száma a tálcán</string>
+ <string name="preferences_interface_dock_default_page_title">Alapértelmezett lap</string>
+ <string name="preferences_interface_dock_default_page_summary">Válasszon alapértelmezett lapot</string>
+ <string name="preferences_interface_dock_icons_title">Ikonok</string>
+ <string name="preferences_interface_dock_icons_summary">Ikonok száma a tálcán</string>
+ <string name="preferences_interface_dock_icon_scale_title">Ikonok mérete</string>
+ <string name="preferences_interface_dock_icon_scale_summary">Tálcán szereplő ikonok mérete</string>
+ <string name="preferences_interface_dock_divider_title">Tálca elválasztó</string>
+ <string name="preferences_interface_dock_divider_summary">Tálca és a képernyő közti elválasztó vonal</string>
+
+ <!-- Icons -->
+ <string name="preferences_interface_icons_title">Ikonok</string>
+
+ <!-- General -->
+ <string name="preferences_interface_general_title">Általános</string>
+ <string name="preferences_interface_general_orientation_title">Képernyő elforgatása</string>
+ <string name="preferences_interface_general_fullscreen_title">Teljes képernyő</string>
+ <string name="preferences_interface_general_fullscreen_summary">Értesítési sáv elrejtése a kezdőképernyő kiterjesztéséhez</string>
+
</resources>
diff --git a/res/values-in-land/strings.xml b/res/values-in-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-in-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-in/strings.xml b/res/values-in/strings.xml
index 3ba622584..24c5c9e78 100644
--- a/res/values-in/strings.xml
+++ b/res/values-in/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Peluncur"</string>
<string name="home" msgid="5921706419368316758">"Beranda"</string>
<string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-it-land/strings.xml b/res/values-it-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-it-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-it/arrays.xml b/res/values-it/arrays.xml
new file mode 100644
index 000000000..7b7297b3c
--- /dev/null
+++ b/res/values-it/arrays.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2008 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 CONDITvalues-itIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="preferences_interface_homescreen_scrolling_transition_effect_entries">
+ <item>Predefinito</item>
+ <item>Tablet</item>
+ <item>Riduci</item>
+ <item>Ingrandisci</item>
+ <item>Ruota su</item>
+ <item>Ruota giù</item>
+ <item>Cilindro interno</item>
+ <item>Cilindro esterno</item>
+ <item>Cubo interno</item>
+ <item>Cubo esterno</item>
+ <item>Ruota</item>
+ <item>Specchia</item>
+ <item>Pila</item>
+ <item>Fisarmonica</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_scrolling_transition_effect_entries">
+ <item>Predefinito</item>
+ <item>Tablet</item>
+ <item>Riduci</item>
+ <item>Ingrandisci</item>
+ <item>Ruota su</item>
+ <item>Ruota giù</item>
+ <item>Cilindro interno</item>
+ <item>Cilindro esterno</item>
+ <item>Cubo interno</item>
+ <item>Cubo esterno</item>
+ <item>Ruota</item>
+ <item>Specchia</item>
+ <item>Pila</item>
+ <item>Fisarmonica</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_orientation_entries">
+ <item>Orizontale</item>
+ <item>Verticale</item>
+ </string-array>
+</resources>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 9a73872e6..2d09eaa7c 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Avvio applicazioni"</string>
<string name="home" msgid="5921706419368316758">"Home"</string>
<string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
@@ -30,6 +29,7 @@
<string name="widgets_tab_label" msgid="9145860100000983599">"Widget"</string>
<string name="long_press_widget_to_add" msgid="7395697462851217506">"Tocca e tieni premuto per scegliere un widget."</string>
<string name="market" msgid="2652226429823445833">"Acquista"</string>
+ <string name="menu">Menù</string>
<string name="external_drop_widget_error" msgid="2285187188524172774">"Rilascio elemento in schermata Home non riuscito."</string>
<string name="external_drop_widget_pick_title" msgid="7040647073452295370">"Scegli il widget da creare"</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Nome cartella"</string>
@@ -55,8 +55,10 @@
<string name="delete_zone_label_workspace" msgid="7153615831493049150">"Rimuovi"</string>
<string name="delete_zone_label_all_apps" msgid="6664588234817475108">"Disinstalla"</string>
<string name="delete_target_label" msgid="665300185123139530">"Rimuovi"</string>
+ <string name="cancel_target_label">Cancella</string>
<string name="delete_target_uninstall_label" msgid="748894921183769150">"Disinstalla"</string>
<string name="info_target_label" msgid="4019495079517426980">"Informazioni applicazione"</string>
+ <string name="edit_target_label">Modifica</string>
<string name="accessibility_search_button" msgid="816822994629942611">"Cerca"</string>
<string name="accessibility_voice_search_button" msgid="3938249215065842475">"Ricerca vocale"</string>
<string name="accessibility_all_apps_button" msgid="8803738611398979849">"Applicazioni"</string>
@@ -68,7 +70,13 @@
<string name="menu_search" msgid="4826514464423239041">"Cerca"</string>
<string name="menu_notifications" msgid="6424587053194766192">"Notifiche"</string>
<string name="menu_settings" msgid="3946232973327980394">"Impostazioni sistema"</string>
+ <string name="menu_preferences">Impostazioni Trebuchet</string>
<string name="menu_help" msgid="4901160661634590633">"Guida"</string>
+ <string name="menu_apps_sort_title">Nome</string>
+ <string name="menu_apps_sort_install_date">Data Installazione</string>
+ <string name="menu_apps_filter_system">Sistema</string>
+ <string name="menu_apps_filter_downloaded">Scaricate</string>
+ <string name="menu_hidden_apps_delete">Ripristina</string>
<string name="cab_menu_delete_app" msgid="4089398025537640349">"Disinstalla applicazione"</string>
<string name="cab_menu_app_info" msgid="914548323652698884">"Dettagli applicazione"</string>
<string name="cab_app_selection_text" msgid="6378522164293415735">"1 applicazione selezionata"</string>
@@ -97,6 +105,8 @@
<string name="workspace_cling_open_all_apps" msgid="2459977609848572588">"Per visualizzare tutte le tue applicazioni, tocca il cerchio."</string>
<string name="all_apps_cling_title" msgid="2559734712581447107">"Scegli alcune applicazioni"</string>
<string name="all_apps_cling_add_item" msgid="5665035103260318891">"Per aggiungere un\'applicazione alla schermata Home, tocca e tieni premuto."</string>
+ <string name="all_apps_sort_cling_title">Ordina applicazioni</string>
+ <string name="all_apps_sort_cling_add_item">Tocca e tieni premuta la scheda delle applicazioni per scegliere in che ordine visualizzarle</string>
<string name="folder_cling_title" msgid="4308949882377840953">"Organizza le tue applicazioni in cartelle"</string>
<string name="folder_cling_move_item" msgid="270598675060435169">"Per spostare un\'applicazione, tocca e tieni premuto."</string>
<string name="folder_cling_create_folder" msgid="8352867485656129478">"Per creare una nuova cartella sulla schermata Home, impila un\'applicazione su un\'altra."</string>
@@ -111,4 +121,84 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+ <string name="hidden_apps_title">Applicazioni nascoste</string>
+ <string name="preferences_title">Preferenze</string>
+ <string name="preferences_interface_title">Interfaccia</string>
+ <string name="preferences_application_title">Applicazione</string>
+ <string name="preferences_interface_homescreen_title">Schermata home</string>
+ <string name="preferences_interface_homescreen_summary">Schermate e sfondo</string>
+ <string name="preferences_interface_homescreen_general_category">Generale</string>
+ <string name="preferences_interface_homescreen_general_screens_title">Schermate Home</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">Numero di schermate nella Home</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">Schermata predefinita</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">Scegli la schermata predefinita nella Home</string>
+ <string name="preferences_interface_homescreen_general_search_title">Barra di ricerca</string>
+ <string name="preferences_interface_homescreen_general_search_summary">Abilita la barra di ricerca persistente</string>
+ <string name="preferences_interface_homescreen_general_grid_title">Dimensioni griglia</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">Scegli il numero di righe/colonne nella schermata Home</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">Righe</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">Colonne</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">Allunga schermate</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">Espandi le schermate per riempire tutto lo schermo</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">Nascondi etichette</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Nascondi le etichette delle icone nella Home</string>
+ <string name="preferences_interface_homescreen_scrolling_category">Scorrimento</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">Effetti di transizione</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">Effetti di transizione quando scorri nella Home</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">Scorrimento sfondo</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Muovi lo sfondo quando scorri nella Home</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">Rendering rapido dello sfondo</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">Usa un hack per incrementare la fluidità delle immagini statiche di sfondo</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">Dimensione sfondo</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">Numero di schermate totali presenti nello sfondo</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">Dissolvenza pagine laterali</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">Dissolvi le pagine laterali quando scorri nella Home</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">Mostra delineatori</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">Mostra dei delineatori quando scorri nella Home</string>
+ <string name="preferences_interface_homescreen_indicator_category">Indicatore</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">Indicatore pagina</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">Mostra l\'indicatore della pagina corrente nella parte inferiore dello schermo</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">Dissolvenza indicatore</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">Dissolvi l\'indicatore dopo aver cambiato Home</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">Posizione indicatore</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">In quale posizione mostrare l\'indicatore nella schermata</string>
+ <string name="preferences_interface_drawer_title">Drawer</string>
+ <string name="preferences_interface_drawer_summary">Contenitore delle applicazioni e dei widget</string>
+ <string name="preferences_interface_drawer_orientation_title">Orientamento</string>
+ <string name="preferences_interface_drawer_orientation_summary">Scegli in quale verso far scorrere il drawer</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">Applicazioni nascoste</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">Nasconde le applicazioni dal drawer</string>
+ <string name="preferences_interface_drawer_widgets_category">Widget</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">Unisci alle applicazioni</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">Scorri dalla schermata applicazioni a quella dei widget senza cambiare scheda</string>
+ <string name="preferences_interface_drawer_scrolling_category">Scorrimento</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">Effetti di transizione</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">Effetti di scorrimento quando scorri nelle schermate</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">Dissolvenza pagine laterali</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">Dissolvi le pagine laterali quando scorri nelle schermate</string>
+ <string name="preferences_interface_drawer_indicator_category">Indicatore</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">Mostra indicatore pagina</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">Mostra l\'indicatore della pagina corrente nella parte inferiore dello schermo</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">Dissolvenza indicatore</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">Dissolvi l\'indicatore dopo aver cambiato pagina</string>
+ <string name="preferences_interface_drawer_indicator_position_title">Posizione indicatore</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">In quale posizione mostrare l\'indicatore nella schermata</string>
+ <string name="preferences_interface_dock_title">Dock</string>
+ <string name="preferences_interface_dock_enabled_title">Mostra dock</string>
+ <string name="preferences_interface_dock_enabled_summary">Mostra dock nella parte inferiore dello schermo</string>
+ <string name="preferences_interface_dock_pages_title">Pagine</string>
+ <string name="preferences_interface_dock_pages_summary">Numero di pagine nella barra dock</string>
+ <string name="preferences_interface_dock_default_page_title">Pagina di default</string>
+ <string name="preferences_interface_dock_default_page_summary">Pagina che viene mostrata per default</string>
+ <string name="preferences_interface_dock_icons_title">Icone</string>
+ <string name="preferences_interface_dock_icons_summary">Numero di icone/colonne nella barra dock</string>
+ <string name="preferences_interface_dock_icon_scale_title">Scala icone</string>
+ <string name="preferences_interface_dock_icon_scale_summary">Scala delle icone nella barra dock</string>
+ <string name="preferences_interface_dock_divider_title">Mostra divisore dock</string>
+ <string name="preferences_interface_dock_divider_summary">Mostra lo sfondo dietro l\'indicatore</string>
+ <string name="preferences_interface_icons_title">Icone</string>
+ <string name="preferences_interface_general_title">Generale</string>
+ <string name="preferences_interface_general_orientation_title">Rotazione schermo</string>
+ <string name="preferences_interface_general_fullscreen_title">Modalità fullscreen</string>
+ <string name="preferences_interface_general_fullscreen_summary">Nasconde la barra di stato per estendere la schermata home</string>
</resources>
diff --git a/res/values-iw-land/strings.xml b/res/values-iw-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-iw-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-iw/strings.xml b/res/values-iw/strings.xml
index 8dd6cd933..be4a64b22 100644
--- a/res/values-iw/strings.xml
+++ b/res/values-iw/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"מפעיל"</string>
<string name="home" msgid="5921706419368316758">"בית"</string>
<string name="uid_name" msgid="3371120195364560632">"יישומי ליבה של Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-ja-land/strings.xml b/res/values-ja-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-ja-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index a049d2e1e..2b6ae697d 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"ランチャー"</string>
<string name="home" msgid="5921706419368316758">"Home"</string>
<string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
@@ -30,6 +29,7 @@
<string name="widgets_tab_label" msgid="9145860100000983599">"ウィジェット"</string>
<string name="long_press_widget_to_add" msgid="7395697462851217506">"ウィジェットを追加するには押し続けます。"</string>
<string name="market" msgid="2652226429823445833">"ショップ"</string>
+ <string name="menu">メニュー</string>
<string name="external_drop_widget_error" msgid="2285187188524172774">"このホーム画面にアイテムをドロップできませんでした。"</string>
<string name="external_drop_widget_pick_title" msgid="7040647073452295370">"作成するウィジェットの選択"</string>
<string name="rename_folder_label" msgid="5646236631298452787">"フォルダ名"</string>
@@ -111,4 +111,116 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+
+ <!-- Options in "Add to Home" dialog box; Title of the group containing the list of all launcher actions -->
+ <!-- Label for the info icon. [CHAR_LIMIT=30] -->
+ <string name="edit_target_label">編集</string>
+ <!-- Noun, menu item used to show system apps -->
+ <string name="menu_apps_filter_system">システム</string>
+ <!-- Noun, menu item used to show downloaded apps -->
+ <string name="menu_apps_filter_downloaded">ダウンロード済み</string>
+ <!-- Noun, menu item used to reset hidden apps list -->
+ <string name="menu_hidden_apps_delete">リセット</string>
+
+ <!-- Hidden apps -->
+ <string name="hidden_apps_title">Hidden Apps</string>
+
+ <string name="cancel_target_label">キャンセル</string>
+ <string name="menu_preferences">Trebuchet設定</string>
+ <string name="menu_apps_sort_title">名前</string>
+ <string name="menu_apps_sort_install_date">インストール日時</string>
+ <string name="all_apps_sort_cling_title">アプリの並び替え</string>
+ <string name="all_apps_sort_cling_add_item">アプリタブを長押ししてソートモードを選択</string>
+ <string name="preferences_title">設定</string>
+ <string name="preferences_interface_title">インタフェース</string>
+ <string name="preferences_application_title">アプリケーション</string>
+
+ <!-- UI -->
+ <!-- Homescreen -->
+ <string name="preferences_interface_homescreen_title">ホーム画面</string>
+ <string name="preferences_interface_homescreen_summary">画面と壁紙</string>
+ <string name="preferences_interface_homescreen_general_category">一般</string>
+ <string name="preferences_interface_homescreen_general_screens_title">スクリーン数</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">ホーム画面で扱うスクリーンの数</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">デフォルトスクリーン</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">デフォルトのホーム画面を選択</string>
+ <string name="preferences_interface_homescreen_general_grid_title">グリッドサイズ</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">ホーム画面の行やカラムの数を選択</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">行数</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">カラム数</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">画面を拡張</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">画面のサイズいっぱいにホーム画面を拡張する</string>
+ <string name="preferences_interface_homescreen_general_search_title">サーチバー</string>
+ <string name="preferences_interface_homescreen_general_search_summary">常設のサーチバーを有効にする</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">アイコンラベルを隠す</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">ホーム画面のアイコンラベルを隠す</string>
+ <string name="preferences_interface_homescreen_scrolling_category">スクロール</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">スクロール効果</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">ホーム画面をスクロールさせたときの演出効果</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">壁紙スクロール</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">ホーム画面をスクロールさせたとき壁紙をスクロールする</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">クイック壁紙描画</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">固定イメージの壁紙のとき、よりスムースに描画するハックを利用する</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">壁紙サイズ</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">壁紙の幅のサイズを指定する</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">画面の端をぼかす</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">ホーム画面をスクロールするとき、画面の端をぼかす</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">アウトラインを表示</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">ホーム画面をスクロールするとき、画面の外枠を表示する</string>
+ <string name="preferences_interface_homescreen_indicator_category">インジケーター</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">ページインジケータを表示する</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">画面の下部に現在のページインジケーターを表示する</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">インジケーターをぼかす</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">ホーム画面を移動した後にインジケーターをぼかす</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">インジケーターの位置</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">インジケーターを表示する画面の位置を選択する</string>
+
+ <!-- Drawer -->
+ <string name="preferences_interface_drawer_title">ドロワー</string>
+ <string name="preferences_interface_drawer_summary">アプリとウェジェットの一覧</string>
+ <string name="preferences_interface_drawer_orientation_title">向き</string>
+ <string name="preferences_interface_drawer_orientation_summary">ドロワーのスクロールする方向を選択する</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">アプリを隠す</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">ドロワーからアプリを隠す</string>
+ <string name="preferences_interface_drawer_widgets_category">ウィジェット</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">アプリと一緒に表示</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">タブを変更しないでアプリドロワーからウィジェットドロワーに遷移する</string>
+ <string name="preferences_interface_drawer_scrolling_category">スクロール</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">スクロール効果</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">ページをスクロールさせたときの演出効果</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">ページの端をぼかす</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">ページをスクロールするとき、ページの端をぼかす</string>
+ <string name="preferences_interface_drawer_indicator_category">インジケーター</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">ページインジケーターを表示</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">画面の下部に現在のページインジケーターを表示する</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">フェード</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">ページを移動した後にインジケーターをフェードする</string>
+ <string name="preferences_interface_drawer_indicator_position_title">インジケーターの位置</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">インジケーターを表示する画面の位置を選択する</string>
+
+ <!-- Dock -->
+ <string name="preferences_interface_dock_title">ドック</string>
+ <string name="preferences_interface_dock_enabled_title">ドックを表示</string>
+ <string name="preferences_interface_dock_enabled_summary">ホームスクリーンの下部にドックを表示する</string>
+ <string name="preferences_interface_dock_pages_title">ページ</string>
+ <string name="preferences_interface_dock_pages_summary">ドックのページ数</string>
+ <string name="preferences_interface_dock_default_page_title">デフォルトページ</string>
+ <string name="preferences_interface_dock_default_page_summary">デフォルトページを選択</string>
+ <string name="preferences_interface_dock_icons_title">アイコン</string>
+ <string name="preferences_interface_dock_icons_summary">ドックのアイコンとカラムの数</string>
+ <string name="preferences_interface_dock_icon_scale_title">アイコンスケール</string>
+ <string name="preferences_interface_dock_icon_scale_summary">ドックに表示するアイコンのスケール</string>
+ <string name="preferences_interface_dock_divider_title">ドックの区切り線を表示</string>
+ <string name="preferences_interface_dock_divider_summary">背景より手前にインジケータを表示する</string>
+
+ <!-- Icons -->
+ <string name="preferences_interface_icons_title">アイコン</string>
+
+ <!-- General -->
+ <string name="preferences_interface_general_title">一般</string>
+ <string name="preferences_interface_general_orientation_title">画面の自動回転</string>
+ <string name="preferences_interface_general_fullscreen_title">フルスクリーンモード</string>
+ <string name="preferences_interface_general_fullscreen_summary">ステータスバーを隠してホーム画面を拡張する</string>
+
+
</resources>
diff --git a/res/values-ko-land/strings.xml b/res/values-ko-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-ko-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index 990dcfb63..34515daaf 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
<string name="home" msgid="5921706419368316758">"홈"</string>
<string name="uid_name" msgid="3371120195364560632">"Android Core 애플리케이션"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-land/config.xml b/res/values-land/config.xml
index fc20456c3..60052f03a 100644
--- a/res/values-land/config.xml
+++ b/res/values-land/config.xml
@@ -18,8 +18,6 @@
<!-- Workspace -->
<!-- Whether or not the drop targets drop down as opposed to fade in -->
<bool name="config_useDropTargetDownTransition">false</bool>
- <!-- Whether or not to fade the side pages -->
- <bool name="config_workspaceFadeAdjacentScreens">false</bool>
<!-- Folder max bounds and max number of items.
Note: folder_max_count_x * folder_max_count_y >= folder_max_num_items. -->
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index 5edd14364..144f6ee09 100644
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -42,6 +42,11 @@
<dimen name="workspace_top_padding">@dimen/workspace_top_padding_land</dimen>
<dimen name="workspace_bottom_padding">@dimen/workspace_bottom_padding_land</dimen>
+ <dimen name="workspace_left_padding_qsb_hidden">@dimen/workspace_left_padding_land_qsb_hidden</dimen>
+ <dimen name="workspace_right_padding_hotseat_hidden">@dimen/workspace_right_padding_land_hotseat_hidden</dimen>
+ <dimen name="workspace_top_padding_qsb_hidden">@dimen/workspace_top_padding_land_qsb_hidden</dimen>
+ <dimen name="workspace_bottom_padding_hotseat_hidden">@dimen/workspace_bottom_padding_land_hotseat_hidden</dimen>
+
<dimen name="app_icon_padding_top">6dp</dimen>
<!-- height of the bottom row of controls -->
diff --git a/res/values-lt-land/strings.xml b/res/values-lt-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-lt-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-lt/strings.xml b/res/values-lt/strings.xml
index 885ecf0cf..c68e290e9 100644
--- a/res/values-lt/strings.xml
+++ b/res/values-lt/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Paleidimo priemonė"</string>
<string name="home" msgid="5921706419368316758">"Pagrindinis"</string>
<string name="uid_name" msgid="3371120195364560632">"Pagrindinės „Android“ programos"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
@@ -111,4 +110,84 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
-</resources>
+ <string name="hidden_apps_title">Slepiamos</string>
+ <string name="preferences_title">Nustatymai</string>
+ <string name="preferences_interface_title">Išvaizda</string>
+ <string name="preferences_application_title">Programėlės</string>
+ <string name="preferences_interface_homescreen_title">Darbalaukis</string>
+ <string name="preferences_interface_homescreen_summary">Langai ir tapetai</string>
+ <string name="preferences_interface_homescreen_general_category">Pagrindiniai</string>
+ <string name="preferences_interface_homescreen_general_screens_title">Darbalaukis</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">Langų skaičius darbalaukyje</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">Pagrindinis langas</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">Pasirinkite pagrindinį</string>
+ <string name="preferences_interface_homescreen_general_search_title">Paieškos juosta</string>
+ <string name="preferences_interface_homescreen_general_search_summary">Įjungti paieškos juostą</string>
+ <string name="preferences_interface_homescreen_general_grid_title">Tinklelio dydis</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">Pasirinkti eilučių/stulpelių skaičių</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">Eiutės</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">Stulpeliai</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">Ištempti langus</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">Ištempti langus per visą ekraną</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">Slepti pavadinimus</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Slepti užrašus po piktogramomis darbalaukyje</string>
+ <string name="preferences_interface_homescreen_scrolling_category">Slinkimas</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">Slinkimo efektas</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">Langų slinkimo efektas</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">Tapeto slinkimas</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Slinkti tapetą sukant langus</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">Tapeto greitas perpiešimas</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">Naudoja tapeto atvaizdavimo modifikaciją</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">Tapeto dydis</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">Kiek langų tapetas turi dengti</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">Blukinti šoninius langus</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">Blukinti šoninius langus slenkant</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">Rodyti kontūrą</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">Rodyti langų kontūrus slenkant</string>
+ <string name="preferences_interface_homescreen_indicator_category">Indikatorius</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">Rodo lango indikatorių</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">Rodyti esamo lango indikatorių</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">Blukinti indikatorių</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">Blukinti indikatorių perslinkus langą</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">Indikatoriaus vieta</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">Pasirinkite kurioje vietoje rodyti indikatorių</string>
+ <string name="preferences_interface_drawer_title">Programėlių sąrašas</string>
+ <string name="preferences_interface_drawer_summary">Programėlės ir valdikliai</string>
+ <string name="preferences_interface_drawer_orientation_title">Orientacija</string>
+ <string name="preferences_interface_drawer_orientation_summary">Pasirinkite kaip slinkti programėlių sąrašą</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">Slepiamos programėlės</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">Slėpti piktogramas programėlių sąraše</string>
+ <string name="preferences_interface_drawer_widgets_category">Valdikliai</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">Jungti su programėlėmis</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">Slenkant pereina prie valdiklių</string>
+ <string name="preferences_interface_drawer_scrolling_category">Slinkimas</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">Slinkimo efektas</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">Slinkimo efekto pasirinkimas</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">Blukinti šoninius</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">Blukinti šoninius slenkant</string>
+ <string name="preferences_interface_drawer_indicator_category">Indikatorius</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">Rodyti lango indikatorių</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">Rodyti esamo lango indikatorių apačioje</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">Blukinti indikatorių</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">Blukinti indikatorių perslinkus langą</string>
+ <string name="preferences_interface_drawer_indicator_position_title">Indikatoriaus vieta</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">Pasirinkite kurioje vietoje rodyti indikatorių</string>
+ <string name="preferences_interface_dock_title">Dokas</string>
+ <string name="preferences_interface_dock_enabled_title">Rodyti doką</string>
+ <string name="preferences_interface_dock_enabled_summary">Rodyti doką po darbalaukiu</string>
+ <string name="preferences_interface_dock_pages_title">Dokai</string>
+ <string name="preferences_interface_dock_pages_summary">Dokų skaičius</string>
+ <string name="preferences_interface_dock_default_page_title">Numatytasis</string>
+ <string name="preferences_interface_dock_default_page_summary">Pasirinkite numatytąjį doką</string>
+ <string name="preferences_interface_dock_icons_title">Piktogramos</string>
+ <string name="preferences_interface_dock_icons_summary">Piktogramų kiekis doke</string>
+ <string name="preferences_interface_dock_icon_scale_title">Piktogramų dydis</string>
+ <string name="preferences_interface_dock_icon_scale_summary">Keisti piktogramų dydį doke</string>
+ <string name="preferences_interface_dock_divider_title">Rodyti doko skyriklį</string>
+ <string name="preferences_interface_dock_divider_summary">Rodo skyriklį tarp darbalaukio ir doko</string>
+ <string name="preferences_interface_icons_title">Piktogramos</string>
+ <string name="preferences_interface_general_title">Pagrindiniai</string>
+ <string name="preferences_interface_general_orientation_title">Automatiškai sukti</string>
+ <string name="preferences_interface_general_fullscreen_title">Per visą ekraną</string>
+ <string name="preferences_interface_general_fullscreen_summary">Slepia būsenos juostą</string>
+</resources> \ No newline at end of file
diff --git a/res/values-lv-land/strings.xml b/res/values-lv-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-lv-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-lv/strings.xml b/res/values-lv/strings.xml
index c1cd54535..ab730923a 100644
--- a/res/values-lv/strings.xml
+++ b/res/values-lv/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Palaidējs"</string>
<string name="home" msgid="5921706419368316758">"Sākums"</string>
<string name="uid_name" msgid="3371120195364560632">"Android kodola lietojumprogrammas"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-ms-land/strings.xml b/res/values-ms-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-ms-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-ms/strings.xml b/res/values-ms/strings.xml
index 3f2d0d84b..11a5cc466 100644
--- a/res/values-ms/strings.xml
+++ b/res/values-ms/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Pelancar"</string>
<string name="home" msgid="5921706419368316758">"Laman Utama"</string>
<string name="uid_name" msgid="3371120195364560632">"Apl Teras Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-nb-land/strings.xml b/res/values-nb-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-nb-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
index a3455165a..e7bbc3466 100644
--- a/res/values-nb/strings.xml
+++ b/res/values-nb/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Utskytingsrampe"</string>
<string name="home" msgid="5921706419368316758">"Home"</string>
<string name="uid_name" msgid="3371120195364560632">"Android-kjerneapplikasjoner"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-nl-land/strings.xml b/res/values-nl-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-nl-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-nl/arrays.xml b/res/values-nl/arrays.xml
new file mode 100644
index 000000000..62b964a96
--- /dev/null
+++ b/res/values-nl/arrays.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+ Copyright (C) 2012 The CyanogenMod 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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="preferences_interface_homescreen_indicator_position_entries">
+ <item>Boven dock</item>
+ <item>Bovenaan</item>
+ <item>Onderaan</item>
+ </string-array>
+ <string-array name="preferences_interface_homescreen_scrolling_transition_effect_entries">
+ <item>Standaard</item>
+ <item>Tablet</item>
+ <item>Inzoomen</item>
+ <item>Uitzoomen</item>
+ <item>Naar boven draaien</item>
+ <item>Naar beneden draaien</item>
+ <item>Cylinder-in</item>
+ <item>Cylinder-uit</item>
+ <item>Kubus-in</item>
+ <item>Kubus-uit</item>
+ <item>Draaien</item>
+ <item>Spiegelen</item>
+ <item>Stapel</item>
+ <item>Accordeon</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_scrolling_transition_effect_entries">
+ <item>Standaard</item>
+ <item>Tablet</item>
+ <item>Inzoomen</item>
+ <item>Uitzoomen</item>
+ <item>Naar boven draaien</item>
+ <item>Naar beneden draaien</item>
+ <item>Cylinder-in</item>
+ <item>Cylinder-uit</item>
+ <item>Kubus-in</item>
+ <item>Kubus-uit</item>
+ <item>Draaien</item>
+ <item>Spiegelen</item>
+ <item>Stapel</item>
+ <item>Accordeon</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_indicator_position_entries">
+ <item>Boven/links</item>
+ <item>Beneden/rechts</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_orientation_entries">
+ <item>Horizontaal</item>
+ <item>Verticaal</item>
+ </string-array>
+</resources>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index f72fb5788..901592a18 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -1,25 +1,21 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
-* Copyright (C) 2008 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.
-*/
- -->
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+ Copyright (C) 2012 The CyanogenMod 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.
+-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
<string name="home" msgid="5921706419368316758">"Startpagina"</string>
<string name="uid_name" msgid="3371120195364560632">"Android-kerntoepassingen"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
@@ -29,7 +25,7 @@
<string name="activity_not_found" msgid="217823393239365967">"App is niet geïnstalleerd."</string>
<string name="widgets_tab_label" msgid="9145860100000983599">"Widgets"</string>
<string name="long_press_widget_to_add" msgid="7395697462851217506">"Blijf aanraken om een widget toe te voegen"</string>
- <string name="market" msgid="2652226429823445833">"Winkel"</string>
+ <string name="market" msgid="2652226429823445833">"Play Store"</string>
<string name="external_drop_widget_error" msgid="2285187188524172774">"Kan item niet neerzetten in dit startscherm."</string>
<string name="external_drop_widget_pick_title" msgid="7040647073452295370">"Widget selecteren om te maken"</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Mapnaam"</string>
@@ -76,15 +72,15 @@
<string name="cab_folder_selection_text" msgid="8916111874189565067">"1 map geselecteerd"</string>
<string name="cab_shortcut_selection_text" msgid="8115847384500412878">"1 snelkoppeling geselecteerd"</string>
<string name="permlab_install_shortcut" msgid="1201690825493376489">"snelkoppelingen installeren"</string>
- <string name="permdesc_install_shortcut" msgid="8634424803272077038">"Een app toestaan snelkoppelingen toe te voegen zonder tussenkomst van de gebruiker."</string>
+ <string name="permdesc_install_shortcut" msgid="8634424803272077038">"Hiermee kan de app snelkoppelingen toevoegen zonder tussenkomst van de gebruiker."</string>
<string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"snelkoppelingen verwijderen"</string>
- <string name="permdesc_uninstall_shortcut" msgid="274355570620220977">"Toestaan dat de app snelkoppelingen verwijdert zonder tussenkomst van de gebruiker."</string>
+ <string name="permdesc_uninstall_shortcut" msgid="274355570620220977">"Hiermee kan de app snelkoppelingen verwijderen zonder tussenkomst van de gebruiker."</string>
<string name="permlab_read_settings" msgid="3452408290738106747">"instellingen en snelkoppelingen voor de startpagina lezen"</string>
- <string name="permdesc_read_settings" msgid="5788109303585403679">"Toestaan dat de app de instellingen en snelkoppelingen op de startpagina leest."</string>
+ <string name="permdesc_read_settings" msgid="5788109303585403679">"Hiermee kan de app de instellingen en snelkoppelingen op de startpagina lezen."</string>
<string name="permlab_write_settings" msgid="1360567537236705628">"instellingen en snelkoppelingen voor de startpagina schrijven"</string>
- <string name="permdesc_write_settings" msgid="8530105489115785531">"Toestaan dat de app de instellingen en snelkoppelingen op de startpagina wijzigt."</string>
- <string name="gadget_error_text" msgid="8359351016167075858">"Probleem bij het laden van widget"</string>
- <string name="uninstall_system_app_text" msgid="6429814133777046491">"Dit is een systeemapp die niet kan worden verwijderd."</string>
+ <string name="permdesc_write_settings" msgid="8530105489115785531">"Hiermee kan de app de instellingen en snelkoppelingen op de startpagina wijzigen."</string>
+ <string name="gadget_error_text" msgid="8359351016167075858">"Kan widget niet laden"</string>
+ <string name="uninstall_system_app_text" msgid="6429814133777046491">"Dit is een systeem-app die niet kan worden verwijderd."</string>
<string name="dream_name" msgid="2847171357608437154">"Rocket Launcher"</string>
<string name="folder_hint_text" msgid="8633351560105748141">"Naamloze map"</string>
<string name="workspace_description_format" msgid="2968608205939373034">"Startscherm %1$d"</string>
@@ -111,4 +107,130 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+
+ <!-- CYANOGENMOD EDITS -->
+
+ <!-- Application copyright -->
+ <string name="application_copyright">Copyright \u00A9 2012 CyanogenMod</string>
+
+ <!-- Label for cancel drop target. [CHAR_LIMIT=30] -->
+ <string name="cancel_target_label">Annuleren</string>
+
+ <!-- Noun, menu item used to show the launcher preferences -->
+ <string name="menu_preferences">Trebuchet-instellingen</string>
+
+ <!-- Noun, menu item used to sort apps by name -->
+ <string name="menu_apps_sort_title">Naam</string>
+ <!-- Noun, menu item used to sort apps by install date -->
+ <string name="menu_apps_sort_install_date">Installatiedatum</string>
+
+ <!-- The title text for the All Apps Sort cling [CHAR_LIMIT=none] -->
+ <string name="all_apps_sort_cling_title">Sorteer uw apps</string>
+ <!-- The description of how to pick sort apps in the drawer [CHAR_LIMIT=none] -->
+ <string name="all_apps_sort_cling_add_item">Blijf de apps-tab aanraken om de sorteermodus te wijzigen.</string>
+
+ <!-- -->
+ <!-- Preferences -->
+ <!-- -->
+ <string name="preferences_title">Voorkeuren</string>
+ <!-- UI -->
+ <string name="preferences_interface_title">Uiterlijk</string>
+ <!-- Application -->
+ <string name="preferences_application_title">App</string>
+
+ <!-- UI -->
+ <!-- Homescreen -->
+ <string name="preferences_interface_homescreen_title">Startscherm</string>
+ <string name="preferences_interface_homescreen_summary">Scherm en achtergrond</string>
+ <string name="preferences_interface_homescreen_general_category">Algemeen</string>
+ <string name="preferences_interface_homescreen_general_screens_title">Startschermen</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">Aantal startschermen</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">Standaardscherm</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">Kies het standaardstartscherm</string>
+ <string name="preferences_interface_homescreen_general_search_title">Permanente zoekbalk</string>
+ <string name="preferences_interface_homescreen_general_search_summary">Zoekbalk permanent tonen</string>
+ <string name="preferences_interface_homescreen_general_grid_title">Rastergrootte</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">Kies het aantal rijen/kolommen op het startscherm</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">Rijen</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">Kolommen</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">Schermen uitrekken</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">Startschermen uitrekken om het scherm te vullen</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">Labels verbergen</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Namen onder iconen verbergen</string>
+
+ <string name="preferences_interface_homescreen_scrolling_category">Bladeren</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">Overgangseffect</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">Bladereffect bij het bladeren door startschermen</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">Achtergrond schuiven</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Achtergrond laten schuiven bij bladeren door startschermen</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">Achtergrond snel renderen</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">Techniek toepassen om statische achtergronden vloeiender te tonen</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">Grootte achtergrond</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">Hoeveel schermen breed de achtergrond moet zijn</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">Zijschermen vervagen</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">Zijschermen vervagen bij het bladeren door startschermen</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">Randen startschermen</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">Schermranden tonen bij het bladeren door startschermen</string>
+
+ <string name="preferences_interface_homescreen_indicator_category">Indicator</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">Startschermindicator tonen</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">Indicator voor huidig startscherm onderaan tonen</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">Indicator vervagen</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">Indicator vervagen na het wisselen van startscherm</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">Plaats indicator</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">Kies waar de indicator getoond moet worden</string>
+
+ <!-- Drawer -->
+ <string name="preferences_interface_drawer_title">Overzicht</string>
+ <string name="preferences_interface_drawer_summary">App- en widgetoverzicht</string>
+ <string name="preferences_interface_drawer_orientation_title">Oriëntatie</string>
+ <string name="preferences_interface_drawer_orientation_summary">Kies naar welke kant het overzicht bladert</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">Verborgen apps</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">Apps verbergen van het app-overzicht</string>
+ <string name="preferences_interface_drawer_widgets_category">Widgets</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">Automatisch overgaan</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">Van apps naar widgets overgaan zonder van tabblad te wisselen</string>
+ <string name="preferences_interface_drawer_scrolling_category">Bladeren</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">Overgangseffecteffect</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">Bladerefect bij het bladeren door schermen</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">Zijpagina\'s vervagen</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">Zijpagina\'s vervagen bij het bladeren door startschermen</string>
+ <string name="preferences_interface_drawer_indicator_category">Indicator</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">Pagina-indicator tonen</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">Indicator voor huidige pagina onderaan tonen</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">Indicator vervagen</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">Indicator vervagen na het wisselen van pagina</string>
+ <string name="preferences_interface_drawer_indicator_position_title">Plaats indicator</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">Kies waar de indicator getoond moet worden</string>
+
+ <!-- Dock -->
+ <string name="preferences_interface_dock_title">Dock</string>
+ <string name="preferences_interface_dock_enabled_title">Dock tonen</string>
+ <string name="preferences_interface_dock_enabled_summary">Dock onderaan het startscherm tonen</string>
+ <string name="preferences_interface_dock_pages_title">Pagina\'s</string>
+ <string name="preferences_interface_dock_pages_summary">Aantal pagina\'s in het dock</string>
+ <string name="preferences_interface_dock_default_page_title">Standaardpagina</string>
+ <string name="preferences_interface_dock_default_page_summary">De standaardpagina kiezen</string>
+ <string name="preferences_interface_dock_icons_title">Pictogrammen</string>
+ <string name="preferences_interface_dock_icons_summary">Aantal pictogrammen/kolommen in het dock</string>
+ <string name="preferences_interface_dock_icon_scale_title">Pictogrammen schalen</string>
+ <string name="preferences_interface_dock_icon_scale_summary">Pictogrammen schalen in het dock</string>
+ <string name="preferences_interface_dock_divider_title">Scheidingslijn</string>
+ <string name="preferences_interface_dock_divider_summary">Een lijn tonen tussen startscherm en dock</string>
+
+ <!-- Icons -->
+ <string name="preferences_interface_icons_title">Pictogrammen</string>
+
+ <!-- General -->
+ <string name="preferences_interface_general_title">Algemeen</string>
+ <string name="preferences_interface_general_orientation_title">Scherm automatisch draaien</string>
+ <string name="preferences_interface_general_fullscreen_title">Volledig scherm</string>
+ <string name="preferences_interface_general_fullscreen_summary">De statusbalk verbergen om het startscherm uit te breiden</string>
+
+ <string name="menu">Menu</string>
+ <string name="edit_target_label">Bewerken</string>
+ <string name="menu_apps_filter_system">Systeem</string>
+ <string name="menu_apps_filter_downloaded">Gedownload</string>
+ <string name="menu_hidden_apps_delete">Herstellen</string>
+ <string name="hidden_apps_title">Verborgen apps</string>
</resources>
diff --git a/res/values-pl-land/strings.xml b/res/values-pl-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-pl-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index 20b421737..12596ab08 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Program uruchamiający"</string>
<string name="home" msgid="5921706419368316758">"Strona główna"</string>
<string name="uid_name" msgid="3371120195364560632">"Aplikacje główne systemu Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-port/dimens.xml b/res/values-port/dimens.xml
index 969d3358a..0b5b12984 100644
--- a/res/values-port/dimens.xml
+++ b/res/values-port/dimens.xml
@@ -34,6 +34,11 @@
<dimen name="workspace_top_padding">@dimen/workspace_top_padding_port</dimen>
<dimen name="workspace_bottom_padding">@dimen/workspace_bottom_padding_port</dimen>
+ <dimen name="workspace_left_padding_qsb_hidden">@dimen/workspace_left_padding_port_qsb_hidden</dimen>
+ <dimen name="workspace_right_padding_hotseat_hidden">@dimen/workspace_right_padding_port_hotseat_hidden</dimen>
+ <dimen name="workspace_top_padding_qsb_hidden">@dimen/workspace_top_padding_port_qsb_hidden</dimen>
+ <dimen name="workspace_bottom_padding_hotseat_hidden">@dimen/workspace_bottom_padding_port_hotseat_hidden</dimen>
+
<dimen name="workspace_page_spacing">-1dp</dimen>
<!-- AppsCustomize -->
diff --git a/res/values-pt-land/strings.xml b/res/values-pt-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-pt-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-pt-rPT-land/strings.xml b/res/values-pt-rPT-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-pt-rPT-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml
index d7cedc09f..94025d519 100644
--- a/res/values-pt-rPT/strings.xml
+++ b/res/values-pt-rPT/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
<string name="home" msgid="5921706419368316758">"Página Inicial"</string>
<string name="uid_name" msgid="3371120195364560632">"Aplicações Principais do Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-pt/arrays.xml b/res/values-pt/arrays.xml
new file mode 100755
index 000000000..ef3cbc065
--- /dev/null
+++ b/res/values-pt/arrays.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2012 The CyanogenMod 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.
+*/
+-->
+
+<resources>
+ <string-array name="preferences_interface_homescreen_indicator_position_entries">
+ <item>Acima do Dock</item>
+ <item>Topo</item>
+ <item>Fundo</item>
+ </string-array>
+ <string-array name="preferences_interface_homescreen_scrolling_transition_effect_entries">
+ <item>Padrão</item>
+ <item>Tablet</item>
+ <item>Aproximado</item>
+ <item>Distanciado</item>
+ <item>Rotacionar p/ cima</item>
+ <item>Rotacionar p/ baixo</item>
+ <item>Cilindro interno</item>
+ <item>Cilindro externo</item>
+ <item>Cubo interno</item>
+ <item>Cubo externo</item>
+ <item>Girar</item>
+ <item>Virar</item>
+ <item>Pilha</item>
+ <item>Acordeão</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_scrolling_transition_effect_entries">
+ <item>Padrão</item>
+ <item>Tablet</item>
+ <item>Aproximado</item>
+ <item>Distanciado</item>
+ <item>Rotacionar p/ cima</item>
+ <item>Rotacionar p/ baixo</item>
+ <item>Cilindro interno</item>
+ <item>Cilindro externo</item>
+ <item>Cubo interno</item>
+ <item>Cubo externo</item>
+ <item>Girar</item>
+ <item>Virar</item>
+ <item>Pilha</item>
+ <item>Acordeão</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_indicator_position_entries">
+ <item>Topo/Esquerda</item>
+ <item>Fundo/Direita</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_orientation_entries">
+ <item>Horizontal</item>
+ <item>Vertical</item>
+ </string-array>
+</resources>
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
index 53468bfe4..f1bd4aea2 100644..100755
--- a/res/values-pt/strings.xml
+++ b/res/values-pt/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
<string name="home" msgid="5921706419368316758">"Início"</string>
<string name="uid_name" msgid="3371120195364560632">"Principais aplicativos do Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
@@ -111,4 +110,94 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+ <string name="cancel_target_label">Cancelar</string>
+ <string name="menu_apps_sort_title">Nome</string>
+ <string name="menu_apps_sort_install_date">Dia de Instalação</string>
+ <string name="all_apps_sort_cling_title">Ordenar seus aplicativos</string>
+ <string name="all_apps_sort_cling_add_item">Toque &amp; segure a aba Aplicativos para selecionar o modo de ordenação</string>
+ <string name="menu_preferences">Configurações Trebuchet</string>
+ <string name="preferences_title">Preferências</string>
+ <string name="preferences_interface_title">Interface</string>
+ <string name="preferences_application_title">Aplicação</string>
+ <string name="preferences_interface_homescreen_title">Tela Inicial</string>
+ <string name="preferences_interface_homescreen_general_category">Geral</string>
+ <string name="preferences_interface_homescreen_general_search_title">Barra de Pesquisa</string>
+ <string name="preferences_interface_homescreen_general_grid_title">Tamanho da grade</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">Escolha o numero de linhas/colunas na tela inicial</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">Linhas</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">Colunas</string>
+ <string name="preferences_interface_homescreen_general_search_summary">Ativar Barra de Pesquisa persistente</string>
+ <string name="preferences_interface_homescreen_general_screens_title">Telas Iniciais</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">Número de telas na Tela Inicial</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">Tela Padrão</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">Escolha a tela padrão</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">Ocultar rótulos dos icones</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Ocultar rótulos dos ícones na tela inicial</string>
+ <string name="preferences_interface_homescreen_scrolling_category">Rolagem</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">Rolar Papel de Parede</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Rola o Papel de Parede na mudança de telas</string>
+ <string name="preferences_interface_homescreen_indicator_category">Indicador</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">Mostrar Indicador de Página</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">Mostra o indicador da página atual no final da tela</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">Esmaecer Indicador</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">Esmaece o indicador após a troca da tela inicial</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">Esticar telas</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">Expandir telas iniciais para preencher o tamanho do visor</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">Efeito de transição</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">Efeito de rolagem na transição de telas iniciais</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">Renderização de papel de parede rápida</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">Use o hack de papel de parede para aumentar a suavizes nos papéis de parede com imagem estática</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">Esmaecer lateral das telas</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">Esmaecer a lateral das telas durante a transição de telas iniciais</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">Exibir linhas externas</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">Exibir linhas externas da tela na transição de telas iniciais</string>
+ <string name="preferences_interface_homescreen_summary">Telas e papéis de parede</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">Tamanho do papel de parede</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">Quantidade de telas que o papel de parede deve ocupar</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">Indicador de posição</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">Escolha onde mostrar na tela o indicador</string>
+ <string name="preferences_interface_icons_title">Ícones</string>
+ <string name="preferences_interface_general_title">Geral</string>
+ <string name="preferences_interface_general_orientation_title">Auto Rotacionar Tela</string>
+ <string name="preferences_interface_drawer_title">Grade de Apps</string>
+ <string name="preferences_interface_drawer_summary">Gaveta de aplicativos e widgets</string>
+ <string name="preferences_interface_drawer_widgets_category">Widgets</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">Unir com Apps</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">Deslize da Grade de Apps para os Widgets sem trocar de abas</string>
+ <string name="preferences_interface_drawer_indicator_category">Indicador</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">Mostrar Indicador de Página</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">Mostra o indicador da página atual no final da tela</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">Esmaecer Indicador</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">Esmaece o indicador após a troca da tela inicial</string>
+ <string name="preferences_interface_drawer_orientation_title">Orientação</string>
+ <string name="preferences_interface_drawer_orientation_summary">Escolha para qual o sentido rolagem da gaveta</string>
+ <string name="preferences_interface_drawer_scrolling_category">Rolagem</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">Efeito de transição</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">Efeito de rolagem na transição de telas</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">Esmaece lateral das páginas</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">Esmaece lateral das páginas na transição de telas</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">Aplicativos ocultos</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">Esconder aplicativos da gaveta</string>
+ <string name="preferences_interface_dock_title">Dock</string>
+ <string name="preferences_interface_dock_divider_title">Exibir divisor do dock</string>
+ <string name="preferences_interface_dock_divider_summary">Exibir divisor entre telas iniciais e dock</string>
+ <string name="preferences_interface_dock_icons_title">Ícones</string>
+ <string name="preferences_interface_dock_icons_summary">Número de ícones/colunas no dock</string>
+ <string name="preferences_interface_dock_default_page_title">Página padrão</string>
+ <string name="preferences_interface_dock_default_page_summary">Escolha a página padrão</string>
+ <string name="preferences_interface_dock_pages_title">Páginas</string>
+ <string name="preferences_interface_dock_pages_summary">Número de páginas no dock</string>
+ <string name="preferences_interface_general_fullscreen_title">Modo tela cheia</string>
+ <string name="preferences_interface_general_fullscreen_summary">Esconder a barra de status para extender a tela inicial</string>
+ <string name="menu_apps_filter_system">Sistema</string>
+ <string name="menu_apps_filter_downloaded">Baixado</string>
+ <string name="menu_hidden_apps_delete">Restaurar</string>
+ <string name="hidden_apps_title">Aplicativos ocultos</string>
+ <string name="edit_target_label">Editar</string>
+ <string name="preferences_interface_drawer_indicator_position_title">Indicador de posição</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">Escolha onde exibir o indicador na tela</string>
+ <string name="preferences_interface_dock_enabled_title">Exibir Dock</string>
+ <string name="preferences_interface_dock_enabled_summary">Exibir o dock embaixo da tela inicial</string>
+ <string name="preferences_interface_dock_icon_scale_title">Escala do ícone</string>
+ <string name="preferences_interface_dock_icon_scale_summary">Escala do ícone no dock</string>
</resources>
diff --git a/res/values-rm-land/strings.xml b/res/values-rm-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-rm-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-rm/strings.xml b/res/values-rm/strings.xml
index 99f72bb1e..34d47c8bb 100644
--- a/res/values-rm/strings.xml
+++ b/res/values-rm/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Lantschader"</string>
<!-- no translation found for home (5921706419368316758) -->
<skip />
<string name="uid_name" msgid="3371120195364560632">"Applicaziuns da basa dad Android"</string>
diff --git a/res/values-ro-land/strings.xml b/res/values-ro-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-ro-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-ro/arrays.xml b/res/values-ro/arrays.xml
new file mode 100644
index 000000000..4e7f0b16d
--- /dev/null
+++ b/res/values-ro/arrays.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2008 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.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="preferences_interface_homescreen_indicator_position_entries">
+ <item>"Mai sus de doc"</item>
+ <item>"În partea de sus"</item>
+ <item>"În partea de jos"</item>
+ </string-array>
+ <string-array name="preferences_interface_homescreen_scrolling_transition_effect_entries">
+ <item>"Standard"</item>
+ <item>"Tabletă"</item>
+ <item>"Mărire"</item>
+ <item>"Micşorare"</item>
+ <item>"Rotire în Sus"</item>
+ <item>"Rotire în Jos"</item>
+ <item>"Cilindru Interior"</item>
+ <item>"Cilindru Exterior"</item>
+ <item>"Cub Interior"</item>
+ <item>"Cub Exterior"</item>
+ <item>"Rotire"</item>
+ <item>"Răsturnare"</item>
+ <item>"Stivă"</item>
+ <item>"Acordeon"</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_scrolling_transition_effect_entries">
+ <item>"Standard"</item>
+ <item>"Tabletă"</item>
+ <item>"Mărire"</item>
+ <item>"Micşorare"</item>
+ <item>"Rotire în Sus"</item>
+ <item>"Rotire în Jos"</item>
+ <item>"Cilindru Interior"</item>
+ <item>"Cilindru Exterior"</item>
+ <item>"Cub Interior"</item>
+ <item>"Cub Exterior"</item>
+ <item>"Rotire"</item>
+ <item>"Răsturnare"</item>
+ <item>"Stivă"</item>
+ <item>"Acordeon"</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_indicator_position_entries">
+ <item>"Sus/Stânga"</item>
+ <item>"Jos/Dreapta"</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_orientation_entries">
+ <item>"Orizontal"</item>
+ <item>"Vertical"</item>
+ </string-array>
+</resources>
diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml
index 1ed96ac5b..fca4a3f3f 100644
--- a/res/values-ro/strings.xml
+++ b/res/values-ro/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Lansator"</string>
<string name="home" msgid="5921706419368316758">"Ecran de pornire"</string>
<string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
@@ -30,6 +29,7 @@
<string name="widgets_tab_label" msgid="9145860100000983599">"Obiecte widget"</string>
<string name="long_press_widget_to_add" msgid="7395697462851217506">"Atingeţi/menţineţi apăsat un widget pt. a-l alege."</string>
<string name="market" msgid="2652226429823445833">"Cumpăraţi"</string>
+ <string name="menu">"Meniu"</string>
<string name="external_drop_widget_error" msgid="2285187188524172774">"Nu am putut plasa articolul pe ecranul de pornire."</string>
<string name="external_drop_widget_pick_title" msgid="7040647073452295370">"Alegeţi widgetul de creare"</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Nume dosar"</string>
@@ -57,6 +57,7 @@
<string name="delete_target_label" msgid="665300185123139530">"Eliminaţi"</string>
<string name="delete_target_uninstall_label" msgid="748894921183769150">"Dezinstalaţi"</string>
<string name="info_target_label" msgid="4019495079517426980">"Informaţii aplicaţie"</string>
+ <string name="edit_target_label">"Editați"</string>
<string name="accessibility_search_button" msgid="816822994629942611">"Căutaţi"</string>
<string name="accessibility_voice_search_button" msgid="3938249215065842475">"Căutare vocală"</string>
<string name="accessibility_all_apps_button" msgid="8803738611398979849">"Aplicaţii"</string>
@@ -69,6 +70,11 @@
<string name="menu_notifications" msgid="6424587053194766192">"Notificări"</string>
<string name="menu_settings" msgid="3946232973327980394">"Setări de sistem"</string>
<string name="menu_help" msgid="4901160661634590633">"Ajutor"</string>
+ <string name="menu_apps_sort_title">"Nume"</string>
+ <string name="menu_apps_sort_install_date">"Dată Instalare"</string>
+ <string name="menu_apps_filter_system">"Sistem"</string>
+ <string name="menu_apps_filter_downloaded">"Descărcate"</string>
+ <string name="menu_hidden_apps_delete">"Resetați"</string>
<string name="cab_menu_delete_app" msgid="4089398025537640349">"Dezinstalaţi aplicaţia"</string>
<string name="cab_menu_app_info" msgid="914548323652698884">"Detalii aplicaţie"</string>
<string name="cab_app_selection_text" msgid="6378522164293415735">"1 aplicaţie selectată"</string>
@@ -111,4 +117,91 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+
+ <string name="hidden_apps_title">"Aplicații ascunse"</string>
+
+ <string name="preferences_title">"Preferinţe"</string>
+
+ <string name="preferences_interface_title">"Interfaţă"</string>
+
+ <string name="preferences_application_title">"Aplicaţie"</string>
+
+ <string name="preferences_interface_homescreen_title">"Ecranul de pornire"</string>
+ <string name="preferences_interface_homescreen_summary">"Ecrane şi im. de fundal"</string>
+ <string name="preferences_interface_homescreen_general_category">"General"</string>
+ <string name="preferences_interface_homescreen_general_screens_title">"Ecrane de pornire"</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">"Numărul de ecrane pe ecranul de pornire"</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">"Ecranul implicit"</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">"Alegeți ecranul de pornire implicit"</string>
+ <string name="preferences_interface_homescreen_general_search_title">"Bara de Căutare"</string>
+ <string name="preferences_interface_homescreen_general_search_summary">"Activează bara de cautare persistentă"</string>
+ <string name="preferences_interface_homescreen_general_grid_title">"Dimensiune Grilă"</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">"Alegeți numărul de rânduri / coloane pe ecranul de pornire"</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">"Rânduri"</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">"Coloane"</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">"Întindeţi ecranele"</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">"Extinde ecranele pentru a umple dimensiunea ecranului dispozitivului"</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">"Ascundeți etichetele pictogramelor"</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">"Ascundeți etichetele pictogramelor pe ecranul de pornire"</string>
+ <string name="preferences_interface_homescreen_scrolling_category">"Defilare"</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">"Efect tranziţie"</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">"Efect de defilare la defilarea ecranelor"</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">"Defilați im. de fundal"</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">"Defilați imaginea de fundal atunci când defilaţi ecranele"</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">"Redare rapidă a im. de fundal"</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">"Utilizaţi hack imagine de fundal pentru a spori fineţea imaginilor de fundal statice"</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">"Dimensiune im. de fundal"</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">"Pe câte ecrane se întinde im. de fundal"</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">"Atenuaţi paginile laterale"</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">"Atenuaţi paginile laterale la defilarea ecranelor"</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">"Afişaţi contur"</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">"Afişaţi conturul ecranelor la defilare"</string>
+ <string name="preferences_interface_homescreen_indicator_category">"Indicator"</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">"Afișaţi indicatorul de pagină"</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">"Afişaţi indicatorul de pagină curentă, în partea de jos a ecranului"</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">"Ascundeţi indicatorul"</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">"Ascundeţi indicatorul după ce ecranul de pornire s-a schimbat"</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">"Poziţie indicator"</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">Alegeţi unde să se arate indicatorul pe ecran"</string>
+
+ <string name="preferences_interface_drawer_title">"Meniul Principal"</string>
+ <string name="preferences_interface_drawer_summary">"Aplicaţii şi obiecte widget"</string>
+ <string name="preferences_interface_drawer_orientation_title">"Orientare"</string>
+ <string name="preferences_interface_drawer_orientation_summary">"Alegeţi în ce direcţie defilează meniul principal"</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">"Aplicații ascunse"</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">"Aplicații ascunse din meniul principal"</string>
+ <string name="preferences_interface_drawer_widgets_category">"Obiecte widget"</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">"Alăturați la aplicații"</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">"Trecere de la aplicații la obiecte widget, fără a schimba filele"</string>
+ <string name="preferences_interface_drawer_scrolling_category">"Defilare"</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">"Efect tranziţie"</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">"Efect de defilare la defilarea ecranelor"</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">"Atenuaţi paginile laterale"</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">"Atenuaţi paginile laterale la defilarea ecranelor"</string>
+ <string name="preferences_interface_drawer_indicator_category">"Indicator"</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">"Afișaţi indicatorul de pagină"</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">"Afişaţi indicatorul de pagină curentă, în partea de jos a ecranului"</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">"Atenuaţi indicatorul"</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">"Ascundeţi indicator după ce pagina s-a schimbat"</string>
+ <string name="preferences_interface_drawer_indicator_position_title">"Poziție indicator"</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">"Alegeţi unde să se arate indicatorul pe ecran"</string>
+
+ <string name="preferences_interface_dock_title">"Doc"</string>
+ <string name="preferences_interface_dock_pages_title">"Pagini"</string>
+ <string name="preferences_interface_dock_pages_summary">"Numărul de pagini în doc"</string>
+ <string name="preferences_interface_dock_default_page_title">"Pagina prestabilită"</string>
+ <string name="preferences_interface_dock_default_page_summary">"Alegeți pagina prestabilită"</string>
+ <string name="preferences_interface_dock_icons_title">"Pictograme"</string>
+ <string name="preferences_interface_dock_icons_summary">"Numărul de pictograme/coloane în doc"</string>
+ <string name="preferences_interface_dock_icon_scale_title">"Dimensiune pictograme"</string>
+ <string name="preferences_interface_dock_icon_scale_summary">"Dimensiunea pictogramelor în doc"</string>
+ <string name="preferences_interface_dock_divider_title">"Arătaţi separator doc"</string>
+ <string name="preferences_interface_dock_divider_summary">"Arătaţi separatorul între ecranul de pornire şi doc"</string>
+
+ <string name="preferences_interface_icons_title">"Pictograme"</string>
+
+ <string name="preferences_interface_general_title">"General"</string>
+ <string name="preferences_interface_general_orientation_title">"Rotire automată a ecranului"</string>
+ <string name="preferences_interface_general_fullscreen_title">"Ecran complet"</string>
+ <string name="preferences_interface_general_fullscreen_summary">Ascundeţi bara de stare pentru a extinde ecranul de pornire"</string>
</resources>
diff --git a/res/values-ru-land/strings.xml b/res/values-ru-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-ru-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-ru/arrays.xml b/res/values-ru/arrays.xml
new file mode 100644
index 000000000..cef6e8c69
--- /dev/null
+++ b/res/values-ru/arrays.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2008 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.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="preferences_interface_homescreen_indicator_position_entries">
+ <item>Над нижней панелью</item>
+ <item>Наверху</item>
+ <item>Внизу</item>
+ </string-array>
+ <string-array name="preferences_interface_homescreen_scrolling_transition_effect_entries">
+ <item>Стандартный</item>
+ <item>Планшетный</item>
+ <item>Увеличение</item>
+ <item>Уменьшение</item>
+ <item>Вращение вверх</item>
+ <item>Вращение вниз</item>
+ <item>Внутри круга</item>
+ <item>Вне круга</item>
+ <item>В куб</item>
+ <item>Из куба</item>
+ <item>Вращение</item>
+ <item>Переворот</item>
+ <item>Друг на друга</item>
+ <item>Аккордеон</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_scrolling_transition_effect_entries">
+ <item>Стандартный</item>
+ <item>Планшетный</item>
+ <item>Увеличение</item>
+ <item>Уменьшение</item>
+ <item>Вращение вверх</item>
+ <item>Вращение вниз</item>
+ <item>Внутри круга</item>
+ <item>Вне круга</item>
+ <item>В куб</item>
+ <item>Из куба</item>
+ <item>Вращение</item>
+ <item>Переворот</item>
+ <item>Друг на друга</item>
+ <item>Аккордеон</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_indicator_position_entries">
+ <item>Наверху/Слева</item>
+ <item>Внизу/Справа</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_orientation_entries">
+ <item>Горизонтальная</item>
+ <item>Вертикальная</item>
+ </string-array>
+</resources>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index c2b88d519..f099a9d2a 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
<string name="home" msgid="5921706419368316758">"Главный экран"</string>
<string name="uid_name" msgid="3371120195364560632">"Основные приложения"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
@@ -55,8 +54,10 @@
<string name="delete_zone_label_workspace" msgid="7153615831493049150">"Удалить"</string>
<string name="delete_zone_label_all_apps" msgid="6664588234817475108">"Удалить"</string>
<string name="delete_target_label" msgid="665300185123139530">"Удалить"</string>
+ <string name="cancel_target_label">Отмена</string>
<string name="delete_target_uninstall_label" msgid="748894921183769150">"Удалить"</string>
<string name="info_target_label" msgid="4019495079517426980">"Сведения о приложении"</string>
+ <string name="edit_target_label">Изменить</string>
<string name="accessibility_search_button" msgid="816822994629942611">"Поиск"</string>
<string name="accessibility_voice_search_button" msgid="3938249215065842475">"Голосовой поиск"</string>
<string name="accessibility_all_apps_button" msgid="8803738611398979849">"Приложения"</string>
@@ -68,7 +69,13 @@
<string name="menu_search" msgid="4826514464423239041">"Поиск"</string>
<string name="menu_notifications" msgid="6424587053194766192">"Уведомления"</string>
<string name="menu_settings" msgid="3946232973327980394">"Настройки"</string>
+ <string name="menu_preferences">Настройки Trebuchet</string>
<string name="menu_help" msgid="4901160661634590633">"Справка"</string>
+ <string name="menu_apps_sort_title">По имени</string>
+ <string name="menu_apps_sort_install_date">По дате установки</string>
+ <string name="menu_apps_filter_system">Системные</string>
+ <string name="menu_apps_filter_downloaded">Загруженные</string>
+ <string name="menu_hidden_apps_delete">Сброс</string>
<string name="cab_menu_delete_app" msgid="4089398025537640349">"Удалить"</string>
<string name="cab_menu_app_info" msgid="914548323652698884">"О приложении"</string>
<string name="cab_app_selection_text" msgid="6378522164293415735">"Выбрано 1 приложение"</string>
@@ -111,4 +118,101 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+
+ <!-- Hidden apps -->
+ <string name="hidden_apps_title">Скрытые приложения</string>
+
+ <!-- -->
+ <!-- Preferences -->
+ <!-- -->
+ <string name="preferences_title">Настройки</string>
+ <!-- UI -->
+ <string name="preferences_interface_title">Интерфейс</string>
+ <!-- Application -->
+ <string name="preferences_application_title">Приложение</string>
+
+ <!-- UI -->
+ <!-- Homescreen -->
+ <string name="preferences_interface_homescreen_title">Главный экран</string>
+ <string name="preferences_interface_homescreen_summary">Настройка экранов и обоев</string>
+ <string name="preferences_interface_homescreen_general_category">ОСНОВНЫЕ</string>
+ <string name="preferences_interface_homescreen_general_screens_title">Рабочие столы</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">Количество рабочих столов на главном экране</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">Стол по умолчанию</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">Выбор рабочего стола по умолчанию</string>
+ <string name="preferences_interface_homescreen_general_search_title">Строка поиска</string>
+ <string name="preferences_interface_homescreen_general_grid_title">Размер сетки</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">Выбор числа строк/столбцов на рабочем столе</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">Строки</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">Столбцы</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">Эластичные экраны</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">Расширять домашние экраны до заполнения размера экрана</string>
+ <string name="preferences_interface_homescreen_general_search_summary">Включить неисчезающую строку поиска Google</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">Прятать подписи иконок</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Прятать подписи иконок на рабочих столах</string>
+ <string name="preferences_interface_homescreen_scrolling_category">ПРОКРУТКА</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">Эффект перехода</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">Эффект перехода при перелистывании рабочих экранов</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">Прокрутка обоев</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Прокручивать обои при прокрутке рабочих столов</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">Быстрая отрисовка обоев</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">Используйте эту настройку для увеличения гладкости статических обоев</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">Размер обоев</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">Какого размера должны быть обои</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">Затемнять края экранов</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">Затемнять края рабочих столов при перелистывании</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">Показывать границы</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">Показывать границы рабочих столов при перелистывании</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">Скрывать индикатор</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">Скрывать индикатор страниц после смены страницы</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">Положение индикатора</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">Выбор расположения индикатора</string>
+ <string name="preferences_interface_homescreen_indicator_category">ИНДИКАТОР</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">Отображать индикатор</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">Отображать индикатор выбранной страницы внизу экрана</string>
+
+ <!-- Drawer -->
+ <string name="preferences_interface_drawer_title">Главное меню</string>
+ <string name="preferences_interface_drawer_summary">Настройки главного меню и виджетов</string>
+ <string name="preferences_interface_drawer_orientation_title">Ориентация</string>
+ <string name="preferences_interface_drawer_orientation_summary">Выбор типа прокрутки главного меню</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">Скрытые приложения</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">Список скрытых приложений в главном меню</string>
+ <string name="preferences_interface_drawer_widgets_category">ВИДЖЕТЫ</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">Вместе с приложениями</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">Пролистывать из меню \"Приложения\" в меню \"Виджеты\" без смены вкладок</string>
+ <string name="preferences_interface_drawer_scrolling_category">Прокрутка</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">Эффект перехода</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">Эффект перехода при пролистывании экранов</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">Затухание страниц</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">Затухание страниц при пролистывании экранов</string>
+ <string name="preferences_interface_drawer_indicator_category">ИНДИКАТОР</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">Отображать индикатор</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">Отображать индикатор выбранной страницы внизу экрана</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">Скрывать индикатор</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">Скрывать индикатор страниц после смены страницы</string>
+ <string name="preferences_interface_drawer_indicator_position_title">Положение индикатора</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">Выбор расположения индикатора</string>
+
+ <!-- Dock -->
+ <string name="preferences_interface_dock_title">Нижняя панель</string>
+ <string name="preferences_interface_dock_pages_title">Страницы</string>
+ <string name="preferences_interface_dock_pages_summary">Количество страниц в нижней панели</string>
+ <string name="preferences_interface_dock_default_page_title">Страница по умолчанию</string>
+ <string name="preferences_interface_dock_default_page_summary">Выбор страницы по умолчанию</string>
+ <string name="preferences_interface_dock_icons_title">Иконки</string>
+ <string name="preferences_interface_dock_icons_summary">Количество иконок/колонок в нижней панели</string>
+ <string name="preferences_interface_dock_icon_scale_title">Масштаб иконок</string>
+ <string name="preferences_interface_dock_icon_scale_summary">Масштабирование иконок в нижней панели</string>
+ <string name="preferences_interface_dock_divider_title">Показывать разделитель</string>
+ <string name="preferences_interface_dock_divider_summary">Отображать разделитель между рабочим столом и нижней панелью</string>
+
+ <!-- Icons -->
+ <string name="preferences_interface_icons_title">Иконки</string>
+
+ <!-- General -->
+ <string name="preferences_interface_general_title">Основные</string>
+ <string name="preferences_interface_general_orientation_title">Автоповорот экрана</string>
+ <string name="preferences_interface_general_fullscreen_title">Полноэкранный режим</string>
+ <string name="preferences_interface_general_fullscreen_summary">Скрывать строку состояния для увеличения площади домашних экранов</string>
</resources>
diff --git a/res/values-sk-land/strings.xml b/res/values-sk-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-sk-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-sk/strings.xml b/res/values-sk/strings.xml
index 43c4c1675..d648dc21e 100644
--- a/res/values-sk/strings.xml
+++ b/res/values-sk/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Spúšťač"</string>
<string name="home" msgid="5921706419368316758">"Plocha"</string>
<string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-sl-land/strings.xml b/res/values-sl-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-sl-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-sl/strings.xml b/res/values-sl/strings.xml
index 3217c0a18..f5af01ccf 100644
--- a/res/values-sl/strings.xml
+++ b/res/values-sl/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Zaganjalnik"</string>
<string name="home" msgid="5921706419368316758">"Začetna stran"</string>
<string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-sr-land/strings.xml b/res/values-sr-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-sr-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-sr/strings.xml b/res/values-sr/strings.xml
index 7e49aef0b..7c26fe902 100644
--- a/res/values-sr/strings.xml
+++ b/res/values-sr/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Покретач"</string>
<string name="home" msgid="5921706419368316758">"Почетна"</string>
<string name="uid_name" msgid="3371120195364560632">"Основне Android апликације"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-sv-land/strings.xml b/res/values-sv-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-sv-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml
index 067b5f10b..aed344085 100644
--- a/res/values-sv/strings.xml
+++ b/res/values-sv/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Startbild"</string>
<string name="home" msgid="5921706419368316758">"Startsida"</string>
<string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-sw-land/strings.xml b/res/values-sw-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-sw-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-sw/strings.xml b/res/values-sw/strings.xml
index c09d32833..a3298065b 100644
--- a/res/values-sw/strings.xml
+++ b/res/values-sw/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Kizinduzi"</string>
<string name="home" msgid="5921706419368316758">"Nyumbani"</string>
<string name="uid_name" msgid="3371120195364560632">"Programu Kuu za Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-sw340dp/dimens.xml b/res/values-sw340dp/dimens.xml
index 93de009db..7fcbefd06 100644
--- a/res/values-sw340dp/dimens.xml
+++ b/res/values-sw340dp/dimens.xml
@@ -22,13 +22,13 @@
<dimen name="hotseat_width_gap">0dp</dimen>
<dimen name="hotseat_height_gap">0dp</dimen>
<!-- height of the bottom row of controls -->
- <dimen name="button_bar_height">80dip</dimen>
+ <dimen name="button_bar_height">62dip</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_height_bottom_padding">0dp</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>
+ <dimen name="button_bar_height_plus_padding">62dp</dimen>
<!-- CellLayout padding land / port-->
<dimen name="cell_layout_left_padding_port">8dp</dimen>
diff --git a/res/values-sw600dp/config.xml b/res/values-sw600dp/config.xml
index fe8827418..763fec2cf 100644
--- a/res/values-sw600dp/config.xml
+++ b/res/values-sw600dp/config.xml
@@ -1,6 +1,6 @@
<resources>
- <integer name="cell_count_x">6</integer>
- <integer name="cell_count_y">6</integer>
+ <integer name="default_cell_count_x">6</integer>
+ <integer name="default_cell_count_y">6</integer>
<integer name="hotseat_cell_count">7</integer>
<integer name="hotseat_all_apps_index">3</integer>
<bool name="allow_rotation">true</bool>
@@ -8,6 +8,10 @@
<!-- Whether or not to use custom clings if a custom workspace layout is passed in -->
<bool name="config_useCustomClings">true</bool>
+<!-- Workspace -->
+ <!-- Whether to show outlines on the screens when scrolling -->
+ <bool name="config_workspaceDefaultShowOutlines">true</bool>
+
<!-- DragController -->
<integer name="config_flingToDeleteMinVelocity">-1000</integer>
diff --git a/res/values-sw720dp/config.xml b/res/values-sw720dp/config.xml
index 7c8d3d2e0..89c21fad0 100644
--- a/res/values-sw720dp/config.xml
+++ b/res/values-sw720dp/config.xml
@@ -1,6 +1,6 @@
<resources>
- <integer name="cell_count_x">8</integer>
- <integer name="cell_count_y">5</integer>
+ <integer name="default_cell_count_x">8</integer>
+ <integer name="default_cell_count_y">5</integer>
<integer name="hotseat_cell_count">9</integer>
<integer name="hotseat_all_apps_index">4</integer>
<bool name="config_largeHeap">true</bool>
@@ -21,7 +21,7 @@
<!-- 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>
+ <bool name="config_workspaceDefualtFadeInAdjacentScreens">true</bool>
<!-- Camera distance for the overscroll effect -->
<integer name="config_cameraDistance">18000</integer>
diff --git a/res/values-sw720dp/dimens.xml b/res/values-sw720dp/dimens.xml
index 439709afd..80d4b3bb4 100644
--- a/res/values-sw720dp/dimens.xml
+++ b/res/values-sw720dp/dimens.xml
@@ -49,6 +49,9 @@
<integer name="apps_customize_maxCellCountY">-1</integer>
<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>
diff --git a/res/values-th-land/strings.xml b/res/values-th-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-th-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-th/strings.xml b/res/values-th/strings.xml
index 91070ad77..3deb934aa 100644
--- a/res/values-th/strings.xml
+++ b/res/values-th/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"ตัวเรียกใช้งาน"</string>
<string name="home" msgid="5921706419368316758">"หน้าแรก"</string>
<string name="uid_name" msgid="3371120195364560632">"แอปหลัก Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-tl-land/strings.xml b/res/values-tl-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-tl-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-tl/strings.xml b/res/values-tl/strings.xml
index dfa535754..6c68bb5df 100644
--- a/res/values-tl/strings.xml
+++ b/res/values-tl/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
<string name="home" msgid="5921706419368316758">"Home"</string>
<string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-tr-land/strings.xml b/res/values-tr-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-tr-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml
index 58fd9d068..41c1526ce 100644
--- a/res/values-tr/strings.xml
+++ b/res/values-tr/strings.xml
@@ -19,19 +19,18 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Launcher"</string>
<string name="home" msgid="5921706419368316758">"Ana Ekran"</string>
<string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
<string name="chooser_wallpaper" msgid="6063168087625352235">"Duvar kağıdı seçin:"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Duvar kağıdını ayarla"</string>
<string name="pick_wallpaper" msgid="5630222540525626723">"Duvar Kağıtları"</string>
- <string name="activity_not_found" msgid="217823393239365967">"Uygulama yüklü değil."</string>
- <string name="widgets_tab_label" msgid="9145860100000983599">"Widget\'lar"</string>
- <string name="long_press_widget_to_add" msgid="7395697462851217506">"Widget seçmek için dokunun ve basılı tutun."</string>
- <string name="market" msgid="2652226429823445833">"Alışveriş"</string>
+ <string name="activity_not_found">Uygulama yüklü değil</string>
+ <string name="widgets_tab_label">Araçlar</string>
+ <string name="long_press_widget_to_add">Araç seçmek için dokunun ve basılı tutun.</string>
+ <string name="market">Google Play</string>
<string name="external_drop_widget_error" msgid="2285187188524172774">"Öğe bu Ana Ekrana bırakılamadı."</string>
- <string name="external_drop_widget_pick_title" msgid="7040647073452295370">"Oluşturmak için widget seçin"</string>
+ <string name="external_drop_widget_pick_title">Oluşturmak için araç seçin</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Klasör adı"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Klasörü yeniden adlandır"</string>
<string name="rename_action" msgid="6016003384693240896">"Tamam"</string>
@@ -39,12 +38,12 @@
<string name="menu_item_add_item" msgid="6233177331075781114">"Ana Sayfaya ekle"</string>
<string name="group_applications" msgid="2103752818818161976">"Uygulamalar"</string>
<string name="group_shortcuts" msgid="9133529424900391877">"Kısayollar"</string>
- <string name="group_widgets" msgid="6704978494073105844">"Widget\'lar"</string>
+ <string name="group_widgets">Araçlar</string>
<string name="group_wallpapers" msgid="1568191644272224858">"Duvar Kağıtları"</string>
<string name="completely_out_of_space" msgid="1759078539443491182">"Ana ekranlarınızda yer kalmadı."</string>
<string name="out_of_space" msgid="8365249326091984698">"Bu Ana Sayfada yer yok."</string>
<string name="hotseat_out_of_space" msgid="6304886797358479361">"Favori kısayollarda yer yok"</string>
- <string name="invalid_hotseat_item" msgid="6545340627805449250">"Bu widget, hotseat için çok büyük."</string>
+ <string name="invalid_hotseat_item">Bu araç, hotseat için çok büyük.</string>
<string name="shortcut_installed" msgid="7071557296331322355">"\"<xliff:g id="NAME">%s</xliff:g>\" kısayolu oluşturuldu."</string>
<string name="shortcut_uninstalled" msgid="2129499669449749995">"\"<xliff:g id="NAME">%s</xliff:g>\" kısayolu kaldırıldı."</string>
<string name="shortcut_duplicate" msgid="4757756326465060694">"\"<xliff:g id="NAME">%s</xliff:g>\" kısayolu zaten var."</string>
@@ -55,6 +54,7 @@
<string name="delete_zone_label_workspace" msgid="7153615831493049150">"Kaldır"</string>
<string name="delete_zone_label_all_apps" msgid="6664588234817475108">"Yüklemeyi Kaldır"</string>
<string name="delete_target_label" msgid="665300185123139530">"Kaldır"</string>
+ <string name="cancel_target_label">İptal</string>
<string name="delete_target_uninstall_label" msgid="748894921183769150">"Yüklemeyi kaldır"</string>
<string name="info_target_label" msgid="4019495079517426980">"Uygulama bilgileri"</string>
<string name="accessibility_search_button" msgid="816822994629942611">"Ara"</string>
@@ -68,11 +68,14 @@
<string name="menu_search" msgid="4826514464423239041">"Ara"</string>
<string name="menu_notifications" msgid="6424587053194766192">"Bildirimler"</string>
<string name="menu_settings" msgid="3946232973327980394">"Sistem ayarları"</string>
+ <string name="menu_preferences">Trebuchet ayarları</string>
<string name="menu_help" msgid="4901160661634590633">"Yardım"</string>
+ <string name="menu_apps_sort_title">Ad</string>
+ <string name="menu_apps_sort_install_date">Kurulum Tarihi</string>
<string name="cab_menu_delete_app" msgid="4089398025537640349">"Uygulamayı kaldır"</string>
<string name="cab_menu_app_info" msgid="914548323652698884">"Uygulama ayrıntıları"</string>
<string name="cab_app_selection_text" msgid="6378522164293415735">"1 uygulama seçildi"</string>
- <string name="cab_widget_selection_text" msgid="962527270506951955">"1 widget seçildi"</string>
+ <string name="cab_widget_selection_text" msgid="962527270506951955">"1 araç seçildi"</string>
<string name="cab_folder_selection_text" msgid="8916111874189565067">"1 klasör seçildi"</string>
<string name="cab_shortcut_selection_text" msgid="8115847384500412878">"1 kısayol seçildi"</string>
<string name="permlab_install_shortcut" msgid="1201690825493376489">"kısayolları yükle"</string>
@@ -83,7 +86,7 @@
<string name="permdesc_read_settings" msgid="5788109303585403679">"Uygulamaya Ana Ekrandaki ayarları ve kısayolları okuma izni verir."</string>
<string name="permlab_write_settings" msgid="1360567537236705628">"Ana Sayfa ayarlarını ve kısayollarını yaz"</string>
<string name="permdesc_write_settings" msgid="8530105489115785531">"Uygulamaya Ana Ekrandaki ayarları ve kısayolları değiştirme izni verir."</string>
- <string name="gadget_error_text" msgid="8359351016167075858">"Widget yüklenirken sorun oluştu"</string>
+ <string name="gadget_error_text" msgid="8359351016167075858">"Araç yüklenirken sorun oluştu"</string>
<string name="uninstall_system_app_text" msgid="6429814133777046491">"Bu bir sistem uygulamasıdır ve kaldırılamaz."</string>
<string name="dream_name" msgid="2847171357608437154">"Roket Fırlatıcı"</string>
<string name="folder_hint_text" msgid="8633351560105748141">"Adsız Klasör"</string>
@@ -91,12 +94,14 @@
<string name="default_scroll_format" msgid="4057140866420001240">"Sayfa %1$d / %2$d"</string>
<string name="workspace_scroll_format" msgid="1704767047951143301">"Ana ekran %1$d / %2$d"</string>
<string name="apps_customize_apps_scroll_format" msgid="5494241912377704885">"Uygulama sayfası %1$d / %2$d"</string>
- <string name="apps_customize_widgets_scroll_format" msgid="5383009742241717437">"Widget sayfası %1$d / %2$d"</string>
- <string name="workspace_cling_title" msgid="738396473989890567">"Kendinizi evinizde hissedin"</string>
- <string name="workspace_cling_move_item" msgid="791013895761065070">"Favori uygulamalarınızı buraya koyabilirsiniz."</string>
+ <string name="apps_customize_widgets_scroll_format" msgid="5383009742241717437">"Araç sayfası %1$d / %2$d"</string>
+ <string name="workspace_cling_title" msgid="738396473989890567">"Masaüstünü özelleştir"</string>
+ <string name="workspace_cling_move_item" msgid="791013895761065070">"Favori uygulamalarınızı buraya sürükleyin."</string>
<string name="workspace_cling_open_all_apps" msgid="2459977609848572588">"Tüm uygulamalarınızı görmek için çembere dokunun."</string>
<string name="all_apps_cling_title" msgid="2559734712581447107">"İstediğiniz uygulamaları seçin"</string>
<string name="all_apps_cling_add_item" msgid="5665035103260318891">"Ana Ekranınıza bir uygulama eklemek için, ilgili uygulamaya dokunup basılı tutun."</string>
+ <string name="all_apps_sort_cling_title">Uygulamaları sırala</string>
+ <string name="all_apps_sort_cling_add_item">Sıralama modunu seçmek için uygulamalara dokunun ve basılı tutun</string>
<string name="folder_cling_title" msgid="4308949882377840953">"Uygulamalarınızı klasörlerle düzenleyin"</string>
<string name="folder_cling_move_item" msgid="270598675060435169">"Bir uygulamayı taşımak için, uygulamaya dokunun ve basılı tutun."</string>
<string name="folder_cling_create_folder" msgid="8352867485656129478">"Ana Ekranınızda yeni bir klasör oluşturmak için, bir uygulamayı diğerinin üzerine getirin."</string>
@@ -111,4 +116,45 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+ <skip />
+ <string name="preferences_title">Tercihler</string>
+ <string name="preferences_interface_title">Arayüz</string>
+ <string name="preferences_application_title">Uygulama</string>
+ <string name="preferences_interface_homescreen_title">Ana ekran</string>
+ <string name="preferences_interface_homescreen_general_category">Genel</string>
+ <string name="preferences_interface_homescreen_general_screens_title">Ana ekranlar</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">Ana ekran sayısı</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">Varsayılan ekran</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">Varsayılan ekranı seçin</string>
+ <string name="preferences_interface_homescreen_general_grid_title">Döşeme boyutu</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">Ana ekranda gösterilecek satır/sütun sayısını seçin</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">Satırlar</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">Sütunlar</string>
+ <string name="preferences_interface_homescreen_general_search_title">Arama çubuğu</string>
+ <string name="preferences_interface_homescreen_general_search_summary">Arama çubuğunu sürekli göster</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">Simge etiketlerini gizle</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Ana ekrandaki simge etiketlerini gizle</string>
+ <string name="preferences_interface_homescreen_scrolling_category">Kaydırma</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">Duvar kağıdını kaydır</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Ana ekranları duvar kağıdı ile birlikte kaydır</string>
+ <string name="preferences_interface_homescreen_indicator_category">Gösterge</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">Sayfa göstergesi</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">Hangi sayfada olduğunuzu gösterir</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">Göstergeyi soldur</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">Ekran değiştikten sonra göstergeyi soldur</string>
+ <string name="preferences_interface_drawer_title">Uygulamalar</string>
+ <string name="preferences_interface_drawer_widgets_category">Araçlar</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">Uygulamalarla birleştir</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">Sekmelere dokunmadan Uygulamalar/Araçlar arası geçiş yap</string>
+ <string name="preferences_interface_drawer_indicator_category">Gösterge</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">Sayfa göstergesi</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">Hangi sayfada olduğunuzu gösterir</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">Göstergeyi soldur</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">Ekran değiştikten sonra göstergeyi soldur</string>
+ <string name="preferences_interface_dock_title">Sabit programlar</string>
+ <string name="preferences_interface_dock_divider_title">Ayırıcı çizgiyi göster</string>
+ <string name="preferences_interface_dock_divider_summary">Sabit uygulamaların üstünde ayırıcı çizgiyi göster</string>
+ <string name="preferences_interface_icons_title">Simgeler</string>
+ <string name="preferences_interface_general_title">Genel</string>
+ <string name="preferences_interface_general_orientation_title">Ekranı otomatik döndür</string>
</resources>
diff --git a/res/values-ug/strings.xml b/res/values-ug/strings.xml
new file mode 100644
index 000000000..b14228d30
--- /dev/null
+++ b/res/values-ug/strings.xml
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+* Copyright (C) 2008 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.
+*/
+ -->
+<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="uid_name" msgid="3371120195364560632">"Android يادرولۇق پىروگراممىلار"</string>
+ <string name="folder_name" msgid="8551881338202938211"/>
+ <string name="chooser_wallpaper" msgid="6063168087625352235">"تام قەغەز تاللاش ئورنى"</string>
+ <string name="wallpaper_instructions" msgid="4215640646180727542">"تام قەغەز تەڭشىكى"</string>
+ <string name="pick_wallpaper" msgid="5630222540525626723">"تام قەغىزى"</string>
+ <string name="activity_not_found" msgid="217823393239365967">"ئەپ ئورنىتىلمىغان."</string>
+ <string name="widgets_tab_label" msgid="9145860100000983599">"پارچەلەر"</string>
+ <string name="long_press_widget_to_add" msgid="7395697462851217506">"چېكىپ بېسىلسا كىچىك ئەپ تاللىغىلى بولىدۇ."</string>
+ <string name="market" msgid="2652226429823445833">"دۇكان"</string>
+ <string name="external_drop_widget_error" msgid="127440783198670829">"بۇ باش ئېكرانغا تۈر تاشلىغىلى بولمايدۇ."</string>
+ <string name="external_drop_widget_pick_title" msgid="7040647073452295370">"قۇرىدىغان كىچىك ئەپنى تاللاڭ"</string>
+ <string name="rename_folder_label" msgid="5646236631298452787">"قىسقۇچ ئاتى"</string>
+ <string name="rename_folder_title" msgid="4544573104191526550">"قىسقۇچ ئاتىنى ئۆزگەرت"</string>
+ <string name="rename_action" msgid="6016003384693240896">"جەزملە"</string>
+ <string name="cancel_action" msgid="3811860427489435048">"ۋاز كەچ"</string>
+ <string name="menu_item_add_item" msgid="6233177331075781114">"باش ئېكرانغا قوش"</string>
+ <string name="group_applications" msgid="2103752818818161976">"ئەپلەر"</string>
+ <string name="group_shortcuts" msgid="9133529424900391877">"قىسقا يول"</string>
+ <string name="group_widgets" msgid="6704978494073105844">"پارچەلەر"</string>
+ <string name="group_wallpapers" msgid="1568191644272224858">"تام قەغىزى"</string>
+ <string name="out_of_space" msgid="8365249326091984698">"باش ئېكراندا ئورۇن يوق."</string>
+ <string name="invalid_hotseat_item" msgid="6545340627805449250">"ئاساسىي تەگلىك ئۈچۈن بۇ پارچە بەك چوڭ."</string>
+ <string name="shortcut_installed" msgid="7071557296331322355">"<xliff:g id="NAME">%s</xliff:g>قىسقا يول \"\" قۇرۇلدى."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"<xliff:g id="NAME">%s</xliff:g>قىسقا يول \"\" چىقىرىۋېتىلدى."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"<xliff:g id="NAME">%s</xliff:g>قىسقا يول \"\" مەۋجۇت."</string>
+ <string name="title_select_shortcut" msgid="2858897527672831763">"قىسقا يول تاللاڭ"</string>
+ <string name="title_select_application" msgid="1793455815754848652">"ئەپ تاللاڭ"</string>
+ <string name="all_apps_button_label" msgid="2578400570124163469">"ئەپلەر"</string>
+ <string name="all_apps_home_button_label" msgid="1022222300329398558">"باش بەت"</string>
+ <string name="delete_zone_label_workspace" msgid="7153615831493049150">"چىقىرىۋەت"</string>
+ <string name="delete_zone_label_all_apps" msgid="6664588234817475108">"ئۆچۈر"</string>
+ <string name="delete_target_label" msgid="665300185123139530">"چىقىرىۋەت"</string>
+ <string name="delete_target_uninstall_label" msgid="748894921183769150">"ئۆچۈر"</string>
+ <string name="info_target_label" msgid="4019495079517426980">"ئەپ ئۇچۇرى"</string>
+ <string name="accessibility_search_button" msgid="816822994629942611">"ئىزدە"</string>
+ <string name="accessibility_voice_search_button" msgid="3938249215065842475">"تاۋۇش ئىزدەش"</string>
+ <string name="accessibility_all_apps_button" msgid="8803738611398979849">"ئەپلەر"</string>
+ <string name="accessibility_delete_button" msgid="3628162007991023603">"چىقىرىۋەت"</string>
+ <string name="delete_zone_label_all_apps_system_app" msgid="3683920959591819044">"يېڭىلاش ئۆچۈرەمدۇ"</string>
+ <string name="menu_add" msgid="3065046628354640854">"قوش"</string>
+ <string name="menu_manage_apps" msgid="2308685199463588895">"ئەپ باشقۇرۇش"</string>
+ <string name="menu_wallpaper" msgid="5837429080911269832">"تام قەغىزى"</string>
+ <string name="menu_search" msgid="4826514464423239041">"ئىزدە"</string>
+ <string name="menu_notifications" msgid="6424587053194766192">"ئۇقتۇرۇشلار"</string>
+ <string name="menu_settings" msgid="3946232973327980394">"سىستېما تەڭشەكلىرى"</string>
+ <string name="menu_help" msgid="4901160661634590633">"ياردەم"</string>
+ <string name="cab_menu_delete_app" msgid="4089398025537640349">"ئەپنى ئۆچۈر"</string>
+ <string name="cab_menu_app_info" msgid="914548323652698884">"ئەپ تەپسىلاتى"</string>
+ <string name="cab_app_selection_text" msgid="6378522164293415735">"1 ئەپ تاللاندى"</string>
+ <string name="cab_widget_selection_text" msgid="962527270506951955">"1 پارچە تاللاندى"</string>
+ <string name="cab_folder_selection_text" msgid="8916111874189565067">"1 قىسقۇچ تاللاندى"</string>
+ <string name="cab_shortcut_selection_text" msgid="8115847384500412878">"1 قىسقا يول تاللاندى"</string>
+ <string name="permlab_install_shortcut" msgid="1201690825493376489">"قىسقا يول ئورنىتىش"</string>
+ <string name="permdesc_install_shortcut" msgid="8634424803272077038">"ئەپنىڭ ئىشلەتكۈچى ئارىلاشمىغان ئەھۋالدا قىسقا يول قۇرۇشقا يول قويىدۇ."</string>
+ <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"قىسقا يول ئۆچۈر"</string>
+ <string name="permdesc_uninstall_shortcut" msgid="7811223557950931994">"ئەپنىڭ ئىشلەتكۈچى ئارىلاشمىغان ئەھۋالدا قىسقا يولنى چىقىرىۋېتىشكە يول قويىدۇ."</string>
+ <string name="permlab_read_settings" msgid="3452408290738106747">"باش بەتتىكى تەڭشەك ۋە قىسقا يولنى ئوقۇيدۇ"</string>
+ <string name="permdesc_read_settings" msgid="1836104524215167383">"ئەپنىڭ باش بەتتىكى تەڭشەك ۋە قىسقا يولنى ئوقۇشىغا يول قويىدۇ."</string>
+ <string name="permlab_write_settings" msgid="1360567537236705628">"باش بەتتىكى تەڭشەك ۋە قىسقا يولنى ياز"</string>
+ <string name="permdesc_write_settings" msgid="6763846563231494591">"ئەپنىڭ باش بەتتىكى تەڭشەك ۋە قىسقا يولنى ئۆزگەرتىشىگە يول قويىدۇ."</string>
+ <string name="gadget_error_text" msgid="8359351016167075858">"پارچە يۈكلەشتە خاتالىق كۆرۈلدى."</string>
+ <string name="uninstall_system_app_text" msgid="6429814133777046491">"بۇ سىستېما ئەپ، ئۆچۈرگىلى بولمايدۇ."</string>
+ <string name="dream_name" msgid="2847171357608437154">"Rocket قوزغاتقۇچ"</string>
+ <string name="folder_hint_text" msgid="8633351560105748141">"ئاتسىز قىسقۇچ"</string>
+ <string name="default_scroll_format" msgid="4057140866420001240">"%1$d-بەت، جەمئىي %2$d بەت"</string>
+ <string name="workspace_scroll_format" msgid="7911126267695001437">"%2$d نىڭ %1$d ئىش بوشلۇقى"</string>
+ <string name="apps_customize_apps_scroll_format" msgid="5494241912377704885">"%1$d-ئەپ بەت، جەمئىي %2$d بەت"</string>
+ <string name="apps_customize_widgets_scroll_format" msgid="5383009742241717437">"%1$d-پارچە بەت، جەمئىي %2$d بەت"</string>
+ <string name="workspace_cling_title" msgid="738396473989890567">"ئۆزىڭىزنىڭ باش ئېكرانىنى ھاسىل قىلىڭ"</string>
+ <string name="workspace_cling_move_item" msgid="791013895761065070">"بۇ جايغا ياقتۇرىدىغان ئەپلەرنى قويالايسىز."</string>
+ <string name="workspace_cling_open_all_apps" msgid="2459977609848572588">"ھەممە ئەپلىرىڭىزنى كۆرۈشتە چەمبەرنى چېكىڭ."</string>
+ <string name="all_apps_cling_title" msgid="2559734712581447107">"ئەپلەرنى تاللاڭ"</string>
+ <string name="all_apps_cling_add_item" msgid="5665035103260318891">"باش ئېكرانغا ئەپ قوشۇشتا، ئەپنى تۇتۇپ، ئۇنى بېسىپ تۇرۇڭ."</string>
+ <string name="folder_cling_title" msgid="4308949882377840953">"ئەپلىرىڭىزنى قىسقۇچلار بىلەن تەشكىللەڭ"</string>
+ <string name="folder_cling_move_item" msgid="270598675060435169">"ئەپنى يۆتكەشتە، ئۇنى تۇتۇپ، بېسىپ تۇرۇڭ."</string>
+ <string name="folder_cling_create_folder" msgid="8352867485656129478">"باش ئېكراندا يېڭى قىسقۇچ قۇرۇشتا، ئەپتىن بىرنى تاللاپ ئۇنى باشقىسىنىڭ ئۈستىگە دەستىلەڭ."</string>
+ <string name="cling_dismiss" msgid="2780907108735868381">"جەزملە"</string>
+ <string name="folder_opened" msgid="4129072635480822768">"قىسقۇچ ئېچىلدى، سىغىمى %2$d دىن %1$d"</string>
+ <string name="folder_tap_to_close" msgid="4076794242530255812">"چېكىلسە قىسقۇچ ياپىدۇ"</string>
+ <string name="folder_tap_to_rename" msgid="2125528923948315223">"چېكىلسە ئات ئۆزگەرتىشنى جەزملەيدۇ"</string>
+ <string name="folder_closed" msgid="3130534551370511932">"قىسقۇچ تاقالدى"</string>
+ <string name="folder_renamed" msgid="781234745487414781">"قىسقۇچ ئاتى %1$s غا ئۆزگەردى"</string>
+ <string name="folder_name_format" msgid="4513766553514769310">"قىسقۇچ: %1$s"</string>
+</resources>
diff --git a/res/values-uk-land/strings.xml b/res/values-uk-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-uk-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml
index 2355b0d33..70dc8cf0b 100644
--- a/res/values-uk/strings.xml
+++ b/res/values-uk/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Пан. запуску"</string>
<string name="home" msgid="5921706419368316758">"Домашня сторінка"</string>
<string name="uid_name" msgid="3371120195364560632">"Служби Android Core"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-vi-land/strings.xml b/res/values-vi-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-vi-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml
index 232aa0a13..d77c5a549 100644
--- a/res/values-vi/strings.xml
+++ b/res/values-vi/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Trình khởi chạy"</string>
<string name="home" msgid="5921706419368316758">"Trang chủ"</string>
<string name="uid_name" msgid="3371120195364560632">"Ứng dụng Lõi Android"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-zh-rCN-land/strings.xml b/res/values-zh-rCN-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-zh-rCN-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-zh-rCN/arrays.xml b/res/values-zh-rCN/arrays.xml
new file mode 100644
index 000000000..73f6ee219
--- /dev/null
+++ b/res/values-zh-rCN/arrays.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2013 The CyanogenMod Project
+* Copyright (C) 2008 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.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="preferences_interface_homescreen_indicator_position_entries">
+ <item>底座上方</item>
+ <item>顶部</item>
+ <item>底部</item>
+ </string-array>
+ <string-array name="preferences_interface_homescreen_scrolling_transition_effect_entries">
+ <item>标准</item>
+ <item>平板</item>
+ <item>放大</item>
+ <item>缩小</item>
+ <item>向上转动</item>
+ <item>向下转动</item>
+ <item>圆柱凹入</item>
+ <item>圆柱凸出</item>
+ <item>立方凹入</item>
+ <item>立方凸出</item>
+ <item>旋转</item>
+ <item>翻动</item>
+ <item>堆叠</item>
+ <item>手风琴</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_scrolling_transition_effect_entries">
+ <item>标准</item>
+ <item>平板</item>
+ <item>放大</item>
+ <item>缩小</item>
+ <item>向上转动</item>
+ <item>向下转动</item>
+ <item>圆柱凹入</item>
+ <item>圆柱凸出</item>
+ <item>立方凹入</item>
+ <item>立方凸出</item>
+ <item>旋转</item>
+ <item>翻动</item>
+ <item>堆叠</item>
+ <item>手风琴</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_indicator_position_entries">
+ <item>上方/左方</item>
+ <item>下方/右方</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_orientation_entries">
+ <item>横向</item>
+ <item>竖向</item>
+ </string-array>
+</resources>
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index fe3077571..5f5110452 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
+* Copyright (C) 2013 The CyanogenMod Project
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,7 +20,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"启动器"</string>
<string name="home" msgid="5921706419368316758">"主屏幕"</string>
<string name="uid_name" msgid="3371120195364560632">"Android 核心应用"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
@@ -30,6 +30,8 @@
<string name="widgets_tab_label" msgid="9145860100000983599">"小部件"</string>
<string name="long_press_widget_to_add" msgid="7395697462851217506">"触摸并按住可选取小部件。"</string>
<string name="market" msgid="2652226429823445833">"购买"</string>
+ <!-- Menu button text. -->
+ <string name="menu">菜单</string>
<string name="external_drop_widget_error" msgid="2285187188524172774">"无法将项拖放到此主屏幕上。"</string>
<string name="external_drop_widget_pick_title" msgid="7040647073452295370">"选择要创建的小部件"</string>
<string name="rename_folder_label" msgid="5646236631298452787">"文件夹名称"</string>
@@ -40,6 +42,7 @@
<string name="group_applications" msgid="2103752818818161976">"应用"</string>
<string name="group_shortcuts" msgid="9133529424900391877">"快捷方式"</string>
<string name="group_widgets" msgid="6704978494073105844">"小部件"</string>
+ <!-- Options in "Add to Home" dialog box; Title of the group containing the list of all launcher actions -->
<string name="group_wallpapers" msgid="1568191644272224858">"壁纸"</string>
<string name="completely_out_of_space" msgid="1759078539443491182">"您的主屏幕上没有空间了。"</string>
<string name="out_of_space" msgid="8365249326091984698">"此主屏幕上已没有空间。"</string>
@@ -55,8 +58,11 @@
<string name="delete_zone_label_workspace" msgid="7153615831493049150">"删除"</string>
<string name="delete_zone_label_all_apps" msgid="6664588234817475108">"卸载"</string>
<string name="delete_target_label" msgid="665300185123139530">"删除"</string>
+ <string name="cancel_target_label">取消</string>
<string name="delete_target_uninstall_label" msgid="748894921183769150">"卸载"</string>
<string name="info_target_label" msgid="4019495079517426980">"应用信息"</string>
+ <!-- Label for the info icon. [CHAR_LIMIT=30] -->
+ <string name="edit_target_label">编辑</string>
<string name="accessibility_search_button" msgid="816822994629942611">"搜索"</string>
<string name="accessibility_voice_search_button" msgid="3938249215065842475">"语音搜索"</string>
<string name="accessibility_all_apps_button" msgid="8803738611398979849">"应用"</string>
@@ -68,7 +74,19 @@
<string name="menu_search" msgid="4826514464423239041">"搜索"</string>
<string name="menu_notifications" msgid="6424587053194766192">"通知"</string>
<string name="menu_settings" msgid="3946232973327980394">"系统设置"</string>
+ <string name="menu_preferences">Trebuchet 设置</string>
<string name="menu_help" msgid="4901160661634590633">"帮助"</string>
+ <string name="menu_apps_sort_title">名称</string>
+ <string name="menu_apps_sort_install_date">安装日期</string>
+
+ <!-- Noun, menu item used to show system apps -->
+ <string name="menu_apps_filter_system">系统</string>
+ <!-- Noun, menu item used to show downloaded apps -->
+ <string name="menu_apps_filter_downloaded">已下载</string>
+
+ <!-- Noun, menu item used to reset hidden apps list -->
+ <string name="menu_hidden_apps_delete">重置</string>
+
<string name="cab_menu_delete_app" msgid="4089398025537640349">"卸载该应用"</string>
<string name="cab_menu_app_info" msgid="914548323652698884">"应用详情"</string>
<string name="cab_app_selection_text" msgid="6378522164293415735">"选中了 1 个应用"</string>
@@ -97,6 +115,8 @@
<string name="workspace_cling_open_all_apps" msgid="2459977609848572588">"要查看您的所有应用,请触摸该圆圈。"</string>
<string name="all_apps_cling_title" msgid="2559734712581447107">"选择一些应用"</string>
<string name="all_apps_cling_add_item" msgid="5665035103260318891">"要将某个应用添加到主屏幕,请触摸并按住该应用。"</string>
+ <string name="all_apps_sort_cling_title">整理您的程序</string>
+ <string name="all_apps_sort_cling_add_item">按住应用程序标签 &amp; 选择您的排列方式。</string>
<string name="folder_cling_title" msgid="4308949882377840953">"使用文件夹整理应用"</string>
<string name="folder_cling_move_item" msgid="270598675060435169">"要移动应用,请触摸并按住该应用。"</string>
<string name="folder_cling_create_folder" msgid="8352867485656129478">"要在主屏幕上创建新文件夹,请将一个应用叠放到另一个上。"</string>
@@ -111,4 +131,103 @@
<string name="custom_workspace_cling_description_1" msgid="6875529190849858047"></string>
<string name="custom_workspace_cling_title_2" msgid="5516006164661020362"></string>
<string name="custom_workspace_cling_description_2" msgid="2758258454975288377"></string>
+
+ <!-- Hidden apps -->
+ <string name="hidden_apps_title">隐藏应用</string>
+
+ <!-- -->
+ <!-- Preferences -->
+ <!-- -->
+ <string name="preferences_title">启动器选项</string>
+ <!-- UI -->
+ <string name="preferences_interface_title">界面</string>
+ <!-- Application -->
+ <string name="preferences_application_title">应用</string>
+
+ <!-- UI -->
+ <!-- Homescreen -->
+ <string name="preferences_interface_homescreen_title">主屏幕</string>
+ <string name="preferences_interface_homescreen_summary">屏幕与壁纸</string>
+ <string name="preferences_interface_homescreen_general_category">常规</string>
+ <string name="preferences_interface_homescreen_general_screens_title">主屏幕数量</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">主屏幕上的页面数量</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">默认主屏幕</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">选择默认的主屏幕</string>
+ <string name="preferences_interface_homescreen_general_search_title">搜索栏</string>
+ <string name="preferences_interface_homescreen_general_search_summary">启用搜索栏</string>
+ <string name="preferences_interface_homescreen_general_grid_title">网格大小</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">选择主屏幕上的行/列数</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">行</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">列</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">拉长屏幕</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">扩展主屏幕为填充屏幕大小</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">隐藏图标标签</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">隐藏在主屏幕上图标的标签</string>
+ <string name="preferences_interface_homescreen_scrolling_category">滚动</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">过渡效果</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">滚动页面时产生的效果</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">滚动壁纸</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">主屏幕滚动时壁纸将会一起滚动</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">壁纸快速渲染器</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">手动绘制壁纸位图, 加强静态壁纸的流畅性</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">壁纸大小</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">设定壁纸宽度 (以屏幕为单位)</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">淡出旁边屏幕</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">滚动主屏幕时淡出旁边的屏幕</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">显示边框</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">滚动主屏幕时显示各屏幕的边框</string>
+ <string name="preferences_interface_homescreen_indicator_category">指示器</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">启用页面指示器</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">在屏幕上显示当前页面的指示器</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">淡出指示器</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">改变主屏幕后将淡出指示器</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">指示器位置</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">选择指示器在屏幕上的位置</string>
+
+ <!-- Drawer -->
+ <string name="preferences_interface_drawer_title">抽屉</string>
+ <string name="preferences_interface_drawer_summary">应用与小部件抽屉</string>
+ <string name="preferences_interface_drawer_orientation_title">方向</string>
+ <string name="preferences_interface_drawer_orientation_summary">选择抽屉的滚动方向</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">隐藏应用</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">从抽屉里隐藏应用程序</string>
+ <string name="preferences_interface_drawer_widgets_category">小部件</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">与应用关联</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">从应用程序菜单直接滑动到小部件菜单</string>
+ <string name="preferences_interface_drawer_scrolling_category">滚动</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">过渡效果</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">滚动屏幕时产生的效果</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">淡出旁边页面</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">滚动屏幕时淡出旁边的页面</string>
+ <string name="preferences_interface_drawer_indicator_category">指示器</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">启用页面指示器</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">在屏幕上显示当前页面的指示器</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">淡出指示器</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">改变页面后将淡出指示器</string>
+ <string name="preferences_interface_drawer_indicator_position_title">指示器位置</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">选择指示器在屏幕上的位置</string>
+
+ <!-- Dock -->
+ <string name="preferences_interface_dock_title">底座</string>
+ <string name="preferences_interface_dock_enabled_title">显示底座</string>
+ <string name="preferences_interface_dock_enabled_summary">显示在主屏幕下部的底座</string>
+ <string name="preferences_interface_dock_pages_title">页面</string>
+ <string name="preferences_interface_dock_pages_summary">设置底座页面数</string>
+ <string name="preferences_interface_dock_default_page_title">默认页面</string>
+ <string name="preferences_interface_dock_default_page_summary">选择默认页面</string>
+ <string name="preferences_interface_dock_icons_title">图标</string>
+ <string name="preferences_interface_dock_icons_summary">设置底座上的图标数量/列数</string>
+ <string name="preferences_interface_dock_icon_scale_title">图标比例</string>
+ <string name="preferences_interface_dock_icon_scale_summary">设置底座上图标的比例</string>
+ <string name="preferences_interface_dock_divider_title">显示底座分隔器</string>
+ <string name="preferences_interface_dock_divider_summary">显示指示器后面的背景</string>
+
+ <!-- Icons -->
+ <string name="preferences_interface_icons_title">图标</string>
+
+ <!-- General -->
+ <string name="preferences_interface_general_title">常规</string>
+ <string name="preferences_interface_general_orientation_title">自动旋转屏幕</string>
+ <string name="preferences_interface_general_fullscreen_title">全屏模式</string>
+ <string name="preferences_interface_general_fullscreen_summary">隐藏状态栏以便扩展主屏幕</string>
</resources>
diff --git a/res/values-zh-rTW-land/strings.xml b/res/values-zh-rTW-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-zh-rTW-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index f261ddfb6..f952277f5 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"啟動器"</string>
<string name="home" msgid="5921706419368316758">"住家"</string>
<string name="uid_name" msgid="3371120195364560632">"Android 核心應用程式"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values-zu-land/strings.xml b/res/values-zu-land/strings.xml
deleted file mode 100644
index b976926f0..000000000
--- a/res/values-zu-land/strings.xml
+++ /dev/null
@@ -1,25 +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.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="delete_target_label" msgid="4155210680095864979"></string>
- <string name="delete_target_uninstall_label" msgid="1839407506844917298"></string>
- <string name="info_target_label" msgid="1424400595004570393"></string>
-</resources>
diff --git a/res/values-zu/strings.xml b/res/values-zu/strings.xml
index 6faa63d01..ed1e57de6 100644
--- a/res/values-zu/strings.xml
+++ b/res/values-zu/strings.xml
@@ -19,7 +19,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="application_name" msgid="8424725141379931883">"Isiqalisi"</string>
<string name="home" msgid="5921706419368316758">"Ikhaya"</string>
<string name="uid_name" msgid="3371120195364560632">"I-Android Core Apps"</string>
<string name="folder_name" msgid="8551881338202938211"></string>
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
new file mode 100644
index 000000000..4fa33371b
--- /dev/null
+++ b/res/values/arrays.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2008 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.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="preferences_interface_homescreen_indicator_position_entries">
+ <item>Above Dock</item>
+ <item>Top</item>
+ <item>Bottom</item>
+ </string-array>
+ <string-array name="preferences_interface_homescreen_indicator_position_values" translatable="false">
+ <item>0</item>
+ <item>1</item>
+ <item>2</item>
+ </string-array>
+ <string-array name="preferences_interface_homescreen_scrolling_transition_effect_entries">
+ <item>Standard</item>
+ <item>Tablet</item>
+ <item>Zoom In</item>
+ <item>Zoom Out</item>
+ <item>Rotate Up</item>
+ <item>Rotate Down</item>
+ <item>Cylinder In</item>
+ <item>Cylinder Out</item>
+ <item>Cube In</item>
+ <item>Cube Out</item>
+ <item>Spin</item>
+ <item>Flip</item>
+ <item>Stack</item>
+ <item>Accordian</item>
+ </string-array>
+ <string-array name="preferences_interface_homescreen_scrolling_transition_effect_values" translatable="false">
+ <item>Standard</item>
+ <item>Tablet</item>
+ <item>ZoomIn</item>
+ <item>ZoomOut</item>
+ <item>RotateUp</item>
+ <item>RotateDown</item>
+ <item>CylinderIn</item>
+ <item>CylinderOut</item>
+ <item>CubeIn</item>
+ <item>CubeOut</item>
+ <item>Spin</item>
+ <item>Flip</item>
+ <item>Stack</item>
+ <item>Accordian</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_scrolling_transition_effect_entries">
+ <item>Standard</item>
+ <item>Tablet</item>
+ <item>Zoom In</item>
+ <item>Zoom Out</item>
+ <item>Rotate Up</item>
+ <item>Rotate Down</item>
+ <item>Cylinder In</item>
+ <item>Cylinder Out</item>
+ <item>Cube In</item>
+ <item>Cube Out</item>
+ <item>Spin</item>
+ <item>Flip</item>
+ <item>Stack</item>
+ <item>Accordian</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_scrolling_transition_effect_values" translatable="false">
+ <item>Standard</item>
+ <item>Tablet</item>
+ <item>ZoomIn</item>
+ <item>ZoomOut</item>
+ <item>RotateUp</item>
+ <item>RotateDown</item>
+ <item>CylinderIn</item>
+ <item>CylinderOut</item>
+ <item>CubeIn</item>
+ <item>CubeOut</item>
+ <item>Spin</item>
+ <item>Flip</item>
+ <item>Stack</item>
+ <item>Accordian</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_indicator_position_entries">
+ <item>Top/Left</item>
+ <item>Bottom/Right</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_indicator_position_values" translatable="false">
+ <item>1</item>
+ <item>0</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_orientation_entries">
+ <item>Horizontal</item>
+ <item>Vertical</item>
+ </string-array>
+ <string-array name="preferences_interface_drawer_orientation_values" translatable="false">
+ <item>horizontal</item>
+ <item>vertical</item>
+ </string-array>
+</resources>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index c76a6a5c4..909a17b6d 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -44,8 +44,6 @@
<!-- Workspace specific attributes. These attributes are used to customize
the workspace in XML files. -->
<declare-styleable name="Workspace">
- <!-- The first screen the workspace should display. -->
- <attr name="defaultScreen" format="integer" />
<!-- The number of horizontal cells in the CellLayout -->
<attr name="cellCountX" format="integer" />
<!-- The number of vertical cells in the CellLayout -->
@@ -55,10 +53,8 @@
<!-- Hotseat specific attributes. These attributes are used to customize
the hotseat in XML files. -->
<declare-styleable name="Hotseat">
- <!-- The number of horizontal cells in the CellLayout -->
- <attr name="cellCountX" />
- <!-- The number of vertical cells in the CellLayout -->
- <attr name="cellCountY" />
+ <!-- The number of cells in the CellLayout -->
+ <attr name="cellCount" format="integer" />
</declare-styleable>
<!-- CellLayout specific attributes. These attributes are used to customize
@@ -108,7 +104,9 @@
<attr name="pageSpacing" format="dimension" />
<!-- The padding for the scroll indicator area -->
<attr name="scrollIndicatorPaddingLeft" format="dimension" />
+ <attr name="scrollIndicatorPaddingTop" format="dimension" />
<attr name="scrollIndicatorPaddingRight" format="dimension" />
+ <attr name="scrollIndicatorPaddingBottom" format="dimension" />
</declare-styleable>
<!-- AppsCustomizePagedView specific attributes. These attributes are used to
@@ -132,13 +130,6 @@
<attr name="clingFocusedY" format="integer" />
</declare-styleable>
- <!-- HandleView specific attributes. These attributes are used to customize
- a HandleView view in XML files. -->
- <declare-styleable name="HandleView">
- <!-- Orientation of the handle. -->
- <attr name="direction" />
- </declare-styleable>
-
<!-- XML attributes used by default_workspace.xml -->
<declare-styleable name="Favorite">
<attr name="className" format="string" />
@@ -163,4 +154,46 @@
</declare-styleable>
<declare-styleable name="CustomClingText">
</declare-styleable>
+
+ <declare-styleable name="NumberPickerPreference">
+ <attr name="max" format="integer" />
+ <attr name="min" format="integer" />
+ <attr name="maxExternal" format="string" />
+ <attr name="minExternal" format="string" />
+ </declare-styleable>
+
+ <declare-styleable name="DoubleNumberPickerPreference">
+ <attr name="defaultValue1" format="integer" />
+ <attr name="defaultValue2" format="integer" />
+ <attr name="max1" format="integer" />
+ <attr name="min1" format="integer" />
+ <attr name="max2" format="integer" />
+ <attr name="min2" format="integer" />
+ <attr name="maxExternal1" format="string" />
+ <attr name="minExternal1" format="string" />
+ <attr name="maxExternal2" format="string" />
+ <attr name="minExternal2" format="string" />
+ <attr name="pickerTitle1" format="string" />
+ <attr name="pickerTitle2" format="string" />
+ </declare-styleable>
+
+ <declare-styleable name="SeekBarDialogPreference">
+ <attr name="max" />
+ <attr name="min" />
+ <attr name="prefix" format="string" />
+ <attr name="suffix" format="string" />
+ </declare-styleable>
+
+ <declare-styleable name="EcoGallery">
+ <attr name="gravity" format="integer" />
+ <attr name="animationDuration" format="integer" />
+ <attr name="unselectedAlpha" format="float" />
+ <attr name="spacing" format="dimension" />
+ </declare-styleable>
+ <attr name="ecoGalleryStyle" format="reference" />
+
+ <declare-styleable name="CustomAbsSpinner">
+ <attr name="entries" format="reference" />
+ </declare-styleable>
+ <attr name="customAbsSpinnerStyle" format="reference" />
</resources>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index c2e1e7b4d..d792f5e14 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -22,6 +22,7 @@
over the delete target or the info target -->
<color name="delete_target_hover_tint">#DAFF0000</color>
<color name="info_target_hover_tint">#DA0099CC</color>
+ <color name="edit_target_hover_tint">#DACCCC00</color>
<color name="bubble_dark_background">#20000000</color>
diff --git a/res/values/config.xml b/res/values/config.xml
index 2c691a4ce..570582534 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -7,6 +7,8 @@
<integer name="config_flingToDeleteMinVelocity">-1500</integer>
<!-- AllApps/Customize/AppsCustomize -->
+ <!-- Which default transition effect to use on the AppsCustomize -->
+ <string name="config_drawerDefaultTransitionEffect">Stack</string>
<!-- The alpha of the AppsCustomize bg in spring loaded mode -->
<integer name="config_appsCustomizeSpringLoadedBgAlpha">45</integer>
<integer name="config_workspaceUnshrinkTime">300</integer>
@@ -31,15 +33,15 @@
AppsCustomize (y / x * 100%) -->
<integer name="config_appsCustomizeDragSlopeThreshold">150</integer>
- <!-- Batch loading for loading in LauncherModel -->
- <integer name="config_allAppsBatchLoadDelay">0</integer>
- <integer name="config_allAppsBatchSize">0</integer>
-
<!-- Workspace -->
<!-- Whether or not the drop targets drop down as opposed to fade in -->
<bool name="config_useDropTargetDownTransition">true</bool>
+ <!-- Which default transition effect to use on the workspace -->
+ <string name="config_workspaceDefaultTransitionEffect">ZoomIn</string>
<!-- Whether or not to fade the side pages -->
- <bool name="config_workspaceFadeAdjacentScreens">false</bool>
+ <bool name="config_workspaceDefualtFadeInAdjacentScreens">false</bool>
+ <!-- Whether to show outlines on the screens when scrolling -->
+ <bool name="config_workspaceDefaultShowOutlines">false</bool>
<!-- The transition duration for the background of the drop targets -->
<integer name="config_dropTargetBgTransitionDuration">0</integer>
@@ -75,12 +77,19 @@
<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>
+ <!-- Actual cell count -->
+ <integer name="target_cell_count_x">@integer/default_cell_count_x</integer>
+ <integer name="target_cell_count_y">@integer/default_cell_count_y</integer>
+ <!-- Default cell count that scales properly (will be used as a reference for scaling when different counts are used) -->
+ <integer name="default_cell_count_x">4</integer>
+ <integer name="default_cell_count_y">4</integer>
<!-- Whether or not to use custom clings if a custom workspace layout is passed in -->
<bool name="config_useCustomClings">false</bool>
+ <!-- Whether or not to use the wallpaper hack by default -->
+ <bool name="config_workspaceDefaultWallpaperHack">false</bool>
+
<!-- Hotseat -->
<bool name="hotseat_transpose_layout_with_orientation">true</bool>
<integer name="hotseat_cell_count">5</integer>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index e82f618d5..a5ffc0ba6 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -31,6 +31,7 @@
<!-- 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">34dp</dimen>
+ <dimen name="qsb_bar_hidden_inset">14dp</dimen>
<dimen name="qsb_bar_height">40dp</dimen>
<dimen name="qsb_padding_left">0dp</dimen>
<dimen name="qsb_padding_right">0dp</dimen>
@@ -49,7 +50,6 @@
<dimen name="hotseat_height_gap">-1dp</dimen>
<dimen name="workspace_overscroll_drawable_padding">0dp</dimen>
<dimen name="workspace_icon_text_size">12sp</dimen>
- <dimen name="workspace_spring_loaded_page_spacing">15dp</dimen>
<dimen name="app_icon_drawable_padding">6dp</dimen>
<dimen name="app_icon_drawable_padding_land">2dp</dimen>
@@ -81,15 +81,19 @@
<dimen name="button_bar_height">62dip</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_top_padding">0dp</dimen>
<dimen name="button_bar_height_bottom_padding">0dp</dimen>
<dimen name="button_bar_width_left_padding">0dp</dimen>
<dimen name="button_bar_width_right_padding">0dp</dimen>
- <dimen name="button_bar_height_plus_padding">70dp</dimen>
+ <dimen name="button_bar_height_plus_padding">62dp</dimen>
<!-- Drag padding to add to the bottom of drop targets -->
<dimen name="drop_target_drag_padding">14dp</dimen>
+ <!-- roughly a status bar (for vertically centering the all apps
+ home icon in landscape) -->
+ <dimen name="status_bar_height">25dip</dimen>
+
<!-- Dragging -->
<!-- the area at the edge of the screen that makes the workspace go left
or right while you're dragging. -->
@@ -146,6 +150,15 @@
<dimen name="workspace_bottom_padding_port">@dimen/button_bar_height</dimen>
<dimen name="workspace_bottom_padding_land">0dp</dimen>
+ <dimen name="workspace_left_padding_port_qsb_hidden">0dp</dimen>
+ <dimen name="workspace_left_padding_land_qsb_hidden">0dp</dimen>
+ <dimen name="workspace_top_padding_port_qsb_hidden">0dp</dimen>
+ <dimen name="workspace_top_padding_land_qsb_hidden">0dp</dimen>
+ <dimen name="workspace_right_padding_port_hotseat_hidden">0dp</dimen>
+ <dimen name="workspace_right_padding_land_hotseat_hidden">0dp</dimen>
+ <dimen name="workspace_bottom_padding_port_hotseat_hidden">0dp</dimen>
+ <dimen name="workspace_bottom_padding_land_hotseat_hidden">0dp</dimen>
+
<!-- Workspace cell size -->
<dimen name="workspace_cell_width_land">106dp</dimen>
<dimen name="workspace_cell_width_port">80dp</dimen>
@@ -155,4 +168,7 @@
<dimen name="workspace_width_gap_port">0dp</dimen>
<dimen name="workspace_height_gap_land">0dp</dimen>
<dimen name="workspace_height_gap_port">0dp</dimen>
+
+<!-- Preferences -->
+ <dimen name="header_icon_width">28dp</dimen>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 0ea12c4ef..f45a97ff7 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -21,7 +21,11 @@
<!-- General -->
<skip />
<!-- Application name -->
- <string name="application_name">Launcher</string>
+ <string name="application_name" translatable="false">Trebuchet</string>
+ <!-- Application copyright -->
+ <string name="application_copyright">Copyright \u00A9 CyanogenMod 2013</string>
+ <!-- Application version -->
+ <string name="application_version">1.0</string>
<!-- Accessibility-facing application name -->
<string name="home">Home</string>
<!-- Name for all applications running as this uid. -->
@@ -45,6 +49,8 @@
<!-- Market button text. The market button text is removed in Launcher.java
in the Phone UI. [CHAR LIMIT=32] -->
<string name="market">Shop</string>
+ <!-- Menu button text. -->
+ <string name="menu">Menu</string>
<!-- The format string for the dimensions of a widget in the drawer -->
<string name="widget_dims_format" translatable="false">%1$d x %2$d</string>
@@ -117,10 +123,14 @@ s -->
<!-- Label for delete drop target. [CHAR_LIMIT=30] -->
<string name="delete_target_label">Remove</string>
+ <!-- Label for cancel drop target. [CHAR_LIMIT=30] -->
+ <string name="cancel_target_label">Cancel</string>
<!-- Label for uninstall drop target. [CHAR_LIMIT=30]-->
<string name="delete_target_uninstall_label">Uninstall</string>
<!-- Label for the info icon. [CHAR_LIMIT=30] -->
<string name="info_target_label">App info</string>
+ <!-- Label for the info icon. [CHAR_LIMIT=30] -->
+ <string name="edit_target_label">Edit</string>
<!-- Accessibility: Search button -->
<string name="accessibility_search_button">Search</string>
@@ -149,9 +159,23 @@ s -->
<string name="menu_notifications">Notifications</string>
<!-- Noun, menu item used to show the system settings -->
<string name="menu_settings">System settings</string>
+ <!-- Noun, menu item used to show the launcher preferences -->
+ <string name="menu_preferences">Trebuchet settings</string>
<!-- Noun, menu item used to show help. [CHAR_LIMIT=none] -->
<string name="menu_help">Help</string>
+ <!-- Noun, menu item used to sort apps by name -->
+ <string name="menu_apps_sort_title">Name</string>
+ <!-- Noun, menu item used to sort apps by install date -->
+ <string name="menu_apps_sort_install_date">Install Date</string>
+ <!-- Noun, menu item used to show system apps -->
+ <string name="menu_apps_filter_system">System</string>
+ <!-- Noun, menu item used to show downloaded apps -->
+ <string name="menu_apps_filter_downloaded">Downloaded</string>
+
+ <!-- Noun, menu item used to reset hidden apps list -->
+ <string name="menu_hidden_apps_delete">Reset</string>
+
<!-- URL pointing to help text. If empty, no link to help will be created [DO NOT TRANSLATE] -->
<string name="help_url" translatable="false"></string>
@@ -236,6 +260,10 @@ s -->
<string name="all_apps_cling_title">Choose some apps</string>
<!-- The description of how to pick up and add an item to the workspace [CHAR_LIMIT=none] -->
<string name="all_apps_cling_add_item">To add an app to your Home screen, touch &amp; hold it.</string>
+ <!-- The title text for the All Apps Sort cling [CHAR_LIMIT=none] -->
+ <string name="all_apps_sort_cling_title">Sort your apps</string>
+ <!-- The description of how to pick sort apps in the drawer [CHAR_LIMIT=none] -->
+ <string name="all_apps_sort_cling_add_item">Touch &amp; hold the Apps tab to select your sort mode</string>
<!-- The title text for the Folder cling [CHAR_LIMIT=none] -->
<string name="folder_cling_title">Organize your apps with folders</string>
<!-- The description of how to move an app [CHAR_LIMIT=none] -->
@@ -274,4 +302,103 @@ s -->
<!-- Dummy string [CHAR_LIMIT=60] -->
<string name="custom_workspace_cling_description_2"></string>
+ <!-- Hidden apps -->
+ <string name="hidden_apps_title">Hidden Apps</string>
+
+ <skip />
+ <!-- -->
+ <!-- Preferences -->
+ <!-- -->
+ <string name="preferences_title">Preferences</string>
+ <!-- UI -->
+ <string name="preferences_interface_title">Interface</string>
+ <!-- Application -->
+ <string name="preferences_application_title">Application</string>
+
+ <!-- UI -->
+ <!-- Homescreen -->
+ <string name="preferences_interface_homescreen_title">Homescreen</string>
+ <string name="preferences_interface_homescreen_summary">Screens and wallpaper</string>
+ <string name="preferences_interface_homescreen_general_category">General</string>
+ <string name="preferences_interface_homescreen_general_screens_title">Homescreens</string>
+ <string name="preferences_interface_homescreen_general_screens_summary">Number of screens on the homescreen</string>
+ <string name="preferences_interface_homescreen_general_default_screen_title">Default screen</string>
+ <string name="preferences_interface_homescreen_general_default_screen_summary">Choose the default homescreen</string>
+ <string name="preferences_interface_homescreen_general_search_title">Search bar</string>
+ <string name="preferences_interface_homescreen_general_search_summary">Enable persistent search bar</string>
+ <string name="preferences_interface_homescreen_general_grid_title">Grid size</string>
+ <string name="preferences_interface_homescreen_general_grid_summary">Choose the number of rows/columns on the homescreen</string>
+ <string name="preferences_interface_homescreen_general_grid_rows_title">Rows</string>
+ <string name="preferences_interface_homescreen_general_grid_columns_title">Columns</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_title">Stretch screens</string>
+ <string name="preferences_interface_homescreen_general_stretch_screens_summary">Expand homescreens to fill the size of display</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_title">Hide icon labels</string>
+ <string name="preferences_interface_homescreen_general_hide_icon_labels_summary">Hide homescreen icon labels</string>
+ <string name="preferences_interface_homescreen_scrolling_category">Scrolling</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_title">Transition effect</string>
+ <string name="preferences_interface_homescreen_scrolling_transition_effect_summary">Scrolling effect when scrolling homescreens</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_title">Scroll wallpaper</string>
+ <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Scroll wallpaper when scrolling homescreens</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">Wallpaper quick render</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">Use wallpaper hack that increases smoothness on static image wallpapers</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">Wallpaper size</string>
+ <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">How many screens wide the wallpaper should be</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">Fade side screens</string>
+ <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">Fade the side screens when scrolling homescreens</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_title">Show outlines</string>
+ <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">Show screen outlines when scrolling homescreens</string>
+ <string name="preferences_interface_homescreen_indicator_category">Indicator</string>
+ <string name="preferences_interface_homescreen_indicator_enable_title">Show page indicator</string>
+ <string name="preferences_interface_homescreen_indicator_enable_summary">Show current page indicator on the screen</string>
+ <string name="preferences_interface_homescreen_indicator_fade_title">Fade indicator</string>
+ <string name="preferences_interface_homescreen_indicator_fade_summary">Fade away the indicator after the homescreen has changed</string>
+ <string name="preferences_interface_homescreen_indicator_position_title">Indicator position</string>
+ <string name="preferences_interface_homescreen_indicator_position_summary">Choose where to show the indicator on the screen</string>
+
+ <!-- Drawer -->
+ <string name="preferences_interface_drawer_title">Drawer</string>
+ <string name="preferences_interface_drawer_summary">Apps and widgets drawer</string>
+ <string name="preferences_interface_drawer_orientation_title">Orientation</string>
+ <string name="preferences_interface_drawer_orientation_summary">Choose which way the drawer scrolls</string>
+ <string name="preferences_interface_drawer_hidden_apps_title">Hidden apps</string>
+ <string name="preferences_interface_drawer_hidden_apps_summary">Hide apps from the drawer</string>
+ <string name="preferences_interface_drawer_widgets_category">Widgets</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_title">Join with apps</string>
+ <string name="preferences_interface_drawer_widgets_join_apps_summary">Swipe from apps drawer to widgets drawer without changing tabs</string>
+ <string name="preferences_interface_drawer_scrolling_category">Scrolling</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_title">Transition effect</string>
+ <string name="preferences_interface_drawer_scrolling_transition_effect_summary">Scrolling effect when scrolling screens</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_title">Fade side pages</string>
+ <string name="preferences_interface_drawer_scrolling_fade_adjacent_screens_summary">Fade the side pages when scrolling screens</string>
+ <string name="preferences_interface_drawer_indicator_category">Indicator</string>
+ <string name="preferences_interface_drawer_indicator_enable_title">Show page indicator</string>
+ <string name="preferences_interface_drawer_indicator_enable_summary">Show current page indicator at the bottom of the screen</string>
+ <string name="preferences_interface_drawer_indicator_fade_title">Fade indicator</string>
+ <string name="preferences_interface_drawer_indicator_fade_summary">Fade away the indicator after the page has changed</string>
+ <string name="preferences_interface_drawer_indicator_position_title">Indicator position</string>
+ <string name="preferences_interface_drawer_indicator_position_summary">Choose where to show the indicator on the screen</string>
+
+ <!-- Dock -->
+ <string name="preferences_interface_dock_title">Dock</string>
+ <string name="preferences_interface_dock_enabled_title">Show dock</string>
+ <string name="preferences_interface_dock_enabled_summary">Show the dock underneath the homescreen</string>
+ <string name="preferences_interface_dock_pages_title">Pages</string>
+ <string name="preferences_interface_dock_pages_summary">Number of pages in the dock</string>
+ <string name="preferences_interface_dock_default_page_title">Default page</string>
+ <string name="preferences_interface_dock_default_page_summary">Choose the default page</string>
+ <string name="preferences_interface_dock_icons_title">Icons</string>
+ <string name="preferences_interface_dock_icons_summary">Number of icons/columns in the dock</string>
+ <string name="preferences_interface_dock_icon_scale_title">Icon scale</string>
+ <string name="preferences_interface_dock_icon_scale_summary">Scale of icons in the dock</string>
+ <string name="preferences_interface_dock_divider_title">Show dock divider</string>
+ <string name="preferences_interface_dock_divider_summary">Show divider between homescreen and dock</string>
+
+ <!-- Icons -->
+ <string name="preferences_interface_icons_title">Icons</string>
+
+ <!-- General -->
+ <string name="preferences_interface_general_title">General</string>
+ <string name="preferences_interface_general_orientation_title">Auto-rotate screen</string>
+ <string name="preferences_interface_general_fullscreen_title">Fullscreen mode</string>
+ <string name="preferences_interface_general_fullscreen_summary">Hide the status bar to extend the homescreen</string>
</resources>
diff --git a/res/xml-sw600dp/default_workspace.xml b/res/xml-sw600dp/default_workspace.xml
index 3afb3b755..58bf21064 100644
--- a/res/xml-sw600dp/default_workspace.xml
+++ b/res/xml-sw600dp/default_workspace.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<favorites xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher">
+<favorites xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet">
<!-- Far-left screen [0] -->
<!-- Left screen [1] -->
@@ -64,28 +64,33 @@
launcher:packageName="com.android.contacts"
launcher:className="com.android.contacts.activities.DialtactsActivity"
launcher:container="-101"
- launcher:screen="1"
+ launcher:screen="0"
launcher:x="1"
launcher:y="0" />
<favorite
launcher:packageName="com.android.contacts"
launcher:className="com.android.contacts.activities.PeopleActivity"
launcher:container="-101"
- launcher:screen="2"
+ launcher:screen="0"
launcher:x="2"
launcher:y="0" />
+ <allapps
+ launcher:container="-101"
+ launcher:screen="0"
+ launcher:x="3"
+ launcher:y="0" />
<favorite
launcher:packageName="com.android.mms"
launcher:className="com.android.mms.ui.ConversationList"
launcher:container="-101"
- launcher:screen="4"
+ launcher:screen="0"
launcher:x="4"
launcher:y="0" />
<favorite
launcher:packageName="com.android.browser"
launcher:className="com.android.browser.BrowserActivity"
launcher:container="-101"
- launcher:screen="5"
+ launcher:screen="0"
launcher:x="5"
launcher:y="0" />
</favorites>
diff --git a/res/xml-sw720dp/default_workspace.xml b/res/xml-sw720dp/default_workspace.xml
index 6302d7e04..ed4b572d4 100644
--- a/res/xml-sw720dp/default_workspace.xml
+++ b/res/xml-sw720dp/default_workspace.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
+<!-- Copyright (C) 2012 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.
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<favorites xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher">
+<favorites xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet">
<!-- Far-left screen [0] -->
<!-- Left screen [1] -->
@@ -58,4 +58,39 @@
launcher:y="3" />
<!-- Far-right screen [4] -->
+
+ <!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
+ <favorite
+ launcher:packageName="com.android.contacts"
+ launcher:className="com.android.contacts.activities.DialtactsActivity"
+ launcher:container="-101"
+ launcher:screen="0"
+ launcher:x="2"
+ launcher:y="0" />
+ <favorite
+ launcher:packageName="com.android.contacts"
+ launcher:className="com.android.contacts.activities.PeopleActivity"
+ launcher:container="-101"
+ launcher:screen="0"
+ launcher:x="3"
+ launcher:y="0" />
+ <allapps
+ launcher:container="-101"
+ launcher:screen="0"
+ launcher:x="4"
+ launcher:y="0" />
+ <favorite
+ launcher:packageName="com.android.mms"
+ launcher:className="com.android.mms.ui.ConversationList"
+ launcher:container="-101"
+ launcher:screen="0"
+ launcher:x="5"
+ launcher:y="0" />
+ <favorite
+ launcher:packageName="com.android.browser"
+ launcher:className="com.android.browser.BrowserActivity"
+ launcher:container="-101"
+ launcher:screen="0"
+ launcher:x="6"
+ launcher:y="0" />
</favorites>
diff --git a/res/xml/default_workspace.xml b/res/xml/default_workspace.xml
index f2f4240ab..80a0e8825 100644
--- a/res/xml/default_workspace.xml
+++ b/res/xml/default_workspace.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<favorites xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher">
+<favorites xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet">
<!-- Far-left screen [0] -->
<!-- Left screen [1] -->
@@ -71,21 +71,26 @@
launcher:packageName="com.android.contacts"
launcher:className="com.android.contacts.activities.PeopleActivity"
launcher:container="-101"
- launcher:screen="1"
+ launcher:screen="0"
launcher:x="1"
launcher:y="0" />
+ <allapps
+ launcher:container="-101"
+ launcher:screen="0"
+ launcher:x="2"
+ launcher:y="0" />
<favorite
launcher:packageName="com.android.mms"
launcher:className="com.android.mms.ui.ConversationList"
launcher:container="-101"
- launcher:screen="3"
+ launcher:screen="0"
launcher:x="3"
launcher:y="0" />
<favorite
launcher:packageName="com.android.browser"
launcher:className="com.android.browser.BrowserActivity"
launcher:container="-101"
- launcher:screen="4"
+ launcher:screen="0"
launcher:x="4"
launcher:y="0" />
</favorites>
diff --git a/res/xml/preferences_dock.xml b/res/xml/preferences_dock.xml
new file mode 100644
index 000000000..c07a1cb39
--- /dev/null
+++ b/res/xml/preferences_dock.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+ 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.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
+ android:key="ui_dock"
+ android:title="@string/preferences_interface_dock_title">
+ <!--<CheckBoxPreference android:key="ui_dock_enabled"
+ android:title="@string/preferences_interface_dock_enabled_title"
+ android:summary="@string/preferences_interface_dock_enabled_summary"
+ android:defaultValue="true" />-->
+ <com.cyanogenmod.trebuchet.preference.NumberPickerPreference android:key="ui_dock_pages"
+ android:title="@string/preferences_interface_dock_pages_title"
+ android:summary="@string/preferences_interface_dock_pages_summary"
+ android:defaultValue="1"
+ launcher:max="3"
+ launcher:min="1" />
+ <!-- android:dependency="ui_dock_enabled" /-->
+ <com.cyanogenmod.trebuchet.preference.NumberPickerPreference android:key="ui_dock_default_page"
+ android:title="@string/preferences_interface_dock_default_page_title"
+ android:summary="@string/preferences_interface_dock_default_page_summary"
+ android:defaultValue="1"
+ launcher:maxExternal="ui_dock_pages"
+ launcher:max="3"
+ launcher:min="1" />
+ <!-- android:dependency="ui_dock_enabled" /-->
+ <com.cyanogenmod.trebuchet.preference.NumberPickerPreference android:key="ui_dock_icons"
+ android:title="@string/preferences_interface_dock_icons_title"
+ android:summary="@string/preferences_interface_dock_icons_summary"
+ android:defaultValue="@integer/hotseat_cell_count"
+ launcher:max="@integer/hotseat_cell_count"
+ launcher:min="3" />
+ <!-- android:dependency="ui_dock_enabled" /-->
+ <com.cyanogenmod.trebuchet.preference.SeekBarDialogPreference android:key="ui_dock_icon_scale"
+ android:title="@string/preferences_interface_dock_icon_scale_title"
+ android:summary="@string/preferences_interface_dock_icon_scale_summary"
+ launcher:min="80"
+ launcher:max="100"
+ android:defaultValue="@integer/hotseat_item_scale_percentage" />
+ <!-- android:dependency="ui_dock_enabled" /-->
+ <CheckBoxPreference android:key="ui_dock_divider"
+ android:title="@string/preferences_interface_dock_divider_title"
+ android:summary="@string/preferences_interface_dock_divider_summary"
+ android:defaultValue="true" />
+ <!-- android:dependency="ui_dock_enabled" /-->
+</PreferenceScreen>
diff --git a/res/xml/preferences_drawer.xml b/res/xml/preferences_drawer.xml
new file mode 100644
index 000000000..3b4a3ef21
--- /dev/null
+++ b/res/xml/preferences_drawer.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+ 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.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
+ android:key="ui_drawer"
+ android:title="@string/preferences_interface_drawer_title">
+ <ListPreference android:key="ui_drawer_orientation"
+ android:title="@string/preferences_interface_drawer_orientation_title"
+ android:summary="@string/preferences_interface_drawer_orientation_summary"
+ android:entries="@array/preferences_interface_drawer_orientation_entries"
+ android:entryValues="@array/preferences_interface_drawer_orientation_values"
+ android:defaultValue="horizontal" />
+ <Preference android:key="ui_drawer_hidden_apps"
+ android:title="@string/preferences_interface_drawer_hidden_apps_title"
+ android:summary="@string/preferences_interface_drawer_hidden_apps_summary">
+ <intent
+ android:targetPackage="com.cyanogenmod.trebuchet"
+ android:targetClass="com.cyanogenmod.trebuchet.preference.HiddenAppsActivity"/>
+ </Preference>
+ <PreferenceCategory android:title="@string/preferences_interface_drawer_widgets_category">
+ <CheckBoxPreference android:key="ui_drawer_widgets_join_apps"
+ android:title="@string/preferences_interface_drawer_widgets_join_apps_title"
+ android:summary="@string/preferences_interface_drawer_widgets_join_apps_summary"
+ android:defaultValue="true" />
+ </PreferenceCategory>
+ <PreferenceCategory android:title="@string/preferences_interface_drawer_scrolling_category">
+ <ListPreference android:key="ui_drawer_scrolling_transition_effect"
+ android:title="@string/preferences_interface_drawer_scrolling_transition_effect_title"
+ android:summary="@string/preferences_interface_drawer_scrolling_transition_effect_summary"
+ android:entries="@array/preferences_interface_drawer_scrolling_transition_effect_entries"
+ android:entryValues="@array/preferences_interface_drawer_scrolling_transition_effect_values"
+ android:defaultValue="@string/config_drawerDefaultTransitionEffect" />
+ <CheckBoxPreference android:key="ui_drawer_scrolling_fade_adjacent_screens"
+ android:title="@string/preferences_interface_drawer_scrolling_fade_adjacent_screens_title"
+ android:summary="@string/preferences_interface_drawer_scrolling_fade_adjacent_screens_summary" />
+ </PreferenceCategory>
+ <PreferenceCategory android:title="@string/preferences_interface_drawer_indicator_category">
+ <CheckBoxPreference android:key="ui_drawer_indicator_enable"
+ android:title="@string/preferences_interface_drawer_indicator_enable_title"
+ android:summary="@string/preferences_interface_drawer_indicator_enable_summary"
+ android:defaultValue="true" />
+ <CheckBoxPreference android:key="ui_drawer_indicator_fade"
+ android:title="@string/preferences_interface_drawer_indicator_fade_title"
+ android:summary="@string/preferences_interface_drawer_indicator_fade_summary"
+ android:defaultValue="true"
+ android:dependency="ui_drawer_indicator_enable" />
+ <ListPreference android:key="ui_drawer_indicator_position"
+ android:title="@string/preferences_interface_drawer_indicator_position_title"
+ android:summary="@string/preferences_interface_drawer_indicator_position_summary"
+ android:entries="@array/preferences_interface_drawer_indicator_position_entries"
+ android:entryValues="@array/preferences_interface_drawer_indicator_position_values"
+ android:defaultValue="0"
+ android:dependency="ui_drawer_indicator_enable" />
+ </PreferenceCategory>
+</PreferenceScreen> \ No newline at end of file
diff --git a/res/xml/preferences_general.xml b/res/xml/preferences_general.xml
new file mode 100644
index 000000000..abe0cf881
--- /dev/null
+++ b/res/xml/preferences_general.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+ 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.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
+ android:key="ui_general"
+ android:title="@string/preferences_interface_general_title">
+ <CheckBoxPreference android:key="ui_general_orientation"
+ android:title="@string/preferences_interface_general_orientation_title" />
+ <CheckBoxPreference android:key="ui_general_fullscreen"
+ android:title="@string/preferences_interface_general_fullscreen_title"
+ android:summary="@string/preferences_interface_general_fullscreen_summary" />
+</PreferenceScreen> \ No newline at end of file
diff --git a/res/xml/preferences_headers.xml b/res/xml/preferences_headers.xml
new file mode 100644
index 000000000..462fc64ce
--- /dev/null
+++ b/res/xml/preferences_headers.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+ 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.
+-->
+
+<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <header android:id="@+id/preferences_homescreen_section"
+ android:fragment="com.cyanogenmod.trebuchet.preference.Preferences$HomescreenFragment"
+ android:title="@string/preferences_interface_homescreen_title"
+ android:summary="@string/preferences_interface_homescreen_summary" />
+
+ <header android:id="@+id/preferences_drawer_section"
+ android:fragment="com.cyanogenmod.trebuchet.preference.Preferences$DrawerFragment"
+ android:title="@string/preferences_interface_drawer_title"
+ android:summary="@string/preferences_interface_drawer_summary" />
+
+ <header android:id="@+id/preferences_dock_section"
+ android:fragment="com.cyanogenmod.trebuchet.preference.Preferences$DockFragment"
+ android:title="@string/preferences_interface_dock_title" />
+
+ <header android:id="@+id/preferences_general_section"
+ android:fragment="com.cyanogenmod.trebuchet.preference.Preferences$GeneralFragment"
+ android:title="@string/preferences_interface_general_title" />
+
+ <header android:id="@+id/preferences_application_section"
+ android:title="@string/preferences_application_title" />
+
+ <header android:id="@+id/preferences_application_version"
+ android:summary="@string/application_copyright" />
+
+</preference-headers>
diff --git a/res/xml/preferences_homescreen.xml b/res/xml/preferences_homescreen.xml
new file mode 100644
index 000000000..862ab20c5
--- /dev/null
+++ b/res/xml/preferences_homescreen.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+ 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.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet"
+ android:key="ui_homescreen"
+ android:title="@string/preferences_interface_homescreen_title">
+ <PreferenceCategory android:title="@string/preferences_interface_homescreen_general_category">
+ <com.cyanogenmod.trebuchet.preference.DoubleNumberPickerPreference android:key="ui_homescreen_grid"
+ android:title="@string/preferences_interface_homescreen_general_grid_title"
+ android:summary="@string/preferences_interface_homescreen_general_grid_summary"
+ launcher:pickerTitle1="@string/preferences_interface_homescreen_general_grid_rows_title"
+ launcher:pickerTitle2="@string/preferences_interface_homescreen_general_grid_columns_title"
+ launcher:defaultValue1="@integer/target_cell_count_x"
+ launcher:defaultValue2="@integer/target_cell_count_y"
+ launcher:max1="7"
+ launcher:min1="3"
+ launcher:max2="7"
+ launcher:min2="3" />
+ <com.cyanogenmod.trebuchet.preference.NumberPickerPreference android:key="ui_homescreen_screens"
+ android:title="@string/preferences_interface_homescreen_general_screens_title"
+ android:summary="@string/preferences_interface_homescreen_general_screens_summary"
+ android:defaultValue="5"
+ launcher:max="7"
+ launcher:min="1" />
+ <com.cyanogenmod.trebuchet.preference.NumberPickerPreference android:key="ui_homescreen_default_screen"
+ android:title="@string/preferences_interface_homescreen_general_default_screen_title"
+ android:summary="@string/preferences_interface_homescreen_general_default_screen_summary"
+ android:defaultValue="3"
+ launcher:maxExternal="ui_homescreen_screens"
+ launcher:max="7"
+ launcher:min="1" />
+ <CheckBoxPreference android:key="ui_homescreen_stretch_screens"
+ android:title="@string/preferences_interface_homescreen_general_stretch_screens_title"
+ android:summary="@string/preferences_interface_homescreen_general_stretch_screens_summary" />
+ <CheckBoxPreference android:key="ui_homescreen_general_search"
+ android:title="@string/preferences_interface_homescreen_general_search_title"
+ android:summary="@string/preferences_interface_homescreen_general_search_summary"
+ android:defaultValue="true" />
+ <CheckBoxPreference android:key="ui_homescreen_general_hide_icon_labels"
+ android:title="@string/preferences_interface_homescreen_general_hide_icon_labels_title"
+ android:summary="@string/preferences_interface_homescreen_general_hide_icon_labels_summary" />
+ </PreferenceCategory>
+ <PreferenceCategory android:title="@string/preferences_interface_homescreen_scrolling_category">
+ <ListPreference android:key="ui_homescreen_scrolling_transition_effect"
+ android:title="@string/preferences_interface_homescreen_scrolling_transition_effect_title"
+ android:summary="@string/preferences_interface_homescreen_scrolling_transition_effect_summary"
+ android:entries="@array/preferences_interface_homescreen_scrolling_transition_effect_entries"
+ android:entryValues="@array/preferences_interface_homescreen_scrolling_transition_effect_values"
+ android:defaultValue="@string/config_workspaceDefaultTransitionEffect" />
+ <CheckBoxPreference android:key="ui_homescreen_scrolling_scroll_wallpaper"
+ android:title="@string/preferences_interface_homescreen_scrolling_scroll_wallpaper_title"
+ android:summary="@string/preferences_interface_homescreen_scrolling_scroll_wallpaper_summary"
+ android:defaultValue="true" />
+ <CheckBoxPreference android:key="ui_homescreen_scrolling_wallpaper_hack"
+ android:title="@string/preferences_interface_homescreen_scrolling_wallpaper_hack_title"
+ android:summary="@string/preferences_interface_homescreen_scrolling_wallpaper_hack_summary"
+ android:defaultValue="@bool/config_workspaceDefaultWallpaperHack" />
+ <com.cyanogenmod.trebuchet.preference.NumberPickerPreference android:key="ui_homescreen_scrolling_wallpaper_size"
+ android:title="@string/preferences_interface_homescreen_scrolling_wallpaper_size_title"
+ android:summary="@string/preferences_interface_homescreen_scrolling_wallpaper_size_summary"
+ android:defaultValue="2"
+ launcher:max="5"
+ launcher:min="2" />
+ <CheckBoxPreference android:key="ui_homescreen_scrolling_fade_adjacent_screens"
+ android:title="@string/preferences_interface_homescreen_scrolling_fade_adjacent_screens_title"
+ android:summary="@string/preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary"
+ android:defaultValue="@bool/config_workspaceDefualtFadeInAdjacentScreens" />
+ <CheckBoxPreference android:key="ui_homescreen_scrolling_show_outlines"
+ android:title="@string/preferences_interface_homescreen_scrolling_show_outlines_title"
+ android:summary="@string/preferences_interface_homescreen_scrolling_show_outlines_summary"
+ android:defaultValue="@bool/config_workspaceDefaultShowOutlines" />
+ </PreferenceCategory>
+ <PreferenceCategory android:title="@string/preferences_interface_homescreen_indicator_category">
+ <CheckBoxPreference android:key="ui_homescreen_indicator_enable"
+ android:title="@string/preferences_interface_homescreen_indicator_enable_title"
+ android:summary="@string/preferences_interface_homescreen_indicator_enable_summary"
+ android:defaultValue="true" />
+ <CheckBoxPreference android:key="ui_homescreen_indicator_fade"
+ android:title="@string/preferences_interface_homescreen_indicator_fade_title"
+ android:summary="@string/preferences_interface_homescreen_indicator_fade_summary"
+ android:defaultValue="true"
+ android:dependency="ui_homescreen_indicator_enable" />
+ <ListPreference android:key="ui_homescreen_indicator_position"
+ android:title="@string/preferences_interface_homescreen_indicator_position_title"
+ android:summary="@string/preferences_interface_homescreen_indicator_position_summary"
+ android:entries="@array/preferences_interface_homescreen_indicator_position_entries"
+ android:entryValues="@array/preferences_interface_homescreen_indicator_position_values"
+ android:defaultValue="0"
+ android:dependency="ui_homescreen_indicator_enable" />
+ </PreferenceCategory>
+</PreferenceScreen>
diff --git a/res/xml/update_workspace.xml b/res/xml/update_workspace.xml
index 44a3f9efa..b93e29cdf 100644
--- a/res/xml/update_workspace.xml
+++ b/res/xml/update_workspace.xml
@@ -14,9 +14,8 @@
limitations under the License.
-->
-<favorites xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher">
- <!-- Update the db with new hotseat items. Note that we reference the browser's original
- package name. -->
+<favorites xmlns:launcher="http://schemas.android.com/apk/res/com.cyanogenmod.trebuchet">
+ <!-- Update the db with new hotseat all apps button. -->
<!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
<favorite
launcher:packageName="com.android.contacts"
@@ -29,21 +28,26 @@
launcher:packageName="com.android.contacts"
launcher:className="com.android.contacts.activities.PeopleActivity"
launcher:container="-101"
- launcher:screen="1"
+ launcher:screen="0"
launcher:x="1"
launcher:y="0" />
+ <allapps
+ launcher:container="-101"
+ launcher:screen="0"
+ launcher:x="2"
+ launcher:y="0" />
<favorite
launcher:packageName="com.android.mms"
launcher:className="com.android.mms.ui.ConversationList"
launcher:container="-101"
- launcher:screen="3"
+ launcher:screen="0"
launcher:x="3"
launcher:y="0" />
<favorite
launcher:packageName="com.android.browser"
launcher:className="com.android.browser.BrowserActivity"
launcher:container="-101"
- launcher:screen="4"
+ launcher:screen="0"
launcher:x="4"
launcher:y="0" />
</favorites>
diff --git a/src/com/android/launcher2/HandleView.java b/src/com/android/launcher2/HandleView.java
deleted file mode 100644
index d77138b0a..000000000
--- a/src/com/android/launcher2/HandleView.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-
-package com.android.launcher2;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.util.AttributeSet;
-import android.view.MotionEvent;
-import android.view.View;
-import android.widget.ImageView;
-
-import com.android.launcher.R;
-
-public class HandleView extends ImageView {
- private static final int ORIENTATION_HORIZONTAL = 1;
-
- private Launcher mLauncher;
- private int mOrientation = ORIENTATION_HORIZONTAL;
-
- public HandleView(Context context) {
- super(context);
- }
-
- public HandleView(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- public HandleView(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
-
- TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.HandleView, defStyle, 0);
- mOrientation = a.getInt(R.styleable.HandleView_direction, ORIENTATION_HORIZONTAL);
- a.recycle();
-
- setContentDescription(context.getString(R.string.all_apps_button_label));
- }
-
- @Override
- public View focusSearch(int direction) {
- View newFocus = super.focusSearch(direction);
- if (newFocus == null && !mLauncher.isAllAppsVisible()) {
- final Workspace workspace = mLauncher.getWorkspace();
- workspace.dispatchUnhandledMove(null, direction);
- return (mOrientation == ORIENTATION_HORIZONTAL && direction == FOCUS_DOWN) ?
- this : workspace;
- }
- return newFocus;
- }
-
- @Override
- public boolean onTouchEvent(MotionEvent ev) {
- if (ev.getAction() == MotionEvent.ACTION_DOWN && mLauncher.isAllAppsVisible()) {
- return false;
- }
- return super.onTouchEvent(ev);
- }
-
- void setLauncher(Launcher launcher) {
- mLauncher = launcher;
- }
-}
diff --git a/src/com/android/launcher2/Hotseat.java b/src/com/android/launcher2/Hotseat.java
deleted file mode 100644
index c122695eb..000000000
--- a/src/com/android/launcher2/Hotseat.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.launcher2;
-
-import android.content.Context;
-import android.content.res.Configuration;
-import android.content.res.Resources;
-import android.content.res.TypedArray;
-import android.util.AttributeSet;
-import android.view.LayoutInflater;
-import android.view.MotionEvent;
-import android.view.View;
-import android.widget.FrameLayout;
-
-import com.android.launcher.R;
-
-public class Hotseat extends FrameLayout {
- @SuppressWarnings("unused")
- private static final String TAG = "Hotseat";
-
- private Launcher mLauncher;
- private CellLayout mContent;
-
- private int mCellCountX;
- private int mCellCountY;
- private int mAllAppsButtonRank;
-
- private boolean mTransposeLayoutWithOrientation;
- private boolean mIsLandscape;
-
- public Hotseat(Context context) {
- this(context, null);
- }
-
- public Hotseat(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- public Hotseat(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
-
- TypedArray a = context.obtainStyledAttributes(attrs,
- R.styleable.Hotseat, defStyle, 0);
- Resources r = context.getResources();
- mCellCountX = a.getInt(R.styleable.Hotseat_cellCountX, -1);
- mCellCountY = a.getInt(R.styleable.Hotseat_cellCountY, -1);
- mAllAppsButtonRank = r.getInteger(R.integer.hotseat_all_apps_index);
- mTransposeLayoutWithOrientation =
- r.getBoolean(R.bool.hotseat_transpose_layout_with_orientation);
- mIsLandscape = context.getResources().getConfiguration().orientation ==
- Configuration.ORIENTATION_LANDSCAPE;
- }
-
- public void setup(Launcher launcher) {
- mLauncher = launcher;
- setOnKeyListener(new HotseatIconKeyEventListener());
- }
-
- CellLayout getLayout() {
- return mContent;
- }
-
- private boolean hasVerticalHotseat() {
- return (mIsLandscape && mTransposeLayoutWithOrientation);
- }
-
- /* Get the orientation invariant order of the item in the hotseat for persistence. */
- int getOrderInHotseat(int x, int y) {
- return hasVerticalHotseat() ? (mContent.getCountY() - y - 1) : x;
- }
- /* Get the orientation specific coordinates given an invariant order in the hotseat. */
- int getCellXFromOrder(int rank) {
- return hasVerticalHotseat() ? 0 : rank;
- }
- int getCellYFromOrder(int rank) {
- return hasVerticalHotseat() ? (mContent.getCountY() - (rank + 1)) : 0;
- }
- public boolean isAllAppsButtonRank(int rank) {
- return rank == mAllAppsButtonRank;
- }
-
- @Override
- protected void onFinishInflate() {
- super.onFinishInflate();
- if (mCellCountX < 0) mCellCountX = LauncherModel.getCellCountX();
- if (mCellCountY < 0) mCellCountY = LauncherModel.getCellCountY();
- mContent = (CellLayout) findViewById(R.id.layout);
- mContent.setGridSize(mCellCountX, mCellCountY);
- mContent.setIsHotseat(true);
-
- resetLayout();
- }
-
- void resetLayout() {
- mContent.removeAllViewsInLayout();
-
- // Add the Apps button
- Context context = getContext();
- LayoutInflater inflater = LayoutInflater.from(context);
- BubbleTextView allAppsButton = (BubbleTextView)
- inflater.inflate(R.layout.application, mContent, false);
- allAppsButton.setCompoundDrawablesWithIntrinsicBounds(null,
- context.getResources().getDrawable(R.drawable.all_apps_button_icon), null, null);
- allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label));
- allAppsButton.setOnTouchListener(new View.OnTouchListener() {
- @Override
- public boolean onTouch(View v, MotionEvent event) {
- if (mLauncher != null &&
- (event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) {
- mLauncher.onTouchDownAllAppsButton(v);
- }
- return false;
- }
- });
-
- allAppsButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(android.view.View v) {
- if (mLauncher != null) {
- mLauncher.onClickAllAppsButton(v);
- }
- }
- });
-
- // 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(mAllAppsButtonRank);
- int y = getCellYFromOrder(mAllAppsButtonRank);
- CellLayout.LayoutParams lp = new CellLayout.LayoutParams(x,y,1,1);
- lp.canReorder = false;
- mContent.addViewToCellLayout(allAppsButton, -1, 0, lp, true);
- }
-}
diff --git a/src/com/android/launcher2/SmoothPagedView.java b/src/com/android/launcher2/SmoothPagedView.java
deleted file mode 100644
index 7e47f1a3f..000000000
--- a/src/com/android/launcher2/SmoothPagedView.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-package com.android.launcher2;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.animation.Interpolator;
-import android.widget.Scroller;
-
-public abstract class SmoothPagedView extends PagedView {
- private static final float SMOOTHING_SPEED = 0.75f;
- private static final float SMOOTHING_CONSTANT = (float) (0.016 / Math.log(SMOOTHING_SPEED));
-
- private float mBaseLineFlingVelocity;
- private float mFlingVelocityInfluence;
-
- static final int DEFAULT_MODE = 0;
- static final int X_LARGE_MODE = 1;
-
- int mScrollMode;
-
- private Interpolator mScrollInterpolator;
-
- public static class OvershootInterpolator implements Interpolator {
- private static final float DEFAULT_TENSION = 1.3f;
- private float mTension;
-
- public OvershootInterpolator() {
- mTension = DEFAULT_TENSION;
- }
-
- public void setDistance(int distance) {
- mTension = distance > 0 ? DEFAULT_TENSION / distance : DEFAULT_TENSION;
- }
-
- public void disableSettle() {
- mTension = 0.f;
- }
-
- public float getInterpolation(float t) {
- // _o(t) = t * t * ((tension + 1) * t + tension)
- // o(t) = _o(t - 1) + 1
- t -= 1.0f;
- return t * t * ((mTension + 1) * t + mTension) + 1.0f;
- }
- }
-
- /**
- * Used to inflate the Workspace from XML.
- *
- * @param context The application's context.
- * @param attrs The attributes set containing the Workspace's customization values.
- */
- public SmoothPagedView(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- /**
- * Used to inflate the Workspace from XML.
- *
- * @param context The application's context.
- * @param attrs The attributes set containing the Workspace's customization values.
- * @param defStyle Unused.
- */
- public SmoothPagedView(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
-
- mUsePagingTouchSlop = false;
-
- // This means that we'll take care of updating the scroll parameter ourselves (we do it
- // in computeScroll), we only do this in the OVERSHOOT_MODE, ie. on phones
- mDeferScrollUpdate = mScrollMode != X_LARGE_MODE;
- }
-
- protected int getScrollMode() {
- return X_LARGE_MODE;
- }
-
- /**
- * Initializes various states for this workspace.
- */
- @Override
- protected void init() {
- super.init();
-
- mScrollMode = getScrollMode();
- if (mScrollMode == DEFAULT_MODE) {
- mBaseLineFlingVelocity = 2500.0f;
- mFlingVelocityInfluence = 0.4f;
- mScrollInterpolator = new OvershootInterpolator();
- mScroller = new Scroller(getContext(), mScrollInterpolator);
- }
- }
-
- @Override
- protected void snapToDestination() {
- if (mScrollMode == X_LARGE_MODE) {
- super.snapToDestination();
- } else {
- snapToPageWithVelocity(getPageNearestToCenterOfScreen(), 0);
- }
- }
-
- @Override
- protected void snapToPageWithVelocity(int whichPage, int velocity) {
- if (mScrollMode == X_LARGE_MODE) {
- super.snapToPageWithVelocity(whichPage, velocity);
- } else {
- snapToPageWithVelocity(whichPage, 0, true);
- }
- }
-
- private void snapToPageWithVelocity(int whichPage, int velocity, boolean settle) {
- // if (!mScroller.isFinished()) return;
-
- whichPage = Math.max(0, Math.min(whichPage, getChildCount() - 1));
-
- final int screenDelta = Math.max(1, Math.abs(whichPage - mCurrentPage));
- final int newX = getChildOffset(whichPage) - getRelativeChildOffset(whichPage);
- final int delta = newX - mUnboundedScrollX;
- int duration = (screenDelta + 1) * 100;
-
- if (!mScroller.isFinished()) {
- mScroller.abortAnimation();
- }
-
- if (settle) {
- ((OvershootInterpolator) mScrollInterpolator).setDistance(screenDelta);
- } else {
- ((OvershootInterpolator) mScrollInterpolator).disableSettle();
- }
-
- velocity = Math.abs(velocity);
- if (velocity > 0) {
- duration += (duration / (velocity / mBaseLineFlingVelocity)) * mFlingVelocityInfluence;
- } else {
- duration += 100;
- }
-
- snapToPage(whichPage, delta, duration);
- }
-
- @Override
- protected void snapToPage(int whichPage) {
- if (mScrollMode == X_LARGE_MODE) {
- super.snapToPage(whichPage);
- } else {
- snapToPageWithVelocity(whichPage, 0, false);
- }
- }
-
- @Override
- public void computeScroll() {
- if (mScrollMode == X_LARGE_MODE) {
- super.computeScroll();
- } else {
- boolean scrollComputed = computeScrollHelper();
-
- if (!scrollComputed && mTouchState == TOUCH_STATE_SCROLLING) {
- final float now = System.nanoTime() / NANOTIME_DIV;
- final float e = (float) Math.exp((now - mSmoothingTime) / SMOOTHING_CONSTANT);
-
- final float dx = mTouchX - mUnboundedScrollX;
- scrollTo(Math.round(mUnboundedScrollX + dx * e), getScrollY());
- mSmoothingTime = now;
-
- // Keep generating points as long as we're more than 1px away from the target
- if (dx > 1.f || dx < -1.f) {
- invalidate();
- }
- }
- }
- }
-}
diff --git a/src/com/android/launcher2/SymmetricalLinearTween.java b/src/com/android/launcher2/SymmetricalLinearTween.java
deleted file mode 100644
index da02242c8..000000000
--- a/src/com/android/launcher2/SymmetricalLinearTween.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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.
- * 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.
- */
-
-package com.android.launcher2;
-
-import android.os.Handler;
-import android.os.SystemClock;
-
-/**
- * Provides an animation between 0.0f and 1.0f over a given duration.
- */
-class SymmetricalLinearTween {
-
- private static final int FPS = 30;
- private static final int FRAME_TIME = 1000 / FPS;
-
- Handler mHandler;
- int mDuration;
- TweenCallback mCallback;
-
- boolean mRunning;
- long mBase;
- boolean mDirection;
- float mValue;
-
- /**
- * @param duration milliseconds duration
- * @param callback callbacks
- */
- public SymmetricalLinearTween(boolean initial, int duration, TweenCallback callback) {
- mValue = initial ? 1.0f : 0.0f;
- mDirection = initial;
- mDuration = duration;
- mCallback = callback;
- mHandler = new Handler();
- }
-
- /**
- * Starts the tweening.
- *
- * @param direction If direction is true, the value goes towards 1.0f. If direction
- * is false, the value goes towards 0.0f.
- */
- public void start(boolean direction) {
- start(direction, SystemClock.uptimeMillis());
- }
-
- /**
- * Starts the tweening.
- *
- * @param direction If direction is true, the value goes towards 1.0f. If direction
- * is false, the value goes towards 0.0f.
- * @param baseTime The time to use as zero for this animation, in the
- * {@link SystemClock.uptimeMillis} time base. This allows you to
- * synchronize multiple animations.
- */
- public void start(boolean direction, long baseTime) {
- if (direction != mDirection) {
- if (!mRunning) {
- mBase = baseTime;
- mRunning = true;
- mCallback.onTweenStarted();
- long next = SystemClock.uptimeMillis() + FRAME_TIME;
- mHandler.postAtTime(mTick, next);
- } else {
- // reverse direction
- long now = SystemClock.uptimeMillis();
- long diff = now - mBase;
- mBase = now + diff - mDuration;
- }
- mDirection = direction;
- }
- }
-
- Runnable mTick = new Runnable() {
- public void run() {
- long base = mBase;
- long now = SystemClock.uptimeMillis();
- long diff = now-base;
- int duration = mDuration;
- float val = diff/(float)duration;
- if (!mDirection) {
- val = 1.0f - val;
- }
- if (val > 1.0f) {
- val = 1.0f;
- } else if (val < 0.0f) {
- val = 0.0f;
- }
- float old = mValue;
- mValue = val;
- mCallback.onTweenValueChanged(val, old);
- int frame = (int)(diff / FRAME_TIME);
- long next = base + ((frame+1)*FRAME_TIME);
- if (diff < duration) {
- mHandler.postAtTime(this, next);
- }
- if (diff >= duration) {
- mCallback.onTweenFinished();
- mRunning = false;
- }
- }
- };
-}
-
diff --git a/src/com/android/launcher2/TweenCallback.java b/src/com/android/launcher2/TweenCallback.java
deleted file mode 100644
index 380a21774..000000000
--- a/src/com/android/launcher2/TweenCallback.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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.
- * 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.
- */
-
-package com.android.launcher2;
-
-interface TweenCallback {
- void onTweenValueChanged(float value, float oldValue);
- void onTweenStarted();
- void onTweenFinished();
-}
-
diff --git a/src/com/android/launcher2/AccessibleTabView.java b/src/com/cyanogenmod/trebuchet/AccessibleTabView.java
index 101f139e7..de5a6893f 100644
--- a/src/com/android/launcher2/AccessibleTabView.java
+++ b/src/com/cyanogenmod/trebuchet/AccessibleTabView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.util.AttributeSet;
diff --git a/src/com/android/launcher2/AddAdapter.java b/src/com/cyanogenmod/trebuchet/AddAdapter.java
index c0bb17b72..8f4e8fcfd 100644
--- a/src/com/android/launcher2/AddAdapter.java
+++ b/src/com/cyanogenmod/trebuchet/AddAdapter.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.content.res.Resources;
@@ -27,7 +27,7 @@ import android.widget.TextView;
import java.util.ArrayList;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
/**
* Adapter showing the types of items that can be added to a {@link Workspace}.
diff --git a/src/com/android/launcher2/Alarm.java b/src/com/cyanogenmod/trebuchet/Alarm.java
index 7cd21c327..61efce42f 100644
--- a/src/com/android/launcher2/Alarm.java
+++ b/src/com/cyanogenmod/trebuchet/Alarm.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.os.Handler;
diff --git a/src/com/android/launcher2/AllAppsList.java b/src/com/cyanogenmod/trebuchet/AllAppsList.java
index 051b0bd1d..bab47c99d 100644
--- a/src/com/android/launcher2/AllAppsList.java
+++ b/src/com/cyanogenmod/trebuchet/AllAppsList.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import java.util.ArrayList;
import java.util.List;
@@ -135,9 +135,7 @@ class AllAppsList {
// Find enabled activities and add them to the adapter
// Also updates existing activities with new labels/icons
- int count = matches.size();
- for (int i = 0; i < count; i++) {
- final ResolveInfo info = matches.get(i);
+ for (final ResolveInfo info : matches) {
ApplicationInfo applicationInfo = findApplicationInfoLocked(
info.activityInfo.applicationInfo.packageName,
info.activityInfo.name);
@@ -195,9 +193,7 @@ class AllAppsList {
* Returns whether <em>apps</em> contains <em>component</em>.
*/
private static boolean findActivity(ArrayList<ApplicationInfo> apps, ComponentName component) {
- final int N = apps.size();
- for (int i=0; i<N; i++) {
- final ApplicationInfo info = apps.get(i);
+ for (final ApplicationInfo info : apps) {
if (info.componentName.equals(component)) {
return true;
}
diff --git a/src/com/android/launcher2/AppWidgetResizeFrame.java b/src/com/cyanogenmod/trebuchet/AppWidgetResizeFrame.java
index 13ee6f913..48d41160d 100644
--- a/src/com/android/launcher2/AppWidgetResizeFrame.java
+++ b/src/com/cyanogenmod/trebuchet/AppWidgetResizeFrame.java
@@ -1,4 +1,4 @@
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
@@ -13,8 +13,6 @@ import android.view.Gravity;
import android.widget.FrameLayout;
import android.widget.ImageView;
-import com.android.launcher.R;
-
public class AppWidgetResizeFrame extends FrameLayout {
private LauncherAppWidgetHostView mWidgetView;
private CellLayout mCellLayout;
@@ -66,11 +64,6 @@ public class AppWidgetResizeFrame extends FrameLayout {
private static Rect mTmpRect = new Rect();
- public static final int LEFT = 0;
- public static final int TOP = 1;
- public static final int RIGHT = 2;
- public static final int BOTTOM = 3;
-
private Launcher mLauncher;
public AppWidgetResizeFrame(Context context,
@@ -124,13 +117,10 @@ public class AppWidgetResizeFrame extends FrameLayout {
mWidgetPaddingRight = p.right;
mWidgetPaddingBottom = p.bottom;
- if (mResizeMode == AppWidgetProviderInfo.RESIZE_HORIZONTAL) {
- mTopHandle.setVisibility(GONE);
- mBottomHandle.setVisibility(GONE);
- } else if (mResizeMode == AppWidgetProviderInfo.RESIZE_VERTICAL) {
- mLeftHandle.setVisibility(GONE);
- mRightHandle.setVisibility(GONE);
- }
+ // Resize any widget
+ mResizeMode = AppWidgetProviderInfo.RESIZE_BOTH;
+ mMinHSpan = 1;
+ mMinVSpan = 1;
final float density = mLauncher.getResources().getDisplayMetrics().density;
mBackgroundPadding = (int) Math.ceil(density * BACKGROUND_PADDING);
diff --git a/src/com/android/launcher2/ApplicationInfo.java b/src/com/cyanogenmod/trebuchet/ApplicationInfo.java
index a3040d4cd..e5a45872b 100644
--- a/src/com/android/launcher2/ApplicationInfo.java
+++ b/src/com/cyanogenmod/trebuchet/ApplicationInfo.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.ComponentName;
import android.content.Intent;
@@ -31,7 +31,7 @@ import java.util.HashMap;
* Represents an app in AllAppsView.
*/
class ApplicationInfo extends ItemInfo {
- private static final String TAG = "Launcher2.ApplicationInfo";
+ private static final String TAG = "Trebuchet.ApplicationInfo";
/**
* The intent used to start the application.
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java
index 4bfeb60b8..9f7595d96 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
@@ -59,8 +59,8 @@ import android.widget.GridLayout;
import android.widget.ImageView;
import android.widget.Toast;
-import com.android.launcher.R;
-import com.android.launcher2.DropTarget.DragObject;
+import com.cyanogenmod.trebuchet.DropTarget.DragObject;
+import com.cyanogenmod.trebuchet.preference.PreferencesProvider;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
@@ -83,16 +83,6 @@ class AsyncTaskPageData {
LoadWidgetPreviewData
}
- AsyncTaskPageData(int p, ArrayList<Object> l, ArrayList<Bitmap> si, AsyncTaskCallback bgR,
- AsyncTaskCallback postR) {
- page = p;
- items = l;
- sourceImages = si;
- generatedImages = new ArrayList<Bitmap>();
- maxImageWidth = maxImageHeight = -1;
- doInBackgroundCallback = bgR;
- postExecuteCallback = postR;
- }
AsyncTaskPageData(int p, ArrayList<Object> l, int cw, int ch, AsyncTaskCallback bgR,
AsyncTaskCallback postR) {
page = p;
@@ -136,8 +126,9 @@ class AsyncTaskPageData {
* A generic template for an async task used in AppsCustomize.
*/
class AppsCustomizeAsyncTask extends AsyncTask<AsyncTaskPageData, Void, AsyncTaskPageData> {
- AppsCustomizeAsyncTask(int p, AsyncTaskPageData.Type ty) {
+ AppsCustomizeAsyncTask(int p, AppsCustomizePagedView.ContentType t, AsyncTaskPageData.Type ty) {
page = p;
+ pageContentType = t;
threadPriority = Process.THREAD_PRIORITY_DEFAULT;
dataType = ty;
}
@@ -164,6 +155,7 @@ class AppsCustomizeAsyncTask extends AsyncTask<AsyncTaskPageData, Void, AsyncTas
// The page that this async task is associated with
AsyncTaskPageData.Type dataType;
int page;
+ AppsCustomizePagedView.ContentType pageContentType;
int threadPriority;
}
@@ -232,7 +224,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
View.OnClickListener, View.OnKeyListener, DragSource,
PagedViewIcon.PressedCallback, PagedViewWidget.ShortPressListener,
LauncherTransitionable {
- static final String TAG = "AppsCustomizePagedView";
+ private static final String TAG = "Trebuchet.AppsCustomizePagedView";
/**
* The different content types that this paged view can show.
@@ -242,6 +234,19 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
Widgets
}
+ /**
+ * The sorting mode of the apps.
+ */
+ public enum SortMode {
+ Title,
+ InstallDate
+ }
+
+ private int mFilterApps = FILTER_APPS_SYSTEM_FLAG | FILTER_APPS_DOWNLOADED_FLAG;
+
+ private static final int FILTER_APPS_SYSTEM_FLAG = 1;
+ private static final int FILTER_APPS_DOWNLOADED_FLAG = 2;
+
// Refs
private Launcher mLauncher;
private DragController mDragController;
@@ -253,11 +258,16 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
private PagedViewIcon mPressedIcon;
// Content
+ private ContentType mContentType;
+ private SortMode mSortMode = SortMode.Title;
private ArrayList<ApplicationInfo> mApps;
+ private ArrayList<ApplicationInfo> mFilteredApps;
+ private ArrayList<ComponentName> mHiddenApps;
private ArrayList<Object> mWidgets;
// Cling
private boolean mHasShownAllAppsCling;
+ private boolean mHasShownAllAppsSortCling;
private int mClingFocusedX;
private int mClingFocusedY;
@@ -271,20 +281,39 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
private int mMaxAppCellCountX, mMaxAppCellCountY;
private int mWidgetCountX, mWidgetCountY;
private int mWidgetWidthGap, mWidgetHeightGap;
- private final float sWidgetPreviewIconPaddingPercentage = 0.25f;
+ private final int mWidgetPreviewIconPaddedDimension;
+ private static final float WIDGET_PREVIEW_ICON_PADDING_PERCENTAGE = 0.25f;
private PagedViewCellLayout mWidgetSpacingLayout;
- private int mNumAppsPages;
- private int mNumWidgetPages;
+ private int mNumAppsPages = 0;
+ private int mNumWidgetPages = 0;
// Relating to the scroll and overscroll effects
Workspace.ZInterpolator mZInterpolator = new Workspace.ZInterpolator(0.5f);
- private static float CAMERA_DISTANCE = 6500;
- private static float TRANSITION_SCALE_FACTOR = 0.74f;
- private static float TRANSITION_PIVOT = 0.65f;
- private static float TRANSITION_MAX_ROTATION = 22;
- private static final boolean PERFORM_OVERSCROLL_ROTATION = true;
+ private static final float TRANSITION_PIVOT = 0.65f;
+ private static final float TRANSITION_MAX_ROTATION = 22;
+ private static final float TRANSITION_SCREEN_ROTATION = 12.5f;
+ private boolean mScrollTransformsDirty = false;
+ private boolean mOverscrollTransformsDirty = false;
+ private int mCameraDistance;
private AccelerateInterpolator mAlphaInterpolator = new AccelerateInterpolator(0.9f);
private DecelerateInterpolator mLeftScreenAlphaInterpolator = new DecelerateInterpolator(4);
+ public enum TransitionEffect {
+ Standard,
+ Tablet,
+ ZoomIn,
+ ZoomOut,
+ RotateUp,
+ RotateDown,
+ Spin,
+ Flip,
+ CubeIn,
+ CubeOut,
+ Stack,
+ Accordian,
+ CylinderIn,
+ CylinderOut
+ }
+ private TransitionEffect mTransitionEffect = TransitionEffect.Standard;
// Previews & outlines
ArrayList<AppsCustomizeAsyncTask> mRunningTasks;
@@ -323,18 +352,54 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
RectCache mCachedAppWidgetPreviewDestRect = new RectCache();
PaintCache mCachedAppWidgetPreviewPaint = new PaintCache();
+ // Preferences
+ private boolean mJoinWidgetsApps;
+ private boolean mFadeScrollingIndicator;
+ private int mScrollingIndicatorPosition;
+
+ private static final int SCROLLING_INDICATOR_TOP = 1;
+ private static final int SCROLLING_INDICATOR_BOTTOM = 0;
+
public AppsCustomizePagedView(Context context, AttributeSet attrs) {
super(context, attrs);
mLayoutInflater = LayoutInflater.from(context);
mPackageManager = context.getPackageManager();
+ mContentType = ContentType.Applications;
mApps = new ArrayList<ApplicationInfo>();
+ mFilteredApps = new ArrayList<ApplicationInfo>();
+ mHiddenApps = new ArrayList<ComponentName>();
mWidgets = new ArrayList<Object>();
mIconCache = ((LauncherApplication) context.getApplicationContext()).getIconCache();
mCanvas = new Canvas();
mRunningTasks = new ArrayList<AppsCustomizeAsyncTask>();
- // Save the default widget preview background
+ mHandleFadeInAdjacentScreens = true;
+
Resources resources = context.getResources();
+
+ mCameraDistance = resources.getInteger(R.integer.config_cameraDistance);
+
+ // Preferences
+ mJoinWidgetsApps = PreferencesProvider.Interface.Drawer.getJoinWidgetsApps();
+ mVertical = PreferencesProvider.Interface.Drawer.getVertical();
+ mTransitionEffect = PreferencesProvider.Interface.Drawer.Scrolling.getTransitionEffect(
+ resources.getString(R.string.config_drawerDefaultTransitionEffect));
+ mFadeInAdjacentScreens = PreferencesProvider.Interface.Drawer.Scrolling.getFadeInAdjacentScreens();
+ boolean showScrollingIndicator = PreferencesProvider.Interface.Drawer.Indicator.getShowScrollingIndicator();
+ mFadeScrollingIndicator = PreferencesProvider.Interface.Drawer.Indicator.getFadeScrollingIndicator();
+ mScrollingIndicatorPosition = PreferencesProvider.Interface.Drawer.Indicator.getScrollingIndicatorPosition();
+
+ String[] flattened = PreferencesProvider.Interface.Drawer.getHiddenApps().split("\\|");
+ for (String flat : flattened) {
+ mHiddenApps.add(ComponentName.unflattenFromString(flat));
+ }
+
+
+ if (!showScrollingIndicator) {
+ disableScrollingIndicator();
+ }
+
+ // Save the default widget preview background
mAppIconSize = resources.getDimensionPixelSize(R.dimen.app_icon_size);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AppsCustomizePagedView, 0, 0);
@@ -353,18 +418,14 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
// The padding on the non-matched dimension for the default widget preview icons
// (top + bottom)
- mFadeInAdjacentScreens = false;
-
- // Unless otherwise specified this view is important for accessibility.
- if (getImportantForAccessibility() == View.IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
- setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
- }
+ mWidgetPreviewIconPaddedDimension =
+ (int) (mAppIconSize * (1 + (2 * WIDGET_PREVIEW_ICON_PADDING_PERCENTAGE)));
}
@Override
protected void init() {
super.init();
- mCenterPagesVertically = false;
+ mCenterPages = false;
Context context = getContext();
Resources r = context.getResources();
@@ -377,22 +438,44 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
int i = -1;
if (getPageCount() > 0) {
int currentPage = getCurrentPage();
- if (currentPage < mNumAppsPages) {
- PagedViewCellLayout layout = (PagedViewCellLayout) getPageAt(currentPage);
- PagedViewCellLayoutChildren childrenLayout = layout.getChildrenLayout();
- int numItemsPerPage = mCellCountX * mCellCountY;
- int childCount = childrenLayout.getChildCount();
- if (childCount > 0) {
- i = (currentPage * numItemsPerPage) + (childCount / 2);
+ if (mJoinWidgetsApps) {
+ if (currentPage < mNumAppsPages) {
+ PagedViewCellLayout layout = (PagedViewCellLayout) getPageAt(currentPage);
+ PagedViewCellLayoutChildren childrenLayout = layout.getChildrenLayout();
+ int numItemsPerPage = mCellCountX * mCellCountY;
+ int childCount = childrenLayout.getChildCount();
+ if (childCount > 0) {
+ i = (currentPage * numItemsPerPage) + (childCount / 2);
+ }
+ } else {
+ int numApps = mFilteredApps.size();
+ PagedViewGridLayout layout = (PagedViewGridLayout) getPageAt(currentPage);
+ int numItemsPerPage = mWidgetCountX * mWidgetCountY;
+ int childCount = layout.getChildCount();
+ if (childCount > 0) {
+ i = numApps +
+ ((currentPage - mNumAppsPages) * numItemsPerPage) + (childCount / 2);
+ }
}
} else {
- int numApps = mApps.size();
- PagedViewGridLayout layout = (PagedViewGridLayout) getPageAt(currentPage);
- int numItemsPerPage = mWidgetCountX * mWidgetCountY;
- int childCount = layout.getChildCount();
- if (childCount > 0) {
- i = numApps +
- ((currentPage - mNumAppsPages) * numItemsPerPage) + (childCount / 2);
+ switch (mContentType) {
+ case Applications: {
+ PagedViewCellLayout layout = (PagedViewCellLayout) getPageAt(currentPage);
+ PagedViewCellLayoutChildren childrenLayout = layout.getChildrenLayout();
+ int numItemsPerPage = mCellCountX * mCellCountY;
+ int childCount = childrenLayout.getChildCount();
+ if (childCount > 0) {
+ i = (currentPage * numItemsPerPage) + (childCount / 2);
+ }}
+ break;
+ case Widgets: {
+ PagedViewGridLayout layout = (PagedViewGridLayout) getPageAt(currentPage);
+ int numItemsPerPage = mWidgetCountX * mWidgetCountY;
+ int childCount = layout.getChildCount();
+ if (childCount > 0) {
+ i = (currentPage * numItemsPerPage) + (childCount / 2);
+ }}
+ break;
}
}
}
@@ -410,14 +493,27 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
/** Returns the page in the current orientation which is expected to contain the specified
* item index. */
int getPageForComponent(int index) {
- if (index < 0) return 0;
+ if (mJoinWidgetsApps) {
+ if (index < 0) return 0;
- if (index < mApps.size()) {
- int numItemsPerPage = mCellCountX * mCellCountY;
- return (index / numItemsPerPage);
+ if (index < mFilteredApps.size()) {
+ int numItemsPerPage = mCellCountX * mCellCountY;
+ return (index / numItemsPerPage);
+ } else {
+ int numItemsPerPage = mWidgetCountX * mWidgetCountY;
+ return mNumAppsPages + ((index - mFilteredApps.size()) / numItemsPerPage);
+ }
} else {
- int numItemsPerPage = mWidgetCountX * mWidgetCountY;
- return mNumAppsPages + ((index - mApps.size()) / numItemsPerPage);
+ switch (mContentType) {
+ case Applications: {
+ int numItemsPerPage = mCellCountX * mCellCountY;
+ return (index / numItemsPerPage);
+ }
+ case Widgets: {
+ int numItemsPerPage = mWidgetCountX * mWidgetCountY;
+ return (index / numItemsPerPage);
+ }}
+ return -1;
}
}
@@ -428,9 +524,11 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
private void updatePageCounts() {
- mNumWidgetPages = (int) Math.ceil(mWidgets.size() /
- (float) (mWidgetCountX * mWidgetCountY));
- mNumAppsPages = (int) Math.ceil((float) mApps.size() / (mCellCountX * mCellCountY));
+ if (mJoinWidgetsApps) {
+ mNumWidgetPages = (int) Math.ceil(mWidgets.size() /
+ (float) (mWidgetCountX * mWidgetCountY));
+ mNumAppsPages = (int) Math.ceil((float) mFilteredApps.size() / (mCellCountX * mCellCountY));
+ }
}
protected void onDataReady(int width, int height) {
@@ -440,10 +538,10 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
int maxCellCountX = Integer.MAX_VALUE;
int maxCellCountY = Integer.MAX_VALUE;
if (LauncherApplication.isScreenLarge()) {
- maxCellCountX = (isLandscape ? LauncherModel.getCellCountX() :
- LauncherModel.getCellCountY());
- maxCellCountY = (isLandscape ? LauncherModel.getCellCountY() :
- LauncherModel.getCellCountX());
+ maxCellCountX = (isLandscape ? LauncherModel.getWorkspaceCellCountX() :
+ LauncherModel.getWorkspaceCellCountY());
+ maxCellCountY = (isLandscape ? LauncherModel.getWorkspaceCellCountY() :
+ LauncherModel.getWorkspaceCellCountX());
}
if (mMaxAppCellCountX > -1) {
maxCellCountX = Math.min(maxCellCountX, mMaxAppCellCountX);
@@ -471,7 +569,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
mWidgetSpacingLayout.measure(widthSpec, heightSpec);
mContentWidth = mWidgetSpacingLayout.getContentWidth();
- AppsCustomizeTabHost host = (AppsCustomizeTabHost) getTabHost();
+ AppsCustomizeTabHost host = getTabHost();
final boolean hostIsTransitioning = host.isTransitioning();
// Restore the page
@@ -492,18 +590,31 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
void showAllAppsCling() {
- if (!mHasShownAllAppsCling && isDataReady()) {
- mHasShownAllAppsCling = true;
- // Calculate the position for the cling punch through
- int[] offset = new int[2];
- int[] pos = mWidgetSpacingLayout.estimateCellPosition(mClingFocusedX, mClingFocusedY);
- mLauncher.getDragLayer().getLocationInDragLayer(this, offset);
- // PagedViews are centered horizontally but top aligned
- // Note we have to shift the items up now that Launcher sits under the status bar
- pos[0] += (getMeasuredWidth() - mWidgetSpacingLayout.getMeasuredWidth()) / 2 +
- offset[0];
- pos[1] += offset[1] - mLauncher.getDragLayer().getPaddingTop();
- mLauncher.showFirstRunAllAppsCling(pos);
+ AppsCustomizeTabHost tabHost = getTabHost();
+ if (tabHost != null) {
+ Cling allAppsCling = (Cling) tabHost.findViewById(R.id.all_apps_cling);
+ if (!mHasShownAllAppsCling && isDataReady()) {
+ mHasShownAllAppsCling = true;
+ // Calculate the position for the cling punch through
+ int[] offset = new int[2];
+ int[] pos = mWidgetSpacingLayout.estimateCellPosition(mClingFocusedX, mClingFocusedY);
+ mLauncher.getDragLayer().getLocationInDragLayer(this, offset);
+ // PagedViews are centered horizontally but top aligned
+ // Note we have to shift the items up now that Launcher sits under the status bar
+ pos[0] += (getMeasuredWidth() - mWidgetSpacingLayout.getMeasuredWidth()) / 2 +
+ offset[0];
+ pos[1] += offset[1] - mLauncher.getDragLayer().getPaddingTop();
+ mLauncher.showFirstRunAllAppsCling(pos);
+ } else if (!mHasShownAllAppsSortCling && isDataReady() &&
+ allAppsCling != null && allAppsCling.isDismissed()) {
+ mHasShownAllAppsSortCling = true;
+ tabHost.selectAppsTab();
+ // Calculate the position for the cling punch through
+ int[] offset = new int[2];
+ View appsTab = tabHost.getCurrentTabView();
+ mLauncher.getDragLayer().getLocationInDragLayer(appsTab, offset);
+ mLauncher.showFirstRunAllAppsSortCling(offset);
+ }
}
}
@@ -512,7 +623,14 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec);
if (!isDataReady()) {
- if (!mApps.isEmpty() && !mWidgets.isEmpty()) {
+ boolean isReady;
+ if (mContentType == AppsCustomizePagedView.ContentType.Widgets || mJoinWidgetsApps) {
+ isReady = (!mApps.isEmpty() && !mWidgets.isEmpty());
+ } else {
+ isReady = !mApps.isEmpty();
+ }
+
+ if (isReady) {
setDataIsReady();
setMeasuredDimension(width, height);
onDataReady(width, height);
@@ -536,8 +654,8 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
int[] minSpanXY = Launcher.getMinSpanForWidget(mLauncher, widget);
int minSpanX = Math.min(spanXY[0], minSpanXY[0]);
int minSpanY = Math.min(spanXY[1], minSpanXY[1]);
- if (minSpanX <= LauncherModel.getCellCountX() &&
- minSpanY <= LauncherModel.getCellCountY()) {
+ if (minSpanX <= LauncherModel.getWorkspaceCellCountX() &&
+ minSpanY <= LauncherModel.getWorkspaceCellCountY()) {
mWidgets.add(widget);
} else {
Log.e(TAG, "Widget " + widget.provider + " can not fit on this device (" +
@@ -616,7 +734,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
mLauncher.getWorkspace().beginDragShared(v, this);
}
- Bundle getDefaultOptionsForWidget(Launcher launcher, PendingAddWidgetInfo info) {
+ Bundle getDefaultOptionsForWidget(PendingAddWidgetInfo info) {
Bundle options = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
AppWidgetResizeFrame.getWidgetSizeRanges(mLauncher, info.spanX, info.spanY, mTmpRect);
@@ -642,7 +760,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
private void preloadWidget(final PendingAddWidgetInfo info) {
final AppWidgetProviderInfo pInfo = info.info;
- final Bundle options = getDefaultOptionsForWidget(mLauncher, info);
+ final Bundle options = getDefaultOptionsForWidget(info);
if (pInfo.configure != null) {
info.bindOptions = options;
@@ -683,7 +801,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
mWidgetCleanupState = WIDGET_INFLATED;
hostView.setVisibility(INVISIBLE);
int[] unScaledSize = mLauncher.getWorkspace().estimateItemSize(info.spanX,
- info.spanY, info, false);
+ info.spanY, false);
// We want the first widget layout to be the correct size. This will be important
// for width size reporting to the AppWidgetManager.
@@ -781,7 +899,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
int spanX = createItemInfo.spanX;
int spanY = createItemInfo.spanY;
int[] size = mLauncher.getWorkspace().estimateItemSize(spanX, spanY,
- createWidgetInfo, true);
+ true);
FastBitmapDrawable previewDrawable = (FastBitmapDrawable) image.getDrawable();
float minScale = 1.25f;
@@ -800,9 +918,9 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
(float) previewDrawable.getIntrinsicHeight()),
Matrix.ScaleToFit.START);
m.getValues(mv);
- scale = (float) mv[0];
- } else {
- PendingAddShortcutInfo createShortcutInfo = (PendingAddShortcutInfo) v.getTag();
+ scale = mv[0];
+ } else if (createItemInfo instanceof PendingAddShortcutInfo) {
+ PendingAddShortcutInfo createShortcutInfo = (PendingAddShortcutInfo) createItemInfo;
Drawable icon = mIconCache.getFullResIcon(createShortcutInfo.shortcutActivityInfo);
preview = Bitmap.createBitmap(icon.getIntrinsicWidth(),
icon.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
@@ -814,6 +932,17 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
mCanvas.restore();
mCanvas.setBitmap(null);
createItemInfo.spanX = createItemInfo.spanY = 1;
+ } else {
+ // Workaround for the fact that we don't keep the original ResolveInfo associated with
+ // the shortcut around. To get the icon, we just render the preview image (which has
+ // the shortcut icon) to a new drag bitmap that clips the non-icon space.
+ preview = Bitmap.createBitmap(mWidgetPreviewIconPaddedDimension,
+ mWidgetPreviewIconPaddedDimension, Bitmap.Config.ARGB_8888);
+ Drawable d = image.getDrawable();
+ mCanvas.setBitmap(preview);
+ d.draw(mCanvas);
+ mCanvas.setBitmap(null);
+ createItemInfo.spanX = createItemInfo.spanY = 1;
}
// Don't clip alpha values for the drag outline if we're using the default widget preview
@@ -986,7 +1115,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
// Clean up all the async tasks
Iterator<AppsCustomizeAsyncTask> iter = mRunningTasks.iterator();
while (iter.hasNext()) {
- AppsCustomizeAsyncTask task = (AppsCustomizeAsyncTask) iter.next();
+ AppsCustomizeAsyncTask task = iter.next();
task.cancel(false);
iter.remove();
mDirtyPageContent.set(task.page, true);
@@ -1002,27 +1131,32 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
public void setContentType(ContentType type) {
- if (type == ContentType.Widgets) {
- invalidatePageData(mNumAppsPages, true);
- } else if (type == ContentType.Applications) {
- invalidatePageData(0, true);
+ if (mJoinWidgetsApps) {
+ if (type == ContentType.Widgets) {
+ invalidatePageData(mNumAppsPages, true);
+ } else if (type == ContentType.Applications) {
+ invalidatePageData(0, true);
+ }
+ } else {
+ mContentType = type;
+ invalidatePageData(0, (type != ContentType.Applications));
}
}
protected void snapToPage(int whichPage, int delta, int duration) {
super.snapToPage(whichPage, delta, duration);
- updateCurrentTab(whichPage);
+ if (mJoinWidgetsApps) {
+ updateCurrentTab(whichPage);
- // Update the thread priorities given the direction lookahead
- Iterator<AppsCustomizeAsyncTask> iter = mRunningTasks.iterator();
- while (iter.hasNext()) {
- AppsCustomizeAsyncTask task = (AppsCustomizeAsyncTask) iter.next();
- int pageIndex = task.page;
- if ((mNextPage > mCurrentPage && pageIndex >= mCurrentPage) ||
- (mNextPage < mCurrentPage && pageIndex <= mCurrentPage)) {
- task.setThreadPriority(getThreadPriorityForPage(pageIndex));
- } else {
- task.setThreadPriority(Process.THREAD_PRIORITY_LOWEST);
+ // Update the thread priorities given the direction lookahead
+ for (AppsCustomizeAsyncTask task : mRunningTasks) {
+ int pageIndex = task.page;
+ if ((mNextPage > mCurrentPage && pageIndex >= mCurrentPage) ||
+ (mNextPage < mCurrentPage && pageIndex <= mCurrentPage)) {
+ task.setThreadPriority(getThreadPriorityForPage(pageIndex));
+ } else {
+ task.setThreadPriority(Process.THREAD_PRIORITY_LOWEST);
+ }
}
}
}
@@ -1043,6 +1177,14 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
}
+ public boolean isContentType(ContentType type) {
+ return (mContentType == type);
+ }
+
+ public void setCurrentPageToWidgets() {
+ invalidatePageData(0);
+ }
+
/*
* Apps PagedView implementation
*/
@@ -1069,19 +1211,26 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
layout.measure(widthSpec, heightSpec);
setVisibilityOnChildren(layout, View.VISIBLE);
}
-
- public void syncAppsPageItems(int page, boolean immediate) {
+ public void syncAppsPages() {
+ // Ensure that we have the right number of pages
+ Context context = getContext();
+ int numPages = (int) Math.ceil((float) mFilteredApps.size() / (mCellCountX * mCellCountY));
+ for (int i = 0; i < numPages; ++i) {
+ PagedViewCellLayout layout = new PagedViewCellLayout(context);
+ setupPage(layout);
+ addView(layout);
+ }
+ }
+ public void syncAppsPageItems(int page) {
// ensure that we have the right number of items on the pages
int numCells = mCellCountX * mCellCountY;
int startIndex = page * numCells;
- int endIndex = Math.min(startIndex + numCells, mApps.size());
+ int endIndex = Math.min(startIndex + numCells, mFilteredApps.size());
PagedViewCellLayout layout = (PagedViewCellLayout) getPageAt(page);
layout.removeAllViewsOnPage();
- ArrayList<Object> items = new ArrayList<Object>();
- ArrayList<Bitmap> images = new ArrayList<Bitmap>();
for (int i = startIndex; i < endIndex; ++i) {
- ApplicationInfo info = mApps.get(i);
+ ApplicationInfo info = mFilteredApps.get(i);
PagedViewIcon icon = (PagedViewIcon) mLayoutInflater.inflate(
R.layout.apps_customize_application, layout, false);
icon.applyFromApplicationInfo(info, true, this);
@@ -1093,10 +1242,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
int index = i - startIndex;
int x = index % mCellCountX;
int y = index / mCellCountX;
- layout.addViewToCellLayout(icon, -1, i, new PagedViewCellLayout.LayoutParams(x,y, 1,1));
-
- items.add(info);
- images.add(info.iconBitmap);
+ layout.addViewToCellLayout(icon, -1, i, new PagedViewCellLayout.LayoutParams(x, y, 1, 1));
}
layout.createHardwareLayers();
@@ -1118,7 +1264,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
Iterator<AppsCustomizeAsyncTask> iter = mRunningTasks.iterator();
int minPageDiff = Integer.MAX_VALUE;
while (iter.hasNext()) {
- AppsCustomizeAsyncTask task = (AppsCustomizeAsyncTask) iter.next();
+ AppsCustomizeAsyncTask task = iter.next();
minPageDiff = Math.abs(task.page - toPage);
}
@@ -1148,12 +1294,12 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
* Creates and executes a new AsyncTask to load a page of widget previews.
*/
private void prepareLoadWidgetPreviewsTask(int page, ArrayList<Object> widgets,
- int cellWidth, int cellHeight, int cellCountX) {
+ int cellWidth, int cellHeight) {
// Prune all tasks that are no longer needed
Iterator<AppsCustomizeAsyncTask> iter = mRunningTasks.iterator();
while (iter.hasNext()) {
- AppsCustomizeAsyncTask task = (AppsCustomizeAsyncTask) iter.next();
+ AppsCustomizeAsyncTask task = iter.next();
int taskPage = task.page;
if (taskPage < getAssociatedLowerPageBound(mCurrentPage) ||
taskPage > getAssociatedUpperPageBound(mCurrentPage)) {
@@ -1173,7 +1319,9 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
try {
try {
Thread.sleep(sleepMs);
- } catch (Exception e) {}
+ } catch (Exception e) {
+ // Ignore
+ }
loadWidgetPreviewsInBackground(task, data);
} finally {
if (task.isCancelled()) {
@@ -1187,13 +1335,17 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
public void run(AppsCustomizeAsyncTask task, AsyncTaskPageData data) {
mRunningTasks.remove(task);
if (task.isCancelled()) return;
+ if (!mJoinWidgetsApps) {
+ if (task.page > getPageCount()) return;
+ if (task.pageContentType != mContentType) return;
+ }
// do cleanup inside onSyncWidgetPageItems
onSyncWidgetPageItems(data);
}
});
// Ensure that the task is appropriately prioritized and runs in parallel
- AppsCustomizeAsyncTask t = new AppsCustomizeAsyncTask(page,
+ AppsCustomizeAsyncTask t = new AppsCustomizeAsyncTask(page, mContentType,
AsyncTaskPageData.Type.LoadWidgetPreviewData);
t.setThreadPriority(getThreadPriorityForPage(page));
t.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, pageData);
@@ -1281,9 +1433,8 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
return preview;
}
- private Bitmap getWidgetPreview(ComponentName provider, int previewImage,
- int iconId, int cellHSpan, int cellVSpan, int maxWidth,
- int maxHeight) {
+ private Bitmap getWidgetPreview(ComponentName provider, int previewImage, int iconId,
+ int cellHSpan, int cellVSpan, int maxWidth, int maxHeight) {
// Load the preview image if possible
String packageName = provider.getPackageName();
if (maxWidth < 0) maxWidth = Integer.MAX_VALUE;
@@ -1330,7 +1481,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
c.setBitmap(null);
// Draw the icon in the top left corner
- int minOffset = (int) (mAppIconSize * sWidgetPreviewIconPaddingPercentage);
+ int minOffset = (int) (mAppIconSize * WIDGET_PREVIEW_ICON_PADDING_PERCENTAGE);
int smallestSide = Math.min(bitmapWidth, bitmapHeight);
float iconScale = Math.min((float) smallestSide
/ (mAppIconSize + 2 * minOffset), 1f);
@@ -1349,6 +1500,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
(int) (mAppIconSize * iconScale));
}
} catch (Resources.NotFoundException e) {
+ // Ignore
}
}
@@ -1389,6 +1541,19 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
return preview;
}
+ public void syncWidgetPages() {
+ // Ensure that we have the right number of pages
+ Context context = getContext();
+ int numPages = (int) Math.ceil(mWidgets.size() /
+ (float) (mWidgetCountX * mWidgetCountY));
+ for (int j = 0; j < numPages; ++j) {
+ PagedViewGridLayout layout = new PagedViewGridLayout(context, mWidgetCountX,
+ mWidgetCountY);
+ setupPage(layout);
+ addView(layout, new PagedViewGridLayout.LayoutParams(LayoutParams.MATCH_PARENT,
+ LayoutParams.MATCH_PARENT));
+ }
+ }
public void syncWidgetPageItems(final int page, final boolean immediate) {
int numItemsPerPage = mWidgetCountX * mWidgetCountY;
@@ -1413,7 +1578,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
layout.setColumnCount(layout.getCellCountX());
for (int i = 0; i < items.size(); ++i) {
Object rawInfo = items.get(i);
- PendingAddItemInfo createItemInfo = null;
+ PendingAddItemInfo createItemInfo;
PagedViewWidget widget = (PagedViewWidget) mLayoutInflater.inflate(
R.layout.apps_customize_widget, layout, false);
if (rawInfo instanceof AppWidgetProviderInfo) {
@@ -1485,7 +1650,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
mDeferredPrepareLoadWidgetPreviewsTasks.add(this);
} else {
prepareLoadWidgetPreviewsTask(page, items,
- maxPreviewWidth, maxPreviewHeight, mWidgetCountX);
+ maxPreviewWidth, maxPreviewHeight);
}
}
}
@@ -1503,8 +1668,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
// Load each of the widget/shortcut previews
ArrayList<Object> items = data.items;
ArrayList<Bitmap> images = data.generatedImages;
- int count = items.size();
- for (int i = 0; i < count; ++i) {
+ for (Object item : items) {
if (task != null) {
// Ensure we haven't been cancelled yet
if (task.isCancelled()) break;
@@ -1513,9 +1677,8 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
task.syncThreadPriority();
}
- Object rawInfo = items.get(i);
- if (rawInfo instanceof AppWidgetProviderInfo) {
- AppWidgetProviderInfo info = (AppWidgetProviderInfo) rawInfo;
+ if (item instanceof AppWidgetProviderInfo) {
+ AppWidgetProviderInfo info = (AppWidgetProviderInfo) item;
int[] cellSpans = Launcher.getSpanForWidget(mLauncher, info);
int maxWidth = Math.min(data.maxImageWidth,
@@ -1525,9 +1688,9 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
Bitmap b = getWidgetPreview(info.provider, info.previewImage, info.icon,
cellSpans[0], cellSpans[1], maxWidth, maxHeight);
images.add(b);
- } else if (rawInfo instanceof ResolveInfo) {
+ } else if (item instanceof ResolveInfo) {
// Fill in the shortcuts information
- ResolveInfo info = (ResolveInfo) rawInfo;
+ ResolveInfo info = (ResolveInfo) item;
images.add(getShortcutPreview(info, data.maxImageWidth, data.maxImageHeight));
}
}
@@ -1548,7 +1711,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
PagedViewWidget widget = (PagedViewWidget) layout.getChildAt(i);
if (widget != null) {
Bitmap preview = data.generatedImages.get(i);
- widget.applyPreview(new FastBitmapDrawable(preview), i);
+ widget.applyPreview(new FastBitmapDrawable(preview));
}
}
@@ -1556,9 +1719,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
invalidate();
// Update all thread priorities
- Iterator<AppsCustomizeAsyncTask> iter = mRunningTasks.iterator();
- while (iter.hasNext()) {
- AppsCustomizeAsyncTask task = (AppsCustomizeAsyncTask) iter.next();
+ for (AppsCustomizeAsyncTask task : mRunningTasks) {
int pageIndex = task.page;
task.setThreadPriority(getThreadPriorityForPage(pageIndex));
}
@@ -1572,28 +1733,50 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
removeAllViews();
cancelAllTasks();
- Context context = getContext();
- for (int j = 0; j < mNumWidgetPages; ++j) {
- PagedViewGridLayout layout = new PagedViewGridLayout(context, mWidgetCountX,
- mWidgetCountY);
- setupPage(layout);
- addView(layout, new PagedView.LayoutParams(LayoutParams.MATCH_PARENT,
- LayoutParams.MATCH_PARENT));
- }
+ if (mJoinWidgetsApps) {
+ Context context = getContext();
+ for (int j = 0; j < mNumWidgetPages; ++j) {
+ PagedViewGridLayout layout = new PagedViewGridLayout(context, mWidgetCountX,
+ mWidgetCountY);
+ setupPage(layout);
+ addView(layout, new PagedView.LayoutParams(LayoutParams.MATCH_PARENT,
+ LayoutParams.MATCH_PARENT));
+ }
- for (int i = 0; i < mNumAppsPages; ++i) {
- PagedViewCellLayout layout = new PagedViewCellLayout(context);
- setupPage(layout);
- addView(layout);
+ for (int i = 0; i < mNumAppsPages; ++i) {
+ PagedViewCellLayout layout = new PagedViewCellLayout(context);
+ setupPage(layout);
+ addView(layout);
+ }
+ } else {
+ switch (mContentType) {
+ case Applications:
+ syncAppsPages();
+ break;
+ case Widgets:
+ syncWidgetPages();
+ break;
+ }
}
}
@Override
public void syncPageItems(int page, boolean immediate) {
- if (page < mNumAppsPages) {
- syncAppsPageItems(page, immediate);
+ if (mJoinWidgetsApps) {
+ if (page < mNumAppsPages) {
+ syncAppsPageItems(page);
+ } else {
+ syncWidgetPageItems(page, immediate);
+ }
} else {
- syncWidgetPageItems(page, immediate);
+ switch (mContentType) {
+ case Applications:
+ syncAppsPageItems(page);
+ break;
+ case Widgets:
+ syncWidgetPageItems(page, immediate);
+ break;
+ }
}
}
@@ -1608,25 +1791,159 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
return getChildCount() - index - 1;
}
- // In apps customize, we have a scrolling effect which emulates pulling cards off of a stack.
- @Override
- protected void screenScrolled(int screenCenter) {
- super.screenScrolled(screenCenter);
+ private void screenScrolledStandard(int screenScroll) {
+ for (int i = 0; i < getChildCount(); i++) {
+ View v = getPageAt(i);
+ if (v != null) {
+ float scrollProgress = getScrollProgress(screenScroll, v, i);
+ if (mFadeInAdjacentScreens) {
+ float alpha = 1 - Math.abs(scrollProgress);
+ v.setAlpha(alpha);
+ }
+ }
+ }
+ }
+
+ private void screenScrolledTablet(int screenScroll) {
+ for (int i = 0; i < getChildCount(); i++) {
+ View v = getPageAt(i);
+ if (v != null) {
+ float scrollProgress = getScrollProgress(screenScroll, v, i);
+ float rotation = TRANSITION_SCREEN_ROTATION * scrollProgress;
+ float translation = mLauncher.getWorkspace().getOffsetXForRotation(rotation, v.getWidth(), v.getHeight());
+
+ if (!mVertical) {
+ v.setTranslationX(translation);
+ v.setRotationY(rotation);
+ } else {
+ v.setTranslationY(translation);
+ v.setRotationX(-rotation);
+ }
+ if (mFadeInAdjacentScreens) {
+ float alpha = 1 - Math.abs(scrollProgress);
+ v.setAlpha(alpha);
+ }
+ }
+ }
+ }
+
+ private void screenScrolledZoom(int screenScroll, boolean in) {
+ for (int i = 0; i < getChildCount(); i++) {
+ View v = getPageAt(i);
+ if (v != null) {
+ float scrollProgress = getScrollProgress(screenScroll, v, i);
+ float scale = 1.0f + (in ? -0.2f : 0.1f) * Math.abs(scrollProgress);
+
+ // Extra translation to account for the increase in size
+ if (!in) {
+ if (!mVertical) {
+ float translationX = v.getMeasuredWidth() * 0.1f * -scrollProgress;
+ v.setTranslationX(translationX);
+ } else {
+ float translationY = v.getMeasuredHeight() * 0.1f * -scrollProgress;
+ v.setTranslationY(translationY);
+ }
+ }
+
+ v.setScaleX(scale);
+ v.setScaleY(scale);
+ if (mFadeInAdjacentScreens) {
+ float alpha = 1 - Math.abs(scrollProgress);
+ v.setAlpha(alpha);
+ }
+ }
+ }
+ }
+
+ private void screenScrolledRotate(int screenScroll, boolean up) {
+ for (int i = 0; i < getChildCount(); i++) {
+ View v = getPageAt(i);
+ if (v != null) {
+ float scrollProgress = getScrollProgress(screenScroll, v, i);
+ float rotation =
+ (up ? TRANSITION_SCREEN_ROTATION : -TRANSITION_SCREEN_ROTATION) * scrollProgress;
+
+ if (!mVertical) {
+ float translationX = v.getMeasuredWidth() * scrollProgress;
+
+ float rotatePoint =
+ (v.getMeasuredWidth() * 0.5f) /
+ (float) Math.tan(Math.toRadians((double) (TRANSITION_SCREEN_ROTATION * 0.5f)));
+
+ v.setPivotX(v.getMeasuredWidth() * 0.5f);
+ if (up) {
+ v.setPivotY(-rotatePoint);
+ } else {
+ v.setPivotY(v.getMeasuredHeight() + rotatePoint);
+ }
+ v.setRotation(rotation);
+ v.setTranslationX(translationX);
+ } else {
+ float translationY = v.getMeasuredHeight() * scrollProgress;
+
+ float rotatePoint =
+ (v.getMeasuredHeight() * 0.5f) /
+ (float) Math.tan(Math.toRadians((double) (TRANSITION_SCREEN_ROTATION * 0.5f)));
+
+ v.setPivotY(v.getMeasuredHeight() * 0.5f);
+ if (up) {
+ v.setPivotX(-rotatePoint);
+ } else {
+ v.setPivotX(v.getMeasuredWidth() + rotatePoint);
+ }
+ v.setRotation(-rotation);
+ v.setTranslationY(translationY);
+ }
+ if (mFadeInAdjacentScreens) {
+ float alpha = 1 - Math.abs(scrollProgress);
+ v.setAlpha(alpha);
+ }
+ }
+ }
+ }
+
+ private void screenScrolledCube(int screenScroll, boolean in) {
for (int i = 0; i < getChildCount(); i++) {
View v = getPageAt(i);
if (v != null) {
- float scrollProgress = getScrollProgress(screenCenter, v, i);
+ float scrollProgress = getScrollProgress(screenScroll, v, i);
+ float rotation = (in ? 90.0f : -90.0f) * scrollProgress;
+
+ if (in) {
+ v.setCameraDistance(mDensity * mCameraDistance);
+ }
+ if (!mVertical) {
+ v.setPivotX(scrollProgress < 0 ? 0 : v.getMeasuredWidth());
+ v.setPivotY(v.getMeasuredHeight() * 0.5f);
+ v.setRotationY(rotation);
+ } else {
+ v.setPivotY(scrollProgress < 0 ? 0 : v.getMeasuredHeight());
+ v.setPivotX(v.getMeasuredWidth() * 0.5f);
+ v.setRotationX(-rotation);
+ }
+ if (mFadeInAdjacentScreens) {
+ float alpha = 1 - Math.abs(scrollProgress);
+ v.setAlpha(alpha);
+ }
+ }
+ }
+ }
+
+ private void screenScrolledStack(int screenScroll) {
+ for (int i = 0; i < getChildCount(); i++) {
+ View v = getPageAt(i);
+ if (v != null) {
+ float scrollProgress = getScrollProgress(screenScroll, v, i);
float interpolatedProgress =
mZInterpolator.getInterpolation(Math.abs(Math.min(scrollProgress, 0)));
- float scale = (1 - interpolatedProgress) +
- interpolatedProgress * TRANSITION_SCALE_FACTOR;
- float translationX = Math.min(0, scrollProgress) * v.getMeasuredWidth();
-
+ float scale = (1 - interpolatedProgress) + interpolatedProgress * 0.76f;
+ float translation = Math.min(0, scrollProgress) *
+ (!mVertical ? v.getMeasuredWidth() : v.getMeasuredHeight());
float alpha;
- if (scrollProgress < 0) {
+ if (!LauncherApplication.isScreenLarge() || scrollProgress < 0) {
alpha = scrollProgress < 0 ? mAlphaInterpolator.getInterpolation(
1 - Math.abs(scrollProgress)) : 1.0f;
} else {
@@ -1634,42 +1951,18 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
alpha = mLeftScreenAlphaInterpolator.getInterpolation(1 - scrollProgress);
}
- v.setCameraDistance(mDensity * CAMERA_DISTANCE);
- int pageWidth = v.getMeasuredWidth();
- int pageHeight = v.getMeasuredHeight();
-
- if (PERFORM_OVERSCROLL_ROTATION) {
- if (i == 0 && scrollProgress < 0) {
- // Overscroll to the left
- v.setPivotX(TRANSITION_PIVOT * pageWidth);
- v.setRotationY(-TRANSITION_MAX_ROTATION * scrollProgress);
- scale = 1.0f;
- alpha = 1.0f;
- // On the first page, we don't want the page to have any lateral motion
- translationX = 0;
- } else if (i == getChildCount() - 1 && scrollProgress > 0) {
- // Overscroll to the right
- v.setPivotX((1 - TRANSITION_PIVOT) * pageWidth);
- v.setRotationY(-TRANSITION_MAX_ROTATION * scrollProgress);
- scale = 1.0f;
- alpha = 1.0f;
- // On the last page, we don't want the page to have any lateral motion.
- translationX = 0;
- } else {
- v.setPivotY(pageHeight / 2.0f);
- v.setPivotX(pageWidth / 2.0f);
- v.setRotationY(0f);
- }
+ if (!mVertical) {
+ v.setTranslationX(translation);
+ } else {
+ v.setTranslationY(translation);
}
-
- v.setTranslationX(translationX);
v.setScaleX(scale);
v.setScaleY(scale);
v.setAlpha(alpha);
// If the view has 0 alpha, we set it to be invisible so as to prevent
// it from accepting touches
- if (alpha == 0) {
+ if (alpha <= 0) {
v.setVisibility(INVISIBLE);
} else if (v.getVisibility() != VISIBLE) {
v.setVisibility(VISIBLE);
@@ -1678,6 +1971,222 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
}
+
+ private void screenScrolledAccordian(int screenScroll) {
+ for (int i = 0; i < getChildCount(); i++) {
+ View v = getPageAt(i);
+ if (v != null) {
+ float scrollProgress = getScrollProgress(screenScroll, v, i);
+ float scale = 1.0f - Math.abs(scrollProgress);
+
+ if (!mVertical) {
+ v.setPivotX(scrollProgress < 0 ? 0 : v.getMeasuredWidth());
+ v.setScaleX(scale);
+ } else {
+ v.setPivotY(scrollProgress < 0 ? 0 : v.getMeasuredHeight());
+ v.setScaleY(scale);
+ }
+
+ if (mFadeInAdjacentScreens) {
+ float alpha = 1 - Math.abs(scrollProgress);
+ v.setAlpha(alpha);
+ }
+ }
+ }
+ }
+
+ private void screenScrolledSpin(int screenScroll) {
+ for (int i = 0; i < getChildCount(); i++) {
+ View v = getPageAt(i);
+ if (v != null) {
+ float scrollProgress = getScrollProgress(screenScroll, v, i);
+ float rotation = 180.0f * scrollProgress;
+
+ v.setRotation(rotation);
+
+ if (getMeasuredHeight() > getMeasuredWidth()) {
+ float translationX =
+ (getMeasuredHeight() - getMeasuredWidth()) / 2.0f * -scrollProgress;
+ v.setTranslationX(translationX);
+ }
+
+ if (mFadeInAdjacentScreens) {
+ float alpha = 1 - Math.abs(scrollProgress);
+ v.setAlpha(alpha);
+ }
+ }
+ }
+ }
+
+ private void screenScrolledFlip(int screenScroll) {
+ for (int i = 0; i < getChildCount(); i++) {
+ View v = getPageAt(i);
+ if (v != null) {
+ float scrollProgress = getScrollProgress(screenScroll, v, i);
+ float rotation = -180.0f * scrollProgress;
+
+ if (scrollProgress >= -0.5f && scrollProgress <= 0.5f) {
+ v.setPivotX(v.getMeasuredWidth() * 0.5f);
+ v.setPivotY(v.getMeasuredHeight() * 0.5f);
+ if (!mVertical) {
+ v.setTranslationX(v.getMeasuredWidth() * scrollProgress);
+ v.setRotationY(rotation);
+ } else {
+ v.setTranslationY(v.getMeasuredHeight() * scrollProgress);
+ v.setRotationX(-rotation);
+ v.setCameraDistance(mDensity * mCameraDistance);
+ }
+ if (v.getVisibility() != VISIBLE) {
+ v.setVisibility(VISIBLE);
+ }
+ if (mFadeInAdjacentScreens) {
+ float alpha = 1 - Math.abs(scrollProgress);
+ v.setAlpha(alpha);
+ }
+ } else {
+ v.setVisibility(INVISIBLE);
+ }
+ }
+ }
+ }
+
+ private void screenScrolledCylinder(int screenScroll, boolean in) {
+ for (int i = 0; i < getChildCount(); i++) {
+ View v = getPageAt(i);
+ if (v != null) {
+ float scrollProgress = getScrollProgress(screenScroll, v, i);
+ float rotation = (in ? TRANSITION_SCREEN_ROTATION : -TRANSITION_SCREEN_ROTATION) * scrollProgress;
+
+ if (!mVertical) {
+ v.setPivotX((scrollProgress + 1) * v.getMeasuredWidth() * 0.5f);
+ v.setPivotY(v.getMeasuredHeight() * 0.5f);
+ v.setRotationY(rotation);
+ } else {
+ v.setPivotY((scrollProgress + 1) * v.getMeasuredHeight() * 0.5f);
+ v.setPivotX(v.getMeasuredWidth() * 0.5f);
+ v.setRotationX(-rotation);
+ }
+
+ if (mFadeInAdjacentScreens) {
+ float alpha = 1 - Math.abs(scrollProgress);
+ v.setAlpha(alpha);
+ }
+ }
+ }
+ }
+
+ // Transition effects
+ @Override
+ protected void screenScrolled(int screenScroll) {
+ super.screenScrolled(screenScroll);
+
+ boolean isInOverscroll = !mVertical ? (mOverScrollX < 0 || mOverScrollX > mMaxScrollX) :
+ (mOverScrollY < 0 || mOverScrollY > mMaxScrollY);
+ if (isInOverscroll && !mOverscrollTransformsDirty) {
+ mScrollTransformsDirty = true;
+ }
+ if (!isInOverscroll || mScrollTransformsDirty) {
+ // Limit the "normal" effects to mScrollX/Y
+ int scroll = !mVertical ? mScrollX : mScrollY;
+
+ // Reset transforms when we aren't in overscroll
+ if (mOverscrollTransformsDirty) {
+ mOverscrollTransformsDirty = false;
+ View v0 = getPageAt(0);
+ View v1 = getPageAt(getChildCount() - 1);
+ if (!mVertical) {
+ v0.setTranslationX(0);
+ v1.setTranslationX(0);
+ v0.setRotationY(0);
+ v1.setRotationY(0);
+ } else {
+ v0.setTranslationY(0);
+ v1.setTranslationY(0);
+ v0.setRotationX(0);
+ v1.setRotationX(0);
+ }
+ v0.setCameraDistance(mDensity * 1280);
+ v1.setCameraDistance(mDensity * 1280);
+ v0.setPivotX(v0.getMeasuredWidth() / 2);
+ v1.setPivotX(v1.getMeasuredWidth() / 2);
+ v0.setPivotY(v0.getMeasuredHeight() / 2);
+ v1.setPivotY(v1.getMeasuredHeight() / 2);
+ }
+
+ switch (mTransitionEffect) {
+ case Standard:
+ screenScrolledStandard(scroll);
+ break;
+ case Tablet:
+ screenScrolledTablet(scroll);
+ break;
+ case ZoomIn:
+ screenScrolledZoom(scroll, true);
+ break;
+ case ZoomOut:
+ screenScrolledZoom(scroll, false);
+ break;
+ case RotateUp:
+ screenScrolledRotate(scroll, true);
+ break;
+ case RotateDown:
+ screenScrolledRotate(scroll, false);
+ break;
+ case Spin:
+ screenScrolledSpin(scroll);
+ break;
+ case Flip:
+ screenScrolledFlip(scroll);
+ break;
+ case CubeIn:
+ screenScrolledCube(scroll, true);
+ break;
+ case CubeOut:
+ screenScrolledCube(scroll, false);
+ break;
+ case Stack:
+ screenScrolledStack(scroll);
+ break;
+ case Accordian:
+ screenScrolledAccordian(scroll);
+ break;
+ case CylinderIn:
+ screenScrolledCylinder(scroll, true);
+ break;
+ case CylinderOut:
+ screenScrolledCylinder(scroll, false);
+ }
+ mScrollTransformsDirty = false;
+ }
+
+ if (isInOverscroll) {
+ int index = (!mVertical ? mOverScrollX : mOverScrollY) < 0 ? 0 : getChildCount() - 1;
+ View v = getPageAt(index);
+ if (v != null) {
+ float scrollProgress = getScrollProgress(screenScroll, v, index);
+ float rotation = -TRANSITION_MAX_ROTATION * scrollProgress;
+ if (!mOverscrollTransformsDirty) {
+ mOverscrollTransformsDirty = true;
+ v.setCameraDistance(mDensity * mCameraDistance);
+ if (!mVertical) {
+ v.setPivotX(v.getMeasuredWidth() * (index == 0 ? TRANSITION_PIVOT : 1 - TRANSITION_PIVOT));
+ v.setPivotY(v.getMeasuredHeight() * 0.5f);
+ v.setTranslationX(0);
+ } else {
+ v.setPivotX(v.getMeasuredWidth() * 0.5f);
+ v.setPivotY(v.getMeasuredHeight() * (index == 0 ? TRANSITION_PIVOT : 1 - TRANSITION_PIVOT));
+ v.setTranslationY(0);
+ }
+ }
+ if (!mVertical) {
+ v.setRotationY(rotation);
+ } else {
+ v.setRotationX(-rotation);
+ }
+ }
+ }
+ }
+
protected void overScroll(float amount) {
acceleratedOverScroll(amount);
}
@@ -1692,13 +2201,43 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
@Override
protected void onPageEndMoving() {
- super.onPageEndMoving();
+ if (mFadeScrollingIndicator) {
+ hideScrollingIndicator(false);
+ }
mForceDrawAllChildrenNextFrame = true;
+
// We reset the save index when we change pages so that it will be recalculated on next
// rotation
mSaveInstanceStateItemIndex = -1;
}
+ @Override
+ protected int getScrollingIndicatorId() {
+ if (!mVertical) {
+ if (mScrollingIndicatorPosition == SCROLLING_INDICATOR_BOTTOM) {
+ return R.id.paged_view_indicator_bottom;
+ } else if (mScrollingIndicatorPosition == SCROLLING_INDICATOR_TOP) {
+ return R.id.paged_view_indicator_top;
+ }
+ } else {
+ if (mScrollingIndicatorPosition == SCROLLING_INDICATOR_BOTTOM) {
+ return R.id.paged_view_indicator_right;
+ } else if (mScrollingIndicatorPosition == SCROLLING_INDICATOR_TOP) {
+ return R.id.paged_view_indicator_left;
+ }
+ }
+ return -1;
+ }
+
+ @Override
+ protected void flashScrollingIndicator(boolean animated) {
+ if (mFadeScrollingIndicator) {
+ super.flashScrollingIndicator(animated);
+ } else {
+ showScrollingIndicator(false);
+ }
+ }
+
/*
* AllAppsView implementation
*/
@@ -1724,17 +2263,55 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
}
+ public SortMode getSortMode() {
+ return mSortMode;
+ }
+
+ public void setSortMode(SortMode sortMode) {
+ if (mSortMode == sortMode) {
+ return;
+ }
+
+ mSortMode = sortMode;
+
+ filterApps();
+ }
+
+ public void setShowSystemApps(boolean show) {
+ if (show) {
+ mFilterApps |= FILTER_APPS_SYSTEM_FLAG;
+ } else {
+ mFilterApps &= ~FILTER_APPS_SYSTEM_FLAG;
+ }
+ filterApps();
+ }
+
+ public void setShowDownloadedApps(boolean show) {
+ if (show) {
+ mFilterApps |= FILTER_APPS_DOWNLOADED_FLAG;
+ } else {
+ mFilterApps &= ~FILTER_APPS_DOWNLOADED_FLAG;
+ }
+ filterApps();
+ }
+
+ public boolean getShowSystemApps() {
+ return (mFilterApps & FILTER_APPS_SYSTEM_FLAG) != 0;
+ }
+
+ public boolean getShowDownloadedApps() {
+ return (mFilterApps & FILTER_APPS_DOWNLOADED_FLAG) != 0;
+ }
+
public void setApps(ArrayList<ApplicationInfo> list) {
mApps = list;
- Collections.sort(mApps, LauncherModel.getAppNameComparator());
+ filterAppsWithoutInvalidate();
updatePageCounts();
invalidateOnDataChange();
}
private void addAppsWithoutInvalidate(ArrayList<ApplicationInfo> list) {
// We add it in place, in alphabetical order
- int count = list.size();
- for (int i = 0; i < count; ++i) {
- ApplicationInfo info = list.get(i);
+ for (ApplicationInfo info : list) {
int index = Collections.binarySearch(mApps, info, LauncherModel.getAppNameComparator());
if (index < 0) {
mApps.add(-(index + 1), info);
@@ -1743,6 +2320,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
public void addApps(ArrayList<ApplicationInfo> list) {
addAppsWithoutInvalidate(list);
+ filterAppsWithoutInvalidate();
updatePageCounts();
invalidateOnDataChange();
}
@@ -1769,9 +2347,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
private void removeAppsWithoutInvalidate(ArrayList<ApplicationInfo> list) {
// loop through all the apps and remove apps that have the same component
- int length = list.size();
- for (int i = 0; i < length; ++i) {
- ApplicationInfo info = list.get(i);
+ for (ApplicationInfo info : list) {
int removeIndex = findAppByComponent(mApps, info);
if (removeIndex > -1) {
mApps.remove(removeIndex);
@@ -1790,6 +2366,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
public void removeApps(ArrayList<String> packageNames) {
removeAppsWithPackageNameWithoutInvalidate(packageNames);
+ filterAppsWithoutInvalidate();
updatePageCounts();
invalidateOnDataChange();
}
@@ -1799,6 +2376,30 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
// place in the list.
removeAppsWithoutInvalidate(list);
addAppsWithoutInvalidate(list);
+ filterAppsWithoutInvalidate();
+ updatePageCounts();
+ invalidateOnDataChange();
+ }
+ public void filterAppsWithoutInvalidate() {
+ mFilteredApps = new ArrayList<ApplicationInfo>(mApps);
+ Iterator<ApplicationInfo> iterator = mFilteredApps.iterator();
+ while (iterator.hasNext()) {
+ ApplicationInfo appInfo = iterator.next();
+ boolean system = (appInfo.flags & ApplicationInfo.DOWNLOADED_FLAG) == 0;
+ if (mHiddenApps.contains(appInfo.componentName) ||
+ (system && !getShowSystemApps()) ||
+ (!system && !getShowDownloadedApps())) {
+ iterator.remove();
+ }
+ }
+ if (mSortMode == SortMode.Title) {
+ Collections.sort(mFilteredApps, LauncherModel.getAppNameComparator());
+ } else if (mSortMode == SortMode.InstallDate) {
+ Collections.sort(mFilteredApps, LauncherModel.APP_INSTALL_TIME_COMPARATOR);
+ }
+ }
+ public void filterApps() {
+ filterAppsWithoutInvalidate();
updatePageCounts();
invalidateOnDataChange();
}
@@ -1807,11 +2408,21 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
// If we have reset, then we should not continue to restore the previous state
mSaveInstanceStateItemIndex = -1;
- AppsCustomizeTabHost tabHost = getTabHost();
- String tag = tabHost.getCurrentTabTag();
- if (tag != null) {
- if (!tag.equals(tabHost.getTabTagForContentType(ContentType.Applications))) {
- tabHost.setCurrentTabFromContent(ContentType.Applications);
+ if (mJoinWidgetsApps) {
+ AppsCustomizeTabHost tabHost = getTabHost();
+ String tag = tabHost.getCurrentTabTag();
+ if (tag != null) {
+ if (!tag.equals(tabHost.getTabTagForContentType(ContentType.Applications))) {
+ tabHost.setCurrentTabFromContent(ContentType.Applications);
+ }
+ }
+ } else {
+ if (mContentType != ContentType.Applications) {
+ // Reset to the first page of the Apps pane
+ AppsCustomizeTabHost tabs = (AppsCustomizeTabHost)
+ mLauncher.findViewById(R.id.apps_customize_pane);
+ tabs.selectAppsTab();
+ return;
}
}
@@ -1877,37 +2488,48 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
* We load an extra page on each side to prevent flashes from scrolling and loading of the
* widget previews in the background with the AsyncTasks.
*/
- final static int sLookBehindPageCount = 2;
- final static int sLookAheadPageCount = 2;
+ final static int sLookBehindPageCount = 3;
+ final static int sLookAheadPageCount = 3;
protected int getAssociatedLowerPageBound(int page) {
final int count = getChildCount();
int windowSize = Math.min(count, sLookBehindPageCount + sLookAheadPageCount + 1);
- int windowMinIndex = Math.max(Math.min(page - sLookBehindPageCount, count - windowSize), 0);
- return windowMinIndex;
+ return Math.max(Math.min(page - sLookBehindPageCount, count - windowSize), 0);
}
protected int getAssociatedUpperPageBound(int page) {
final int count = getChildCount();
int windowSize = Math.min(count, sLookBehindPageCount + sLookAheadPageCount + 1);
- int windowMaxIndex = Math.min(Math.max(page + sLookAheadPageCount, windowSize - 1),
+ return Math.min(Math.max(page + sLookAheadPageCount, windowSize - 1),
count - 1);
- return windowMaxIndex;
}
@Override
protected String getCurrentPageDescription() {
int page = (mNextPage != INVALID_PAGE) ? mNextPage : mCurrentPage;
int stringId = R.string.default_scroll_format;
- int count = 0;
-
- if (page < mNumAppsPages) {
- stringId = R.string.apps_customize_apps_scroll_format;
- count = mNumAppsPages;
+
+ if (mJoinWidgetsApps) {
+ int count;
+
+ if (page < mNumAppsPages) {
+ stringId = R.string.apps_customize_apps_scroll_format;
+ count = mNumAppsPages;
+ } else {
+ page -= mNumAppsPages;
+ stringId = R.string.apps_customize_widgets_scroll_format;
+ count = mNumWidgetPages;
+ }
+
+ return String.format(getContext().getString(stringId), page + 1, count);
} else {
- page -= mNumAppsPages;
- stringId = R.string.apps_customize_widgets_scroll_format;
- count = mNumWidgetPages;
+ switch (mContentType) {
+ case Applications:
+ stringId = R.string.apps_customize_apps_scroll_format;
+ break;
+ case Widgets:
+ stringId = R.string.apps_customize_widgets_scroll_format;
+ break;
+ }
+ return String.format(getContext().getString(stringId), page + 1, getChildCount());
}
-
- return String.format(getContext().getString(stringId), page + 1, count);
}
}
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/cyanogenmod/trebuchet/AppsCustomizeTabHost.java
index 5eb848306..067b98ff2 100644
--- a/src/com/android/launcher2/AppsCustomizeTabHost.java
+++ b/src/com/cyanogenmod/trebuchet/AppsCustomizeTabHost.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -33,13 +33,14 @@ import android.widget.TabHost;
import android.widget.TabWidget;
import android.widget.TextView;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
+import com.cyanogenmod.trebuchet.preference.PreferencesProvider;
import java.util.ArrayList;
public class AppsCustomizeTabHost extends TabHost implements LauncherTransitionable,
TabHost.OnTabChangeListener {
- static final String LOG_TAG = "AppsCustomizeTabHost";
+ private static final String TAG = "Trebuchet.AppsCustomizeTabHost";
private static final String APPS_TAB_TAG = "APPS";
private static final String WIDGETS_TAB_TAG = "WIDGETS";
@@ -56,6 +57,10 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
private boolean mResetAfterTransition;
private Runnable mRelayoutAndMakeVisible;
+ // Preferences
+ private boolean mJoinWidgetsApps;
+ private boolean mFadeScrollingIndicator;
+
public AppsCustomizeTabHost(Context context, AttributeSet attrs) {
super(context, attrs);
mLayoutInflater = LayoutInflater.from(context);
@@ -65,6 +70,10 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
mTabsContainer.setAlpha(1f);
}
};
+
+ // Preferences
+ mJoinWidgetsApps = PreferencesProvider.Interface.Drawer.getJoinWidgetsApps();
+ mFadeScrollingIndicator = PreferencesProvider.Interface.Drawer.Indicator.getFadeScrollingIndicator();
}
/**
@@ -85,6 +94,7 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
}
void selectWidgetsTab() {
setContentTypeImmediate(AppsCustomizePagedView.ContentType.Widgets);
+ mAppsCustomizePane.setCurrentPageToWidgets();
}
/**
@@ -121,6 +131,14 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
tabView = (TextView) mLayoutInflater.inflate(R.layout.tab_widget_indicator, tabs, false);
tabView.setText(label);
tabView.setContentDescription(label);
+ if (getContext() instanceof Launcher) {
+ tabView.setOnLongClickListener(new View.OnLongClickListener() {
+ public boolean onLongClick(View v) {
+ ((Launcher) getContext()).onLongClickAppsTab(v);
+ return true;
+ }
+ });
+ }
addTab(newTabSpec(APPS_TAB_TAG).setIndicator(tabView).setContent(contentFactory));
label = getContext().getString(R.string.widgets_tab_label);
tabView = (TextView) mLayoutInflater.inflate(R.layout.tab_widget_indicator, tabs, false);
@@ -136,6 +154,10 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
View shopButton = findViewById(R.id.market_button);
shopButton.setOnKeyListener(keyListener);
+ // Soft menu button
+ View overflowMenuButton = findViewById(R.id.overflow_menu_button);
+ overflowMenuButton.setOnKeyListener(keyListener);
+
// Hide the tab bar until we measure
mTabsContainer.setAlpha(0f);
}
@@ -161,11 +183,8 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
public boolean onInterceptTouchEvent(MotionEvent ev) {
// If we are mid transitioning to the workspace, then intercept touch events here so we
// can ignore them, otherwise we just let all apps handle the touch events.
- if (mInTransition && mTransitioningToWorkspace) {
- return true;
- }
- return super.onInterceptTouchEvent(ev);
- };
+ return mInTransition && mTransitioningToWorkspace || super.onInterceptTouchEvent(ev);
+ }
@Override
public boolean onTouchEvent(MotionEvent event) {
@@ -202,97 +221,98 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
public void onTabChanged(String tabId) {
final AppsCustomizePagedView.ContentType type = getContentTypeForTabTag(tabId);
- // Animate the changing of the tab content by fading pages in and out
- final Resources res = getResources();
- final int duration = res.getInteger(R.integer.config_tabTransitionDuration);
+ if (!mAppsCustomizePane.isContentType(type) || mJoinWidgetsApps) {
- // We post a runnable here because there is a delay while the first page is loading and
- // the feedback from having changed the tab almost feels better than having it stick
- post(new Runnable() {
- @Override
- public void run() {
- if (mAppsCustomizePane.getMeasuredWidth() <= 0 ||
- mAppsCustomizePane.getMeasuredHeight() <= 0) {
- reloadCurrentPage();
- return;
- }
+ // Animate the changing of the tab content by fading pages in and out
+ final Resources res = getResources();
+ final int duration = res.getInteger(R.integer.config_tabTransitionDuration);
- // Take the visible pages and re-parent them temporarily to mAnimatorBuffer
- // and then cross fade to the new pages
- int[] visiblePageRange = new int[2];
- mAppsCustomizePane.getVisiblePages(visiblePageRange);
- if (visiblePageRange[0] == -1 && visiblePageRange[1] == -1) {
- // If we can't get the visible page ranges, then just skip the animation
- reloadCurrentPage();
- return;
- }
- ArrayList<View> visiblePages = new ArrayList<View>();
- for (int i = visiblePageRange[0]; i <= visiblePageRange[1]; i++) {
- visiblePages.add(mAppsCustomizePane.getPageAt(i));
- }
-
- // We want the pages to be rendered in exactly the same way as they were when
- // their parent was mAppsCustomizePane -- so set the scroll on mAnimationBuffer
- // to be exactly the same as mAppsCustomizePane, and below, set the left/top
- // parameters to be correct for each of the pages
- mAnimationBuffer.scrollTo(mAppsCustomizePane.getScrollX(), 0);
-
- // mAppsCustomizePane renders its children in reverse order, so
- // add the pages to mAnimationBuffer in reverse order to match that behavior
- for (int i = visiblePages.size() - 1; i >= 0; i--) {
- View child = visiblePages.get(i);
- if (child instanceof PagedViewCellLayout) {
- ((PagedViewCellLayout) child).resetChildrenOnKeyListeners();
- } else if (child instanceof PagedViewGridLayout) {
- ((PagedViewGridLayout) child).resetChildrenOnKeyListeners();
- }
- PagedViewWidget.setDeletePreviewsWhenDetachedFromWindow(false);
- mAppsCustomizePane.removeView(child);
- PagedViewWidget.setDeletePreviewsWhenDetachedFromWindow(true);
- mAnimationBuffer.setAlpha(1f);
- mAnimationBuffer.setVisibility(View.VISIBLE);
- LayoutParams p = new FrameLayout.LayoutParams(child.getMeasuredWidth(),
- child.getMeasuredHeight());
- p.setMargins((int) child.getLeft(), (int) child.getTop(), 0, 0);
- mAnimationBuffer.addView(child, p);
- }
-
- // Toggle the new content
- onTabChangedStart();
- onTabChangedEnd(type);
-
- // Animate the transition
- ObjectAnimator outAnim = LauncherAnimUtils.ofFloat(mAnimationBuffer, "alpha", 0f);
- outAnim.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- mAnimationBuffer.setVisibility(View.GONE);
- mAnimationBuffer.removeAllViews();
- }
- @Override
- public void onAnimationCancel(Animator animation) {
- mAnimationBuffer.setVisibility(View.GONE);
- mAnimationBuffer.removeAllViews();
+ // We post a runnable here because there is a delay while the first page is loading and
+ // the feedback from having changed the tab almost feels better than having it stick
+ post(new Runnable() {
+ @Override
+ public void run() {
+ if (mAppsCustomizePane.getMeasuredWidth() <= 0 ||
+ mAppsCustomizePane.getMeasuredHeight() <= 0) {
+ reloadCurrentPage();
+ return;
}
- });
- ObjectAnimator inAnim = LauncherAnimUtils.ofFloat(mAppsCustomizePane, "alpha", 1f);
- inAnim.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
+ // Take the visible pages and re-parent them temporarily to mAnimatorBuffer
+ // and then cross fade to the new pages
+ int[] visiblePageRange = new int[2];
+ mAppsCustomizePane.getVisiblePages(visiblePageRange);
+ if (visiblePageRange[0] == -1 && visiblePageRange[1] == -1) {
+ // If we can't get the visible page ranges, then just skip the animation
reloadCurrentPage();
+ return;
}
- });
-
- final AnimatorSet animSet = LauncherAnimUtils.createAnimatorSet();
- animSet.playTogether(outAnim, inAnim);
- animSet.setDuration(duration);
- post(new Runnable() {
- public void run() {
- animSet.start();
+ ArrayList<View> visiblePages = new ArrayList<View>();
+ for (int i = visiblePageRange[0]; i <= visiblePageRange[1]; i++) {
+ visiblePages.add(mAppsCustomizePane.getPageAt(i));
}
- });
- }
- });
+ // We want the pages to be rendered in exactly the same way as they were when
+ // their parent was mAppsCustomizePane -- so set the scroll on mAnimationBuffer
+ // to be exactly the same as mAppsCustomizePane, and below, set the left/top
+ // parameters to be correct for each of the pages
+ mAnimationBuffer.scrollTo(mAppsCustomizePane.getScrollX(), 0);
+
+ // mAppsCustomizePane renders its children in reverse order, so
+ // add the pages to mAnimationBuffer in reverse order to match that behavior
+ for (int i = visiblePages.size() - 1; i >= 0; i--) {
+ View child = visiblePages.get(i);
+ if (child instanceof PagedViewCellLayout) {
+ ((PagedViewCellLayout) child).resetChildrenOnKeyListeners();
+ } else if (child instanceof PagedViewGridLayout) {
+ ((PagedViewGridLayout) child).resetChildrenOnKeyListeners();
+ }
+ PagedViewWidget.setDeletePreviewsWhenDetachedFromWindow(false);
+ mAppsCustomizePane.removeView(child);
+ PagedViewWidget.setDeletePreviewsWhenDetachedFromWindow(true);
+ mAnimationBuffer.setAlpha(1f);
+ mAnimationBuffer.setVisibility(View.VISIBLE);
+ LayoutParams p = new FrameLayout.LayoutParams(child.getMeasuredWidth(),
+ child.getMeasuredHeight());
+ p.setMargins(child.getLeft(), child.getTop(), 0, 0);
+ mAnimationBuffer.addView(child, p);
+ }
+
+ // Toggle the new content
+ onTabChangedStart();
+ onTabChangedEnd(type);
+
+ // Animate the transition
+ ObjectAnimator outAnim = LauncherAnimUtils.ofFloat(mAnimationBuffer, "alpha", 0f);
+ outAnim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ mAnimationBuffer.setVisibility(View.GONE);
+ mAnimationBuffer.removeAllViews();
+ }
+ @Override
+ public void onAnimationCancel(Animator animation) {
+ mAnimationBuffer.setVisibility(View.GONE);
+ mAnimationBuffer.removeAllViews();
+ }
+ });
+ ObjectAnimator inAnim = LauncherAnimUtils.ofFloat(mAppsCustomizePane, "alpha", 1f);
+ inAnim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ reloadCurrentPage();
+ }
+ });
+
+ final AnimatorSet animSet = LauncherAnimUtils.createAnimatorSet();
+ animSet.playTogether(outAnim, inAnim);
+ animSet.setDuration(duration);
+ post(new Runnable() {
+ public void run() {
+ animSet.start();
+ }
+ });
+ }
+ });
+ }
}
public void setCurrentTabFromContent(AppsCustomizePagedView.ContentType type) {
@@ -426,7 +446,7 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
// prevent slowing down the animation)
mAppsCustomizePane.loadAssociatedPages(mAppsCustomizePane.getCurrentPage());
- if (!LauncherApplication.isScreenLarge()) {
+ if (!LauncherApplication.isScreenLarge() && mFadeScrollingIndicator) {
mAppsCustomizePane.hideScrollingIndicator(false);
}
diff --git a/src/com/android/launcher2/BubbleTextView.java b/src/com/cyanogenmod/trebuchet/BubbleTextView.java
index c5bed1694..8a48b1645 100644
--- a/src/com/android/launcher2/BubbleTextView.java
+++ b/src/com/cyanogenmod/trebuchet/BubbleTextView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.content.res.Resources;
@@ -33,8 +33,7 @@ import android.widget.TextView;
* because we want to make the bubble taller than the text and TextView's clip is
* too aggressive.
*/
-public class BubbleTextView extends TextView {
- static final float CORNER_RADIUS = 4.0f;
+public class BubbleTextView extends TextView implements ShortcutInfo.ShortcutListener {
static final float SHADOW_LARGE_RADIUS = 4.0f;
static final float SHADOW_SMALL_RADIUS = 1.75f;
static final float SHADOW_Y_OFFSET = 2.0f;
@@ -61,6 +60,9 @@ public class BubbleTextView extends TextView {
private boolean mStayPressed;
private CheckLongPressHelper mLongPressHelper;
+ private boolean mTextVisible = true;
+ private CharSequence mVisibleText;
+
public BubbleTextView(Context context) {
super(context);
init();
@@ -95,6 +97,7 @@ public class BubbleTextView extends TextView {
null, null);
setText(info.title);
setTag(info);
+ info.setListener(this);
}
@Override
@@ -158,6 +161,15 @@ public class BubbleTextView extends TextView {
super.drawableStateChanged();
}
+ @Override
+ public void onTitleChanged(CharSequence title) {
+ if (mTextVisible) {
+ setText(title);
+ } else {
+ mVisibleText = title;
+ }
+ }
+
/**
* Draw this BubbleTextView into the given Canvas.
*
@@ -339,4 +351,15 @@ public class BubbleTextView extends TextView {
mLongPressHelper.cancelLongPress();
}
+
+ public void setTextVisible(boolean visible) {
+ if (mTextVisible == visible) return;
+ mTextVisible = visible;
+ if (visible) {
+ setText(mVisibleText);
+ } else {
+ mVisibleText = getText();
+ setText("");
+ }
+ }
}
diff --git a/src/com/android/launcher2/ButtonDropTarget.java b/src/com/cyanogenmod/trebuchet/ButtonDropTarget.java
index 1c9fa5f95..9317d1d3d 100644
--- a/src/com/android/launcher2/ButtonDropTarget.java
+++ b/src/com/cyanogenmod/trebuchet/ButtonDropTarget.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.content.res.Resources;
@@ -24,7 +24,7 @@ import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.TextView;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
/**
@@ -71,9 +71,9 @@ public class ButtonDropTarget extends TextView implements DropTarget, DragContro
protected Drawable getCurrentDrawable() {
Drawable[] drawables = getCompoundDrawables();
- for (int i = 0; i < drawables.length; ++i) {
- if (drawables[i] != null) {
- return drawables[i];
+ for (Drawable drawable : drawables) {
+ if (drawable != null) {
+ return drawable;
}
}
return null;
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/cyanogenmod/trebuchet/CellLayout.java
index 7818da435..a59a96e0d 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/cyanogenmod/trebuchet/CellLayout.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -48,8 +48,7 @@ import android.view.animation.Animation;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.LayoutAnimationController;
-import com.android.launcher.R;
-import com.android.launcher2.FolderIcon.FolderRingAnimator;
+import com.cyanogenmod.trebuchet.FolderIcon.FolderRingAnimator;
import java.util.ArrayList;
import java.util.Arrays;
@@ -59,11 +58,14 @@ import java.util.HashMap;
import java.util.Stack;
public class CellLayout extends ViewGroup {
- static final String TAG = "CellLayout";
+ private static final String TAG = "Trebuchet.CellLayout";
private Launcher mLauncher;
private int mCellWidth;
private int mCellHeight;
+ // Save values before applying grid-size related changes. We may need to reset it.
+ private int mOriginalCellWidth;
+ private int mOriginalCellHeight;
private int mCountX;
private int mCountY;
@@ -138,8 +140,7 @@ public class CellLayout extends ViewGroup {
private TimeInterpolator mEaseOutInterpolator;
private ShortcutAndWidgetContainer mShortcutsAndWidgets;
- private boolean mIsHotseat = false;
- private float mHotseatScale = 1f;
+ private float mChildrenScale = 1f;
public static final int MODE_DRAG_OVER = 0;
public static final int MODE_ON_DROP = 1;
@@ -185,13 +186,13 @@ public class CellLayout extends ViewGroup {
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CellLayout, defStyle, 0);
- mCellWidth = a.getDimensionPixelSize(R.styleable.CellLayout_cellWidth, 10);
- mCellHeight = a.getDimensionPixelSize(R.styleable.CellLayout_cellHeight, 10);
+ mCellWidth = mOriginalCellWidth = a.getDimensionPixelSize(R.styleable.CellLayout_cellWidth, 10);
+ mCellHeight = mOriginalCellHeight = a.getDimensionPixelSize(R.styleable.CellLayout_cellHeight, 10);
mWidthGap = mOriginalWidthGap = a.getDimensionPixelSize(R.styleable.CellLayout_widthGap, 0);
mHeightGap = mOriginalHeightGap = a.getDimensionPixelSize(R.styleable.CellLayout_heightGap, 0);
mMaxGap = a.getDimensionPixelSize(R.styleable.CellLayout_maxGap, 0);
- mCountX = LauncherModel.getCellCountX();
- mCountY = LauncherModel.getCellCountY();
+ mCountX = LauncherModel.getWorkspaceCellCountX();
+ mCountY = LauncherModel.getWorkspaceCellCountY();
mOccupied = new boolean[mCountX][mCountY];
mTmpOccupied = new boolean[mCountX][mCountY];
mPreviousReorderDirection[0] = INVALID_DIRECTION;
@@ -202,8 +203,6 @@ public class CellLayout extends ViewGroup {
setAlwaysDrawnWithCacheEnabled(false);
final Resources res = getResources();
- mHotseatScale = (res.getInteger(R.integer.hotseat_item_scale_percentage) / 100f);
-
mNormalBackground = res.getDrawable(R.drawable.homescreen_blue_normal_holo);
mActiveGlowBackground = res.getDrawable(R.drawable.homescreen_blue_strong_holo);
@@ -282,6 +281,12 @@ public class CellLayout extends ViewGroup {
mForegroundRect = new Rect();
mShortcutsAndWidgets = new ShortcutAndWidgetContainer(context);
+
+ if (!LauncherApplication.isScreenLarge()){
+ mCellWidth = (mCellWidth * res.getInteger(R.integer.default_cell_count_x)) / mCountX;
+ mCellHeight = (mCellHeight * res.getInteger(R.integer.default_cell_count_y)) / mCountY;
+ }
+
mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap);
addView(mShortcutsAndWidgets);
}
@@ -320,8 +325,12 @@ public class CellLayout extends ViewGroup {
mShortcutsAndWidgets.buildLayer();
}
+ public void setChildrenScale(float childrenScale) {
+ mChildrenScale = childrenScale;
+ }
+
public float getChildrenScale() {
- return mIsHotseat ? mHotseatScale : 1.0f;
+ return mChildrenScale;
}
public void setGridSize(int x, int y) {
@@ -330,6 +339,12 @@ public class CellLayout extends ViewGroup {
mOccupied = new boolean[mCountX][mCountY];
mTmpOccupied = new boolean[mCountX][mCountY];
mTempRectStack.clear();
+
+ // Reset scaling if the grid has been modified. This is a folder or the hotseat
+ mCellWidth = mOriginalCellWidth;
+ mCellHeight = mOriginalCellHeight;
+ mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap);
+
requestLayout();
}
@@ -348,7 +363,7 @@ public class CellLayout extends ViewGroup {
mOverScrollForegroundDrawable = mOverScrollRight;
}
- mForegroundAlpha = (int) Math.round((r * 255));
+ mForegroundAlpha = Math.round((r * 255));
mOverScrollForegroundDrawable.setAlpha(mForegroundAlpha);
invalidate();
}
@@ -391,6 +406,7 @@ public class CellLayout extends ViewGroup {
setOverScrollAmount(0, false);
setPivotX(getMeasuredWidth() / 2);
setPivotY(getMeasuredHeight() / 2);
+ setCameraDistance(1280 * LauncherApplication.getScreenDensity());
}
}
@@ -480,14 +496,12 @@ public class CellLayout extends ViewGroup {
int previewOffset = FolderRingAnimator.sPreviewSize;
// The folder outer / inner ring image(s)
- for (int i = 0; i < mFolderOuterRings.size(); i++) {
- FolderRingAnimator fra = mFolderOuterRings.get(i);
-
+ for (FolderRingAnimator ringAnimator : mFolderOuterRings) {
// Draw outer ring
Drawable d = FolderRingAnimator.sSharedOuterRingDrawable;
- int width = (int) fra.getOuterRingSize();
+ int width = (int) ringAnimator.getOuterRingSize();
int height = width;
- cellToPoint(fra.mCellX, fra.mCellY, mTempLocation);
+ cellToPoint(ringAnimator.mCellX, ringAnimator.mCellY, mTempLocation);
int centerX = mTempLocation[0] + mCellWidth / 2;
int centerY = mTempLocation[1] + previewOffset / 2;
@@ -500,9 +514,9 @@ public class CellLayout extends ViewGroup {
// Draw inner ring
d = FolderRingAnimator.sSharedInnerRingDrawable;
- width = (int) fra.getInnerRingSize();
+ width = (int) ringAnimator.getInnerRingSize();
height = width;
- cellToPoint(fra.mCellX, fra.mCellY, mTempLocation);
+ cellToPoint(ringAnimator.mCellX, ringAnimator.mCellY, mTempLocation);
centerX = mTempLocation[0] + mCellWidth / 2;
centerY = mTempLocation[1] + previewOffset / 2;
@@ -598,24 +612,15 @@ 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) {
final LayoutParams lp = params;
- // Hotseat icons - remove text
if (child instanceof BubbleTextView) {
BubbleTextView bubbleChild = (BubbleTextView) child;
Resources res = getResources();
- if (mIsHotseat) {
- bubbleChild.setTextColor(res.getColor(android.R.color.transparent));
- } else {
- bubbleChild.setTextColor(res.getColor(R.color.workspace_icon_text_color));
- }
+ bubbleChild.setTextColor(res.getColor(R.color.workspace_icon_text_color));
}
child.setScaleX(getChildrenScale());
@@ -882,9 +887,13 @@ public class CellLayout extends ViewGroup {
public float getDistanceFromCell(float x, float y, int[] cell) {
cellToCenterPoint(cell[0], cell[1], mTmpPoint);
- float distance = (float) Math.sqrt( Math.pow(x - mTmpPoint[0], 2) +
+ return (float) Math.sqrt( Math.pow(x - mTmpPoint[0], 2) +
Math.pow(y - mTmpPoint[1], 2));
- return distance;
+ }
+
+ void setCellGaps(int widthGap, int heightGap) {
+ mWidthGap = mOriginalWidthGap = widthGap;
+ mHeightGap = mOriginalHeightGap = heightGap;
}
int getCellWidth() {
@@ -990,6 +999,7 @@ public class CellLayout extends ViewGroup {
mHeightGap = mOriginalHeightGap;
}
+
// Initial values correspond to widthSpecMode == MeasureSpec.EXACTLY
int newWidth = widthSpecSize;
int newHeight = heightSpecSize;
@@ -1134,7 +1144,7 @@ public class CellLayout extends ViewGroup {
va.addUpdateListener(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
- float r = ((Float) animation.getAnimatedValue()).floatValue();
+ float r = (Float) animation.getAnimatedValue();
lp.x = (int) ((1 - r) * oldX + r * newX);
lp.y = (int) ((1 - r) * oldY + r * newY);
child.requestLayout();
@@ -1435,9 +1445,6 @@ public class CellLayout extends ViewGroup {
hitMaxY |= ySize >= spanY;
incX = !incX;
}
- incX = true;
- hitMaxX = xSize >= spanX;
- hitMaxY = ySize >= spanY;
}
final int[] cellXY = mTmpXY;
cellToCenterPoint(x, y, cellXY);
@@ -2135,9 +2142,7 @@ public class CellLayout extends ViewGroup {
private void copyOccupiedArray(boolean[][] occupied) {
for (int i = 0; i < mCountX; i++) {
- for (int j = 0; j < mCountY; j++) {
- occupied[i][j] = mOccupied[i][j];
- }
+ System.arraycopy(mOccupied[i], 0, occupied[i], 0, mCountY);
}
}
@@ -2154,10 +2159,9 @@ public class CellLayout extends ViewGroup {
int result[] = new int[2];
result = findNearestArea(pixelX, pixelY, spanX, spanY, result);
- boolean success = false;
// First we try the exact nearest position of the item being dragged,
// we will then want to try to move this around to other neighbouring positions
- success = rearrangementExists(result[0], result[1], spanX, spanY, direction, dragView,
+ boolean success = rearrangementExists(result[0], result[1], spanX, spanY, direction, dragView,
solution);
if (!success) {
@@ -2332,7 +2336,7 @@ public class CellLayout extends ViewGroup {
va.addUpdateListener(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
- float r = ((Float) animation.getAnimatedValue()).floatValue();
+ float r = (Float) animation.getAnimatedValue();
float x = r * finalDeltaX + (1 - r) * initDeltaX;
float y = r * finalDeltaY + (1 - r) * initDeltaY;
child.setTranslationX(x);
@@ -2388,9 +2392,7 @@ public class CellLayout extends ViewGroup {
private void commitTempPlacement() {
for (int i = 0; i < mCountX; i++) {
- for (int j = 0; j < mCountY; j++) {
- mOccupied[i][j] = mTmpOccupied[i][j];
- }
+ System.arraycopy(mTmpOccupied[i], 0, mOccupied[i], 0, mCountY);
}
int childCount = mShortcutsAndWidgets.getChildCount();
for (int i = 0; i < childCount; i++) {
@@ -2422,7 +2424,7 @@ public class CellLayout extends ViewGroup {
}
ItemConfiguration findConfigurationNoShuffle(int pixelX, int pixelY, int minSpanX, int minSpanY,
- int spanX, int spanY, View dragView, ItemConfiguration solution) {
+ int spanX, int spanY, ItemConfiguration solution) {
int[] result = new int[2];
int[] resultSpan = new int[2];
findNearestVacantArea(pixelX, pixelY, minSpanX, minSpanY, spanX, spanY, null, result,
@@ -2602,7 +2604,7 @@ public class CellLayout extends ViewGroup {
// We attempt the approach which doesn't shuffle views at all
ItemConfiguration noShuffleSolution = findConfigurationNoShuffle(pixelX, pixelY, minSpanX,
- minSpanY, spanX, spanY, dragView, new ItemConfiguration());
+ minSpanY, spanX, spanY, new ItemConfiguration());
ItemConfiguration finalSolution = null;
if (swapSolution.isSolution && swapSolution.area() >= noShuffleSolution.area()) {
@@ -2887,7 +2889,6 @@ public class CellLayout extends ViewGroup {
// intersecting
intersectX = -1;
intersectY = -1;
- continue;
}
}
@@ -3252,8 +3253,8 @@ out: for (int i = x; i < x + spanX - 1 && x < xCount; i++) {
leftMargin - rightMargin;
height = myCellVSpan * cellHeight + ((myCellVSpan - 1) * heightGap) -
topMargin - bottomMargin;
- x = (int) (myCellX * (cellWidth + widthGap) + leftMargin);
- y = (int) (myCellY * (cellHeight + heightGap) + topMargin);
+ x = myCellX * (cellWidth + widthGap) + leftMargin;
+ y = myCellY * (cellHeight + heightGap) + topMargin;
}
}
diff --git a/src/com/android/launcher2/CheckLongPressHelper.java b/src/com/cyanogenmod/trebuchet/CheckLongPressHelper.java
index 5c3752ad6..4b17fee4c 100644
--- a/src/com/android/launcher2/CheckLongPressHelper.java
+++ b/src/com/cyanogenmod/trebuchet/CheckLongPressHelper.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.view.View;
diff --git a/src/com/android/launcher2/Cling.java b/src/com/cyanogenmod/trebuchet/Cling.java
index 971d9ff53..d3abe07f1 100644
--- a/src/com/android/launcher2/Cling.java
+++ b/src/com/cyanogenmod/trebuchet/Cling.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.content.res.Resources;
@@ -33,12 +33,11 @@ import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
-import com.android.launcher.R;
-
public class Cling extends FrameLayout {
static final String WORKSPACE_CLING_DISMISSED_KEY = "cling.workspace.dismissed";
static final String ALLAPPS_CLING_DISMISSED_KEY = "cling.allapps.dismissed";
+ static final String ALLAPPS_SORT_CLING_DISMISSED_KEY = "cling.allappssort.dismissed";
static final String FOLDER_CLING_DISMISSED_KEY = "cling.folder.dismissed";
private static String WORKSPACE_PORTRAIT = "workspace_portrait";
@@ -50,9 +49,12 @@ public class Cling extends FrameLayout {
private static String ALLAPPS_LANDSCAPE = "all_apps_landscape";
private static String ALLAPPS_LARGE = "all_apps_large";
+ private static String ALLAPPS_SORT_PORTRAIT = "all_apps_sort_portrait";
+ private static String ALLAPPS_SORT_LANDSCAPE = "all_apps_sort_landscape";
private static String FOLDER_PORTRAIT = "folder_portrait";
private static String FOLDER_LANDSCAPE = "folder_landscape";
private static String FOLDER_LARGE = "folder_large";
+ private static String ALLAPPS_SORT_LARGE = "all_apps_sort_large";
private Launcher mLauncher;
private boolean mIsInitialized;
@@ -65,6 +67,7 @@ public class Cling extends FrameLayout {
private int mButtonBarHeight;
private float mRevealRadius;
private int[] mPositionData;
+ private boolean mDismissed;
private Paint mErasePaint;
@@ -90,6 +93,7 @@ public class Cling extends FrameLayout {
if (!mIsInitialized) {
mLauncher = l;
mPositionData = positionData;
+ mDismissed = false;
Resources r = getContext().getResources();
@@ -109,6 +113,14 @@ public class Cling extends FrameLayout {
}
}
+ void dismiss() {
+ mDismissed = true;
+ }
+
+ boolean isDismissed() {
+ return mDismissed;
+ }
+
void cleanup() {
mBackground = null;
mPunchThroughGraphic = null;
@@ -131,8 +143,11 @@ public class Cling extends FrameLayout {
final int cornerYOffset = (int) (scale * 10);
return new int[]{getMeasuredWidth() - cornerXOffset, cornerYOffset};
} else if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
- mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) ||
- mDrawIdentifier.equals(ALLAPPS_LARGE)) {
+ mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) ||
+ mDrawIdentifier.equals(ALLAPPS_LARGE) ||
+ mDrawIdentifier.equals(ALLAPPS_SORT_PORTRAIT) ||
+ mDrawIdentifier.equals(ALLAPPS_SORT_LANDSCAPE) ||
+ mDrawIdentifier.equals(ALLAPPS_SORT_LARGE)) {
return mPositionData;
}
return new int[]{-1, -1};
@@ -166,7 +181,10 @@ public class Cling extends FrameLayout {
mDrawIdentifier.equals(WORKSPACE_LARGE) ||
mDrawIdentifier.equals(ALLAPPS_PORTRAIT) ||
mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) ||
- mDrawIdentifier.equals(ALLAPPS_LARGE)) {
+ mDrawIdentifier.equals(ALLAPPS_LARGE) ||
+ mDrawIdentifier.equals(ALLAPPS_SORT_PORTRAIT) ||
+ mDrawIdentifier.equals(ALLAPPS_SORT_LANDSCAPE) ||
+ mDrawIdentifier.equals(ALLAPPS_SORT_LARGE)) {
int[] positions = getPunchThroughPositions();
for (int i = 0; i < positions.length; i += 2) {
@@ -189,7 +207,7 @@ public class Cling extends FrameLayout {
}
}
return true;
- };
+ }
@Override
protected void dispatchDraw(Canvas canvas) {
@@ -262,10 +280,10 @@ public class Cling extends FrameLayout {
canvas.drawBitmap(b, 0, 0, null);
c.setBitmap(null);
- b = null;
+ b.recycle();
}
// Draw the rest of the cling
super.dispatchDraw(canvas);
- };
+ }
}
diff --git a/src/com/android/launcher2/DeferredHandler.java b/src/com/cyanogenmod/trebuchet/DeferredHandler.java
index cee27dfa8..747a832e8 100644
--- a/src/com/android/launcher2/DeferredHandler.java
+++ b/src/com/cyanogenmod/trebuchet/DeferredHandler.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.os.Handler;
import android.os.Looper;
diff --git a/src/com/android/launcher2/DeleteDropTarget.java b/src/com/cyanogenmod/trebuchet/DeleteDropTarget.java
index 39a0b09c7..d66a068ed 100644
--- a/src/com/android/launcher2/DeleteDropTarget.java
+++ b/src/com/cyanogenmod/trebuchet/DeleteDropTarget.java
@@ -14,19 +14,23 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.content.Context;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.PointF;
import android.graphics.Rect;
-import android.graphics.drawable.TransitionDrawable;
+import android.graphics.drawable.Drawable;
+import android.os.Handler;
import android.util.AttributeSet;
+import android.view.HapticFeedbackConstants;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
@@ -34,21 +38,27 @@ import android.view.animation.AnimationUtils;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.LinearInterpolator;
-import com.android.launcher.R;
-
public class DeleteDropTarget extends ButtonDropTarget {
- private static int DELETE_ANIMATION_DURATION = 285;
- private static int FLING_DELETE_ANIMATION_DURATION = 350;
- private static float FLING_TO_DELETE_FRICTION = 0.035f;
- private static int MODE_FLING_DELETE_TO_TRASH = 0;
- private static int MODE_FLING_DELETE_ALONG_VECTOR = 1;
+ private static final int DELETE_ANIMATION_DURATION = 285;
+ private static final int FLING_DELETE_ANIMATION_DURATION = 350;
+ private static final float FLING_TO_DELETE_FRICTION = 0.035f;
+ private static final int MODE_FLING_DELETE_TO_TRASH = 0;
+ private static final int MODE_FLING_DELETE_ALONG_VECTOR = 1;
private final int mFlingDeleteMode = MODE_FLING_DELETE_ALONG_VECTOR;
+ private static final int MODE_DELETE = 0;
+ private static final int MODE_UNINSTALL = 1;
+ private int mMode = MODE_DELETE;
+
private ColorStateList mOriginalTextColor;
- private TransitionDrawable mUninstallDrawable;
- private TransitionDrawable mRemoveDrawable;
- private TransitionDrawable mCurrentDrawable;
+ private Drawable mUninstallActiveDrawable;
+ private Drawable mRemoveActiveDrawable;
+ private Drawable mRemoveNormalDrawable;
+ private Drawable mCurrentDrawable;
+ private boolean mUninstall;
+
+ private final Handler mHandler = new Handler();
public DeleteDropTarget(Context context, AttributeSet attrs) {
this(context, attrs, 0);
@@ -58,6 +68,13 @@ public class DeleteDropTarget extends ButtonDropTarget {
super(context, attrs, defStyle);
}
+ private final Runnable mShowUninstaller = new Runnable() {
+ public void run() {
+ performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
+ switchToUninstallTarget();
+ }
+ };
+
@Override
protected void onFinishInflate() {
super.onFinishInflate();
@@ -68,26 +85,23 @@ public class DeleteDropTarget extends ButtonDropTarget {
// Get the hover color
Resources r = getResources();
mHoverColor = r.getColor(R.color.delete_target_hover_tint);
- mUninstallDrawable = (TransitionDrawable)
- r.getDrawable(R.drawable.uninstall_target_selector);
- mRemoveDrawable = (TransitionDrawable) r.getDrawable(R.drawable.remove_target_selector);
+ mUninstallActiveDrawable = r.getDrawable(R.drawable.ic_launcher_trashcan_active_holo);
+ mRemoveActiveDrawable = r.getDrawable(R.drawable.ic_launcher_clear_active_holo);
+ mRemoveNormalDrawable = r.getDrawable(R.drawable.ic_launcher_clear_normal_holo);
- mRemoveDrawable.setCrossFadeEnabled(true);
- mUninstallDrawable.setCrossFadeEnabled(true);
-
- // The current drawable is set to either the remove drawable or the uninstall drawable
- // and is initially set to the remove drawable, as set in the layout xml.
- mCurrentDrawable = (TransitionDrawable) getCurrentDrawable();
-
- // Remove the text in the Phone UI in landscape
+ // Remove the text in landscape
int orientation = getResources().getConfiguration().orientation;
+ boolean transposeLayout = getResources().getBoolean(R.bool.hotseat_transpose_layout_with_orientation);
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
- if (!LauncherApplication.isScreenLarge()) {
+ if (transposeLayout) {
setText("");
}
}
}
+ private boolean isAllAppsItem(DragSource source, Object info) {
+ return isAllAppsApplication(source, info) || isAllAppsWidget(source, info);
+ }
private boolean isAllAppsApplication(DragSource source, Object info) {
return (source instanceof AppsCustomizePagedView) && (info instanceof ApplicationInfo);
}
@@ -98,93 +112,143 @@ public class DeleteDropTarget extends ButtonDropTarget {
switch (addInfo.itemType) {
case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
+ case LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS:
return true;
}
}
}
return false;
}
- private boolean isDragSourceWorkspaceOrFolder(DragObject d) {
- return (d.dragSource instanceof Workspace) || (d.dragSource instanceof Folder);
+ private boolean isDragSourceWorkspaceOrFolder(DragSource source) {
+ return (source instanceof Workspace) || (source instanceof Folder);
}
- private boolean isWorkspaceOrFolderApplication(DragObject d) {
- return isDragSourceWorkspaceOrFolder(d) && (d.dragInfo instanceof ShortcutInfo);
+ private boolean isWorkspaceOrFolderApplication(DragSource source, Object info) {
+ return isDragSourceWorkspaceOrFolder(source) && (info instanceof ShortcutInfo);
}
- private boolean isWorkspaceOrFolderWidget(DragObject d) {
- return isDragSourceWorkspaceOrFolder(d) && (d.dragInfo instanceof LauncherAppWidgetInfo);
+ private boolean isWorkspaceWidget(DragSource source, Object info) {
+ return isDragSourceWorkspaceOrFolder(source) && (info instanceof LauncherAppWidgetInfo);
}
- private boolean isWorkspaceFolder(DragObject d) {
- return (d.dragSource instanceof Workspace) && (d.dragInfo instanceof FolderInfo);
+ private boolean isWorkspaceFolder(DragSource source, Object info) {
+ return (source instanceof Workspace) && (info instanceof FolderInfo);
}
private void setHoverColor() {
- mCurrentDrawable.startTransition(mTransitionDuration);
setTextColor(mHoverColor);
}
private void resetHoverColor() {
- mCurrentDrawable.resetTransition();
setTextColor(mOriginalTextColor);
}
@Override
public boolean acceptDrop(DragObject d) {
- // We can remove everything including App shortcuts, folders, widgets, etc.
+ if (d.dragInfo instanceof ShortcutInfo) {
+ if (((ShortcutInfo) d.dragInfo).itemType == LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS) {
+ d.deferDragViewCleanupPostAnimation = false;
+ return false;
+ }
+ }
return true;
}
@Override
public void onDragStart(DragSource source, Object info, int dragAction) {
- boolean isVisible = true;
boolean isUninstall = false;
+ boolean isVisible = true;
- // If we are dragging a widget from AppsCustomize, hide the delete target
- if (isAllAppsWidget(source, info)) {
- isVisible = false;
- }
-
- // If we are dragging an application from AppsCustomize, only show the control if we can
- // delete the app (it was downloaded), and rename the string to "uninstall" in such a case
+ // If we are dragging an application from AppsCustomize, only show the uninstall control if we
+ // can delete the app (it was downloaded)
if (isAllAppsApplication(source, info)) {
ApplicationInfo appInfo = (ApplicationInfo) info;
if ((appInfo.flags & ApplicationInfo.DOWNLOADED_FLAG) != 0) {
isUninstall = true;
+ }
+ } else if (isWorkspaceOrFolderApplication(source, info)) {
+ ShortcutInfo shortcutInfo = (ShortcutInfo) info;
+ PackageManager pm = getContext().getPackageManager();
+ if (shortcutInfo.itemType != LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS) {
+ ResolveInfo resolveInfo = pm.resolveActivity(shortcutInfo.intent, 0);
+ if (resolveInfo != null && (resolveInfo.activityInfo.applicationInfo.flags &
+ android.content.pm.ApplicationInfo.FLAG_SYSTEM) == 0) {
+ isUninstall = true;
+ }
} else {
isVisible = false;
}
}
- if (isUninstall) {
- setCompoundDrawablesWithIntrinsicBounds(mUninstallDrawable, null, null, null);
- } else {
- setCompoundDrawablesWithIntrinsicBounds(mRemoveDrawable, null, null, null);
- }
- mCurrentDrawable = (TransitionDrawable) getCurrentDrawable();
+ setCompoundDrawablesWithIntrinsicBounds(mRemoveNormalDrawable, null, null, null);
+ mCurrentDrawable = getCompoundDrawables()[0];
+ mUninstall = isUninstall;
mActive = isVisible;
+ mMode = MODE_DELETE;
+
+ setTextColor(mOriginalTextColor);
resetHoverColor();
((ViewGroup) getParent()).setVisibility(isVisible ? View.VISIBLE : View.GONE);
if (getText().length() > 0) {
- setText(isUninstall ? R.string.delete_target_uninstall_label
- : R.string.delete_target_label);
+ if (isAllAppsItem(source, info)) {
+ setText(R.string.cancel_target_label);
+ } else {
+ setText(R.string.delete_target_label);
+ }
}
}
+ private void switchToUninstallTarget() {
+ if (!mUninstall) {
+ return;
+ }
+
+ mMode = MODE_UNINSTALL;
+
+ if (getText().length() > 0) {
+ setText(R.string.delete_target_uninstall_label);
+ }
+
+ setCompoundDrawablesWithIntrinsicBounds(mUninstallActiveDrawable, null, null, null);
+ mCurrentDrawable = getCompoundDrawables()[0];
+ }
+
@Override
public void onDragEnd() {
super.onDragEnd();
+
mActive = false;
}
public void onDragEnter(DragObject d) {
super.onDragEnter(d);
+ if (mUninstall) {
+ mHandler.removeCallbacks(mShowUninstaller);
+ mHandler.postDelayed(mShowUninstaller, 1000);
+ }
+
+ setCompoundDrawablesWithIntrinsicBounds(mRemoveActiveDrawable, null, null, null);
+ mCurrentDrawable = getCompoundDrawables()[0];
+
setHoverColor();
}
public void onDragExit(DragObject d) {
super.onDragExit(d);
+ mHandler.removeCallbacks(mShowUninstaller);
+
if (!d.dragComplete) {
+ mMode = MODE_DELETE;
+
+ if (getText().length() > 0) {
+ if (isAllAppsItem(d.dragSource, d.dragInfo)) {
+ setText(R.string.cancel_target_label);
+ } else {
+ setText(R.string.delete_target_label);
+ }
+ }
+
+ setCompoundDrawablesWithIntrinsicBounds(mRemoveNormalDrawable, null, null, null);
+ mCurrentDrawable = getCompoundDrawables()[0];
resetHoverColor();
} else {
// Restore the hover color if we are deleting
@@ -218,32 +282,42 @@ public class DeleteDropTarget extends ButtonDropTarget {
private void completeDrop(DragObject d) {
ItemInfo item = (ItemInfo) d.dragInfo;
- if (isAllAppsApplication(d.dragSource, item)) {
- // Uninstall the application if it is being dragged from AppsCustomize
- mLauncher.startApplicationUninstallActivity((ApplicationInfo) item);
- } else if (isWorkspaceOrFolderApplication(d)) {
- LauncherModel.deleteItemFromDatabase(mLauncher, item);
- } else if (isWorkspaceFolder(d)) {
- // Remove the folder from the workspace and delete the contents from launcher model
- FolderInfo folderInfo = (FolderInfo) item;
- mLauncher.removeFolder(folderInfo);
- LauncherModel.deleteFolderContentsFromDatabase(mLauncher, folderInfo);
- } else if (isWorkspaceOrFolderWidget(d)) {
- // Remove the widget from the workspace
- mLauncher.removeAppWidget((LauncherAppWidgetInfo) item);
- LauncherModel.deleteItemFromDatabase(mLauncher, item);
-
- final LauncherAppWidgetInfo launcherAppWidgetInfo = (LauncherAppWidgetInfo) item;
- final LauncherAppWidgetHost appWidgetHost = mLauncher.getAppWidgetHost();
- if (appWidgetHost != null) {
- // Deleting an app widget ID is a void call but writes to disk before returning
- // to the caller...
- new Thread("deleteAppWidgetId") {
- public void run() {
- appWidgetHost.deleteAppWidgetId(launcherAppWidgetInfo.appWidgetId);
+ switch (mMode) {
+ case MODE_DELETE:
+ if (isWorkspaceOrFolderApplication(d.dragSource, item)) {
+ LauncherModel.deleteItemFromDatabase(mLauncher, item);
+ } else if (isWorkspaceFolder(d.dragSource, d.dragInfo)) {
+ // Remove the folder from the workspace and delete the contents from launcher model
+ FolderInfo folderInfo = (FolderInfo) item;
+ mLauncher.removeFolder(folderInfo);
+ LauncherModel.deleteFolderContentsFromDatabase(mLauncher, folderInfo);
+ } else if (isWorkspaceWidget(d.dragSource, item)) {
+ // Remove the widget from the workspace
+ mLauncher.removeAppWidget((LauncherAppWidgetInfo) item);
+ LauncherModel.deleteItemFromDatabase(mLauncher, item);
+
+ final LauncherAppWidgetInfo launcherAppWidgetInfo = (LauncherAppWidgetInfo) item;
+ final LauncherAppWidgetHost appWidgetHost = mLauncher.getAppWidgetHost();
+ if (appWidgetHost != null) {
+ // Deleting an app widget ID is a void call but writes to disk before returning
+ // to the caller...
+ new Thread("deleteAppWidgetId") {
+ public void run() {
+ appWidgetHost.deleteAppWidgetId(launcherAppWidgetInfo.appWidgetId);
+ }
+ }.start();
}
- }.start();
- }
+ }
+ break;
+ case MODE_UNINSTALL:
+ if (isAllAppsApplication(d.dragSource, item)) {
+ // Uninstall the application
+ mLauncher.startApplicationUninstallActivity((ApplicationInfo) item);
+ } else if (isWorkspaceOrFolderApplication(d.dragSource, item)) {
+ // Uninstall the shortcut
+ mLauncher.startShortcutUninstallActivity((ShortcutInfo) item);
+ }
+ break;
}
}
@@ -284,7 +358,7 @@ public class DeleteDropTarget extends ButtonDropTarget {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
final DragView dragView = (DragView) dragLayer.getAnimatedView();
- float t = ((Float) animation.getAnimatedValue()).floatValue();
+ float t = (Float) animation.getAnimatedValue();
float tp = scaleAlphaInterpolator.getInterpolation(t);
float initialScale = dragView.getInitialScale();
float finalAlpha = 0.5f;
@@ -332,7 +406,7 @@ public class DeleteDropTarget extends ButtonDropTarget {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
final DragView dragView = (DragView) mDragLayer.getAnimatedView();
- float t = ((Float) animation.getAnimatedValue()).floatValue();
+ float t = (Float) animation.getAnimatedValue();
long curTime = AnimationUtils.currentAnimationTimeMillis();
if (!mHasOffsetForScale) {
@@ -356,10 +430,9 @@ public class DeleteDropTarget extends ButtonDropTarget {
mVelocity.y *= mFriction;
mPrevTime = curTime;
}
- };
+ }
private AnimatorUpdateListener createFlingAlongVectorAnimatorListener(final DragLayer dragLayer,
- DragObject d, PointF vel, final long startTime, final int duration,
- ViewConfiguration config) {
+ DragObject d, PointF vel, final long startTime) {
final Rect from = new Rect();
dragLayer.getViewRectRelativeToSelf(d.dragView, from);
@@ -414,8 +487,7 @@ public class DeleteDropTarget extends ButtonDropTarget {
if (mFlingDeleteMode == MODE_FLING_DELETE_TO_TRASH) {
updateCb = createFlingToTrashAnimatorListener(dragLayer, d, vel, config);
} else if (mFlingDeleteMode == MODE_FLING_DELETE_ALONG_VECTOR) {
- updateCb = createFlingAlongVectorAnimatorListener(dragLayer, d, vel, startTime,
- duration, config);
+ updateCb = createFlingAlongVectorAnimatorListener(dragLayer, d, vel, startTime);
}
Runnable onAnimationEndRunnable = new Runnable() {
@Override
diff --git a/src/com/android/launcher2/DragController.java b/src/com/cyanogenmod/trebuchet/DragController.java
index 4c4295319..2a0569585 100644
--- a/src/com/android/launcher2/DragController.java
+++ b/src/com/cyanogenmod/trebuchet/DragController.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.content.res.Resources;
@@ -33,15 +33,13 @@ import android.view.View;
import android.view.ViewConfiguration;
import android.view.inputmethod.InputMethodManager;
-import com.android.launcher.R;
-
import java.util.ArrayList;
/**
* Class for initiating a drag within a view or across multiple views.
*/
public class DragController {
- private static final String TAG = "Launcher.DragController";
+ private static final String TAG = "Trebuchet.DragController";
/** Indicates the drag is a move. */
public static int DRAG_ACTION_MOVE = 0;
@@ -326,7 +324,7 @@ public class DragController {
}
endDrag();
}
- public void onAppsRemoved(ArrayList<String> packageNames, Context context) {
+ public void onAppsRemoved(ArrayList<String> packageNames) {
// Cancel the current drag if we are removing an app that we are dragging
if (mDragObject != null) {
Object rawDragInfo = mDragObject.dragInfo;
@@ -416,7 +414,7 @@ public class DragController {
@SuppressWarnings("all") // suppress dead code warning
final boolean debug = false;
if (debug) {
- Log.d(Launcher.TAG, "DragController.onInterceptTouchEvent " + ev + " mDragging="
+ Log.d(TAG, "onInterceptTouchEvent " + ev + " mDragging="
+ mDragging);
}
@@ -442,7 +440,7 @@ public class DragController {
if (mDragging) {
PointF vec = isFlingingToDelete(mDragObject.dragSource);
if (vec != null) {
- dropOnFlingToDeleteTarget(dragLayerX, dragLayerY, vec);
+ dropOnFlingToDeleteTarget(vec);
} else {
drop(dragLayerX, dragLayerY);
}
@@ -519,7 +517,7 @@ public class DragController {
if (mScrollState == SCROLL_OUTSIDE_ZONE) {
mScrollState = SCROLL_WAITING_IN_ZONE;
if (mDragScroller.onEnterScrollArea(x, y, SCROLL_LEFT)) {
- mLauncher.getDragLayer().onEnterScrollArea(SCROLL_LEFT);
+ mLauncher.getDragLayer().onEnterScrollArea();
mScrollRunnable.setDirection(SCROLL_LEFT);
mHandler.postDelayed(mScrollRunnable, delay);
}
@@ -528,7 +526,7 @@ public class DragController {
if (mScrollState == SCROLL_OUTSIDE_ZONE) {
mScrollState = SCROLL_WAITING_IN_ZONE;
if (mDragScroller.onEnterScrollArea(x, y, SCROLL_RIGHT)) {
- mLauncher.getDragLayer().onEnterScrollArea(SCROLL_RIGHT);
+ mLauncher.getDragLayer().onEnterScrollArea();
mScrollRunnable.setDirection(SCROLL_RIGHT);
mHandler.postDelayed(mScrollRunnable, delay);
}
@@ -584,7 +582,7 @@ public class DragController {
if (mDragging) {
PointF vec = isFlingingToDelete(mDragObject.dragSource);
if (vec != null) {
- dropOnFlingToDeleteTarget(dragLayerX, dragLayerY, vec);
+ dropOnFlingToDeleteTarget(vec);
} else {
drop(dragLayerX, dragLayerY);
}
@@ -626,7 +624,7 @@ public class DragController {
return null;
}
- private void dropOnFlingToDeleteTarget(float x, float y, PointF vel) {
+ private void dropOnFlingToDeleteTarget(PointF vel) {
final int[] coordinates = mCoordinatesTemp;
mDragObject.x = coordinates[0];
diff --git a/src/com/android/launcher2/DragLayer.java b/src/com/cyanogenmod/trebuchet/DragLayer.java
index e870d0aa1..eb7a5d118 100644
--- a/src/com/android/launcher2/DragLayer.java
+++ b/src/com/cyanogenmod/trebuchet/DragLayer.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -30,7 +30,6 @@ import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
-import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
@@ -39,14 +38,12 @@ import android.view.animation.Interpolator;
import android.widget.FrameLayout;
import android.widget.TextView;
-import com.android.launcher.R;
-
import java.util.ArrayList;
/**
* A ViewGroup that coordinates dragging across its descendants
*/
-public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChangeListener {
+public class DragLayer extends FrameLayout {
private DragController mDragController;
private int[] mTmpXY = new int[2];
@@ -68,8 +65,6 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
private boolean mHoverPointClosesFolder = false;
private Rect mHitRect = new Rect();
- private int mWorkspaceIndex = -1;
- private int mQsbIndex = -1;
public static final int ANIMATION_END_DISAPPEAR = 0;
public static final int ANIMATION_END_FADE_OUT = 1;
public static final int ANIMATION_END_REMAIN_VISIBLE = 2;
@@ -86,7 +81,6 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
// Disable multitouch across the workspace/all apps/customize tray
setMotionEventSplittingEnabled(false);
setChildrenDrawingOrderEnabled(true);
- setOnHierarchyChangeListener(this);
mLeftHoverDrawable = getResources().getDrawable(R.drawable.page_hover_left_holo);
mRightHoverDrawable = getResources().getDrawable(R.drawable.page_hover_right_holo);
@@ -104,18 +98,12 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
private boolean isEventOverFolderTextRegion(Folder folder, MotionEvent ev) {
getDescendantRectRelativeToSelf(folder.getEditTextRegion(), mHitRect);
- if (mHitRect.contains((int) ev.getX(), (int) ev.getY())) {
- return true;
- }
- return false;
+ return mHitRect.contains((int) ev.getX(), (int) ev.getY());
}
private boolean isEventOverFolder(Folder folder, MotionEvent ev) {
getDescendantRectRelativeToSelf(folder, mHitRect);
- if (mHitRect.contains((int) ev.getX(), (int) ev.getY())) {
- return true;
- }
- return false;
+ return mHitRect.contains((int) ev.getX(), (int) ev.getY());
}
private boolean handleTouchDown(MotionEvent ev, boolean intercept) {
@@ -186,10 +174,8 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
sendTapOutsideFolderAccessibilityEvent(currentFolder.isEditingName());
mHoverPointClosesFolder = true;
return true;
- } else if (isOverFolder) {
- mHoverPointClosesFolder = false;
} else {
- return true;
+ mHoverPointClosesFolder = false;
}
case MotionEvent.ACTION_HOVER_MOVE:
isOverFolder = isEventOverFolder(currentFolder, ev);
@@ -257,8 +243,7 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
mCurrentResizeFrame = null;
}
}
- if (handled) return true;
- return mDragController.onTouchEvent(ev);
+ return handled || mDragController.onTouchEvent(ev);
}
/**
@@ -309,8 +294,8 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
pt[1] += view.getTop() - view.getScrollY();
viewParent = view.getParent();
}
- coord[0] = (int) Math.round(pt[0]);
- coord[1] = (int) Math.round(pt[1]);
+ coord[0] = Math.round(pt[0]);
+ coord[1] = Math.round(pt[1]);
return scale;
}
@@ -403,16 +388,7 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
}
}
- public boolean hasResizeFrames() {
- return mResizeFrames.size() > 0;
- }
-
- public boolean isWidgetBeingResized() {
- return mCurrentResizeFrame != null;
- }
-
- public void addResizeFrame(ItemInfo itemInfo, LauncherAppWidgetHostView widget,
- CellLayout cellLayout) {
+ public void addResizeFrame(LauncherAppWidgetHostView widget, CellLayout cellLayout) {
AppWidgetResizeFrame resizeFrame = new AppWidgetResizeFrame(getContext(),
widget, cellLayout, this);
@@ -689,50 +665,11 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
mFadeOutAnim.start();
}
- @Override
- public void onChildViewAdded(View parent, View child) {
- updateChildIndices();
- }
-
- @Override
- public void onChildViewRemoved(View parent, View child) {
- updateChildIndices();
- }
-
- private void updateChildIndices() {
- if (mLauncher != null) {
- mWorkspaceIndex = indexOfChild(mLauncher.getWorkspace());
- mQsbIndex = indexOfChild(mLauncher.getSearchBar());
- }
- }
-
- @Override
- protected int getChildDrawingOrder(int childCount, int i) {
- // TODO: We have turned off this custom drawing order because it now effects touch
- // dispatch order. We need to sort that issue out and then decide how to go about this.
- if (true || LauncherApplication.isScreenLandscape(getContext()) ||
- mWorkspaceIndex == -1 || mQsbIndex == -1 ||
- mLauncher.getWorkspace().isDrawingBackgroundGradient()) {
- return i;
- }
-
- // This ensures that the workspace is drawn above the hotseat and qsb,
- // except when the workspace is drawing a background gradient, in which
- // case we want the workspace to stay behind these elements.
- if (i == mQsbIndex) {
- return mWorkspaceIndex;
- } else if (i == mWorkspaceIndex) {
- return mQsbIndex;
- } else {
- return i;
- }
- }
-
private boolean mInScrollArea;
private Drawable mLeftHoverDrawable;
private Drawable mRightHoverDrawable;
- void onEnterScrollArea(int direction) {
+ void onEnterScrollArea() {
mInScrollArea = true;
invalidate();
}
@@ -749,10 +686,11 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
if (mInScrollArea && !LauncherApplication.isScreenLarge()) {
Workspace workspace = mLauncher.getWorkspace();
int width = workspace.getWidth();
+ int page = workspace.getNextPage();
+
Rect childRect = new Rect();
- getDescendantRectRelativeToSelf(workspace.getChildAt(0), childRect);
+ getDescendantRectRelativeToSelf(workspace.getChildAt(page), childRect);
- int page = workspace.getNextPage();
CellLayout leftPage = (CellLayout) workspace.getChildAt(page - 1);
CellLayout rightPage = (CellLayout) workspace.getChildAt(page + 1);
diff --git a/src/com/android/launcher2/DragScroller.java b/src/com/cyanogenmod/trebuchet/DragScroller.java
index a3ee6c237..5c47fc633 100644
--- a/src/com/android/launcher2/DragScroller.java
+++ b/src/com/cyanogenmod/trebuchet/DragScroller.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
/**
* Handles scrolling while dragging
diff --git a/src/com/android/launcher2/DragSource.java b/src/com/cyanogenmod/trebuchet/DragSource.java
index 54404770a..3f5ef0ed6 100644
--- a/src/com/android/launcher2/DragSource.java
+++ b/src/com/cyanogenmod/trebuchet/DragSource.java
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.view.View;
-import com.android.launcher2.DropTarget.DragObject;
+import com.cyanogenmod.trebuchet.DropTarget.DragObject;
/**
* Interface defining an object that can originate a drag.
diff --git a/src/com/android/launcher2/DragView.java b/src/com/cyanogenmod/trebuchet/DragView.java
index e6b15b8ee..69c0cc903 100644
--- a/src/com/android/launcher2/DragView.java
+++ b/src/com/cyanogenmod/trebuchet/DragView.java
@@ -15,7 +15,7 @@
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
@@ -30,7 +30,7 @@ import android.graphics.Rect;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
public class DragView extends View {
private static float sDragAlpha = 1f;
diff --git a/src/com/android/launcher2/DrawableStateProxyView.java b/src/com/cyanogenmod/trebuchet/DrawableStateProxyView.java
index 5d2f6e0a2..dcaad352b 100644
--- a/src/com/android/launcher2/DrawableStateProxyView.java
+++ b/src/com/cyanogenmod/trebuchet/DrawableStateProxyView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.content.res.TypedArray;
@@ -23,7 +23,7 @@ import android.view.MotionEvent;
import android.view.View;
import android.widget.LinearLayout;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
public class DrawableStateProxyView extends LinearLayout {
diff --git a/src/com/android/launcher2/DropTarget.java b/src/com/cyanogenmod/trebuchet/DropTarget.java
index d627a4c2e..92d644060 100644
--- a/src/com/android/launcher2/DropTarget.java
+++ b/src/com/cyanogenmod/trebuchet/DropTarget.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.graphics.PointF;
@@ -26,8 +26,7 @@ import android.util.Log;
*
*/
public interface DropTarget {
-
- public static final String TAG = "DropTarget";
+ static final String TAG = "Trebuchet.DropTarget";
class DragObject {
public int x = -1;
diff --git a/src/com/cyanogenmod/trebuchet/EditDropTarget.java b/src/com/cyanogenmod/trebuchet/EditDropTarget.java
new file mode 100644
index 000000000..5ea8ccddc
--- /dev/null
+++ b/src/com/cyanogenmod/trebuchet/EditDropTarget.java
@@ -0,0 +1,125 @@
+/*
+ * 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.
+ */
+
+package com.cyanogenmod.trebuchet;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.res.ColorStateList;
+import android.content.res.Configuration;
+import android.content.res.Resources;
+import android.graphics.drawable.TransitionDrawable;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.cyanogenmod.trebuchet.R;
+
+public class EditDropTarget extends ButtonDropTarget {
+
+ private ColorStateList mOriginalTextColor;
+ private TransitionDrawable mDrawable;
+
+ public EditDropTarget(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public EditDropTarget(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ @Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+
+ mOriginalTextColor = getTextColors();
+
+ // Get the hover color
+ Resources r = getResources();
+ mHoverColor = r.getColor(R.color.edit_target_hover_tint);
+ mDrawable = (TransitionDrawable) getCurrentDrawable();
+ mDrawable.setCrossFadeEnabled(true);
+
+ // Remove the text in landscape
+ int orientation = getResources().getConfiguration().orientation;
+ boolean transposeLayout = getResources().getBoolean(R.bool.hotseat_transpose_layout_with_orientation);
+ if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
+ if (transposeLayout) {
+ setText("");
+ }
+ }
+ }
+
+ private boolean isDragSourceWorkspaceOrFolder(DragSource source) {
+ return (source instanceof Workspace) || (source instanceof Folder);
+ }
+ private boolean isWorkspaceOrFolderApplication(DragSource source, Object info) {
+ return isDragSourceWorkspaceOrFolder(source) && (info instanceof ShortcutInfo);
+ }
+
+ @Override
+ public boolean acceptDrop(DragObject d) {
+ // acceptDrop is called just before onDrop. We do the work here, rather than
+ // in onDrop, because it allows us to reject the drop (by returning false)
+ // so that the object being dragged isn't removed from the drag source.
+ if (d.dragInfo instanceof ShortcutInfo) {
+ mLauncher.updateShortcut((ShortcutInfo) d.dragInfo);
+ } else if (d.dragInfo instanceof Folder) {
+ //
+ }
+
+ // There is no post-drop animation, so clean up the DragView now
+ d.deferDragViewCleanupPostAnimation = false;
+ return false;
+ }
+
+ @Override
+ public void onDragStart(DragSource source, Object info, int dragAction) {
+ boolean isVisible = true;
+
+ // Hide this button unless we are dragging something from AllApps
+ if (!isWorkspaceOrFolderApplication(source, info)) {
+ isVisible = false;
+ }
+
+ mActive = isVisible;
+ mDrawable.resetTransition();
+ setTextColor(mOriginalTextColor);
+ ((ViewGroup) getParent()).setVisibility(isVisible ? View.VISIBLE : View.GONE);
+ }
+
+ @Override
+ public void onDragEnd() {
+ super.onDragEnd();
+ mActive = false;
+ }
+
+ public void onDragEnter(DragObject d) {
+ super.onDragEnter(d);
+
+ mDrawable.startTransition(mTransitionDuration);
+ setTextColor(mHoverColor);
+ }
+
+ public void onDragExit(DragObject d) {
+ super.onDragExit(d);
+
+ if (!d.dragComplete) {
+ mDrawable.resetTransition();
+ setTextColor(mOriginalTextColor);
+ }
+ }
+} \ No newline at end of file
diff --git a/src/com/android/launcher2/FastBitmapDrawable.java b/src/com/cyanogenmod/trebuchet/FastBitmapDrawable.java
index d317d3302..732e4c1ee 100644
--- a/src/com/android/launcher2/FastBitmapDrawable.java
+++ b/src/com/cyanogenmod/trebuchet/FastBitmapDrawable.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.graphics.Bitmap;
import android.graphics.Canvas;
diff --git a/src/com/android/launcher2/FocusHelper.java b/src/com/cyanogenmod/trebuchet/FocusHelper.java
index e9f986d76..9e0043a44 100644
--- a/src/com/android/launcher2/FocusHelper.java
+++ b/src/com/cyanogenmod/trebuchet/FocusHelper.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.res.Configuration;
import android.view.KeyEvent;
@@ -24,7 +24,7 @@ import android.view.ViewParent;
import android.widget.TabHost;
import android.widget.TabWidget;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
import java.util.ArrayList;
import java.util.Collections;
@@ -81,12 +81,13 @@ public class FocusHelper {
}
/**
- * Handles key events in a AppsCustomize tab between the last tab view and the shop button.
+ * Handles key events in a AppsCustomize tab between the last tab view and the shop/menu button.
*/
static boolean handleAppsCustomizeTabKeyEvent(View v, int keyCode, KeyEvent e) {
final TabHost tabHost = findTabHostParent(v);
final ViewGroup contents = tabHost.getTabContentView();
final View shop = tabHost.findViewById(R.id.market_button);
+ final View overflowMenu = tabHost.findViewById(R.id.overflow_menu_button);
final int action = e.getAction();
final boolean handleKeyEvent = (action != KeyEvent.ACTION_UP);
@@ -95,8 +96,12 @@ public class FocusHelper {
case KeyEvent.KEYCODE_DPAD_RIGHT:
if (handleKeyEvent) {
// Select the shop button if we aren't on it
- if (v != shop) {
- shop.requestFocus();
+ if (v != shop || v != overflowMenu) {
+ if (shop.getVisibility() == View.VISIBLE){
+ shop.requestFocus();
+ } else if (overflowMenu.getVisibility() == View.VISIBLE) {
+ overflowMenu.requestFocus();
+ }
}
}
wasHandled = true;
@@ -104,7 +109,7 @@ public class FocusHelper {
case KeyEvent.KEYCODE_DPAD_DOWN:
if (handleKeyEvent) {
// Select the content view (down is handled by the tab key handler otherwise)
- if (v == shop) {
+ if (v == shop || v == overflowMenu) {
contents.requestFocus();
wasHandled = true;
}
@@ -139,7 +144,7 @@ public class FocusHelper {
final TabWidget tabs = tabHost.getTabWidget();
final int widgetIndex = parent.indexOfChild(w);
final int widgetCount = parent.getChildCount();
- final int pageIndex = ((PagedView) container).indexToPage(container.indexOfChild(parent));
+ final int pageIndex = container.indexToPage(container.indexOfChild(parent));
final int pageCount = container.getChildCount();
final int cellCountX = parent.getCellCountX();
final int cellCountY = parent.getCellCountY();
@@ -148,7 +153,7 @@ public class FocusHelper {
final int action = e.getAction();
final boolean handleKeyEvent = (action != KeyEvent.ACTION_UP);
- ViewGroup newParent = null;
+ ViewGroup newParent;
// Now that we load items in the bg asynchronously, we can't just focus
// child siblings willy-nilly
View child = null;
@@ -299,7 +304,7 @@ public class FocusHelper {
final TabWidget tabs = tabHost.getTabWidget();
final int iconIndex = itemContainer.indexOfChild(v);
final int itemCount = itemContainer.getChildCount();
- final int pageIndex = ((PagedView) container).indexToPage(container.indexOfChild(parentLayout));
+ final int pageIndex = container.indexToPage(container.indexOfChild(parentLayout));
final int pageCount = container.getChildCount();
final int x = iconIndex % countX;
@@ -307,10 +312,10 @@ public class FocusHelper {
final int action = e.getAction();
final boolean handleKeyEvent = (action != KeyEvent.ACTION_UP);
- ViewGroup newParent = null;
+ ViewGroup newParent;
// Side pages do not always load synchronously, so check before focusing child siblings
// willy-nilly
- View child = null;
+ View child;
boolean wasHandled = false;
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_LEFT:
diff --git a/src/com/android/launcher2/FocusOnlyTabWidget.java b/src/com/cyanogenmod/trebuchet/FocusOnlyTabWidget.java
index 8e9f58c61..96bf589c5 100644
--- a/src/com/android/launcher2/FocusOnlyTabWidget.java
+++ b/src/com/cyanogenmod/trebuchet/FocusOnlyTabWidget.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.util.AttributeSet;
@@ -72,15 +72,11 @@ public class FocusOnlyTabWidget extends TabWidget {
super.onFocusChange(tab, true);
}
}
- public void superOnFocusChange(View v, boolean hasFocus) {
- super.onFocusChange(v, hasFocus);
- }
@Override
public void onFocusChange(android.view.View v, boolean hasFocus) {
if (v == this && hasFocus && getTabCount() > 0) {
getSelectedTab().requestFocus();
- return;
}
}
}
diff --git a/src/com/android/launcher2/Folder.java b/src/com/cyanogenmod/trebuchet/Folder.java
index 5feac2f4b..00152987b 100644
--- a/src/com/android/launcher2/Folder.java
+++ b/src/com/cyanogenmod/trebuchet/Folder.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -44,8 +44,8 @@ import android.view.inputmethod.InputMethodManager;
import android.widget.LinearLayout;
import android.widget.TextView;
-import com.android.launcher.R;
-import com.android.launcher2.FolderInfo.FolderListener;
+import com.cyanogenmod.trebuchet.FolderInfo.FolderListener;
+import com.cyanogenmod.trebuchet.preference.PreferencesProvider;
import java.util.ArrayList;
import java.util.Collections;
@@ -57,7 +57,7 @@ import java.util.Comparator;
public class Folder extends LinearLayout implements DragSource, View.OnClickListener,
View.OnLongClickListener, DropTarget, FolderListener, TextView.OnEditorActionListener,
View.OnFocusChangeListener {
- private static final String TAG = "Launcher.Folder";
+ private static final String TAG = "Trebuchet.Folder";
protected DragController mDragController;
protected Launcher mLauncher;
@@ -127,8 +127,8 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
mMaxCountY = res.getInteger(R.integer.folder_max_count_y);
mMaxNumItems = res.getInteger(R.integer.folder_max_num_items);
if (mMaxCountX < 0 || mMaxCountY < 0 || mMaxNumItems < 0) {
- mMaxCountX = LauncherModel.getCellCountX();
- mMaxCountY = LauncherModel.getCellCountY();
+ mMaxCountX = LauncherModel.getWorkspaceCellCountX();
+ mMaxCountY = LauncherModel.getWorkspaceCellCountY();
mMaxNumItems = mMaxCountX * mMaxCountY;
}
@@ -172,6 +172,11 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
mFolderName.setSelectAllOnFocus(true);
mFolderName.setInputType(mFolderName.getInputType() |
InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_FLAG_CAP_WORDS);
+
+ if (PreferencesProvider.Interface.Homescreen.getHideIconLabels()){
+ mFolderName.setVisibility(View.GONE);
+ mFolderNameHeight = getPaddingBottom();
+ }
}
private ActionMode.Callback mActionModeCallback = new ActionMode.Callback() {
@@ -254,7 +259,9 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
// Convert to a string here to ensure that no other state associated with the text field
// gets saved.
String newTitle = mFolderName.getText().toString();
- mInfo.setTitle(newTitle);
+ if (!PreferencesProvider.Interface.Homescreen.getHideIconLabels()) {
+ mInfo.setTitle(newTitle);
+ }
LauncherModel.updateItemInDatabase(mLauncher, mInfo);
if (commit) {
@@ -331,8 +338,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
private void placeInReadingOrder(ArrayList<ShortcutInfo> items) {
int maxX = 0;
int count = items.size();
- for (int i = 0; i < count; i++) {
- ShortcutInfo item = items.get(i);
+ for (ShortcutInfo item : items) {
if (item.cellX > maxX) {
maxX = item.cellX;
}
@@ -357,8 +363,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
setupContentForNumItems(children.size());
placeInReadingOrder(children);
int count = 0;
- for (int i = 0; i < children.size(); i++) {
- ShortcutInfo child = (ShortcutInfo) children.get(i);
+ for (ShortcutInfo child : children) {
if (!createAndAddShortcut(child)) {
overflow.add(child);
} else {
@@ -577,11 +582,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
};
boolean readingOrderGreaterThan(int[] v1, int[] v2) {
- if (v1[1] > v2[1] || (v1[1] == v2[1] && v1[0] > v2[0])) {
- return true;
- } else {
- return false;
- }
+ return v1[1] > v2[1] || (v1[1] == v2[1] && v1[0] > v2[0]);
}
private void realTimeReorder(int[] empty, int[] target) {
@@ -742,11 +743,10 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
private void updateItemLocationsInDatabase() {
ArrayList<View> list = getItemsInReadingOrder();
- for (int i = 0; i < list.size(); i++) {
- View v = list.get(i);
+ for (View v : list) {
ItemInfo info = (ItemInfo) v.getTag();
LauncherModel.moveItemInDatabase(mLauncher, info, mInfo.id, 0,
- info.cellX, info.cellY);
+ info.cellX, info.cellY);
}
}
@@ -894,8 +894,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
}
mContent.removeAllViews();
- for (int i = 0; i < list.size(); i++) {
- View v = list.get(i);
+ for (View v : list) {
mContent.getVacantCell(vacant, 1, 1);
CellLayout.LayoutParams lp = (CellLayout.LayoutParams) v.getLayoutParams();
lp.cellX = vacant[0];
@@ -907,8 +906,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
LauncherModel.addOrMoveItemInDatabase(mLauncher, info, mInfo.id, 0,
info.cellX, info.cellY);
}
- boolean insert = false;
- mContent.addViewToCellLayout(v, insert ? 0 : -1, (int)info.id, lp, true);
+ mContent.addViewToCellLayout(v, 0, (int) info.id, lp, true);
}
mItemsInvalidated = true;
}
diff --git a/src/com/android/launcher2/FolderEditText.java b/src/com/cyanogenmod/trebuchet/FolderEditText.java
index 13169bd51..4504460bf 100644
--- a/src/com/android/launcher2/FolderEditText.java
+++ b/src/com/cyanogenmod/trebuchet/FolderEditText.java
@@ -1,4 +1,4 @@
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.util.AttributeSet;
diff --git a/src/com/android/launcher2/FolderIcon.java b/src/com/cyanogenmod/trebuchet/FolderIcon.java
index 05921dc1c..b67e0bd33 100644
--- a/src/com/android/launcher2/FolderIcon.java
+++ b/src/com/cyanogenmod/trebuchet/FolderIcon.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -39,14 +39,13 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
-import com.android.launcher.R;
-import com.android.launcher2.DropTarget.DragObject;
-import com.android.launcher2.FolderInfo.FolderListener;
+import com.cyanogenmod.trebuchet.DropTarget.DragObject;
+import com.cyanogenmod.trebuchet.FolderInfo.FolderListener;
import java.util.ArrayList;
/**
- * An icon that can appear on in the workspace representing an {@link UserFolder}.
+ * An icon that can appear on in the workspace representing an {@link Folder}.
*/
public class FolderIcon extends LinearLayout implements FolderListener {
private Launcher mLauncher;
@@ -113,15 +112,8 @@ public class FolderIcon extends LinearLayout implements FolderListener {
mLongPressHelper = new CheckLongPressHelper(this);
}
- public boolean isDropEnabled() {
- final ViewGroup cellLayoutChildren = (ViewGroup) getParent();
- final ViewGroup cellLayout = (ViewGroup) cellLayoutChildren.getParent();
- final Workspace workspace = (Workspace) cellLayout.getParent();
- return !workspace.isSmall();
- }
-
static FolderIcon fromXml(int resId, Launcher launcher, ViewGroup group,
- FolderInfo folderInfo, IconCache iconCache) {
+ FolderInfo folderInfo) {
@SuppressWarnings("all") // suppress dead code warning
final boolean error = INITIAL_ITEM_ANIMATION_DURATION >= DROP_IN_ANIMATION_DURATION;
if (error) {
@@ -292,12 +284,13 @@ public class FolderIcon extends LinearLayout implements FolderListener {
private boolean willAcceptItem(ItemInfo item) {
final int itemType = item.itemType;
return ((itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION ||
- itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) &&
+ itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT ||
+ itemType == LauncherSettings.Favorites.ITEM_TYPE_FOLDER) &&
!mFolder.isFull() && item != mInfo && !mInfo.opened);
}
- public boolean acceptDrop(Object dragInfo) {
- final ItemInfo item = (ItemInfo) dragInfo;
+ public boolean acceptDrop(ItemInfo dragInfo) {
+ final ItemInfo item = dragInfo;
return !mFolder.isDestroyed() && willAcceptItem(item);
}
@@ -315,9 +308,6 @@ public class FolderIcon extends LinearLayout implements FolderListener {
layout.showFolderAccept(mFolderRingAnimator);
}
- public void onDragOver(Object dragInfo) {
- }
-
public void performCreateAnimation(final ShortcutInfo destInfo, final View destView,
final ShortcutInfo srcInfo, final DragView srcView, Rect dstRect,
float scaleRelativeToDragLayer, Runnable postAnimationRunnable) {
@@ -333,7 +323,7 @@ public class FolderIcon extends LinearLayout implements FolderListener {
addItem(destInfo);
// This will animate the dragView (srcView) into the new folder
- onDrop(srcInfo, srcView, dstRect, scaleRelativeToDragLayer, 1, postAnimationRunnable, null);
+ onDrop(srcInfo, srcView, dstRect, scaleRelativeToDragLayer, 1, postAnimationRunnable);
}
public void performDestroyAnimation(final View finalView, Runnable onCompleteRunnable) {
@@ -347,17 +337,12 @@ public class FolderIcon extends LinearLayout implements FolderListener {
onCompleteRunnable);
}
- public void onDragExit(Object dragInfo) {
- onDragExit();
- }
-
public void onDragExit() {
mFolderRingAnimator.animateToNaturalState();
}
private void onDrop(final ShortcutInfo item, DragView animateView, Rect finalRect,
- float scaleRelativeToDragLayer, int index, Runnable postAnimationRunnable,
- DragObject d) {
+ float scaleRelativeToDragLayer, int index, Runnable postAnimationRunnable) {
item.cellX = -1;
item.cellY = -1;
@@ -387,8 +372,8 @@ public class FolderIcon extends LinearLayout implements FolderListener {
int[] center = new int[2];
float scale = getLocalCenterForIndex(index, center);
- center[0] = (int) Math.round(scaleRelativeToDragLayer * center[0]);
- center[1] = (int) Math.round(scaleRelativeToDragLayer * center[1]);
+ center[0] = Math.round(scaleRelativeToDragLayer * center[0]);
+ center[1] = Math.round(scaleRelativeToDragLayer * center[1]);
to.offset(center[0] - animateView.getMeasuredWidth() / 2,
center[1] - animateView.getMeasuredHeight() / 2);
@@ -418,15 +403,20 @@ public class FolderIcon extends LinearLayout implements FolderListener {
if (d.dragInfo instanceof ApplicationInfo) {
// Came from all apps -- make a copy
item = ((ApplicationInfo) d.dragInfo).makeShortcut();
+ } else if (d.dragInfo instanceof FolderInfo) {
+ FolderInfo folder = (FolderInfo) d.dragInfo;
+ mFolder.notifyDrop();
+ for (ShortcutInfo fItem : folder.contents) {
+ onDrop(fItem, d.dragView, null, 1.0f, mInfo.contents.size(), d.postAnimationRunnable);
+ }
+ mLauncher.removeFolder(folder);
+ LauncherModel.deleteItemFromDatabase(mLauncher, folder);
+ return;
} else {
item = (ShortcutInfo) d.dragInfo;
}
mFolder.notifyDrop();
- onDrop(item, d.dragView, null, 1.0f, mInfo.contents.size(), d.postAnimationRunnable, d);
- }
-
- public DropTarget getDropTargetDelegate(DragObject d) {
- return null;
+ onDrop(item, d.dragView, null, 1.0f, mInfo.contents.size(), d.postAnimationRunnable);
}
private void computePreviewDrawingParams(int drawableSize, int totalSize) {
@@ -478,8 +468,8 @@ public class FolderIcon extends LinearLayout implements FolderListener {
float offsetX = mParams.transX + (mParams.scale * mIntrinsicIconSize) / 2;
float offsetY = mParams.transY + (mParams.scale * mIntrinsicIconSize) / 2;
- center[0] = (int) Math.round(offsetX);
- center[1] = (int) Math.round(offsetY);
+ center[0] = Math.round(offsetX);
+ center[1] = Math.round(offsetY);
return mParams.scale;
}
diff --git a/src/com/android/launcher2/FolderInfo.java b/src/com/cyanogenmod/trebuchet/FolderInfo.java
index dbac90ec5..7c6941b4d 100644
--- a/src/com/android/launcher2/FolderInfo.java
+++ b/src/com/cyanogenmod/trebuchet/FolderInfo.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import java.util.ArrayList;
@@ -48,8 +48,8 @@ class FolderInfo extends ItemInfo {
*/
public void add(ShortcutInfo item) {
contents.add(item);
- for (int i = 0; i < listeners.size(); i++) {
- listeners.get(i).onAdd(item);
+ for (FolderListener listener : listeners) {
+ listener.onAdd(item);
}
itemsChanged();
}
@@ -61,16 +61,16 @@ class FolderInfo extends ItemInfo {
*/
public void remove(ShortcutInfo item) {
contents.remove(item);
- for (int i = 0; i < listeners.size(); i++) {
- listeners.get(i).onRemove(item);
+ for (FolderListener listener : listeners) {
+ listener.onRemove(item);
}
itemsChanged();
}
public void setTitle(CharSequence title) {
this.title = title;
- for (int i = 0; i < listeners.size(); i++) {
- listeners.get(i).onTitleChanged(title);
+ for (FolderListener listener : listeners) {
+ listener.onTitleChanged(title);
}
}
@@ -91,8 +91,8 @@ class FolderInfo extends ItemInfo {
}
void itemsChanged() {
- for (int i = 0; i < listeners.size(); i++) {
- listeners.get(i).onItemsChanged();
+ for (FolderListener listener : listeners) {
+ listener.onItemsChanged();
}
}
diff --git a/src/com/android/launcher2/HideFromAccessibilityHelper.java b/src/com/cyanogenmod/trebuchet/HideFromAccessibilityHelper.java
index 0b2ce5ba6..e3c198d98 100644
--- a/src/com/android/launcher2/HideFromAccessibilityHelper.java
+++ b/src/com/cyanogenmod/trebuchet/HideFromAccessibilityHelper.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.view.View;
import android.view.ViewGroup;
@@ -110,4 +110,4 @@ public class HideFromAccessibilityHelper implements OnHierarchyChangeListener {
(v.getParent() instanceof ViewGroup &&
hasAncestorOfType((ViewGroup) v.getParent(), c)));
}
-} \ No newline at end of file
+}
diff --git a/src/com/android/launcher2/HolographicImageView.java b/src/com/cyanogenmod/trebuchet/HolographicImageView.java
index 9e551e047..d159358f0 100644
--- a/src/com/android/launcher2/HolographicImageView.java
+++ b/src/com/cyanogenmod/trebuchet/HolographicImageView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.graphics.Canvas;
diff --git a/src/com/android/launcher2/HolographicLinearLayout.java b/src/com/cyanogenmod/trebuchet/HolographicLinearLayout.java
index 0f997d5fa..3af541511 100644
--- a/src/com/android/launcher2/HolographicLinearLayout.java
+++ b/src/com/cyanogenmod/trebuchet/HolographicLinearLayout.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.content.res.TypedArray;
@@ -25,7 +25,7 @@ import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.LinearLayout;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
public class HolographicLinearLayout extends LinearLayout {
diff --git a/src/com/android/launcher2/HolographicOutlineHelper.java b/src/com/cyanogenmod/trebuchet/HolographicOutlineHelper.java
index 1e990dcff..64ac2ec4a 100644
--- a/src/com/android/launcher2/HolographicOutlineHelper.java
+++ b/src/com/cyanogenmod/trebuchet/HolographicOutlineHelper.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.graphics.Bitmap;
import android.graphics.BlurMaskFilter;
diff --git a/src/com/android/launcher2/HolographicViewHelper.java b/src/com/cyanogenmod/trebuchet/HolographicViewHelper.java
index 93d785351..245f75416 100644
--- a/src/com/android/launcher2/HolographicViewHelper.java
+++ b/src/com/cyanogenmod/trebuchet/HolographicViewHelper.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.content.res.Resources;
diff --git a/src/com/cyanogenmod/trebuchet/Hotseat.java b/src/com/cyanogenmod/trebuchet/Hotseat.java
new file mode 100644
index 000000000..e5de57bac
--- /dev/null
+++ b/src/com/cyanogenmod/trebuchet/Hotseat.java
@@ -0,0 +1,246 @@
+/*
+ * 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.
+ */
+
+package com.cyanogenmod.trebuchet;
+
+import android.content.Context;
+import android.content.res.Configuration;
+import android.content.res.TypedArray;
+import android.graphics.Matrix;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+
+import com.cyanogenmod.trebuchet.preference.PreferencesProvider;
+
+import java.util.Arrays;
+
+public class Hotseat extends PagedView {
+ private int mCellCount;
+
+ private boolean mTransposeLayoutWithOrientation;
+ private boolean mIsLandscape;
+
+ private float[] mTempCellLayoutCenterCoordinates = new float[2];
+ private Matrix mTempInverseMatrix = new Matrix();
+
+ private static final int DEFAULT_CELL_COUNT = 5;
+
+ public Hotseat(Context context) {
+ this(context, null);
+ }
+
+ public Hotseat(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public Hotseat(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+
+ mFadeInAdjacentScreens = false;
+ mHandleScrollIndicator = true;
+
+ int hotseatPages = PreferencesProvider.Interface.Dock.getNumberPages();
+ int defaultPage = PreferencesProvider.Interface.Dock.getDefaultPage(hotseatPages / 2);
+
+
+ mCurrentPage = defaultPage;
+
+ TypedArray a = context.obtainStyledAttributes(attrs,
+ R.styleable.Hotseat, defStyle, 0);
+ mTransposeLayoutWithOrientation =
+ context.getResources().getBoolean(R.bool.hotseat_transpose_layout_with_orientation);
+ mIsLandscape = context.getResources().getConfiguration().orientation ==
+ Configuration.ORIENTATION_LANDSCAPE;
+ mCellCount = a.getInt(R.styleable.Hotseat_cellCount, DEFAULT_CELL_COUNT);
+ mCellCount = PreferencesProvider.Interface.Dock.getNumberIcons(mCellCount);
+
+ LauncherModel.updateHotseatLayoutCells(mCellCount);
+
+ mVertical = hasVerticalHotseat();
+
+
+ float childrenScale = PreferencesProvider.Interface.Dock.getIconScale(
+ getResources().getInteger(R.integer.hotseat_item_scale_percentage)) / 100f;
+
+ LayoutInflater inflater =
+ (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ for (int i = 0; i < hotseatPages; i++) {
+ CellLayout cl = (CellLayout) inflater.inflate(R.layout.hotseat_page, null);
+ cl.setChildrenScale(childrenScale);
+ cl.setGridSize((!hasVerticalHotseat() ? mCellCount : 1), (hasVerticalHotseat() ? mCellCount : 1));
+ addView(cl);
+ }
+
+ // No data needed
+ setDataIsReady();
+
+ setOnKeyListener(new HotseatIconKeyEventListener());
+ }
+
+ public boolean hasPage(View view) {
+ for (int i = 0; i < getChildCount(); i++) {
+ if (view == getChildAt(i)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean hasVerticalHotseat() {
+ return (mIsLandscape && mTransposeLayoutWithOrientation);
+ }
+
+ /* Get the orientation invariant order of the item in the hotseat for persistence. */
+ int getOrderInHotseat(int x, int y) {
+ return hasVerticalHotseat() ? (mCellCount - y - 1) : x;
+ }
+ /* Get the orientation specific coordinates given an invariant order in the hotseat. */
+ int getCellXFromOrder(int rank) {
+ return hasVerticalHotseat() ? 0 : rank;
+ }
+ int getCellYFromOrder(int rank) {
+ return hasVerticalHotseat() ? (mCellCount - rank - 1) : 0;
+ }
+ int getScreenFromOrder(int screen) {
+ return hasVerticalHotseat() ? (getChildCount() - screen - 1) : screen;
+ }
+
+ /*
+ *
+ * Convert the 2D coordinate xy from the parent View's coordinate space to this CellLayout's
+ * coordinate space. The argument xy is modified with the return result.
+ *
+ * if cachedInverseMatrix is not null, this method will just use that matrix instead of
+ * computing it itself; we use this to avoid redundant matrix inversions in
+ * findMatchingPageForDragOver
+ *
+ */
+ void mapPointFromSelfToChild(View v, float[] xy, Matrix cachedInverseMatrix) {
+ if (cachedInverseMatrix == null) {
+ v.getMatrix().invert(mTempInverseMatrix);
+ cachedInverseMatrix = mTempInverseMatrix;
+ }
+ int scrollX = getScrollX();
+ if (mNextPage != INVALID_PAGE) {
+ scrollX = mScroller.getFinalX();
+ }
+ xy[0] = xy[0] + scrollX - v.getLeft();
+ xy[1] = xy[1] + getScrollY() - v.getTop();
+ cachedInverseMatrix.mapPoints(xy);
+ }
+
+ /**
+ * Convert the 2D coordinate xy from this CellLayout's coordinate space to
+ * the parent View's coordinate space. The argument xy is modified with the return result.
+ */
+ void mapPointFromChildToSelf(View v, float[] xy) {
+ v.getMatrix().mapPoints(xy);
+ int scrollX = getScrollX();
+ if (mNextPage != INVALID_PAGE) {
+ scrollX = mScroller.getFinalX();
+ }
+ xy[0] -= (scrollX - v.getLeft());
+ xy[1] -= (getScrollY() - v.getTop());
+ }
+
+ /**
+ * This method returns the CellLayout that is currently being dragged to. In order to drag
+ * to a CellLayout, either the touch point must be directly over the CellLayout, or as a second
+ * strategy, we see if the dragView is overlapping any CellLayout and choose the closest one
+ *
+ * Return null if no CellLayout is currently being dragged over
+ */
+ CellLayout findMatchingPageForDragOver(float originX, float originY, boolean exact) {
+ // We loop through all the screens (ie CellLayouts) and see which ones overlap
+ // with the item being dragged and then choose the one that's closest to the touch point
+ final int screenCount = getChildCount();
+ CellLayout bestMatchingScreen = null;
+ float smallestDistSoFar = Float.MAX_VALUE;
+
+ for (int i = 0; i < screenCount; i++) {
+ CellLayout cl = (CellLayout) getChildAt(i);
+
+ final float[] touchXy = {originX, originY};
+ // Transform the touch coordinates to the CellLayout's local coordinates
+ // If the touch point is within the bounds of the cell layout, we can return immediately
+ cl.getMatrix().invert(mTempInverseMatrix);
+ mapPointFromSelfToChild(cl, touchXy, mTempInverseMatrix);
+
+ if (touchXy[0] >= 0 && touchXy[0] <= cl.getWidth() &&
+ touchXy[1] >= 0 && touchXy[1] <= cl.getHeight()) {
+ return cl;
+ }
+
+ if (!exact) {
+ // Get the center of the cell layout in screen coordinates
+ final float[] cellLayoutCenter = mTempCellLayoutCenterCoordinates;
+ cellLayoutCenter[0] = cl.getWidth()/2;
+ cellLayoutCenter[1] = cl.getHeight()/2;
+ mapPointFromChildToSelf(cl, cellLayoutCenter);
+
+ touchXy[0] = originX;
+ touchXy[1] = originY;
+
+ // Calculate the distance between the center of the CellLayout
+ // and the touch point
+ float dist = Workspace.squaredDistance(touchXy, cellLayoutCenter);
+
+ if (dist < smallestDistSoFar) {
+ smallestDistSoFar = dist;
+ bestMatchingScreen = cl;
+ }
+ }
+ }
+ return bestMatchingScreen;
+ }
+
+ public void setChildrenOutlineAlpha(float alpha) {
+ for (int i = 0; i < getChildCount(); i++) {
+ CellLayout cl = (CellLayout) getChildAt(i);
+ cl.setBackgroundAlpha(alpha);
+ }
+ }
+
+ @Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+ resetLayout();
+ }
+
+ void resetLayout() {
+ for (int i = 0; i < getChildCount(); i++) {
+ CellLayout cl = (CellLayout) getPageAt(i);
+ cl.removeAllViewsInLayout();
+ }
+ }
+
+ @Override
+ public void syncPages() {
+ }
+
+ @Override
+ public void syncPageItems(int page, boolean immediate) {
+ }
+
+ @Override
+ protected void loadAssociatedPages(int page) {
+ }
+ @Override
+ protected void loadAssociatedPages(int page, boolean immediateAndOnly) {
+ }
+}
diff --git a/src/com/android/launcher2/IconCache.java b/src/com/cyanogenmod/trebuchet/IconCache.java
index aa19545bd..7005e1208 100644
--- a/src/com/android/launcher2/IconCache.java
+++ b/src/com/cyanogenmod/trebuchet/IconCache.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.app.ActivityManager;
import android.content.ComponentName;
@@ -35,7 +35,7 @@ import java.util.HashMap;
*/
public class IconCache {
@SuppressWarnings("unused")
- private static final String TAG = "Launcher.IconCache";
+ private static final String TAG = "Trebuchet.IconCache";
private static final int INITIAL_ICON_CACHE_CAPACITY = 50;
@@ -216,9 +216,9 @@ public class IconCache {
return entry;
}
- public HashMap<ComponentName,Bitmap> getAllIcons() {
+ public HashMap<ComponentName, Bitmap> getAllIcons() {
synchronized (mCache) {
- HashMap<ComponentName,Bitmap> set = new HashMap<ComponentName,Bitmap>();
+ HashMap<ComponentName, Bitmap> set = new HashMap<ComponentName,Bitmap>();
for (ComponentName cn : mCache.keySet()) {
final CacheEntry e = mCache.get(cn);
set.put(cn, e.icon);
diff --git a/src/com/android/launcher2/InfoDropTarget.java b/src/com/cyanogenmod/trebuchet/InfoDropTarget.java
index d6bf5f2cc..eaef23ea8 100644
--- a/src/com/android/launcher2/InfoDropTarget.java
+++ b/src/com/cyanogenmod/trebuchet/InfoDropTarget.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.ComponentName;
import android.content.Context;
@@ -26,8 +26,6 @@ import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
-import com.android.launcher.R;
-
public class InfoDropTarget extends ButtonDropTarget {
private ColorStateList mOriginalTextColor;
@@ -53,10 +51,11 @@ public class InfoDropTarget extends ButtonDropTarget {
mDrawable = (TransitionDrawable) getCurrentDrawable();
mDrawable.setCrossFadeEnabled(true);
- // Remove the text in the Phone UI in landscape
+ // Remove the text in landscape
int orientation = getResources().getConfiguration().orientation;
+ boolean transposeLayout = getResources().getBoolean(R.bool.hotseat_transpose_layout_with_orientation);
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
- if (!LauncherApplication.isScreenLarge()) {
+ if (transposeLayout) {
setText("");
}
}
diff --git a/src/com/android/launcher2/InstallShortcutReceiver.java b/src/com/cyanogenmod/trebuchet/InstallShortcutReceiver.java
index 20a19660e..d8a69ba49 100644
--- a/src/com/android/launcher2/InstallShortcutReceiver.java
+++ b/src/com/cyanogenmod/trebuchet/InstallShortcutReceiver.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -24,7 +24,7 @@ import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.widget.Toast;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.preference.PreferencesProvider;
import java.util.ArrayList;
import java.util.HashSet;
@@ -46,7 +46,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
// A mime-type representing shortcut data
public static final String SHORTCUT_MIMETYPE =
- "com.android.launcher/shortcut";
+ "com.cyanogenmod.trebuchet/shortcut";
// The set of shortcuts that are pending install
private static ArrayList<PendingInstallShortcutInfo> mInstallQueue =
@@ -91,8 +91,8 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
}
}
// Queue the item up for adding if launcher has not loaded properly yet
- boolean launcherNotLoaded = LauncherModel.getCellCountX() <= 0 ||
- LauncherModel.getCellCountY() <= 0;
+ boolean launcherNotLoaded = LauncherModel.getWorkspaceCellCountX() <= 0 ||
+ LauncherModel.getWorkspaceCellCountY() <= 0;
PendingInstallShortcutInfo info = new PendingInstallShortcutInfo(data, name, intent);
if (mUseInstallQueue || launcherNotLoaded) {
@@ -132,15 +132,18 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
boolean found = false;
synchronized (app) {
final ArrayList<ItemInfo> items = LauncherModel.getItemsInLocalCoordinates(context);
- final boolean exists = LauncherModel.shortcutExists(context, name, intent);
+ final boolean exists = LauncherModel.shortcutExists(context, intent);
// Try adding to the workspace screens incrementally, starting at the default or center
// screen and alternating between +1, -1, +2, -2, etc. (using ~ ceil(i/2f)*(-1)^(i-1))
- final int screen = Launcher.DEFAULT_SCREEN;
- for (int i = 0; i < (2 * Launcher.SCREEN_COUNT) + 1 && !found; ++i) {
+ final int screenCount = PreferencesProvider.Interface.Homescreen.getNumberHomescreens();
+ final int screenDefault = PreferencesProvider.Interface.Homescreen.getDefaultHomescreen(screenCount / 2);
+ final int screen = (screenDefault >= screenCount) ? screenCount / 2 : screenDefault;
+
+ for (int i = 0; i <= (2 * screenCount) + 1 && !found; ++i) {
int si = screen + (int) ((i / 2f) + 0.5f) * ((i % 2 == 1) ? 1 : -1);
- if (0 <= si && si < Launcher.SCREEN_COUNT) {
- found = installShortcut(context, data, items, name, intent, si, exists, sp,
+ if (0 <= si && si < screenCount) {
+ found = installShortcut(context, data, items, intent, si, exists, sp,
result);
}
}
@@ -160,10 +163,10 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
}
private static boolean installShortcut(Context context, Intent data, ArrayList<ItemInfo> items,
- String name, Intent intent, final int screen, boolean shortcutExists,
+ Intent intent, final int screen, boolean shortcutExists,
final SharedPreferences sharedPrefs, int[] result) {
int[] tmpCoordinates = new int[2];
- if (findEmptyCell(context, items, tmpCoordinates, screen)) {
+ if (findEmptyCell(items, tmpCoordinates, screen)) {
if (intent != null) {
if (intent.getAction() == null) {
intent.setAction(Intent.ACTION_VIEW);
@@ -186,7 +189,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
newApps = sharedPrefs.getStringSet(NEW_APPS_LIST_KEY, newApps);
}
synchronized (newApps) {
- newApps.add(intent.toUri(0).toString());
+ newApps.add(intent.toUri(0));
}
final Set<String> savedNewApps = newApps;
new Thread("setNewAppsThread") {
@@ -221,16 +224,14 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
return false;
}
- private static boolean findEmptyCell(Context context, ArrayList<ItemInfo> items, int[] xy,
+ private static boolean findEmptyCell(ArrayList<ItemInfo> items, int[] xy,
int screen) {
- final int xCount = LauncherModel.getCellCountX();
- final int yCount = LauncherModel.getCellCountY();
+ final int xCount = LauncherModel.getWorkspaceCellCountX();
+ final int yCount = LauncherModel.getWorkspaceCellCountY();
boolean[][] occupied = new boolean[xCount][yCount];
- ItemInfo item = null;
int cellX, cellY, spanX, spanY;
- for (int i = 0; i < items.size(); ++i) {
- item = items.get(i);
+ for (ItemInfo item : items) {
if (item.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) {
if (item.screen == screen) {
cellX = item.cellX;
diff --git a/src/com/android/launcher2/InstallWidgetReceiver.java b/src/com/cyanogenmod/trebuchet/InstallWidgetReceiver.java
index a1e9b1187..a133f51e3 100644
--- a/src/com/android/launcher2/InstallWidgetReceiver.java
+++ b/src/com/cyanogenmod/trebuchet/InstallWidgetReceiver.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import java.util.List;
@@ -33,7 +33,7 @@ import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.TextView;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
/**
@@ -42,18 +42,18 @@ import com.android.launcher.R;
*/
public class InstallWidgetReceiver {
public static final String ACTION_INSTALL_WIDGET =
- "com.android.launcher.action.INSTALL_WIDGET";
+ "com.cyanogenmod.trebuchet.action.INSTALL_WIDGET";
public static final String ACTION_SUPPORTS_CLIPDATA_MIMETYPE =
- "com.android.launcher.action.SUPPORTS_CLIPDATA_MIMETYPE";
+ "com.cyanogenmod.trebuchet.action.SUPPORTS_CLIPDATA_MIMETYPE";
// Currently not exposed. Put into Intent when we want to make it public.
// TEMP: Should we call this "EXTRA_APPWIDGET_PROVIDER"?
public static final String EXTRA_APPWIDGET_COMPONENT =
- "com.android.launcher.extra.widget.COMPONENT";
+ "com.cyanogenmod.trebuchet.extra.widget.COMPONENT";
public static final String EXTRA_APPWIDGET_CONFIGURATION_DATA_MIME_TYPE =
- "com.android.launcher.extra.widget.CONFIGURATION_DATA_MIME_TYPE";
+ "com.cyanogenmod.trebuchet.extra.widget.CONFIGURATION_DATA_MIME_TYPE";
public static final String EXTRA_APPWIDGET_CONFIGURATION_DATA =
- "com.android.launcher.extra.widget.CONFIGURATION_DATA";
+ "com.cyanogenmod.trebuchet.extra.widget.CONFIGURATION_DATA";
/**
* A simple data class that contains per-item information that the adapter below can reference.
diff --git a/src/com/android/launcher2/InterruptibleInOutAnimator.java b/src/com/cyanogenmod/trebuchet/InterruptibleInOutAnimator.java
index 9831ba3d4..ea847d756 100644
--- a/src/com/android/launcher2/InterruptibleInOutAnimator.java
+++ b/src/com/cyanogenmod/trebuchet/InterruptibleInOutAnimator.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -62,7 +62,7 @@ public class InterruptibleInOutAnimator {
final long currentPlayTime = mAnimator.getCurrentPlayTime();
final float toValue = (direction == IN) ? mOriginalToValue : mOriginalFromValue;
final float startValue = mFirstRun ? mOriginalFromValue :
- ((Float) mAnimator.getAnimatedValue()).floatValue();
+ (Float) mAnimator.getAnimatedValue();
// Make sure it's stopped before we modify any values
cancel();
diff --git a/src/com/android/launcher2/ItemInfo.java b/src/com/cyanogenmod/trebuchet/ItemInfo.java
index 165c07b91..11be86979 100644
--- a/src/com/android/launcher2/ItemInfo.java
+++ b/src/com/cyanogenmod/trebuchet/ItemInfo.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.ContentValues;
import android.content.Intent;
@@ -23,19 +23,20 @@ import android.util.Log;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.util.Arrays;
/**
* Represents an item in the launcher.
*/
class ItemInfo {
-
+
static final int NO_ID = -1;
-
+
/**
* The id in the settings database for this item
*/
long id = NO_ID;
-
+
/**
* One of {@link LauncherSettings.Favorites#ITEM_TYPE_APPLICATION},
* {@link LauncherSettings.Favorites#ITEM_TYPE_SHORTCUT},
@@ -43,20 +44,20 @@ class ItemInfo {
* {@link LauncherSettings.Favorites#ITEM_TYPE_APPWIDGET}.
*/
int itemType;
-
+
/**
- * The id of the container that holds this item. For the desktop, this will be
+ * The id of the container that holds this item. For the desktop, this will be
* {@link LauncherSettings.Favorites#CONTAINER_DESKTOP}. For the all applications folder it
* will be {@link #NO_ID} (since it is not stored in the settings DB). For user folders
* it will be the id of the folder.
*/
long container = NO_ID;
-
+
/**
* Iindicates the screen in which the shortcut appears.
*/
int screen = -1;
-
+
/**
* Indicates the X position of the associated cell.
*/
@@ -189,6 +190,6 @@ class ItemInfo {
public String toString() {
return "Item(id=" + this.id + " type=" + this.itemType + " container=" + this.container
+ " screen=" + screen + " cellX=" + cellX + " cellY=" + cellY + " spanX=" + spanX
- + " spanY=" + spanY + " dropPos=" + dropPos + ")";
+ + " spanY=" + spanY + " dropPos=" + Arrays.toString(dropPos) + ")";
}
}
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/cyanogenmod/trebuchet/Launcher.java
index a4ed91f73..c69ec47be 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/cyanogenmod/trebuchet/Launcher.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.accounts.Account;
import android.accounts.AccountManager;
@@ -29,6 +29,7 @@ import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityOptions;
+import android.app.AlertDialog;
import android.app.SearchManager;
import android.appwidget.AppWidgetHostView;
import android.appwidget.AppWidgetManager;
@@ -39,12 +40,14 @@ import android.content.ComponentCallbacks2;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
+import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.pm.ResolveInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.ContentObserver;
@@ -53,6 +56,7 @@ import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.Rect;
+import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
@@ -80,6 +84,7 @@ import android.view.MotionEvent;
import android.view.Surface;
import android.view.View;
import android.view.View.OnLongClickListener;
+import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
@@ -90,13 +95,15 @@ import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.view.inputmethod.InputMethodManager;
import android.widget.Advanceable;
+import android.widget.EditText;
import android.widget.ImageView;
+import android.widget.PopupMenu;
import android.widget.TextView;
import android.widget.Toast;
import com.android.common.Search;
-import com.android.launcher.R;
-import com.android.launcher2.DropTarget.DragObject;
+import com.cyanogenmod.trebuchet.DropTarget.DragObject;
+import com.cyanogenmod.trebuchet.preference.*;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -119,8 +126,7 @@ import java.util.Set;
public final class Launcher extends Activity
implements View.OnClickListener, OnLongClickListener, LauncherModel.Callbacks,
View.OnTouchListener {
- static final String TAG = "Launcher";
- static final boolean LOGD = false;
+ private static final String TAG = "Trebuchet.Launcher";
static final boolean PROFILE_STARTUP = false;
static final boolean DEBUG_WIDGETS = false;
@@ -129,7 +135,8 @@ public final class Launcher extends Activity
private static final int MENU_GROUP_WALLPAPER = 1;
private static final int MENU_WALLPAPER_SETTINGS = Menu.FIRST + 1;
private static final int MENU_MANAGE_APPS = MENU_WALLPAPER_SETTINGS + 1;
- private static final int MENU_SYSTEM_SETTINGS = MENU_MANAGE_APPS + 1;
+ private static final int MENU_PREFERENCES = MENU_MANAGE_APPS + 1;
+ private static final int MENU_SYSTEM_SETTINGS = MENU_PREFERENCES + 1;
private static final int MENU_HELP = MENU_SYSTEM_SETTINGS + 1;
private static final int REQUEST_CREATE_SHORTCUT = 1;
@@ -143,7 +150,9 @@ public final class Launcher extends Activity
static final String EXTRA_SHORTCUT_DUPLICATE = "duplicate";
- static final int SCREEN_COUNT = 5;
+ static final int MAX_WORKSPACE_SCREEN_COUNT = 7;
+ static final int MAX_HOTSEAT_SCREEN_COUNT = 3;
+ static final int MAX_SCREEN_COUNT = MAX_WORKSPACE_SCREEN_COUNT + MAX_HOTSEAT_SCREEN_COUNT;
static final int DEFAULT_SCREEN = 2;
private static final String PREFERENCES = "launcher.preferences";
@@ -154,7 +163,7 @@ public final class Launcher extends Activity
// The Intent extra that defines whether to ignore the launch animation
static final String INTENT_EXTRA_IGNORE_LAUNCH_ANIMATION =
- "com.android.launcher.intent.extra.shortcut.INGORE_LAUNCH_ANIMATION";
+ "com.cyanogenmod.trebuchet.intent.extra.shortcut.INGORE_LAUNCH_ANIMATION";
// Type: int
private static final String RUNTIME_STATE_CURRENT_SCREEN = "launcher.current_screen";
@@ -186,7 +195,7 @@ public final class Launcher extends Activity
"com.android.launcher.toolbar_voice_search_icon";
/** The different states that Launcher can be in. */
- private enum State { NONE, WORKSPACE, APPS_CUSTOMIZE, APPS_CUSTOMIZE_SPRING_LOADED };
+ private enum State { NONE, WORKSPACE, APPS_CUSTOMIZE, APPS_CUSTOMIZE_SPRING_LOADED }
private State mState = State.WORKSPACE;
private AnimatorSet mStateAnimation;
private AnimatorSet mDividerAnimator;
@@ -197,11 +206,8 @@ public final class Launcher extends Activity
private static final int SHOW_CLING_DURATION = 550;
private static final int DISMISS_CLING_DURATION = 250;
- private static final Object sLock = new Object();
- private static int sScreen = DEFAULT_SCREEN;
-
// How long to wait before the new-shortcut animation automatically pans the workspace
- private static int NEW_APPS_ANIMATION_INACTIVE_TIMEOUT_SECONDS = 10;
+ private static final int NEW_APPS_ANIMATION_INACTIVE_TIMEOUT_SECONDS = 10;
private final BroadcastReceiver mCloseSystemDialogsReceiver
= new CloseSystemDialogsIntentReceiver();
@@ -227,7 +233,6 @@ public final class Launcher extends Activity
private FolderInfo mFolderInfo;
private Hotseat mHotseat;
- private View mAllAppsButton;
private SearchDropTargetBar mSearchDropTargetBar;
private AppsCustomizeTabHost mAppsCustomizeTabHost;
@@ -252,8 +257,6 @@ public final class Launcher extends Activity
// Keep track of whether the user has left launcher
private static boolean sPausedFromUserAction = false;
- private Bundle mSavedInstanceState;
-
private LauncherModel mModel;
private IconCache mIconCache;
private boolean mUserPresent = true;
@@ -277,7 +280,7 @@ public final class Launcher extends Activity
// Determines how long to wait after a rotation before restoring the screen orientation to
// match the sensor state.
- private final int mRestoreScreenOrientationDelay = 500;
+ private static final int RESTORE_SCREEN_ORIENTATION_DELAY = 500;
// External icons saved in case of resource changes, orientation, etc.
private static Drawable.ConstantState[] sGlobalSearchIcon = new Drawable.ConstantState[2];
@@ -308,6 +311,15 @@ public final class Launcher extends Activity
private HideFromAccessibilityHelper mHideFromAccessibilityHelper
= new HideFromAccessibilityHelper();
+ // Preferences
+ private boolean mShowSearchBar;
+ private boolean mShowHotseat;
+ private boolean mShowDockDivider;
+ private boolean mHideIconLabels;
+ private boolean mAutoRotate;
+ private boolean mFullscreenMode;
+
+ private boolean mWallpaperVisible;
private Runnable mBuildLayersRunnable = new Runnable() {
public void run() {
@@ -337,6 +349,17 @@ public final class Launcher extends Activity
@Override
protected void onCreate(Bundle savedInstanceState) {
+ // Listen for expanded desktop
+ getContentResolver().registerContentObserver(
+ Settings.System.getUriFor(Settings.System.EXPANDED_DESKTOP_STATE),
+ false, new ContentObserver(new Handler()) {
+ @Override
+ public void onChange(boolean selfChange) {
+ // Refresh launcher content
+ finish();
+ }
+ });
+
if (DEBUG_STRICT_MODE) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectDiskReads()
@@ -361,6 +384,9 @@ public final class Launcher extends Activity
mDragController = new DragController(this);
mInflater = getLayoutInflater();
+ // Load all preferences
+ PreferencesProvider.load(this);
+
mAppWidgetManager = AppWidgetManager.getInstance(this);
mAppWidgetHost = new LauncherAppWidgetHost(this, APPWIDGET_HOST_ID);
mAppWidgetHost.startListening();
@@ -369,6 +395,13 @@ public final class Launcher extends Activity
// this also ensures that any synchronous binding below doesn't re-trigger another
// LauncherModel load.
mPaused = false;
+ // Preferences
+ mShowSearchBar = PreferencesProvider.Interface.Homescreen.getShowSearchBar();
+ mShowHotseat = PreferencesProvider.Interface.Dock.getShowDock();
+ mShowDockDivider = PreferencesProvider.Interface.Dock.getShowDivider() && mShowHotseat;
+ mHideIconLabels = PreferencesProvider.Interface.Homescreen.getHideIconLabels();
+ mAutoRotate = PreferencesProvider.Interface.General.getAutoRotate(getResources().getBoolean(R.bool.allow_rotation));
+ mFullscreenMode = PreferencesProvider.Interface.General.getFullscreenMode();
if (PROFILE_STARTUP) {
android.os.Debug.startMethodTracing(
@@ -569,18 +602,6 @@ public final class Launcher extends Activity
return !mModel.isLoadingWorkspace();
}
- static int getScreen() {
- synchronized (sLock) {
- return sScreen;
- }
- }
-
- static void setScreen(int screen) {
- synchronized (sLock) {
- sScreen = screen;
- }
- }
-
/**
* Returns whether we should delay spring loaded mode -- for shortcuts and widgets that have
* a configuration step, this allows the proper animations to run after other transitions.
@@ -594,7 +615,8 @@ public final class Launcher extends Activity
break;
case REQUEST_PICK_SHORTCUT:
processShortcut(args.intent);
- break;
+ // Don't remove pending add info
+ return false;
case REQUEST_CREATE_SHORTCUT:
completeAddShortcut(args.intent, args.container, args.screen, args.cellX,
args.cellY);
@@ -653,7 +675,7 @@ public final class Launcher extends Activity
// For example, the user would PICK_SHORTCUT for "Music playlist", and we
// launch over to the Music app to actually CREATE_SHORTCUT.
- if (resultCode == RESULT_OK && mPendingAddInfo.container != ItemInfo.NO_ID) {
+ if (resultCode == RESULT_OK && mPendingAddInfo.container != com.cyanogenmod.trebuchet.ItemInfo.NO_ID) {
final PendingAddArguments args = new PendingAddArguments();
args.requestCode = requestCode;
args.intent = data;
@@ -690,8 +712,7 @@ public final class Launcher extends Activity
public void run() {
completeAddAppWidget(appWidgetId, mPendingAddInfo.container,
mPendingAddInfo.screen, layout, null);
- exitSpringLoadedDragModeDelayed((resultCode != RESULT_CANCELED), false,
- null);
+ exitSpringLoadedDragModeDelayed(true, false, null);
}
};
} else if (resultCode == RESULT_CANCELED) {
@@ -699,8 +720,7 @@ public final class Launcher extends Activity
onCompleteRunnable = new Runnable() {
@Override
public void run() {
- exitSpringLoadedDragModeDelayed((resultCode != RESULT_CANCELED), false,
- null);
+ exitSpringLoadedDragModeDelayed(false, false, null);
}
};
}
@@ -710,7 +730,9 @@ public final class Launcher extends Activity
animationType, boundWidget, true);
} else {
// The animated view may be null in the case of a rotation during widget configuration
- onCompleteRunnable.run();
+ if (onCompleteRunnable != null) {
+ onCompleteRunnable.run();
+ }
}
}
@@ -734,6 +756,10 @@ public final class Launcher extends Activity
mPaused = false;
sPausedFromUserAction = false;
+ // Restart launcher when preferences are changed
+ if (preferencesChanged()) {
+ android.os.Process.killProcess(android.os.Process.myPid());
+ }
if (mRestoring || mOnResumeNeedsLoad) {
mWorkspaceLoading = true;
mModel.startLoader(true, -1);
@@ -756,6 +782,7 @@ public final class Launcher extends Activity
// (framework issue). On resuming, we ensure that any widgets are inflated for the current
// orientation.
getWorkspace().reinflateWidgetsIfNecessary();
+ getWorkspace().checkWallpaper();
// Again, as with the above scenario, it's possible that one or more of the global icons
// were updated in the wrong orientation.
@@ -785,27 +812,6 @@ public final class Launcher extends Activity
return Boolean.TRUE;
}
- // We can't hide the IME if it was forced open. So don't bother
- /*
- @Override
- public void onWindowFocusChanged(boolean hasFocus) {
- super.onWindowFocusChanged(hasFocus);
-
- if (hasFocus) {
- final InputMethodManager inputManager = (InputMethodManager)
- getSystemService(Context.INPUT_METHOD_SERVICE);
- WindowManager.LayoutParams lp = getWindow().getAttributes();
- inputManager.hideSoftInputFromWindow(lp.token, 0, new android.os.ResultReceiver(new
- android.os.Handler()) {
- protected void onReceiveResult(int resultCode, Bundle resultData) {
- Log.d(TAG, "ResultReceiver got resultCode=" + resultCode);
- }
- });
- Log.d(TAG, "called hideSoftInputFromWindow from onWindowFocusChanged");
- }
- }
- */
-
private boolean acceptFilter() {
final InputMethodManager inputManager = (InputMethodManager)
getSystemService(Context.INPUT_METHOD_SERVICE);
@@ -856,9 +862,9 @@ public final class Launcher extends Activity
private static State intToState(int stateOrdinal) {
State state = State.WORKSPACE;
final State[] stateValues = State.values();
- for (int i = 0; i < stateValues.length; i++) {
- if (stateValues[i].ordinal() == stateOrdinal) {
- state = stateValues[i];
+ for (State stateValue : stateValues) {
+ if (stateValue.ordinal() == stateOrdinal) {
+ state = stateValue;
break;
}
}
@@ -888,7 +894,7 @@ public final class Launcher extends Activity
final long pendingAddContainer = savedState.getLong(RUNTIME_STATE_PENDING_ADD_CONTAINER, -1);
final int pendingAddScreen = savedState.getInt(RUNTIME_STATE_PENDING_ADD_SCREEN, -1);
- if (pendingAddContainer != ItemInfo.NO_ID && pendingAddScreen > -1) {
+ if (pendingAddContainer != com.cyanogenmod.trebuchet.ItemInfo.NO_ID && pendingAddScreen > -1) {
mPendingAddInfo.container = pendingAddContainer;
mPendingAddInfo.screen = pendingAddScreen;
mPendingAddInfo.cellX = savedState.getInt(RUNTIME_STATE_PENDING_ADD_CELL_X);
@@ -945,9 +951,6 @@ public final class Launcher extends Activity
// Setup the hotseat
mHotseat = (Hotseat) findViewById(R.id.hotseat);
- if (mHotseat != null) {
- mHotseat.setup(this);
- }
// Setup the workspace
mWorkspace.setHapticFeedbackEnabled(false);
@@ -958,6 +961,19 @@ public final class Launcher extends Activity
// Get the search/delete bar
mSearchDropTargetBar = (SearchDropTargetBar) mDragLayer.findViewById(R.id.qsb_bar);
+ // Hide the search divider if we are hiding search bar
+ if (!mShowSearchBar && mQsbDivider != null && getCurrentOrientation() == Configuration.ORIENTATION_LANDSCAPE) {
+ mQsbDivider.setVisibility(View.GONE);
+ }
+
+ if (!mShowHotseat) {
+ mHotseat.setVisibility(View.GONE);
+ }
+
+ if (!mShowDockDivider && mDockDivider != null) {
+ mDockDivider.setVisibility(View.GONE);
+ }
+
// Setup AppsCustomize
mAppsCustomizeTabHost = (AppsCustomizeTabHost) findViewById(R.id.apps_customize_pane);
mAppsCustomizeContent = (AppsCustomizePagedView)
@@ -975,6 +991,31 @@ public final class Launcher extends Activity
}
/**
+ * Starts shortcut rename dialog.
+ *
+ * @param info The shortcut to be edited
+ */
+ void updateShortcut(final ShortcutInfo info) {
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ View layout = mInflater.inflate(R.layout.dialog_edit, null);
+ ImageView icon = (ImageView) layout.findViewById(R.id.dialog_edit_icon);
+ icon.setImageBitmap(info.getIcon(mIconCache));
+ final EditText title = (EditText) layout.findViewById(R.id.dialog_edit_text);
+ title.setText(info.title);
+ builder.setView(layout)
+ .setTitle(info.title)
+ .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id) {
+ info.setTitle(title.getText());
+ LauncherModel.updateItemInDatabase(Launcher.this, info);
+ }
+ })
+ .setNegativeButton(android.R.string.cancel, null);
+ builder.show();
+ }
+
+ /**
* Creates a view representing a shortcut.
*
* @param info The data structure describing the shortcut.
@@ -998,7 +1039,11 @@ public final class Launcher extends Activity
View createShortcut(int layoutResId, ViewGroup parent, ShortcutInfo info) {
BubbleTextView favorite = (BubbleTextView) mInflater.inflate(layoutResId, parent, false);
favorite.applyFromShortcutInfo(info, mIconCache);
+ if (mHideIconLabels) {
+ favorite.setTextVisible(false);
+ }
favorite.setOnClickListener(this);
+ favorite.setOnTouchListener(this);
return favorite;
}
@@ -1026,8 +1071,8 @@ public final class Launcher extends Activity
if (info != null) {
info.setActivity(data.getComponent(), Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
- info.container = ItemInfo.NO_ID;
- mWorkspace.addApplicationShortcut(info, layout, container, screen, cellXY[0], cellXY[1],
+ info.container = com.cyanogenmod.trebuchet.ItemInfo.NO_ID;
+ mWorkspace.addApplicationShortcut(info, layout, container, screen,
isWorkspaceLocked(), cellX, cellY);
} else {
Log.e(TAG, "Couldn't find ActivityInfo for selected application: " + data);
@@ -1046,7 +1091,7 @@ public final class Launcher extends Activity
int[] touchXY = mPendingAddInfo.dropPos;
CellLayout layout = getCellLayout(container, screen);
- boolean foundCellSpan = false;
+ boolean foundCellSpan;
ShortcutInfo info = mModel.infoFromShortcutIntent(this, data, null);
if (info == null) {
@@ -1067,7 +1112,7 @@ public final class Launcher extends Activity
}
DragObject dragObject = new DragObject();
dragObject.dragInfo = info;
- if (mWorkspace.addToExistingFolderIfNecessary(view, layout, cellXY, 0, dragObject,
+ if (mWorkspace.addToExistingFolderIfNecessary(layout, cellXY, 0, dragObject,
true)) {
return;
}
@@ -1143,7 +1188,7 @@ public final class Launcher extends Activity
int[] cellXY = mTmpAddItemCellCoordinates;
int[] touchXY = mPendingAddInfo.dropPos;
int[] finalSpan = new int[2];
- boolean foundCellSpan = false;
+ boolean foundCellSpan;
if (mPendingAddInfo.cellX >= 0 && mPendingAddInfo.cellY >= 0) {
cellXY[0] = mPendingAddInfo.cellX;
cellXY[1] = mPendingAddInfo.cellY;
@@ -1220,13 +1265,15 @@ public final class Launcher extends Activity
// Reset AllApps to its initial state only if we are not in the middle of
// processing a multi-step drop
- if (mAppsCustomizeTabHost != null && mPendingAddInfo.container == ItemInfo.NO_ID) {
+ if (mAppsCustomizeTabHost != null && mPendingAddInfo.container == com.cyanogenmod.trebuchet.ItemInfo.NO_ID) {
mAppsCustomizeTabHost.reset();
showWorkspace(false);
}
} else if (Intent.ACTION_USER_PRESENT.equals(action)) {
mUserPresent = true;
updateRunning();
+ } else if (Intent.ACTION_SET_WALLPAPER.equals(action)) {
+ mWorkspace.checkWallpaper();
}
}
};
@@ -1239,6 +1286,7 @@ public final class Launcher extends Activity
final IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_SCREEN_OFF);
filter.addAction(Intent.ACTION_USER_PRESENT);
+ filter.addAction(Intent.ACTION_SET_WALLPAPER);
registerReceiver(mReceiver, filter);
mAttached = true;
@@ -1463,7 +1511,7 @@ public final class Launcher extends Activity
// this state is reflected.
closeFolder();
- if (mPendingAddInfo.container != ItemInfo.NO_ID && mPendingAddInfo.screen > -1 &&
+ if (mPendingAddInfo.container != com.cyanogenmod.trebuchet.ItemInfo.NO_ID && mPendingAddInfo.screen > -1 &&
mWaitingForResult) {
outState.putLong(RUNTIME_STATE_PENDING_ADD_CONTAINER, mPendingAddInfo.container);
outState.putInt(RUNTIME_STATE_PENDING_ADD_SCREEN, mPendingAddInfo.screen);
@@ -1545,7 +1593,7 @@ public final class Launcher extends Activity
/**
* Indicates that we want global search for this activity by setting the globalSearch
- * argument for {@link #startSearch} to true.
+ * argument for startSearch to true.
*/
@Override
public void startSearch(String initialQuery, boolean selectInitialQuery,
@@ -1621,6 +1669,9 @@ public final class Launcher extends Activity
Intent manageApps = new Intent(Settings.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS);
manageApps.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
+ Intent preferences = new Intent().setClass(this, Preferences.class);
+ preferences.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
+ | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
Intent settings = new Intent(android.provider.Settings.ACTION_SETTINGS);
settings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
@@ -1635,11 +1686,17 @@ public final class Launcher extends Activity
menu.add(0, MENU_MANAGE_APPS, 0, R.string.menu_manage_apps)
.setIcon(android.R.drawable.ic_menu_manage)
.setIntent(manageApps)
- .setAlphabeticShortcut('M');
+ .setAlphabeticShortcut('A');
+
+ menu.add(0, MENU_PREFERENCES, 0, R.string.menu_preferences)
+ .setIcon(android.R.drawable.ic_menu_preferences)
+ .setIntent(preferences)
+ .setAlphabeticShortcut('P');
+
menu.add(0, MENU_SYSTEM_SETTINGS, 0, R.string.menu_settings)
.setIcon(android.R.drawable.ic_menu_preferences)
.setIntent(settings)
- .setAlphabeticShortcut('P');
+ .setAlphabeticShortcut('S');
if (!helpUrl.isEmpty()) {
menu.add(0, MENU_HELP, 0, R.string.menu_help)
.setIcon(android.R.drawable.ic_menu_help)
@@ -1659,6 +1716,15 @@ public final class Launcher extends Activity
boolean allAppsVisible = (mAppsCustomizeTabHost.getVisibility() == View.VISIBLE);
menu.setGroupVisible(MENU_GROUP_WALLPAPER, !allAppsVisible);
+ Intent launcherIntent = new Intent(Intent.ACTION_MAIN);
+ launcherIntent.addCategory(Intent.CATEGORY_HOME);
+ launcherIntent.addCategory(Intent.CATEGORY_DEFAULT);
+ ActivityInfo defaultLauncher = getPackageManager().resolveActivity(launcherIntent, PackageManager.MATCH_DEFAULT_ONLY).activityInfo;
+ // Hide preferences if not on CyanogenMod or not default launcher
+ // (in which case preferences don't get shown in system settings)
+ boolean preferencesVisible = !getPackageManager().hasSystemFeature("com.cyanogenmod.android") ||
+ !defaultLauncher.packageName.equals(getClass().getPackage().getName());
+ menu.findItem(MENU_PREFERENCES).setVisible(preferencesVisible);
return true;
}
@@ -1685,7 +1751,7 @@ public final class Launcher extends Activity
}
private void resetAddInfo() {
- mPendingAddInfo.container = ItemInfo.NO_ID;
+ mPendingAddInfo.container = com.cyanogenmod.trebuchet.ItemInfo.NO_ID;
mPendingAddInfo.screen = -1;
mPendingAddInfo.cellX = mPendingAddInfo.cellY = -1;
mPendingAddInfo.spanX = mPendingAddInfo.spanY = -1;
@@ -1774,7 +1840,7 @@ public final class Launcher extends Activity
appWidgetId = getAppWidgetHost().allocateAppWidgetId();
Bundle options = info.bindOptions;
- boolean success = false;
+ boolean success;
if (options != null) {
success = mAppWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId,
info.componentName, options);
@@ -1830,7 +1896,10 @@ public final class Launcher extends Activity
// Create the view
FolderIcon newFolder =
- FolderIcon.fromXml(R.layout.folder_icon, this, layout, folderInfo, mIconCache);
+ FolderIcon.fromXml(R.layout.folder_icon, this, layout, folderInfo);
+ if (mHideIconLabels) {
+ newFolder.setTextVisible(false);
+ }
mWorkspace.addInScreen(newFolder, container, screen, cellX, cellY, 1, 1,
isWorkspaceLocked());
return newFolder;
@@ -1845,18 +1914,7 @@ public final class Launcher extends Activity
final Intent pickWallpaper = new Intent(Intent.ACTION_SET_WALLPAPER);
Intent chooser = Intent.createChooser(pickWallpaper,
getText(R.string.chooser_wallpaper));
- // NOTE: Adds a configure option to the chooser if the wallpaper supports it
- // Removed in Eclair MR1
-// WallpaperManager wm = (WallpaperManager)
-// getSystemService(Context.WALLPAPER_SERVICE);
-// WallpaperInfo wi = wm.getWallpaperInfo();
-// if (wi != null && wi.getSettingsActivity() != null) {
-// LabeledIntent li = new LabeledIntent(getPackageName(),
-// R.string.configure_wallpaper, 0);
-// li.setClassName(wi.getPackageName(), wi.getSettingsActivity());
-// chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] { li });
-// }
- startActivityForResult(chooser, REQUEST_PICK_WALLPAPER);
+ processWallpaper(chooser);
}
/**
@@ -1938,37 +1996,41 @@ public final class Launcher extends Activity
Object tag = v.getTag();
if (tag instanceof ShortcutInfo) {
- // Open shortcut
- final Intent intent = ((ShortcutInfo) tag).intent;
- int[] pos = new int[2];
- v.getLocationOnScreen(pos);
- intent.setSourceBounds(new Rect(pos[0], pos[1],
- pos[0] + v.getWidth(), pos[1] + v.getHeight()));
-
- boolean success = startActivitySafely(v, intent, tag);
-
- if (success && v instanceof BubbleTextView) {
- mWaitingForResume = (BubbleTextView) v;
- mWaitingForResume.setStayPressed(true);
+ if (((ShortcutInfo) tag).itemType == LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS) {
+ showAllApps(true);
+ } else {
+ // Open shortcut
+ final Intent intent = ((ShortcutInfo) tag).intent;
+ int[] pos = new int[2];
+ v.getLocationOnScreen(pos);
+ intent.setSourceBounds(new Rect(pos[0], pos[1],
+ pos[0] + v.getWidth(), pos[1] + v.getHeight()));
+
+ boolean success = startActivitySafely(v, intent, tag);
+
+ if (success && v instanceof BubbleTextView) {
+ mWaitingForResume = (BubbleTextView) v;
+ mWaitingForResume.setStayPressed(true);
+ }
}
} else if (tag instanceof FolderInfo) {
if (v instanceof FolderIcon) {
FolderIcon fi = (FolderIcon) v;
handleFolderClick(fi);
}
- } else if (v == mAllAppsButton) {
- if (isAllAppsVisible()) {
- showWorkspace(true);
- } else {
- onClickAllAppsButton(v);
- }
}
}
+ @Override
public boolean onTouch(View v, MotionEvent event) {
- // this is an intercepted event being forwarded from mWorkspace;
- // clicking anywhere on the workspace causes the customization drawer to slide down
- showWorkspace(true);
+ if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
+ Object tag = v.getTag();
+ if (tag instanceof ShortcutInfo &&
+ ((ShortcutInfo)tag).itemType == LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS) {
+ v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
+ HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
+ }
+ }
return false;
}
@@ -2008,21 +2070,6 @@ public final class Launcher extends Activity
}
}
- /**
- * Event handler for the "grid" button that appears on the home screen, which
- * enters all apps mode.
- *
- * @param v The view that was clicked.
- */
- public void onClickAllAppsButton(View v) {
- showAllApps(true);
- }
-
- public void onTouchDownAllAppsButton(View v) {
- // Provide the same haptic feedback that the system offers for virtual keys.
- v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
- }
-
public void onClickAppMarketButton(View v) {
if (mAppMarketIntent != null) {
startActivitySafely(v, mAppMarketIntent, "app market");
@@ -2031,6 +2078,52 @@ public final class Launcher extends Activity
}
}
+ public void onLongClickAppsTab(View v) {
+ final PopupMenu popupMenu = new PopupMenu(this, v);
+ final Menu menu = popupMenu.getMenu();
+ dismissAllAppsSortCling(null);
+ popupMenu.inflate(R.menu.apps_tab);
+ AppsCustomizePagedView.SortMode sortMode = mAppsCustomizeContent.getSortMode();
+ if (sortMode == AppsCustomizePagedView.SortMode.Title) {
+ menu.findItem(R.id.apps_sort_title).setChecked(true);
+ } else if (sortMode == AppsCustomizePagedView.SortMode.InstallDate) {
+ menu.findItem(R.id.apps_sort_install_date).setChecked(true);
+ }
+ boolean showSystemApps = mAppsCustomizeContent.getShowSystemApps();
+ boolean showDownloadedApps = mAppsCustomizeContent.getShowDownloadedApps();
+ menu.findItem(R.id.apps_filter_system).setChecked(showSystemApps).setEnabled(showDownloadedApps);
+ menu.findItem(R.id.apps_filter_downloaded).setChecked(showDownloadedApps).setEnabled(showSystemApps);
+ popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
+ public boolean onMenuItemClick(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.apps_sort_title:
+ mAppsCustomizeContent.setSortMode(AppsCustomizePagedView.SortMode.Title);
+ break;
+ case R.id.apps_sort_install_date:
+ mAppsCustomizeContent.setSortMode(AppsCustomizePagedView.SortMode.InstallDate);
+ break;
+ case R.id.apps_filter_system:
+ mAppsCustomizeContent.setShowSystemApps(!item.isChecked());
+ break;
+ case R.id.apps_filter_downloaded:
+ mAppsCustomizeContent.setShowDownloadedApps(!item.isChecked());
+ break;
+ }
+ return true;
+ }
+ });
+ popupMenu.show();
+ }
+
+ public void onClickOverflowMenuButton(View v) {
+ final PopupMenu popupMenu = new PopupMenu(this, v);
+ final Menu menu = popupMenu.getMenu();
+ onCreateOptionsMenu(menu);
+ onPrepareOptionsMenu(menu);
+ popupMenu.show();
+ }
+
+
void startApplicationDetailsActivity(ComponentName componentName) {
String packageName = componentName.getPackageName();
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
@@ -2056,6 +2149,26 @@ public final class Launcher extends Activity
}
}
+ void startShortcutUninstallActivity(ShortcutInfo shortcutInfo) {
+ PackageManager pm = getPackageManager();
+ ResolveInfo resolveInfo = pm.resolveActivity(shortcutInfo.intent, 0);
+ if ((resolveInfo.activityInfo.applicationInfo.flags &
+ android.content.pm.ApplicationInfo.FLAG_SYSTEM) != 0) {
+ // System applications cannot be installed. For now, show a toast explaining that.
+ // We may give them the option of disabling apps this way.
+ int messageId = R.string.uninstall_system_app_text;
+ Toast.makeText(this, messageId, Toast.LENGTH_SHORT).show();
+ } else {
+ String packageName = shortcutInfo.intent.getComponent().getPackageName();
+ String className = shortcutInfo.intent.getComponent().getClassName();
+ Intent intent = new Intent(
+ Intent.ACTION_DELETE, Uri.fromParts("package", packageName, className));
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
+ Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
+ startActivity(intent);
+ }
+ }
+
boolean startActivity(View v, Intent intent, Object tag) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
@@ -2261,7 +2374,7 @@ public final class Launcher extends Activity
// There was a one-off crash where the folder had a parent already.
if (folder.getParent() == null) {
mDragLayer.addView(folder);
- mDragController.addDropTarget((DropTarget) folder);
+ mDragController.addDropTarget(folder);
} else {
Log.w(TAG, "Opening folder (" + folder + ") which already has a parent (" +
folder.getParent() + ").");
@@ -2319,6 +2432,7 @@ public final class Launcher extends Activity
// User long pressed on empty space
mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
+
startWallpaper();
} else {
if (!(itemUnderLongClick instanceof Folder)) {
@@ -2332,7 +2446,7 @@ public final class Launcher extends Activity
boolean isHotseatLayout(View layout) {
return mHotseat != null && layout != null &&
- (layout instanceof CellLayout) && (layout == mHotseat.getLayout());
+ (layout instanceof CellLayout) && mHotseat.hasPage(layout);
}
Hotseat getHotseat() {
return mHotseat;
@@ -2347,7 +2461,7 @@ public final class Launcher extends Activity
CellLayout getCellLayout(long container, int screen) {
if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
if (mHotseat != null) {
- return mHotseat.getLayout();
+ return (CellLayout) mHotseat.getPageAt(screen);
} else {
return null;
}
@@ -2366,17 +2480,12 @@ public final class Launcher extends Activity
return (mState == State.APPS_CUSTOMIZE) || (mOnResumeState == State.APPS_CUSTOMIZE);
}
- @Override
- public boolean isAllAppsButtonRank(int rank) {
- return mHotseat.isAllAppsButtonRank(rank);
- }
-
/**
* Helper method for the cameraZoomIn/cameraZoomOut animations
* @param view The view being animated
* @param scaleFactor The scale factor used for the zoom
*/
- private void setPivotsForZoom(View view, float scaleFactor) {
+ private void setPivotsForZoom(View view) {
view.setPivotX(view.getWidth() / 2.0f);
view.setPivotY(view.getHeight() / 2.0f);
}
@@ -2391,13 +2500,18 @@ public final class Launcher extends Activity
}
}
+ void setWallpaperVisibility(boolean visible) {
+ mWallpaperVisible = visible;
+ updateWallpaperVisibility(visible);
+ }
+
private void setWorkspaceBackground(boolean workspace) {
mLauncherView.setBackground(workspace ?
mWorkspaceBackgroundDrawable : mBlackBackgroundDrawable);
}
void updateWallpaperVisibility(boolean visible) {
- int wpflags = visible ? WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER : 0;
+ int wpflags = visible && mWallpaperVisible ? WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER : 0;
int curflags = getWindow().getAttributes().flags
& WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
if (wpflags != curflags) {
@@ -2406,6 +2520,15 @@ public final class Launcher extends Activity
setWorkspaceBackground(visible);
}
+ private void updateFullscreenMode(boolean enable) {
+ int fsflags = enable ? WindowManager.LayoutParams.FLAG_FULLSCREEN : 0;
+ int curflags = getWindow().getAttributes().flags
+ & WindowManager.LayoutParams.FLAG_FULLSCREEN;
+ if (fsflags != curflags) {
+ getWindow().setFlags(fsflags, WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ }
+ }
+
private void dispatchOnLauncherTransitionPrepare(View v, boolean animated, boolean toWorkspace) {
if (v instanceof LauncherTransitionable) {
((LauncherTransitionable) v).onLauncherTransitionPrepare(this, animated, toWorkspace);
@@ -2496,7 +2619,7 @@ public final class Launcher extends Activity
final int startDelay =
res.getInteger(R.integer.config_workspaceAppsCustomizeAnimationStagger);
- setPivotsForZoom(toView, scale);
+ setPivotsForZoom(toView);
// Shrink workspaces away if going to AppsCustomize from workspace
Animator workspaceAnim =
@@ -2540,7 +2663,7 @@ public final class Launcher extends Activity
@Override
public void onAnimationStart(Animator animation) {
- updateWallpaperVisibility(true);
+ updateWallpaperVisibility(!mWorkspace.isRenderingWallpaper());
// Prepare the position
toView.setTranslationX(0.0f);
toView.setTranslationY(0.0f);
@@ -2585,7 +2708,7 @@ public final class Launcher extends Activity
// If any of the objects being animated haven't been measured/laid out
// yet, delay the animation until we get a layout pass
- if ((((LauncherTransitionable) toView).getContent().getMeasuredWidth() == 0) ||
+ if ((toView.getContent().getMeasuredWidth() == 0) ||
(mWorkspace.getMeasuredWidth() == 0) ||
(toView.getMeasuredWidth() == 0)) {
observer = mWorkspace.getViewTreeObserver();
@@ -2601,7 +2724,7 @@ public final class Launcher extends Activity
// we waited for a layout/draw pass
if (mStateAnimation != stateAnimation)
return;
- setPivotsForZoom(toView, scale);
+ setPivotsForZoom(toView);
dispatchOnLauncherTransitionStart(fromView, animated, false);
dispatchOnLauncherTransitionStart(toView, animated, false);
toView.post(new Runnable() {
@@ -2660,7 +2783,7 @@ public final class Launcher extends Activity
* @param animated If true, the transition will be animated.
*/
private void hideAppsCustomizeHelper(State toState, final boolean animated,
- final boolean springLoaded, final Runnable onCompleteRunnable) {
+ final Runnable onCompleteRunnable) {
if (mStateAnimation != null) {
mStateAnimation.cancel();
@@ -2686,7 +2809,7 @@ public final class Launcher extends Activity
Workspace.State.SPRING_LOADED, animated);
}
- setPivotsForZoom(fromView, scaleFactor);
+ setPivotsForZoom(fromView);
updateWallpaperVisibility(true);
showHotseat(animated);
if (animated) {
@@ -2782,6 +2905,10 @@ public final class Launcher extends Activity
disableWallpaperIfInAllApps();
}
}, 500);
+
+ if (mFullscreenMode) {
+ updateFullscreenMode(true);
+ }
}
}
@@ -2793,7 +2920,7 @@ public final class Launcher extends Activity
if (mState != State.WORKSPACE) {
boolean wasInSpringLoadedMode = (mState == State.APPS_CUSTOMIZE_SPRING_LOADED);
mWorkspace.setVisibility(View.VISIBLE);
- hideAppsCustomizeHelper(State.WORKSPACE, animated, false, onCompleteRunnable);
+ hideAppsCustomizeHelper(State.WORKSPACE, animated, onCompleteRunnable);
// Show the search bar (only animate if we were showing the drop target bar in spring
// loaded mode)
@@ -2803,11 +2930,6 @@ public final class Launcher extends Activity
// We only need to animate in the dock divider if we're going from spring loaded mode
showDockDivider(animated && wasInSpringLoadedMode);
-
- // Set focus to the AppsCustomize button
- if (mAllAppsButton != null) {
- mAllAppsButton.requestFocus();
- }
}
mWorkspace.flashScrollingIndicator(animated);
@@ -2845,7 +2967,7 @@ public final class Launcher extends Activity
void enterSpringLoadedDragMode() {
if (isAllAppsVisible()) {
- hideAppsCustomizeHelper(State.APPS_CUSTOMIZE_SPRING_LOADED, true, true, null);
+ hideAppsCustomizeHelper(State.APPS_CUSTOMIZE_SPRING_LOADED, true, null);
hideDockDivider();
mState = State.APPS_CUSTOMIZE_SPRING_LOADED;
}
@@ -2885,15 +3007,23 @@ public final class Launcher extends Activity
void hideDockDivider() {
if (mQsbDivider != null && mDockDivider != null) {
- mQsbDivider.setVisibility(View.INVISIBLE);
- mDockDivider.setVisibility(View.INVISIBLE);
+ if (mShowSearchBar) {
+ mQsbDivider.setVisibility(View.INVISIBLE);
+ }
+ if (mShowDockDivider) {
+ mDockDivider.setVisibility(View.INVISIBLE);
+ }
}
}
void showDockDivider(boolean animated) {
if (mQsbDivider != null && mDockDivider != null) {
- mQsbDivider.setVisibility(View.VISIBLE);
- mDockDivider.setVisibility(View.VISIBLE);
+ if (mShowSearchBar) {
+ mQsbDivider.setVisibility(View.VISIBLE);
+ }
+ if (mShowDockDivider) {
+ mDockDivider.setVisibility(View.VISIBLE);
+ }
if (mDividerAnimator != null) {
mDividerAnimator.cancel();
mQsbDivider.setAlpha(1f);
@@ -2902,8 +3032,10 @@ public final class Launcher extends Activity
}
if (animated) {
mDividerAnimator = LauncherAnimUtils.createAnimatorSet();
- mDividerAnimator.playTogether(LauncherAnimUtils.ofFloat(mQsbDivider, "alpha", 1f),
- LauncherAnimUtils.ofFloat(mDockDivider, "alpha", 1f));
+ if (mShowSearchBar && mShowDockDivider) {
+ mDividerAnimator.playTogether(LauncherAnimUtils.ofFloat(mQsbDivider, "alpha", 1f),
+ LauncherAnimUtils.ofFloat(mDockDivider, "alpha", 1f));
+ }
int duration = 0;
if (mSearchDropTargetBar != null) {
duration = mSearchDropTargetBar.getTransitionInDuration();
@@ -2926,7 +3058,7 @@ public final class Launcher extends Activity
* Shows the hotseat area.
*/
void showHotseat(boolean animated) {
- if (!LauncherApplication.isScreenLarge()) {
+ if (mShowHotseat) {
if (animated) {
if (mHotseat.getAlpha() != 1f) {
int duration = 0;
@@ -2945,7 +3077,7 @@ public final class Launcher extends Activity
* Hides the hotseat area.
*/
void hideHotseat(boolean animated) {
- if (!LauncherApplication.isScreenLarge()) {
+ if (mShowHotseat) {
if (animated) {
if (mHotseat.getAlpha() != 0f) {
int duration = 0;
@@ -2960,20 +3092,14 @@ public final class Launcher extends Activity
}
}
- /**
- * Add an item from all apps or customize onto the given workspace screen.
- * If layout is null, add to the current screen.
- */
- void addExternalItemToScreen(ItemInfo itemInfo, final CellLayout layout) {
- if (!mWorkspace.addExternalItemToScreen(itemInfo, layout)) {
- showOutOfSpaceMessage(isHotseatLayout(layout));
- }
+ public int getCurrentOrientation() {
+ return getResources().getConfiguration().orientation;
}
/** Maps the current orientation to an index for referencing orientation correct global icons */
private int getCurrentOrientationIndexForGlobalIcons() {
// default - 0, landscape - 1
- switch (getResources().getConfiguration().orientation) {
+ switch (getCurrentOrientation()) {
case Configuration.ORIENTATION_LANDSCAPE:
return 1;
default:
@@ -3084,7 +3210,7 @@ public final class Launcher extends Activity
final SearchManager searchManager =
(SearchManager) getSystemService(Context.SEARCH_SERVICE);
ComponentName activityName = searchManager.getGlobalSearchActivity();
- if (activityName != null) {
+ if (activityName != null && mShowSearchBar) {
int coi = getCurrentOrientationIndexForGlobalIcons();
sGlobalSearchIcon[coi] = updateButtonWithIconFromExternalActivity(
R.id.search_button, activityName, R.drawable.ic_home_search_normal_holo,
@@ -3114,7 +3240,7 @@ public final class Launcher extends Activity
private void updateGlobalSearchIcon(Drawable.ConstantState d) {
final View searchButtonContainer = findViewById(R.id.search_button_container);
- final View searchButton = (ImageView) findViewById(R.id.search_button);
+ final View searchButton = findViewById(R.id.search_button);
updateButtonWithDrawable(R.id.search_button, d);
invalidatePressedFocusedStates(searchButtonContainer, searchButton);
}
@@ -3186,7 +3312,17 @@ public final class Launcher extends Activity
// Find the app market activity by resolving an intent.
// (If multiple app markets are installed, it will return the ResolverActivity.)
ComponentName activityName = intent.resolveActivity(getPackageManager());
- if (activityName != null) {
+
+ // Check to see if overflow menu is shown
+ Intent launcherIntent = new Intent(Intent.ACTION_MAIN);
+ launcherIntent.addCategory(Intent.CATEGORY_HOME);
+ launcherIntent.addCategory(Intent.CATEGORY_DEFAULT);
+ ActivityInfo defaultLauncher = getPackageManager().resolveActivity(launcherIntent, PackageManager.MATCH_DEFAULT_ONLY).activityInfo;
+ // Hide preferences if not on CyanogenMod or not default launcher
+ // (in which case preferences don't get shown in system settings)
+ boolean preferencesVisible = !getPackageManager().hasSystemFeature("com.cyanogenmod.android") ||
+ !defaultLauncher.packageName.equals(getClass().getPackage().getName());
+ if (activityName != null && (ViewConfiguration.get(this).hasPermanentMenuKey() || !preferencesVisible)) {
int coi = getCurrentOrientationIndexForGlobalIcons();
mAppMarketIntent = intent;
sAppMarketIcon[coi] = updateTextButtonWithIconFromExternalActivity(
@@ -3226,6 +3362,24 @@ public final class Launcher extends Activity
return result;
}
+ private void updateOverflowMenuButton() {
+ final View overflowMenuButton = findViewById(R.id.overflow_menu_button);
+ Intent launcherIntent = new Intent(Intent.ACTION_MAIN);
+ launcherIntent.addCategory(Intent.CATEGORY_HOME);
+ launcherIntent.addCategory(Intent.CATEGORY_DEFAULT);
+ ActivityInfo defaultLauncher = getPackageManager().resolveActivity(launcherIntent, PackageManager.MATCH_DEFAULT_ONLY).activityInfo;
+ // Hide preferences if not on CyanogenMod or not default launcher
+ // (in which case preferences don't get shown in system settings)
+ boolean preferencesVisible = !getPackageManager().hasSystemFeature("com.cyanogenmod.android") ||
+ !defaultLauncher.packageName.equals(getClass().getPackage().getName());
+ if (ViewConfiguration.get(this).hasPermanentMenuKey() || !preferencesVisible) {
+ overflowMenuButton.setVisibility(View.GONE);
+ overflowMenuButton.setEnabled(false);
+ } else {
+ overflowMenuButton.setVisibility(View.VISIBLE);
+ }
+ }
+
/**
* Receives notifications when system dialogs are to be closed.
*/
@@ -3281,7 +3435,7 @@ public final class Launcher extends Activity
if (mWorkspace != null) {
return mWorkspace.getCurrentPage();
} else {
- return SCREEN_COUNT / 2;
+ return DEFAULT_SCREEN;
}
}
@@ -3333,8 +3487,9 @@ public final class Launcher extends Activity
switch (item.itemType) {
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
+ case LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS:
ShortcutInfo info = (ShortcutInfo) item;
- String uri = info.intent.toUri(0).toString();
+ String uri = info.intent != null ? info.intent.toUri(0) : null;
View shortcut = createShortcut(info);
workspace.addInScreen(shortcut, item.container, item.screen, item.cellX,
item.cellY, 1, 1, false);
@@ -3358,7 +3513,10 @@ public final class Launcher extends Activity
case LauncherSettings.Favorites.ITEM_TYPE_FOLDER:
FolderIcon newFolder = FolderIcon.fromXml(R.layout.folder_icon, this,
(ViewGroup) workspace.getChildAt(workspace.getCurrentPage()),
- (FolderInfo) item, mIconCache);
+ (FolderInfo) item);
+ if (!mHideIconLabels) {
+ newFolder.setTextVisible(false);
+ }
workspace.addInScreen(newFolder, item.container, item.screen, item.cellX,
item.cellY, 1, 1, false);
break;
@@ -3437,8 +3595,8 @@ public final class Launcher extends Activity
// If we received the result of any pending adds while the loader was running (e.g. the
// widget configuration forced an orientation change), process them now.
- for (int i = 0; i < sPendingAddList.size(); i++) {
- completeAdd(sPendingAddList.get(i));
+ for (PendingAddArguments pendingAdd : sPendingAddList) {
+ completeAdd(pendingAdd);
}
sPendingAddList.clear();
@@ -3496,7 +3654,7 @@ public final class Launcher extends Activity
public int compare(View a, View b) {
CellLayout.LayoutParams alp = (CellLayout.LayoutParams) a.getLayoutParams();
CellLayout.LayoutParams blp = (CellLayout.LayoutParams) b.getLayoutParams();
- int cellCountX = LauncherModel.getCellCountX();
+ int cellCountX = LauncherModel.getWorkspaceCellCountX();
return (alp.cellY * cellCountX + alp.cellX) - (blp.cellY * cellCountX + blp.cellX);
}
});
@@ -3517,7 +3675,7 @@ public final class Launcher extends Activity
PropertyValuesHolder.ofFloat("scaleY", 1f));
bounceAnim.setDuration(InstallShortcutReceiver.NEW_SHORTCUT_BOUNCE_DURATION);
bounceAnim.setStartDelay(i * InstallShortcutReceiver.NEW_SHORTCUT_STAGGER_DELAY);
- bounceAnim.setInterpolator(new SmoothPagedView.OvershootInterpolator());
+ bounceAnim.setInterpolator(new PagedView.OvershootInterpolator());
bounceAnims.add(bounceAnim);
}
anim.playTogether(bounceAnims);
@@ -3543,6 +3701,9 @@ public final class Launcher extends Activity
.commit();
}
}.start();
+
+ // Hide overflow menu on devices with a hardkey
+ updateOverflowMenuButton();
}
@Override
@@ -3630,7 +3791,7 @@ public final class Launcher extends Activity
}
// Notify the drag controller
- mDragController.onAppsRemoved(packageNames, this);
+ mDragController.onAppsRemoved(packageNames);
}
/**
@@ -3680,13 +3841,13 @@ public final class Launcher extends Activity
return enableRotation;
}
public void lockScreenOrientation() {
- if (isRotationEnabled()) {
+ if (mAutoRotate) {
setRequestedOrientation(mapConfigurationOriActivityInfoOri(getResources()
.getConfiguration().orientation));
}
}
public void unlockScreenOrientation(boolean immediate) {
- if (isRotationEnabled()) {
+ if (mAutoRotate) {
if (immediate) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
} else {
@@ -3694,17 +3855,18 @@ public final class Launcher extends Activity
public void run() {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
}
- }, mRestoreScreenOrientationDelay);
+ }, RESTORE_SCREEN_ORIENTATION_DELAY);
}
+ } else {
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
}
}
/* Cling related */
private boolean isClingsEnabled() {
// disable clings when running in a test harness
- if(ActivityManager.isRunningInTestHarness()) return false;
+ return !ActivityManager.isRunningInTestHarness();
- return true;
}
private Cling initCling(int clingId, int[] positionData, boolean animate, int delay) {
@@ -3756,7 +3918,7 @@ public final class Launcher extends Activity
editor.commit();
}
}.start();
- };
+ }
});
anim.start();
mHideFromAccessibilityHelper.restoreImportantForAccessibility(mDragLayer);
@@ -3821,6 +3983,16 @@ public final class Launcher extends Activity
removeCling(R.id.all_apps_cling);
}
}
+ public void showFirstRunAllAppsSortCling(int[] position) {
+ // Enable the clings only if they have not been dismissed before
+ SharedPreferences prefs =
+ getSharedPreferences(PreferencesProvider.PREFERENCES_KEY, Context.MODE_PRIVATE);
+ if (isClingsEnabled() && !prefs.getBoolean(Cling.ALLAPPS_SORT_CLING_DISMISSED_KEY, false)) {
+ initCling(R.id.all_apps_sort_cling, position, true, 0);
+ } else {
+ removeCling(R.id.all_apps_sort_cling);
+ }
+ }
public Cling showFirstRunFoldersCling() {
// Enable the clings only if they have not been dismissed before
if (isClingsEnabled() &&
@@ -3833,10 +4005,7 @@ public final class Launcher extends Activity
}
public boolean isFolderClingVisible() {
Cling cling = (Cling) findViewById(R.id.folder_cling);
- if (cling != null) {
- return cling.getVisibility() == View.VISIBLE;
- }
- return false;
+ return cling != null && cling.getVisibility() == View.VISIBLE;
}
public void dismissWorkspaceCling(View v) {
Cling cling = (Cling) findViewById(R.id.workspace_cling);
@@ -3846,11 +4015,27 @@ public final class Launcher extends Activity
Cling cling = (Cling) findViewById(R.id.all_apps_cling);
dismissCling(cling, Cling.ALLAPPS_CLING_DISMISSED_KEY, DISMISS_CLING_DURATION);
}
+ public void dismissAllAppsSortCling(View v) {
+ Cling cling = (Cling) findViewById(R.id.all_apps_sort_cling);
+ dismissCling(cling, Cling.ALLAPPS_SORT_CLING_DISMISSED_KEY, DISMISS_CLING_DURATION);
+ }
public void dismissFolderCling(View v) {
Cling cling = (Cling) findViewById(R.id.folder_cling);
dismissCling(cling, Cling.FOLDER_CLING_DISMISSED_KEY, DISMISS_CLING_DURATION);
}
+ public boolean preferencesChanged() {
+ SharedPreferences prefs =
+ getSharedPreferences(PreferencesProvider.PREFERENCES_KEY, Context.MODE_PRIVATE);
+ boolean preferencesChanged = prefs.getBoolean(PreferencesProvider.PREFERENCES_CHANGED, false);
+ if (preferencesChanged) {
+ SharedPreferences.Editor editor = prefs.edit();
+ editor.putBoolean(PreferencesProvider.PREFERENCES_CHANGED, false);
+ editor.commit();
+ }
+ return preferencesChanged;
+ }
+
/**
* Prints out out state for debugging.
*/
@@ -3860,7 +4045,7 @@ public final class Launcher extends Activity
Log.d(TAG, "mWorkspaceLoading=" + mWorkspaceLoading);
Log.d(TAG, "mRestoring=" + mRestoring);
Log.d(TAG, "mWaitingForResult=" + mWaitingForResult);
- Log.d(TAG, "mSavedInstanceState=" + mSavedInstanceState);
+ Log.d(TAG, "mSavedInstanceState=" + mSavedState);
Log.d(TAG, "sFolders.size=" + sFolders.size());
mModel.dumpState();
@@ -3875,8 +4060,8 @@ public final class Launcher extends Activity
super.dump(prefix, fd, writer, args);
writer.println(" ");
writer.println("Debug logs: ");
- for (int i = 0; i < sDumpLogs.size(); i++) {
- writer.println(" " + sDumpLogs.get(i));
+ for (String dumpLog : sDumpLogs) {
+ writer.println(" " + dumpLog);
}
}
@@ -3884,8 +4069,8 @@ public final class Launcher extends Activity
Log.d(TAG, "");
Log.d(TAG, "*********************");
Log.d(TAG, "Launcher debug logs: ");
- for (int i = 0; i < sDumpLogs.size(); i++) {
- Log.d(TAG, " " + sDumpLogs.get(i));
+ for (String dumpLog : sDumpLogs) {
+ Log.d(TAG, " " + dumpLog);
}
Log.d(TAG, "*********************");
Log.d(TAG, "");
diff --git a/src/com/android/launcher2/LauncherAnimUtils.java b/src/com/cyanogenmod/trebuchet/LauncherAnimUtils.java
index 9317c31b6..456c3c0cb 100644
--- a/src/com/android/launcher2/LauncherAnimUtils.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherAnimUtils.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.Animator;
import android.animation.AnimatorSet;
diff --git a/src/com/android/launcher2/LauncherAnimatorUpdateListener.java b/src/com/cyanogenmod/trebuchet/LauncherAnimatorUpdateListener.java
index dd821134d..df9ded1ea 100644
--- a/src/com/android/launcher2/LauncherAnimatorUpdateListener.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherAnimatorUpdateListener.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
diff --git a/src/com/android/launcher2/LauncherAppWidgetHost.java b/src/com/cyanogenmod/trebuchet/LauncherAppWidgetHost.java
index 45c1d2311..2f1639256 100644
--- a/src/com/android/launcher2/LauncherAppWidgetHost.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherAppWidgetHost.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.appwidget.AppWidgetHost;
import android.appwidget.AppWidgetHostView;
diff --git a/src/com/android/launcher2/LauncherAppWidgetHostView.java b/src/com/cyanogenmod/trebuchet/LauncherAppWidgetHostView.java
index 549d3340e..d87c536fc 100644
--- a/src/com/android/launcher2/LauncherAppWidgetHostView.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherAppWidgetHostView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.appwidget.AppWidgetHostView;
import android.content.Context;
@@ -24,7 +24,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.RemoteViews;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
/**
* {@inheritDoc}
@@ -56,10 +56,7 @@ public class LauncherAppWidgetHostView extends AppWidgetHostView {
public boolean orientationChangedSincedInflation() {
int orientation = mContext.getResources().getConfiguration().orientation;
- if (mPreviousOrientation != orientation) {
- return true;
- }
- return false;
+ return mPreviousOrientation != orientation;
}
public boolean onInterceptTouchEvent(MotionEvent ev) {
diff --git a/src/com/android/launcher2/LauncherAppWidgetInfo.java b/src/com/cyanogenmod/trebuchet/LauncherAppWidgetInfo.java
index f001b2b64..0ab5dae84 100644
--- a/src/com/android/launcher2/LauncherAppWidgetInfo.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherAppWidgetInfo.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.appwidget.AppWidgetHostView;
import android.content.ComponentName;
diff --git a/src/com/android/launcher2/LauncherApplication.java b/src/com/cyanogenmod/trebuchet/LauncherApplication.java
index 28362fd0b..7fa88177b 100644
--- a/src/com/android/launcher2/LauncherApplication.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherApplication.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.app.Application;
import android.app.SearchManager;
@@ -26,7 +26,7 @@ import android.content.res.Configuration;
import android.database.ContentObserver;
import android.os.Handler;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
import java.lang.ref.WeakReference;
@@ -36,7 +36,7 @@ public class LauncherApplication extends Application {
private static boolean sIsScreenLarge;
private static float sScreenDensity;
private static int sLongPressTimeout = 300;
- private static final String sSharedPreferencesKey = "com.android.launcher2.prefs";
+ private static final String sSharedPreferencesKey = "com.cyanogenmod.trebuchet.prefs";
WeakReference<LauncherProvider> mLauncherProvider;
@Override
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/cyanogenmod/trebuchet/LauncherModel.java
index ccf83282c..501058e86 100644
--- a/src/com/android/launcher2/LauncherModel.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherModel.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.app.SearchManager;
import android.appwidget.AppWidgetManager;
@@ -27,7 +27,6 @@ import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.Intent.ShortcutIconResource;
-import android.content.pm.ActivityInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
@@ -47,13 +46,11 @@ import android.os.RemoteException;
import android.os.SystemClock;
import android.util.Log;
-import com.android.launcher.R;
-import com.android.launcher2.InstallWidgetReceiver.WidgetMimeTypeHandlerData;
-
import java.lang.ref.WeakReference;
import java.net.URISyntaxException;
import java.text.Collator;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@@ -68,13 +65,11 @@ import java.util.Set;
* for the Launcher.
*/
public class LauncherModel extends BroadcastReceiver {
- static final boolean DEBUG_LOADERS = false;
- static final String TAG = "Launcher.Model";
+ private static final boolean DEBUG_LOADERS = false;
+ private static final String TAG = "Trebuchet.LauncherModel";
private static final int ITEMS_CHUNK = 6; // batch size for the workspace icons
private final boolean mAppsCanBeOnExternalStorage;
- private int mBatchSize; // 0 is all apps at once
- private int mAllAppsLoadDelay; // milliseconds between batches
private final LauncherApplication mApp;
private final Object mLock = new Object();
@@ -140,8 +135,9 @@ public class LauncherModel extends BroadcastReceiver {
private IconCache mIconCache;
private Bitmap mDefaultIcon;
- private static int mCellCountX;
- private static int mCellCountY;
+ private static int sWorkspaceCellCountX;
+ private static int sWorkspaceCellCountY;
+ private static int sHotseatCellCount;
protected int mPreviousConfigMcc;
@@ -159,7 +155,6 @@ public class LauncherModel extends BroadcastReceiver {
public void bindAppsRemoved(ArrayList<String> packageNames, boolean permanent);
public void bindPackagesUpdated();
public boolean isAllAppsVisible();
- public boolean isAllAppsButtonRank(int rank);
public void bindSearchablesChanged();
public void onPageBoundSynchronously(int page);
}
@@ -174,8 +169,6 @@ public class LauncherModel extends BroadcastReceiver {
mIconCache.getFullResDefaultActivityIcon(), app);
final Resources res = app.getResources();
- mAllAppsLoadDelay = res.getInteger(R.integer.config_allAppsBatchLoadDelay);
- mBatchSize = res.getInteger(R.integer.config_allAppsBatchSize);
Configuration config = res.getConfiguration();
mPreviousConfigMcc = config.mcc;
}
@@ -183,9 +176,6 @@ public class LauncherModel extends BroadcastReceiver {
/** Runs the specified runnable immediately if called from the main thread, otherwise it is
* posted on the main thread handler. */
private void runOnMainThread(Runnable r) {
- runOnMainThread(r, 0);
- }
- private void runOnMainThread(Runnable r, int type) {
if (sWorkerThread.getThreadId() == Process.myTid()) {
// If we are on the worker thread, post onto the main handler
mHandler.post(r);
@@ -319,7 +309,7 @@ public class LauncherModel extends BroadcastReceiver {
}
static void updateItemInDatabaseHelper(Context context, final ContentValues values,
- final ItemInfo item, final String callingFunction) {
+ final ItemInfo item) {
final long itemId = item.id;
final Uri uri = LauncherSettings.Favorites.getContentUri(itemId, false);
final ContentResolver cr = context.getContentResolver();
@@ -350,12 +340,13 @@ public class LauncherModel extends BroadcastReceiver {
// as in Workspace.onDrop. Here, we just add/remove them from the list of items
// that are on the desktop, as appropriate
ItemInfo modelItem = sBgItemsIdMap.get(itemId);
- if (modelItem.container == LauncherSettings.Favorites.CONTAINER_DESKTOP ||
- modelItem.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
+ if (modelItem != null && (modelItem.container == LauncherSettings.Favorites.CONTAINER_DESKTOP ||
+ modelItem.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT)) {
switch (modelItem.itemType) {
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
case LauncherSettings.Favorites.ITEM_TYPE_FOLDER:
+ case LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS:
if (!sBgWorkspaceItems.contains(modelItem)) {
sBgWorkspaceItems.add(modelItem);
}
@@ -386,14 +377,7 @@ public class LauncherModel extends BroadcastReceiver {
item.cellX = cellX;
item.cellY = cellY;
- // We store hotseat items in canonical form which is this orientation invariant position
- // in the hotseat
- if (context instanceof Launcher && screen < 0 &&
- container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
- item.screen = ((Launcher) context).getHotseat().getOrderInHotseat(cellX, cellY);
- } else {
- item.screen = screen;
- }
+ item.screen = screen;
final ContentValues values = new ContentValues();
values.put(LauncherSettings.Favorites.CONTAINER, item.container);
@@ -401,7 +385,7 @@ public class LauncherModel extends BroadcastReceiver {
values.put(LauncherSettings.Favorites.CELLY, item.cellY);
values.put(LauncherSettings.Favorites.SCREEN, item.screen);
- updateItemInDatabaseHelper(context, values, item, "moveItemInDatabase");
+ updateItemInDatabaseHelper(context, values, item);
}
/**
@@ -436,7 +420,7 @@ public class LauncherModel extends BroadcastReceiver {
values.put(LauncherSettings.Favorites.SPANY, item.spanY);
values.put(LauncherSettings.Favorites.SCREEN, item.screen);
- updateItemInDatabaseHelper(context, values, item, "modifyItemInDatabase");
+ updateItemInDatabaseHelper(context, values, item);
}
/**
@@ -446,18 +430,18 @@ public class LauncherModel extends BroadcastReceiver {
final ContentValues values = new ContentValues();
item.onAddToDatabase(values);
item.updateValuesWithCoordinates(values, item.cellX, item.cellY);
- updateItemInDatabaseHelper(context, values, item, "updateItemInDatabase");
+ updateItemInDatabaseHelper(context, values, item);
}
/**
* Returns true if the shortcuts already exists in the database.
- * we identify a shortcut by its title and intent.
+ * we identify a shortcut by its intent.
*/
- static boolean shortcutExists(Context context, String title, Intent intent) {
+ static boolean shortcutExists(Context context, Intent intent) {
final ContentResolver cr = context.getContentResolver();
Cursor c = cr.query(LauncherSettings.Favorites.CONTENT_URI,
- new String[] { "title", "intent" }, "title=? and intent=?",
- new String[] { title, intent.toUri(0) }, null);
+ new String[] { "intent" }, "intent=?",
+ new String[] { intent.toUri(0) }, null);
boolean result = false;
try {
result = c.moveToFirst();
@@ -535,12 +519,14 @@ public class LauncherModel extends BroadcastReceiver {
break;
}
- folderInfo.title = c.getString(titleIndex);
- folderInfo.id = id;
- folderInfo.container = c.getInt(containerIndex);
- folderInfo.screen = c.getInt(screenIndex);
- folderInfo.cellX = c.getInt(cellXIndex);
- folderInfo.cellY = c.getInt(cellYIndex);
+ if (folderInfo != null) {
+ folderInfo.title = c.getString(titleIndex);
+ folderInfo.id = id;
+ folderInfo.container = c.getInt(containerIndex);
+ folderInfo.screen = c.getInt(screenIndex);
+ folderInfo.cellX = c.getInt(cellXIndex);
+ folderInfo.cellY = c.getInt(cellYIndex);
+ }
return folderInfo;
}
@@ -560,14 +546,8 @@ public class LauncherModel extends BroadcastReceiver {
item.container = container;
item.cellX = cellX;
item.cellY = cellY;
- // We store hotseat items in canonical form which is this orientation invariant position
- // in the hotseat
- if (context instanceof Launcher && screen < 0 &&
- container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
- item.screen = ((Launcher) context).getHotseat().getOrderInHotseat(cellX, cellY);
- } else {
- item.screen = screen;
- }
+
+ item.screen = screen;
final ContentValues values = new ContentValues();
final ContentResolver cr = context.getContentResolver();
@@ -599,6 +579,7 @@ public class LauncherModel extends BroadcastReceiver {
// Fall through
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
+ case LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS:
if (item.container == LauncherSettings.Favorites.CONTAINER_DESKTOP ||
item.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
sBgWorkspaceItems.add(item);
@@ -625,18 +606,21 @@ public class LauncherModel extends BroadcastReceiver {
/**
* Creates a new unique child id, for a given cell span across all layouts.
*/
- static int getCellLayoutChildId(
- long container, int screen, int localCellX, int localCellY, int spanX, int spanY) {
+ static int getCellLayoutChildId(long container, int screen, int localCellX, int localCellY) {
return (((int) container & 0xFF) << 24)
| (screen & 0xFF) << 16 | (localCellX & 0xFF) << 8 | (localCellY & 0xFF);
}
- static int getCellCountX() {
- return mCellCountX;
+ static int getWorkspaceCellCountX() {
+ return sWorkspaceCellCountX;
+ }
+
+ static int getWorkspaceCellCountY() {
+ return sWorkspaceCellCountY;
}
- static int getCellCountY() {
- return mCellCountY;
+ static int getHotseatCellCount() {
+ return sHotseatCellCount;
}
/**
@@ -644,8 +628,16 @@ public class LauncherModel extends BroadcastReceiver {
* when performing local/canonical coordinate transformations.
*/
static void updateWorkspaceLayoutCells(int shortAxisCellCount, int longAxisCellCount) {
- mCellCountX = shortAxisCellCount;
- mCellCountY = longAxisCellCount;
+ sWorkspaceCellCountX = shortAxisCellCount;
+ sWorkspaceCellCountY = longAxisCellCount;
+ }
+
+ /**
+ * Updates the model orientation helper to take into account the current layout dimensions
+ * when performing local/canonical coordinate transformations.
+ */
+ static void updateHotseatLayoutCells(int cellCount) {
+ sHotseatCellCount = cellCount;
}
/**
@@ -686,6 +678,7 @@ public class LauncherModel extends BroadcastReceiver {
break;
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
+ case LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS:
sBgWorkspaceItems.remove(item);
break;
case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
@@ -732,6 +725,27 @@ public class LauncherModel extends BroadcastReceiver {
}
/**
+ * Count the amount of items of a type
+ */
+ static int countAllItemsOfType(Context context, int itemType) {
+ final ContentResolver cr = context.getContentResolver();
+ Cursor c = cr.query(LauncherSettings.Favorites.CONTENT_URI, null,
+ "itemType=?", new String[]{ String.valueOf(itemType) }, null);
+ return c.getCount();
+ }
+
+ /**
+ * Count the amount of items of a type in a container
+ */
+ static int countAllItemsOfType(Context context, int itemType, long container) {
+ final ContentResolver cr = context.getContentResolver();
+ Cursor c = cr.query(LauncherSettings.Favorites.CONTENT_URI, null,
+ "itemType=? and container=?", new String[]{ String.valueOf(itemType),
+ String.valueOf(container) }, null);
+ return c.getCount();
+ }
+
+ /**
* Set this as the current Launcher activity object for the loader.
*/
public void initialize(Callbacks callbacks) {
@@ -1060,7 +1074,7 @@ public class LauncherModel extends BroadcastReceiver {
// All Apps interface in the foreground, load All Apps first. Otherwise, load the
// workspace first (default).
final Callbacks cbk = mCallbacks.get();
- final boolean loadWorkspaceFirst = cbk != null ? (!cbk.isAllAppsVisible()) : true;
+ final boolean loadWorkspaceFirst = cbk == null || !cbk.isAllAppsVisible();
keep_running: {
// Elevate priority when Home launches for the first time to avoid
@@ -1172,22 +1186,7 @@ public class LauncherModel extends BroadcastReceiver {
private boolean checkItemPlacement(ItemInfo occupied[][][], ItemInfo item) {
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 (mCallbacks == null || mCallbacks.get().isAllAppsButtonRank(item.screen)) {
- return false;
- }
-
- // We use the last index to refer to the hotseat and the screen as the rank, so
- // test and update the occupied state accordingly
- if (occupied[Launcher.SCREEN_COUNT][item.screen][0] != null) {
- Log.e(TAG, "Error loading shortcut into hotseat " + item
- + " into position (" + item.screen + ":" + item.cellX + "," + item.cellY
- + ") occupied by " + occupied[Launcher.SCREEN_COUNT][item.screen][0]);
- return false;
- } else {
- occupied[Launcher.SCREEN_COUNT][item.screen][0] = item;
- return true;
- }
+ containerIndex += Launcher.MAX_WORKSPACE_SCREEN_COUNT;
} else if (item.container != LauncherSettings.Favorites.CONTAINER_DESKTOP) {
// Skip further checking if it is not the hotseat or workspace container
return true;
@@ -1239,11 +1238,11 @@ public class LauncherModel extends BroadcastReceiver {
final Cursor c = contentResolver.query(
LauncherSettings.Favorites.CONTENT_URI, null, null, null, null);
- // +1 for the hotseat (it can be larger than the workspace)
// Load workspace in reverse order to ensure that latest items are loaded first (and
// before any earlier duplicates)
final ItemInfo occupied[][][] =
- new ItemInfo[Launcher.SCREEN_COUNT + 1][mCellCountX + 1][mCellCountY + 1];
+ new ItemInfo[Launcher.MAX_SCREEN_COUNT][Math.max(sWorkspaceCellCountX, sHotseatCellCount)]
+ [Math.max(sWorkspaceCellCountY, sHotseatCellCount)];
try {
final int idIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites._ID);
@@ -1274,16 +1273,13 @@ public class LauncherModel extends BroadcastReceiver {
(LauncherSettings.Favorites.SPANX);
final int spanYIndex = c.getColumnIndexOrThrow(
LauncherSettings.Favorites.SPANY);
- //final int uriIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.URI);
- //final int displayModeIndex = c.getColumnIndexOrThrow(
- // LauncherSettings.Favorites.DISPLAY_MODE);
ShortcutInfo info;
String intentDescription;
LauncherAppWidgetInfo appWidgetInfo;
int container;
long id;
- Intent intent;
+ Intent intent = null;
while (!mStopped && c.moveToNext()) {
try {
@@ -1299,10 +1295,12 @@ public class LauncherModel extends BroadcastReceiver {
continue;
}
+ case LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS:
+
if (itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION) {
info = getShortcutInfo(manager, intent, context, c, iconIndex,
titleIndex, mLabelCache);
- } else {
+ } else if (itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) {
info = getShortcutInfo(c, context, iconTypeIndex,
iconPackageIndex, iconResourceIndex, iconIndex,
titleIndex);
@@ -1318,6 +1316,11 @@ public class LauncherModel extends BroadcastReceiver {
Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
}
+ } else {
+ info = getShortcutInfo(c, context, iconTypeIndex,
+ iconPackageIndex, iconResourceIndex, iconIndex,
+ titleIndex);
+ info.itemType = LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS;
}
if (info != null) {
@@ -1465,13 +1468,13 @@ public class LauncherModel extends BroadcastReceiver {
if (DEBUG_LOADERS) {
Log.d(TAG, "loaded workspace in " + (SystemClock.uptimeMillis()-t) + "ms");
Log.d(TAG, "workspace layout: ");
- for (int y = 0; y < mCellCountY; y++) {
+ for (int y = 0; y < sWorkspaceCellCountY; y++) {
String line = "";
- for (int s = 0; s < Launcher.SCREEN_COUNT; s++) {
+ for (int s = 0; s < Launcher.MAX_SCREEN_COUNT; s++) {
if (s > 0) {
line += " | ";
}
- for (int x = 0; x < mCellCountX; x++) {
+ for (int x = 0; x < sWorkspaceCellCountX; x++) {
line += ((occupied[s][x][y] != null) ? "#" : ".");
}
}
@@ -1588,10 +1591,10 @@ public class LauncherModel extends BroadcastReceiver {
Collections.sort(workspaceItems, new Comparator<ItemInfo>() {
@Override
public int compare(ItemInfo lhs, ItemInfo rhs) {
- int cellCountX = LauncherModel.getCellCountX();
- int cellCountY = LauncherModel.getCellCountY();
+ int cellCountX = LauncherModel.getWorkspaceCellCountX();
+ int cellCountY = LauncherModel.getWorkspaceCellCountY();
int screenOffset = cellCountX * cellCountY;
- int containerOffset = screenOffset * (Launcher.SCREEN_COUNT + 1); // +1 hotseat
+ int containerOffset = screenOffset * (Launcher.MAX_SCREEN_COUNT + 1); // +1 hotseat
long lr = (lhs.container * containerOffset + lhs.screen * screenOffset +
lhs.cellY * cellCountX + lhs.cellX);
long rr = (rhs.container * containerOffset + rhs.screen * screenOffset +
@@ -1626,7 +1629,7 @@ public class LauncherModel extends BroadcastReceiver {
if (postOnMainThread) {
deferredBindRunnables.add(r);
} else {
- runOnMainThread(r, MAIN_THREAD_BINDING_RUNNABLE);
+ runOnMainThread(r);
}
}
@@ -1643,7 +1646,7 @@ public class LauncherModel extends BroadcastReceiver {
if (postOnMainThread) {
deferredBindRunnables.add(r);
} else {
- runOnMainThread(r, MAIN_THREAD_BINDING_RUNNABLE);
+ runOnMainThread(r);
}
}
@@ -1662,7 +1665,7 @@ public class LauncherModel extends BroadcastReceiver {
if (postOnMainThread) {
deferredBindRunnables.add(r);
} else {
- runOnMainThread(r, MAIN_THREAD_BINDING_RUNNABLE);
+ runOnMainThread(r);
}
}
}
@@ -1730,7 +1733,7 @@ public class LauncherModel extends BroadcastReceiver {
}
}
};
- runOnMainThread(r, MAIN_THREAD_BINDING_RUNNABLE);
+ runOnMainThread(r);
// Load items on the current page
bindWorkspaceItems(oldCallbacks, currentWorkspaceItems, currentAppWidgets,
@@ -1744,7 +1747,7 @@ public class LauncherModel extends BroadcastReceiver {
}
}
};
- runOnMainThread(r, MAIN_THREAD_BINDING_RUNNABLE);
+ runOnMainThread(r);
}
// Load all the remaining pages (if we are loading synchronously, we want to defer this
@@ -1773,7 +1776,7 @@ public class LauncherModel extends BroadcastReceiver {
if (isLoadingSynchronously) {
mDeferredBindRunnables.add(r);
} else {
- runOnMainThread(r, MAIN_THREAD_BINDING_RUNNABLE);
+ runOnMainThread(r);
}
}
@@ -1842,102 +1845,64 @@ public class LauncherModel extends BroadcastReceiver {
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
- final PackageManager packageManager = mContext.getPackageManager();
- List<ResolveInfo> apps = null;
-
- int N = Integer.MAX_VALUE;
-
- int startIndex;
- int i=0;
- int batchSize = -1;
- while (i < N && !mStopped) {
- if (i == 0) {
- mBgAllAppsList.clear();
- final long qiaTime = DEBUG_LOADERS ? SystemClock.uptimeMillis() : 0;
- apps = packageManager.queryIntentActivities(mainIntent, 0);
- if (DEBUG_LOADERS) {
- Log.d(TAG, "queryIntentActivities took "
- + (SystemClock.uptimeMillis()-qiaTime) + "ms");
- }
- if (apps == null) {
- return;
- }
- N = apps.size();
- if (DEBUG_LOADERS) {
- Log.d(TAG, "queryIntentActivities got " + N + " apps");
- }
- if (N == 0) {
- // There are no apps?!?
- return;
- }
- if (mBatchSize == 0) {
- batchSize = N;
- } else {
- batchSize = mBatchSize;
- }
-
- final long sortTime = DEBUG_LOADERS ? SystemClock.uptimeMillis() : 0;
- Collections.sort(apps,
- new LauncherModel.ShortcutNameComparator(packageManager, mLabelCache));
- if (DEBUG_LOADERS) {
- Log.d(TAG, "sort took "
- + (SystemClock.uptimeMillis()-sortTime) + "ms");
- }
- }
+ mBgAllAppsList.clear();
+ final long qiaTime = DEBUG_LOADERS ? SystemClock.uptimeMillis() : 0;
- final long t2 = DEBUG_LOADERS ? SystemClock.uptimeMillis() : 0;
+ final PackageManager packageManager = mContext.getPackageManager();
+ List<ResolveInfo> apps = packageManager.queryIntentActivities(mainIntent, 0);
- startIndex = i;
- for (int j=0; i<N && j<batchSize; j++) {
- // This builds the icon bitmaps.
- mBgAllAppsList.add(new ApplicationInfo(packageManager, apps.get(i),
- mIconCache, mLabelCache));
- i++;
- }
+ if (DEBUG_LOADERS) {
+ Log.d(TAG, "queryIntentActivities took "
+ + (SystemClock.uptimeMillis()-qiaTime) + "ms");
+ }
+ if (apps == null) {
+ return;
+ }
+ int N = apps.size();
+ if (DEBUG_LOADERS) {
+ Log.d(TAG, "queryIntentActivities got " + N + " apps");
+ }
+ if (N == 0) {
+ // There are no apps?!?
+ return;
+ }
- final boolean first = i <= batchSize;
- final Callbacks callbacks = tryGetCallbacks(oldCallbacks);
- final ArrayList<ApplicationInfo> added = mBgAllAppsList.added;
- mBgAllAppsList.added = new ArrayList<ApplicationInfo>();
+ final long sortTime = DEBUG_LOADERS ? SystemClock.uptimeMillis() : 0;
+ Collections.sort(apps,
+ new ShortcutNameComparator(packageManager, mLabelCache));
+ if (DEBUG_LOADERS) {
+ Log.d(TAG, "sort took "
+ + (SystemClock.uptimeMillis()-sortTime) + "ms");
+ }
- mHandler.post(new Runnable() {
- public void run() {
- final long t = SystemClock.uptimeMillis();
- if (callbacks != null) {
- if (first) {
- callbacks.bindAllApplications(added);
- } else {
- callbacks.bindAppsAdded(added);
- }
- if (DEBUG_LOADERS) {
- Log.d(TAG, "bound " + added.size() + " apps in "
- + (SystemClock.uptimeMillis() - t) + "ms");
- }
- } else {
- Log.i(TAG, "not binding apps: no Launcher activity");
- }
- }
- });
+ for (ResolveInfo info : apps) {
+ // This builds the icon bitmaps.
+ mBgAllAppsList.add(new ApplicationInfo(packageManager, info,
+ mIconCache, mLabelCache));
+ }
- if (DEBUG_LOADERS) {
- Log.d(TAG, "batch of " + (i-startIndex) + " icons processed in "
- + (SystemClock.uptimeMillis()-t2) + "ms");
- }
+ final Callbacks callbacks = tryGetCallbacks(oldCallbacks);
+ final ArrayList<ApplicationInfo> added = mBgAllAppsList.added;
+ mBgAllAppsList.added = new ArrayList<ApplicationInfo>();
- if (mAllAppsLoadDelay > 0 && i < N) {
- try {
+ mHandler.post(new Runnable() {
+ public void run() {
+ final long t = SystemClock.uptimeMillis();
+ if (callbacks != null) {
+ callbacks.bindAllApplications(added);
if (DEBUG_LOADERS) {
- Log.d(TAG, "sleeping for " + mAllAppsLoadDelay + "ms");
+ Log.d(TAG, "bound " + added.size() + " apps in "
+ + (SystemClock.uptimeMillis() - t) + "ms");
}
- Thread.sleep(mAllAppsLoadDelay);
- } catch (InterruptedException exc) { }
+ } else {
+ Log.i(TAG, "not binding apps: no Launcher activity");
+ }
}
- }
+ });
if (DEBUG_LOADERS) {
Log.d(TAG, "cached all " + N + " apps in "
- + (SystemClock.uptimeMillis()-t) + "ms"
- + (mAllAppsLoadDelay > 0 ? " (including delay)" : ""));
+ + (SystemClock.uptimeMillis()-t) + "ms");
}
}
@@ -1976,25 +1941,24 @@ public class LauncherModel extends BroadcastReceiver {
final Context context = mApp;
final String[] packages = mPackages;
- final int N = packages.length;
switch (mOp) {
case OP_ADD:
- for (int i=0; i<N; i++) {
- if (DEBUG_LOADERS) Log.d(TAG, "mAllAppsList.addPackage " + packages[i]);
- mBgAllAppsList.addPackage(context, packages[i]);
+ for (String p : packages) {
+ if (DEBUG_LOADERS) Log.d(TAG, "mAllAppsList.addPackage " + p);
+ mBgAllAppsList.addPackage(context, p);
}
break;
case OP_UPDATE:
- for (int i=0; i<N; i++) {
- if (DEBUG_LOADERS) Log.d(TAG, "mAllAppsList.updatePackage " + packages[i]);
- mBgAllAppsList.updatePackage(context, packages[i]);
+ for (String p : packages) {
+ if (DEBUG_LOADERS) Log.d(TAG, "mAllAppsList.updatePackage " + p);
+ mBgAllAppsList.updatePackage(context, p);
}
break;
case OP_REMOVE:
case OP_UNAVAILABLE:
- for (int i=0; i<N; i++) {
- if (DEBUG_LOADERS) Log.d(TAG, "mAllAppsList.removePackage " + packages[i]);
- mBgAllAppsList.removePackage(packages[i]);
+ for (String p : packages) {
+ if (DEBUG_LOADERS) Log.d(TAG, "mAllAppsList.removePackage " + p);
+ mBgAllAppsList.removePackage(p);
}
break;
}
@@ -2017,9 +1981,7 @@ public class LauncherModel extends BroadcastReceiver {
if (mBgAllAppsList.removed.size() > 0) {
mBgAllAppsList.removed.clear();
- for (int i = 0; i < N; ++i) {
- removedPackageNames.add(packages[i]);
- }
+ removedPackageNames.addAll(Arrays.asList(packages));
}
final Callbacks callbacks = mCallbacks != null ? mCallbacks.get() : null;
@@ -2033,7 +1995,7 @@ public class LauncherModel extends BroadcastReceiver {
mHandler.post(new Runnable() {
public void run() {
Callbacks cb = mCallbacks != null ? mCallbacks.get() : null;
- if (callbacks == cb && cb != null) {
+ if (callbacks == cb) {
callbacks.bindAppsAdded(addedFinal);
}
}
@@ -2044,7 +2006,7 @@ public class LauncherModel extends BroadcastReceiver {
mHandler.post(new Runnable() {
public void run() {
Callbacks cb = mCallbacks != null ? mCallbacks.get() : null;
- if (callbacks == cb && cb != null) {
+ if (callbacks == cb) {
callbacks.bindAppsUpdated(modifiedFinal);
}
}
@@ -2055,7 +2017,7 @@ public class LauncherModel extends BroadcastReceiver {
mHandler.post(new Runnable() {
public void run() {
Callbacks cb = mCallbacks != null ? mCallbacks.get() : null;
- if (callbacks == cb && cb != null) {
+ if (callbacks == cb) {
callbacks.bindAppsRemoved(removedPackageNames, permanent);
}
}
@@ -2066,7 +2028,7 @@ public class LauncherModel extends BroadcastReceiver {
@Override
public void run() {
Callbacks cb = mCallbacks != null ? mCallbacks.get() : null;
- if (callbacks == cb && cb != null) {
+ if (callbacks == cb) {
callbacks.bindPackagesUpdated();
}
}
@@ -2151,8 +2113,14 @@ public class LauncherModel extends BroadcastReceiver {
}
info.setIcon(icon);
+ // from the db
+ if (info.title == null) {
+ if (c != null) {
+ info.title = c.getString(titleIndex);
+ }
+ }
// from the resource
- if (resolveInfo != null) {
+ if (info.title == null && resolveInfo != null) {
ComponentName key = LauncherModel.getComponentNameFromResolveInfo(resolveInfo);
if (labelCache != null && labelCache.containsKey(key)) {
info.title = labelCache.get(key);
@@ -2163,12 +2131,6 @@ public class LauncherModel extends BroadcastReceiver {
}
}
}
- // from the db
- if (info.title == null) {
- if (c != null) {
- info.title = c.getString(titleIndex);
- }
- }
// fall back to the class name of the activity
if (info.title == null) {
info.title = componentName.getClassName();
@@ -2285,59 +2247,6 @@ public class LauncherModel extends BroadcastReceiver {
return info;
}
- /**
- * Attempts to find an AppWidgetProviderInfo that matches the given component.
- */
- AppWidgetProviderInfo findAppWidgetProviderInfoWithComponent(Context context,
- ComponentName component) {
- List<AppWidgetProviderInfo> widgets =
- AppWidgetManager.getInstance(context).getInstalledProviders();
- for (AppWidgetProviderInfo info : widgets) {
- if (info.provider.equals(component)) {
- return info;
- }
- }
- return null;
- }
-
- /**
- * Returns a list of all the widgets that can handle configuration with a particular mimeType.
- */
- List<WidgetMimeTypeHandlerData> resolveWidgetsForMimeType(Context context, String mimeType) {
- final PackageManager packageManager = context.getPackageManager();
- final List<WidgetMimeTypeHandlerData> supportedConfigurationActivities =
- new ArrayList<WidgetMimeTypeHandlerData>();
-
- final Intent supportsIntent =
- new Intent(InstallWidgetReceiver.ACTION_SUPPORTS_CLIPDATA_MIMETYPE);
- supportsIntent.setType(mimeType);
-
- // Create a set of widget configuration components that we can test against
- final List<AppWidgetProviderInfo> widgets =
- AppWidgetManager.getInstance(context).getInstalledProviders();
- final HashMap<ComponentName, AppWidgetProviderInfo> configurationComponentToWidget =
- new HashMap<ComponentName, AppWidgetProviderInfo>();
- for (AppWidgetProviderInfo info : widgets) {
- configurationComponentToWidget.put(info.configure, info);
- }
-
- // Run through each of the intents that can handle this type of clip data, and cross
- // reference them with the components that are actual configuration components
- final List<ResolveInfo> activities = packageManager.queryIntentActivities(supportsIntent,
- PackageManager.MATCH_DEFAULT_ONLY);
- for (ResolveInfo info : activities) {
- final ActivityInfo activityInfo = info.activityInfo;
- final ComponentName infoComponent = new ComponentName(activityInfo.packageName,
- activityInfo.name);
- if (configurationComponentToWidget.containsKey(infoComponent)) {
- supportedConfigurationActivities.add(
- new InstallWidgetReceiver.WidgetMimeTypeHandlerData(info,
- configurationComponentToWidget.get(infoComponent)));
- }
- }
- return supportedConfigurationActivities;
- }
-
ShortcutInfo infoFromShortcutIntent(Context context, Intent data, Bitmap fallbackIcon) {
Intent intent = data.getParcelableExtra(Intent.EXTRA_SHORTCUT_INTENT);
String name = data.getStringExtra(Intent.EXTRA_SHORTCUT_NAME);
@@ -2471,7 +2380,7 @@ public class LauncherModel extends BroadcastReceiver {
final Collator collator = Collator.getInstance();
return new Comparator<AppWidgetProviderInfo>() {
public final int compare(AppWidgetProviderInfo a, AppWidgetProviderInfo b) {
- return collator.compare(a.label.toString(), b.label.toString());
+ return collator.compare(a.label, b.label);
}
};
}
@@ -2516,7 +2425,7 @@ public class LauncherModel extends BroadcastReceiver {
}
return mCollator.compare(labelA, labelB);
}
- };
+ }
public static class WidgetAndShortcutNameComparator implements Comparator<Object> {
private Collator mCollator;
private PackageManager mPackageManager;
@@ -2527,26 +2436,30 @@ public class LauncherModel extends BroadcastReceiver {
mCollator = Collator.getInstance();
}
public final int compare(Object a, Object b) {
- String labelA, labelB;
+ String labelA = "", labelB = "";
if (mLabelCache.containsKey(a)) {
labelA = mLabelCache.get(a);
} else {
- labelA = (a instanceof AppWidgetProviderInfo) ?
- ((AppWidgetProviderInfo) a).label :
- ((ResolveInfo) a).loadLabel(mPackageManager).toString();
+ if (a instanceof AppWidgetProviderInfo) {
+ labelA = ((AppWidgetProviderInfo) a).label;
+ } else if (a instanceof ResolveInfo) {
+ labelA = ((ResolveInfo) a).loadLabel(mPackageManager).toString();
+ }
mLabelCache.put(a, labelA);
}
if (mLabelCache.containsKey(b)) {
labelB = mLabelCache.get(b);
} else {
- labelB = (b instanceof AppWidgetProviderInfo) ?
- ((AppWidgetProviderInfo) b).label :
- ((ResolveInfo) b).loadLabel(mPackageManager).toString();
+ if (b instanceof AppWidgetProviderInfo) {
+ labelB = ((AppWidgetProviderInfo) b).label;
+ } else if (b instanceof ResolveInfo) {
+ labelB = ((ResolveInfo) b).loadLabel(mPackageManager).toString();
+ }
mLabelCache.put(b, labelB);
}
return mCollator.compare(labelA, labelB);
}
- };
+ }
public void dumpState() {
Log.d(TAG, "mCallbacks=" + mCallbacks);
diff --git a/src/com/android/launcher2/LauncherProvider.java b/src/com/cyanogenmod/trebuchet/LauncherProvider.java
index 8097ac99e..b16002a48 100644
--- a/src/com/android/launcher2/LauncherProvider.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherProvider.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.app.SearchManager;
import android.appwidget.AppWidgetHost;
@@ -28,7 +28,6 @@ import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
-import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.content.res.TypedArray;
@@ -38,9 +37,6 @@ import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteQueryBuilder;
-import android.database.sqlite.SQLiteStatement;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
@@ -49,8 +45,7 @@ import android.util.AttributeSet;
import android.util.Log;
import android.util.Xml;
-import com.android.launcher.R;
-import com.android.launcher2.LauncherSettings.Favorites;
+import com.cyanogenmod.trebuchet.LauncherSettings.Favorites;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -61,14 +56,14 @@ import java.util.ArrayList;
import java.util.List;
public class LauncherProvider extends ContentProvider {
- private static final String TAG = "Launcher.LauncherProvider";
+ private static final String TAG = "Trebuchet.LauncherProvider";
private static final boolean LOGD = false;
private static final String DATABASE_NAME = "launcher.db";
- private static final int DATABASE_VERSION = 12;
+ private static final int DATABASE_VERSION = 14;
- static final String AUTHORITY = "com.android.launcher2.settings";
+ static final String AUTHORITY = "com.cyanogenmod.trebuchet.settings";
static final String TABLE_FAVORITES = "favorites";
static final String PARAMETER_NOTIFY = "notify";
@@ -78,7 +73,7 @@ public class LauncherProvider extends ContentProvider {
"DEFAULT_WORKSPACE_RESOURCE_ID";
private static final String ACTION_APPWIDGET_DEFAULT_WORKSPACE_CONFIGURE =
- "com.android.launcher.action.APPWIDGET_DEFAULT_WORKSPACE_CONFIGURE";
+ "com.cyanogenmod.trebuchet.action.APPWIDGET_DEFAULT_WORKSPACE_CONFIGURE";
/**
* {@link Uri} triggered at any registered {@link android.database.ContentObserver} when
@@ -122,8 +117,7 @@ public class LauncherProvider extends ContentProvider {
return result;
}
- private static long dbInsertAndCheck(DatabaseHelper helper,
- SQLiteDatabase db, String table, String nullColumnHack, ContentValues values) {
+ private static long dbInsertAndCheck(SQLiteDatabase db, String table, String nullColumnHack, ContentValues values) {
if (!values.containsKey(LauncherSettings.Favorites._ID)) {
throw new RuntimeException("Error: attempting to add item without specifying an id");
}
@@ -141,7 +135,7 @@ public class LauncherProvider extends ContentProvider {
SqlArguments args = new SqlArguments(uri);
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
- final long rowId = dbInsertAndCheck(mOpenHelper, db, args.table, null, initialValues);
+ final long rowId = dbInsertAndCheck(db, args.table, null, initialValues);
if (rowId <= 0) return null;
uri = ContentUris.withAppendedId(uri, rowId);
@@ -157,9 +151,8 @@ public class LauncherProvider extends ContentProvider {
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
db.beginTransaction();
try {
- int numValues = values.length;
- for (int i = 0; i < numValues; i++) {
- if (dbInsertAndCheck(mOpenHelper, db, args.table, null, values[i]) < 0) {
+ for (ContentValues value : values) {
+ if (dbInsertAndCheck(db, args.table, null, value) < 0) {
return 0;
}
}
@@ -237,6 +230,7 @@ public class LauncherProvider extends ContentProvider {
private static final String TAG_SEARCH = "search";
private static final String TAG_APPWIDGET = "appwidget";
private static final String TAG_SHORTCUT = "shortcut";
+ private static final String TAG_ALLAPPS = "allapps";
private static final String TAG_FOLDER = "folder";
private static final String TAG_EXTRA = "extra";
@@ -289,9 +283,7 @@ public class LauncherProvider extends ContentProvider {
"iconType INTEGER," +
"iconPackage TEXT," +
"iconResource TEXT," +
- "icon BLOB," +
- "uri TEXT," +
- "displayMode INTEGER" +
+ "icon BLOB" +
");");
// Database was just created, so wipe any previous widgets
@@ -342,12 +334,6 @@ public class LauncherProvider extends ContentProvider {
}
}
- if (converted) {
- // Convert widgets from this import into widgets
- if (LOGD) Log.d(TAG, "converted and now triggering widget upgrade");
- convertWidgets(db);
- }
-
return converted;
}
@@ -364,8 +350,6 @@ public class LauncherProvider extends ContentProvider {
final int screenIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.SCREEN);
final int cellXIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLX);
final int cellYIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLY);
- final int uriIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.URI);
- final int displayModeIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.DISPLAY_MODE);
ContentValues[] rows = new ContentValues[c.getCount()];
int i = 0;
@@ -384,8 +368,6 @@ public class LauncherProvider extends ContentProvider {
values.put(LauncherSettings.Favorites.SCREEN, c.getInt(screenIndex));
values.put(LauncherSettings.Favorites.CELLX, c.getInt(cellXIndex));
values.put(LauncherSettings.Favorites.CELLY, c.getInt(cellYIndex));
- values.put(LauncherSettings.Favorites.URI, c.getString(uriIndex));
- values.put(LauncherSettings.Favorites.DISPLAY_MODE, c.getInt(displayModeIndex));
rows[i++] = values;
}
@@ -394,7 +376,7 @@ public class LauncherProvider extends ContentProvider {
try {
int numValues = rows.length;
for (i = 0; i < numValues; i++) {
- if (dbInsertAndCheck(this, db, TABLE_FAVORITES, null, rows[i]) < 0) {
+ if (dbInsertAndCheck(db, TABLE_FAVORITES, null, rows[i]) < 0) {
return 0;
} else {
total++;
@@ -413,74 +395,22 @@ public class LauncherProvider extends ContentProvider {
if (LOGD) Log.d(TAG, "onUpgrade triggered");
int version = oldVersion;
- if (version < 3) {
- // upgrade 1,2 -> 3 added appWidgetId column
- db.beginTransaction();
- try {
- // Insert new column for holding appWidgetIds
- db.execSQL("ALTER TABLE favorites " +
- "ADD COLUMN appWidgetId INTEGER NOT NULL DEFAULT -1;");
- db.setTransactionSuccessful();
- version = 3;
- } catch (SQLException ex) {
- // Old version remains, which means we wipe old data
- Log.e(TAG, ex.getMessage(), ex);
- } finally {
- db.endTransaction();
- }
-
- // Convert existing widgets only if table upgrade was successful
- if (version == 3) {
- convertWidgets(db);
- }
- }
-
- if (version < 4) {
- version = 4;
- }
-
- // Where's version 5?
- // - Donut and sholes on 2.0 shipped with version 4 of launcher1.
- // - Passion shipped on 2.1 with version 6 of launcher2
- // - Sholes shipped on 2.1r1 (aka Mr. 3) with version 5 of launcher 1
- // but version 5 on there was the updateContactsShortcuts change
- // which was version 6 in launcher 2 (first shipped on passion 2.1r1).
- // The updateContactsShortcuts change is idempotent, so running it twice
- // is okay so we'll do that when upgrading the devices that shipped with it.
- if (version < 6) {
- // We went from 3 to 5 screens. Move everything 1 to the right
- db.beginTransaction();
- try {
- db.execSQL("UPDATE favorites SET screen=(screen + 1);");
- db.setTransactionSuccessful();
- } catch (SQLException ex) {
- // Old version remains, which means we wipe old data
- Log.e(TAG, ex.getMessage(), ex);
- } finally {
- db.endTransaction();
- }
-
- // We added the fast track.
- if (updateContactsShortcuts(db)) {
- version = 6;
- }
- }
- if (version < 7) {
- // Version 7 gets rid of the special search widget.
- convertWidgets(db);
- version = 7;
+ // We bumped the version three time during JB, once to update the launch flags, once to
+ // update the override for the default launch animation and once to set the mimetype
+ // to improve startup performance
+ if (version < 12) {
+ // Contact shortcuts need a different set of flags to be launched now
+ // The updateContactsShortcuts change is idempotent, so we can keep using it like
+ // back in the Donut days
+ updateContactsShortcuts(db);
+ version = 12;
}
- if (version < 8) {
- // Version 8 (froyo) has the icons all normalized. This should
- // already be the case in practice, but we now rely on it and don't
- // resample the images each time.
- normalizeIcons(db);
- version = 8;
- }
+ if (version < 14) {
+ db.delete(TABLE_FAVORITES, Favorites.CONTAINER + "=?", new String[] { Integer.toString(Favorites.CONTAINER_HOTSEAT) });
+ db.execSQL("ALTER TABLE favorites ADD COLUMN action TEXT;");
- if (version < 9) {
// The max id is not yet set at this point (onUpgrade is triggered in the ctor
// before it gets a change to get set, so we need to read it here when we use it)
if (mMaxId == -1) {
@@ -489,18 +419,7 @@ public class LauncherProvider extends ContentProvider {
// Add default hotseat icons
loadFavorites(db, R.xml.update_workspace);
- version = 9;
- }
-
- // We bumped the version three time during JB, once to update the launch flags, once to
- // update the override for the default launch animation and once to set the mimetype
- // to improve startup performance
- if (version < 12) {
- // Contact shortcuts need a different set of flags to be launched now
- // The updateContactsShortcuts change is idempotent, so we can keep using it like
- // back in the Donut days
- updateContactsShortcuts(db);
- version = 12;
+ version = 14;
}
if (version != DATABASE_VERSION) {
@@ -510,6 +429,15 @@ public class LauncherProvider extends ContentProvider {
}
}
+ @Override
+ public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ if (LOGD) Log.d(TAG, "onDowngrade triggered");
+
+ Log.w(TAG, "Destroying all old data.");
+ db.execSQL("DROP TABLE IF EXISTS " + TABLE_FAVORITES);
+ onCreate(db);
+ }
+
private boolean updateContactsShortcuts(SQLiteDatabase db) {
final String selectWhere = buildOrWhereString(Favorites.ITEM_TYPE,
new int[] { Favorites.ITEM_TYPE_SHORTCUT });
@@ -520,7 +448,7 @@ public class LauncherProvider extends ContentProvider {
try {
// Select and iterate through each matching widget
c = db.query(TABLE_FAVORITES,
- new String[] { Favorites._ID, Favorites.INTENT },
+ new String[]{Favorites._ID, Favorites.INTENT},
selectWhere, null, null, null, null);
if (c == null) return false;
@@ -590,62 +518,6 @@ public class LauncherProvider extends ContentProvider {
return true;
}
- private void normalizeIcons(SQLiteDatabase db) {
- Log.d(TAG, "normalizing icons");
-
- db.beginTransaction();
- Cursor c = null;
- SQLiteStatement update = null;
- try {
- boolean logged = false;
- update = db.compileStatement("UPDATE favorites "
- + "SET icon=? WHERE _id=?");
-
- c = db.rawQuery("SELECT _id, icon FROM favorites WHERE iconType=" +
- Favorites.ICON_TYPE_BITMAP, null);
-
- final int idIndex = c.getColumnIndexOrThrow(Favorites._ID);
- final int iconIndex = c.getColumnIndexOrThrow(Favorites.ICON);
-
- while (c.moveToNext()) {
- long id = c.getLong(idIndex);
- byte[] data = c.getBlob(iconIndex);
- try {
- Bitmap bitmap = Utilities.resampleIconBitmap(
- BitmapFactory.decodeByteArray(data, 0, data.length),
- mContext);
- if (bitmap != null) {
- update.bindLong(1, id);
- data = ItemInfo.flattenBitmap(bitmap);
- if (data != null) {
- update.bindBlob(2, data);
- update.execute();
- }
- bitmap.recycle();
- }
- } catch (Exception e) {
- if (!logged) {
- Log.e(TAG, "Failed normalizing icon " + id, e);
- } else {
- Log.e(TAG, "Also failed normalizing icon " + id);
- }
- logged = true;
- }
- }
- db.setTransactionSuccessful();
- } catch (SQLException ex) {
- Log.w(TAG, "Problem while allocating appWidgetIds for existing widgets", ex);
- } finally {
- db.endTransaction();
- if (update != null) {
- update.close();
- }
- if (c != null) {
- c.close();
- }
- }
- }
-
// Generates a new ID to use for an object in your database. This method should be only
// called from the main UI thread. As an exception, we do call it when we call the
// constructor from the worker thread; however, this doesn't extend until after the
@@ -679,96 +551,12 @@ public class LauncherProvider extends ContentProvider {
return id;
}
- /**
- * Upgrade existing clock and photo frame widgets into their new widget
- * equivalents.
- */
- private void convertWidgets(SQLiteDatabase db) {
- final AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(mContext);
- final int[] bindSources = new int[] {
- Favorites.ITEM_TYPE_WIDGET_CLOCK,
- Favorites.ITEM_TYPE_WIDGET_PHOTO_FRAME,
- Favorites.ITEM_TYPE_WIDGET_SEARCH,
- };
-
- final String selectWhere = buildOrWhereString(Favorites.ITEM_TYPE, bindSources);
-
- Cursor c = null;
-
- db.beginTransaction();
- try {
- // Select and iterate through each matching widget
- c = db.query(TABLE_FAVORITES, new String[] { Favorites._ID, Favorites.ITEM_TYPE },
- selectWhere, null, null, null, null);
-
- if (LOGD) Log.d(TAG, "found upgrade cursor count=" + c.getCount());
-
- final ContentValues values = new ContentValues();
- while (c != null && c.moveToNext()) {
- long favoriteId = c.getLong(0);
- int favoriteType = c.getInt(1);
-
- // Allocate and update database with new appWidgetId
- try {
- int appWidgetId = mAppWidgetHost.allocateAppWidgetId();
-
- if (LOGD) {
- Log.d(TAG, "allocated appWidgetId=" + appWidgetId
- + " for favoriteId=" + favoriteId);
- }
- values.clear();
- values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_APPWIDGET);
- values.put(Favorites.APPWIDGET_ID, appWidgetId);
-
- // Original widgets might not have valid spans when upgrading
- if (favoriteType == Favorites.ITEM_TYPE_WIDGET_SEARCH) {
- values.put(LauncherSettings.Favorites.SPANX, 4);
- values.put(LauncherSettings.Favorites.SPANY, 1);
- } else {
- values.put(LauncherSettings.Favorites.SPANX, 2);
- values.put(LauncherSettings.Favorites.SPANY, 2);
- }
-
- String updateWhere = Favorites._ID + "=" + favoriteId;
- db.update(TABLE_FAVORITES, values, updateWhere, null);
-
- if (favoriteType == Favorites.ITEM_TYPE_WIDGET_CLOCK) {
- // TODO: check return value
- appWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId,
- new ComponentName("com.android.alarmclock",
- "com.android.alarmclock.AnalogAppWidgetProvider"));
- } else if (favoriteType == Favorites.ITEM_TYPE_WIDGET_PHOTO_FRAME) {
- // TODO: check return value
- appWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId,
- new ComponentName("com.android.camera",
- "com.android.camera.PhotoAppWidgetProvider"));
- } else if (favoriteType == Favorites.ITEM_TYPE_WIDGET_SEARCH) {
- // TODO: check return value
- appWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId,
- getSearchWidgetProvider());
- }
- } catch (RuntimeException ex) {
- Log.e(TAG, "Problem allocating appWidgetId", ex);
- }
- }
-
- db.setTransactionSuccessful();
- } catch (SQLException ex) {
- Log.w(TAG, "Problem while allocating appWidgetIds for existing widgets", ex);
- } finally {
- db.endTransaction();
- if (c != null) {
- c.close();
- }
- }
- }
-
- private static final void beginDocument(XmlPullParser parser, String firstElementName)
+ private static void beginDocument(XmlPullParser parser, String firstElementName)
throws XmlPullParserException, IOException {
int type;
while ((type = parser.next()) != XmlPullParser.START_TAG
&& type != XmlPullParser.END_DOCUMENT) {
- ;
+
}
if (type != XmlPullParser.START_TAG) {
@@ -793,8 +581,6 @@ 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);
@@ -825,14 +611,6 @@ public class LauncherProvider extends ContentProvider {
String x = a.getString(R.styleable.Favorite_x);
String y = a.getString(R.styleable.Favorite_y);
- // 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
- && Integer.valueOf(screen) == allAppsButtonRank) {
- throw new RuntimeException("Invalid screen position for hotseat item");
- }
-
values.clear();
values.put(LauncherSettings.Favorites.CONTAINER, container);
values.put(LauncherSettings.Favorites.SCREEN, screen);
@@ -847,7 +625,10 @@ public class LauncherProvider extends ContentProvider {
} else if (TAG_CLOCK.equals(name)) {
added = addClockWidget(db, values);
} else if (TAG_APPWIDGET.equals(name)) {
- added = addAppWidget(parser, attrs, type, db, values, a, packageManager);
+ added = addAppWidget(parser, attrs, db, values, a, packageManager);
+ } else if (TAG_ALLAPPS.equals(name)) {
+ long id = addAllAppsButton(db, values);
+ added = id >= 0;
} else if (TAG_SHORTCUT.equals(name)) {
long id = addUriShortcut(db, values, a);
added = id >= 0;
@@ -924,31 +705,29 @@ public class LauncherProvider extends ContentProvider {
private long addAppShortcut(SQLiteDatabase db, ContentValues values, TypedArray a,
PackageManager packageManager, Intent intent) {
long id = -1;
- ActivityInfo info;
String packageName = a.getString(R.styleable.Favorite_packageName);
String className = a.getString(R.styleable.Favorite_className);
try {
ComponentName cn;
try {
cn = new ComponentName(packageName, className);
- info = packageManager.getActivityInfo(cn, 0);
+ packageManager.getActivityInfo(cn, 0);
} catch (PackageManager.NameNotFoundException nnfe) {
String[] packages = packageManager.currentToCanonicalPackageNames(
new String[] { packageName });
cn = new ComponentName(packages[0], className);
- info = packageManager.getActivityInfo(cn, 0);
+ packageManager.getActivityInfo(cn, 0);
}
id = generateNewId();
intent.setComponent(cn);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
values.put(Favorites.INTENT, intent.toUri(0));
- values.put(Favorites.TITLE, info.loadLabel(packageManager).toString());
values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_APPLICATION);
values.put(Favorites.SPANX, 1);
values.put(Favorites.SPANY, 1);
values.put(Favorites._ID, generateNewId());
- if (dbInsertAndCheck(this, db, TABLE_FAVORITES, null, values) < 0) {
+ if (dbInsertAndCheck(db, TABLE_FAVORITES, null, values) < 0) {
return -1;
}
} catch (PackageManager.NameNotFoundException e) {
@@ -964,7 +743,7 @@ public class LauncherProvider extends ContentProvider {
values.put(Favorites.SPANY, 1);
long id = generateNewId();
values.put(Favorites._ID, id);
- if (dbInsertAndCheck(this, db, TABLE_FAVORITES, null, values) <= 0) {
+ if (dbInsertAndCheck(db, TABLE_FAVORITES, null, values) <= 0) {
return -1;
} else {
return id;
@@ -987,9 +766,8 @@ public class LauncherProvider extends ContentProvider {
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(mContext);
List<AppWidgetProviderInfo> providers = appWidgetManager.getInstalledProviders();
if (providers == null) return null;
- final int providerCount = providers.size();
- for (int i = 0; i < providerCount; i++) {
- ComponentName provider = providers.get(i).provider;
+ for (AppWidgetProviderInfo p : providers) {
+ ComponentName provider = p.provider;
if (provider != null && provider.getPackageName().equals(packageName)) {
return provider;
}
@@ -1008,7 +786,7 @@ public class LauncherProvider extends ContentProvider {
return addAppWidget(db, values, cn, 2, 2, null);
}
- private boolean addAppWidget(XmlResourceParser parser, AttributeSet attrs, int type,
+ private boolean addAppWidget(XmlResourceParser parser, AttributeSet attrs,
SQLiteDatabase db, ContentValues values, TypedArray a,
PackageManager packageManager) throws XmlPullParserException, IOException {
@@ -1041,6 +819,7 @@ public class LauncherProvider extends ContentProvider {
// Read the extras
Bundle extras = new Bundle();
int widgetDepth = parser.getDepth();
+ int type;
while ((type = parser.next()) != XmlPullParser.END_TAG ||
parser.getDepth() > widgetDepth) {
if (type != XmlPullParser.START_TAG) {
@@ -1081,7 +860,7 @@ public class LauncherProvider extends ContentProvider {
values.put(Favorites.SPANY, spanY);
values.put(Favorites.APPWIDGET_ID, appWidgetId);
values.put(Favorites._ID, generateNewId());
- dbInsertAndCheck(this, db, TABLE_FAVORITES, null, values);
+ dbInsertAndCheck(db, TABLE_FAVORITES, null, values);
allocatedAppWidgets = true;
@@ -1103,6 +882,25 @@ public class LauncherProvider extends ContentProvider {
return allocatedAppWidgets;
}
+ private long addAllAppsButton(SQLiteDatabase db, ContentValues values) {
+ Resources r = mContext.getResources();
+
+ long id = generateNewId();
+ values.put(Favorites.TITLE, r.getString(R.string.all_apps_button_label));
+ values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_ALLAPPS);
+ values.put(Favorites.SPANX, 1);
+ values.put(Favorites.SPANY, 1);
+ values.put(Favorites.ICON_TYPE, Favorites.ICON_TYPE_RESOURCE);
+ values.put(Favorites.ICON_PACKAGE, mContext.getPackageName());
+ values.put(Favorites.ICON_RESOURCE, r.getResourceName(R.drawable.all_apps_button_icon));
+ values.put(Favorites._ID, id);
+
+ if (dbInsertAndCheck(db, TABLE_FAVORITES, null, values) < 0) {
+ return -1;
+ }
+ return id;
+ }
+
private long addUriShortcut(SQLiteDatabase db, ContentValues values,
TypedArray a) {
Resources r = mContext.getResources();
@@ -1137,7 +935,7 @@ public class LauncherProvider extends ContentProvider {
values.put(Favorites.ICON_RESOURCE, r.getResourceName(iconResId));
values.put(Favorites._ID, id);
- if (dbInsertAndCheck(this, db, TABLE_FAVORITES, null, values) < 0) {
+ if (dbInsertAndCheck(db, TABLE_FAVORITES, null, values) < 0) {
return -1;
}
return id;
diff --git a/src/com/android/launcher2/LauncherSettings.java b/src/com/cyanogenmod/trebuchet/LauncherSettings.java
index ee003716b..425d84f6c 100644
--- a/src/com/android/launcher2/LauncherSettings.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherSettings.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.net.Uri;
import android.provider.BaseColumns;
@@ -56,6 +56,11 @@ class LauncherSettings {
static final int ITEM_TYPE_SHORTCUT = 1;
/**
+ * The gesture is a launcher action
+ */
+ static final int ITEM_TYPE_ALLAPPS = 3;
+
+ /**
* The icon type.
* <P>Type: INTEGER</P>
*/
@@ -173,64 +178,15 @@ class LauncherSettings {
static final int ITEM_TYPE_FOLDER = 2;
/**
- * The favorite is a live folder
- *
- * Note: live folders can no longer be added to Launcher, and any live folders which
- * exist within the launcher database will be ignored when loading. That said, these
- * entries in the database may still exist, and are not automatically stripped.
- */
- static final int ITEM_TYPE_LIVE_FOLDER = 3;
-
- /**
* The favorite is a widget
*/
static final int ITEM_TYPE_APPWIDGET = 4;
/**
- * The favorite is a clock
- */
- static final int ITEM_TYPE_WIDGET_CLOCK = 1000;
-
- /**
- * The favorite is a search widget
- */
- static final int ITEM_TYPE_WIDGET_SEARCH = 1001;
-
- /**
- * The favorite is a photo frame
- */
- static final int ITEM_TYPE_WIDGET_PHOTO_FRAME = 1002;
-
- /**
* The appWidgetId of the widget
*
* <P>Type: INTEGER</P>
*/
static final String APPWIDGET_ID = "appWidgetId";
-
- /**
- * Indicates whether this favorite is an application-created shortcut or not.
- * If the value is 0, the favorite is not an application-created shortcut, if the
- * value is 1, it is an application-created shortcut.
- * <P>Type: INTEGER</P>
- */
- @Deprecated
- static final String IS_SHORTCUT = "isShortcut";
-
- /**
- * The URI associated with the favorite. It is used, for instance, by
- * live folders to find the content provider.
- * <P>Type: TEXT</P>
- */
- static final String URI = "uri";
-
- /**
- * The display mode if the item is a live folder.
- * <P>Type: INTEGER</P>
- *
- * @see android.provider.LiveFolders#DISPLAY_MODE_GRID
- * @see android.provider.LiveFolders#DISPLAY_MODE_LIST
- */
- static final String DISPLAY_MODE = "displayMode";
}
}
diff --git a/src/com/android/launcher2/LauncherViewPropertyAnimator.java b/src/com/cyanogenmod/trebuchet/LauncherViewPropertyAnimator.java
index 3ffc418ae..ee67b7fc2 100644
--- a/src/com/android/launcher2/LauncherViewPropertyAnimator.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherViewPropertyAnimator.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.Animator;
import android.animation.Animator.AnimatorListener;
@@ -31,6 +31,7 @@ public class LauncherViewPropertyAnimator extends Animator implements AnimatorLi
TRANSLATION_Y,
SCALE_X,
SCALE_Y,
+ ROTATION,
ROTATION_Y,
ALPHA,
START_DELAY,
@@ -45,6 +46,7 @@ public class LauncherViewPropertyAnimator extends Animator implements AnimatorLi
float mTranslationY;
float mScaleX;
float mScaleY;
+ float mRotation;
float mRotationY;
float mAlpha;
long mStartDelay;
@@ -195,6 +197,9 @@ public class LauncherViewPropertyAnimator extends Animator implements AnimatorLi
if (mPropertiesToSet.contains(Properties.SCALE_X)) {
mViewPropertyAnimator.scaleX(mScaleX);
}
+ if (mPropertiesToSet.contains(Properties.ROTATION)) {
+ mViewPropertyAnimator.rotation(mRotation);
+ }
if (mPropertiesToSet.contains(Properties.ROTATION_Y)) {
mViewPropertyAnimator.rotationY(mRotationY);
}
@@ -242,6 +247,12 @@ public class LauncherViewPropertyAnimator extends Animator implements AnimatorLi
return this;
}
+ public LauncherViewPropertyAnimator rotation(float value) {
+ mPropertiesToSet.add(Properties.ROTATION);
+ mRotation = value;
+ return this;
+ }
+
public LauncherViewPropertyAnimator rotationY(float value) {
mPropertiesToSet.add(Properties.ROTATION_Y);
mRotationY = value;
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/cyanogenmod/trebuchet/PagedView.java
index 6d5d151f8..42ae9687e 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/cyanogenmod/trebuchet/PagedView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -42,7 +42,7 @@ import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.Interpolator;
import android.widget.Scroller;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
import java.util.ArrayList;
@@ -51,16 +51,16 @@ import java.util.ArrayList;
* sequential list of "pages"
*/
public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeListener {
- private static final String TAG = "PagedView";
+ private static final String TAG = "Trebuchet.PagedView";
private static final boolean DEBUG = false;
protected static final int INVALID_PAGE = -1;
// the min drag distance for a fling to register, to prevent random page shifts
private static final int MIN_LENGTH_FOR_FLING = 25;
- protected static final int PAGE_SNAP_ANIMATION_DURATION = 550;
- protected static final int MAX_PAGE_SNAP_DURATION = 750;
- protected static final int SLOW_PAGE_SNAP_ANIMATION_DURATION = 950;
+ protected static final int PAGE_SNAP_ANIMATION_DURATION = 400;
+ protected static final int MAX_PAGE_SNAP_DURATION = 550;
+ protected static final int SLOW_PAGE_SNAP_ANIMATION_DURATION = 750;
protected static final float NANOTIME_DIV = 1000000000.0f;
private static final float OVERSCROLL_ACCELERATE_FACTOR = 2;
@@ -82,24 +82,32 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
protected int mMinFlingVelocity;
protected int mMinSnapVelocity;
+ // Vertical paged view
+ protected boolean mVertical;
+
protected float mDensity;
protected float mSmoothingTime;
protected float mTouchX;
+ protected float mTouchY;
protected boolean mFirstLayout = true;
protected int mCurrentPage;
protected int mNextPage = INVALID_PAGE;
protected int mMaxScrollX;
+ protected int mMaxScrollY;
protected Scroller mScroller;
private VelocityTracker mVelocityTracker;
private float mDownMotionX;
+ private float mDownMotionY;
protected float mLastMotionX;
protected float mLastMotionXRemainder;
protected float mLastMotionY;
+ protected float mLastMotionYRemainder;
protected float mTotalMotionX;
- private int mLastScreenCenter = -1;
+ protected float mTotalMotionY;
+ private int mLastScreenScroll = -1;
private int[] mChildOffsets;
private int[] mChildRelativeOffsets;
private int[] mChildOffsetsWithLayoutScale;
@@ -121,6 +129,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
private int mPagingTouchSlop;
private int mMaximumVelocity;
private int mMinimumWidth;
+ private int mMinimumHeight;
protected int mPageSpacing;
protected int mPageLayoutPaddingTop;
protected int mPageLayoutPaddingBottom;
@@ -130,9 +139,10 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
protected int mPageLayoutHeightGap;
protected int mCellCountX = 0;
protected int mCellCountY = 0;
- protected boolean mCenterPagesVertically;
+ protected boolean mCenterPages;
protected boolean mAllowOverScroll = true;
protected int mUnboundedScrollX;
+ protected int mUnboundedScrollY;
protected int[] mTempVisiblePagesRange = new int[2];
protected boolean mForceDrawAllChildrenNextFrame;
@@ -140,6 +150,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
// it is equal to the scaled overscroll position. We use a separate value so as to prevent
// the screens from continuing to translate beyond the normal bounds.
protected int mOverScrollX;
+ protected int mOverScrollY;
// parameter that adjusts the layout to be optimized for pages with that scale factor
protected float mLayoutScale = 1.0f;
@@ -158,12 +169,14 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
// If true, modify alpha of neighboring pages as user scrolls left/right
protected boolean mFadeInAdjacentScreens = true;
+ // If true, mFadeInAdjacentScreens will be handled manually
+ protected boolean mHandleFadeInAdjacentScreens = false;
+
// It true, use a different slop parameter (pagingTouchSlop = 2 * touchSlop) for deciding
// to switch to a new page
protected boolean mUsePagingTouchSlop = true;
// If true, the subclass should directly update scrollX itself in its computeScroll method
- // (SmoothPagedView does this)
protected boolean mDeferScrollUpdate = false;
protected boolean mIsPageMoving = false;
@@ -175,12 +188,16 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
private ValueAnimator mScrollIndicatorAnimator;
private View mScrollIndicator;
private int mScrollIndicatorPaddingLeft;
+ private int mScrollIndicatorPaddingTop;
private int mScrollIndicatorPaddingRight;
+ private int mScrollIndicatorPaddingBottom;
private boolean mHasScrollIndicator = true;
private boolean mShouldShowScrollIndicator = false;
private boolean mShouldShowScrollIndicatorImmediately = false;
+ protected boolean mHandleScrollIndicator = false;
protected static final int sScrollIndicatorFadeInDuration = 150;
protected static final int sScrollIndicatorFadeOutDuration = 650;
+ protected static final int sScrollIndicatorFadeOutShortDuration = 150;
protected static final int sScrollIndicatorFlashDuration = 650;
private boolean mScrollingPaused = false;
@@ -219,8 +236,12 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
R.styleable.PagedView_pageLayoutHeightGap, 0);
mScrollIndicatorPaddingLeft =
a.getDimensionPixelSize(R.styleable.PagedView_scrollIndicatorPaddingLeft, 0);
+ mScrollIndicatorPaddingTop =
+ a.getDimensionPixelSize(R.styleable.PagedView_scrollIndicatorPaddingTop, 0);
mScrollIndicatorPaddingRight =
a.getDimensionPixelSize(R.styleable.PagedView_scrollIndicatorPaddingRight, 0);
+ mScrollIndicatorPaddingBottom =
+ a.getDimensionPixelSize(R.styleable.PagedView_scrollIndicatorPaddingBottom, 0);
a.recycle();
setHapticFeedbackEnabled(false);
@@ -233,9 +254,10 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
protected void init() {
mDirtyPageContent = new ArrayList<Boolean>();
mDirtyPageContent.ensureCapacity(32);
- mScroller = new Scroller(getContext(), new ScrollInterpolator());
+ mScroller = new Scroller(getContext(), getScrollInterpolator());
mCurrentPage = 0;
- mCenterPagesVertically = true;
+ mVertical = false;
+ mCenterPages = true;
final ViewConfiguration configuration = ViewConfiguration.get(getContext());
mTouchSlop = configuration.getScaledTouchSlop();
@@ -396,33 +418,50 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
@Override
public void scrollBy(int x, int y) {
- scrollTo(mUnboundedScrollX + x, getScrollY() + y);
+ scrollTo((!mVertical ? mUnboundedScrollX : mScrollX) + x, (mVertical ? mUnboundedScrollY : mScrollY) + y);
}
@Override
public void scrollTo(int x, int y) {
mUnboundedScrollX = x;
+ mUnboundedScrollY = y;
- if (x < 0) {
- super.scrollTo(0, y);
- if (mAllowOverScroll) {
- overScroll(x);
- }
- } else if (x > mMaxScrollX) {
- super.scrollTo(mMaxScrollX, y);
- if (mAllowOverScroll) {
- overScroll(x - mMaxScrollX);
+ if (!mVertical) {
+ if (x < 0) {
+ super.scrollTo(0, y);
+ if (mAllowOverScroll) {
+ overScroll(x);
+ }
+ } else if (x > mMaxScrollX) {
+ super.scrollTo(mMaxScrollX, y);
+ if (mAllowOverScroll) {
+ overScroll(x - mMaxScrollX);
+ }
+ } else {
+ mOverScrollX = x;
+ super.scrollTo(x, y);
}
} else {
- mOverScrollX = x;
- super.scrollTo(x, y);
+ if (y < 0) {
+ super.scrollTo(x, 0);
+ if (mAllowOverScroll) {
+ overScroll(y);
+ }
+ } else if (y > mMaxScrollY) {
+ super.scrollTo(x, mMaxScrollY);
+ if (mAllowOverScroll) {
+ overScroll(y - mMaxScrollY);
+ }
+ } else {
+ mOverScrollY = y;
+ super.scrollTo(x, y);
+ }
}
-
mTouchX = x;
+ mTouchY = y;
mSmoothingTime = System.nanoTime() / NANOTIME_DIV;
}
- // we moved this functionality to a helper function so SmoothPagedView can reuse it
protected boolean computeScrollHelper() {
if (mScroller.computeScrollOffset()) {
// Don't bother scrolling if the page does not need to be moved
@@ -477,25 +516,23 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
- final int widthSize = MeasureSpec.getSize(widthMeasureSpec);
final int heightMode = MeasureSpec.getMode(heightMeasureSpec);
+ int widthSize = MeasureSpec.getSize(widthMeasureSpec);
int heightSize = MeasureSpec.getSize(heightMeasureSpec);
- if (widthMode != MeasureSpec.EXACTLY) {
- throw new IllegalStateException("Workspace can only be used in EXACTLY mode.");
- }
-
// Return early if we aren't given a proper dimension
if (widthSize <= 0 || heightSize <= 0) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
return;
}
+ if (!mVertical && widthMode != MeasureSpec.EXACTLY) {
+ throw new IllegalStateException("Workspace can only be used in EXACTLY mode.");
+ }
+ if (mVertical && heightMode != MeasureSpec.EXACTLY) {
+ throw new IllegalStateException("Workspace can only be used in EXACTLY mode.");
+ }
- /* Allow the height to be set as WRAP_CONTENT. This allows the particular case
- * of the All apps view on XLarge displays to not take up more space then it needs. Width
- * is still not allowed to be set as WRAP_CONTENT since many parts of the code expect
- * each page to have the same width.
- */
int maxChildHeight = 0;
+ int maxChildWidth = 0;
final int verticalPadding = getPaddingTop() + getPaddingBottom();
final int horizontalPadding = getPaddingLeft() + getPaddingRight();
@@ -531,12 +568,15 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
maxChildHeight = Math.max(maxChildHeight, child.getMeasuredHeight());
+ maxChildWidth = Math.max(maxChildWidth, child.getMeasuredWidth());
if (DEBUG) Log.d(TAG, "\tmeasure-child" + i + ": " + child.getMeasuredWidth() + ", "
+ child.getMeasuredHeight());
}
- if (heightMode == MeasureSpec.AT_MOST) {
+ if (!mVertical && heightMode == MeasureSpec.AT_MOST) {
heightSize = maxChildHeight + verticalPadding;
+ } else if (mVertical && widthMode == MeasureSpec.AT_MOST) {
+ widthSize = maxChildWidth + horizontalPadding;
}
setMeasuredDimension(widthSize, heightSize);
@@ -566,20 +606,24 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
updateScrollingIndicatorPosition();
if (childCount > 0) {
- mMaxScrollX = getChildOffset(childCount - 1) - getRelativeChildOffset(childCount - 1);
+ mMaxScrollX = mMaxScrollY = getChildOffset(childCount - 1) - getRelativeChildOffset(childCount - 1);
} else {
- mMaxScrollX = 0;
+ mMaxScrollX = mMaxScrollY = 0;
}
}
protected void scrollToNewPageWithoutMovingPages(int newCurrentPage) {
- int newX = getChildOffset(newCurrentPage) - getRelativeChildOffset(newCurrentPage);
- int delta = newX - getScrollX();
+ int newXY = getChildOffset(newCurrentPage) - getRelativeChildOffset(newCurrentPage);
+ int delta = newXY - (!mVertical ? mScrollX : mScrollY);
final int pageCount = getChildCount();
for (int i = 0; i < pageCount; i++) {
- View page = (View) getPageAt(i);
- page.setX(page.getX() + delta);
+ View page = getPageAt(i);
+ if (!mVertical) {
+ page.setX(page.getX() + delta);
+ } else {
+ page.setY(page.getY() + delta);
+ }
}
setCurrentPage(newCurrentPage);
}
@@ -629,46 +673,90 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
if (DEBUG) Log.d(TAG, "PagedView.onLayout()");
- final int verticalPadding = getPaddingTop() + getPaddingBottom();
+ final int verticalPadding = mPaddingTop + mPaddingBottom;
+ final int horizontalPadding = mPaddingLeft + mPaddingRight;
final int childCount = getChildCount();
- int childLeft = getRelativeChildOffset(0);
+ int childLeft = 0;
+ int childTop = 0;
+ if (childCount > 0) {
+ if (DEBUG) Log.d(TAG, "getRelativeChildOffset(): " + getMeasuredWidth() + ", "
+ + getChildWidth(0));
+
+ if (!mVertical) {
+ childLeft = getRelativeChildOffset(0);
+ } else {
+ childTop = getRelativeChildOffset(0);
+ }
+
+ // Calculate the variable page spacing if necessary
+ if (mPageSpacing < 0) {
+ if (!mVertical) {
+ setPageSpacing(((right - left) - getChildAt(0).getMeasuredWidth()) / 2);
+ } else {
+ setPageSpacing(((top - bottom) - getChildAt(0).getMeasuredHeight()) / 2);
+ }
+ }
+ }
for (int i = 0; i < childCount; i++) {
final View child = getPageAt(i);
if (child.getVisibility() != View.GONE) {
- final int childWidth = getScaledMeasuredWidth(child);
- final int childHeight = child.getMeasuredHeight();
- int childTop = getPaddingTop();
- if (mCenterPagesVertically) {
- childTop += ((getMeasuredHeight() - verticalPadding) - childHeight) / 2;
+ final int childWidth = !mVertical ? getScaledMeasuredWidth(child) : child.getMeasuredWidth();
+ final int childHeight = mVertical ? getScaledMeasuredHeight(child) : child.getMeasuredHeight();
+ if (!mVertical) {
+ childTop = mPaddingTop;
+ } else {
+ childLeft = mPaddingLeft;
+ }
+
+ if (mCenterPages) {
+ if (!mVertical) {
+ childTop += ((getMeasuredHeight() - verticalPadding) - childHeight) / 2;
+ } else {
+ childLeft += ((getMeasuredWidth() - horizontalPadding) - childWidth) / 2;
+ }
}
if (DEBUG) Log.d(TAG, "\tlayout-child" + i + ": " + childLeft + ", " + childTop);
child.layout(childLeft, childTop,
- childLeft + child.getMeasuredWidth(), childTop + childHeight);
- childLeft += childWidth + mPageSpacing;
+ childLeft + (!mVertical ? child.getMeasuredWidth() : childWidth),
+ childTop + (mVertical ? child.getMeasuredHeight() : childHeight));
+ if (!mVertical) {
+ childLeft += childWidth + mPageSpacing;
+ } else {
+ childTop += childHeight + mPageSpacing;
+ }
}
}
if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
- setHorizontalScrollBarEnabled(false);
- updateCurrentPageScroll();
- setHorizontalScrollBarEnabled(true);
+ int newXY = getChildOffset(mCurrentPage) - getRelativeChildOffset(mCurrentPage);
+ if (!mVertical) {
+ setHorizontalScrollBarEnabled(false);
+ scrollTo(newXY, 0);
+ mScroller.setFinalX(newXY);
+ setHorizontalScrollBarEnabled(true);
+ } else {
+ setVerticalScrollBarEnabled(false);
+ scrollTo(0, newXY);
+ mScroller.setFinalY(newXY);
+ setVerticalScrollBarEnabled(true);
+ }
mFirstLayout = false;
}
}
- protected void screenScrolled(int screenCenter) {
+ protected void screenScrolled(int screenScroll) {
if (isScrollingIndicatorEnabled()) {
updateScrollingIndicator();
}
boolean isInOverscroll = mOverScrollX < 0 || mOverScrollX > mMaxScrollX;
- if (mFadeInAdjacentScreens && !isInOverscroll) {
+ if (mFadeInAdjacentScreens && !isInOverscroll && !mHandleFadeInAdjacentScreens) {
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (child != null) {
- float scrollProgress = getScrollProgress(screenCenter, child, i);
+ float scrollProgress = getScrollProgress(screenScroll, child, i);
float alpha = 1 - Math.abs(scrollProgress);
child.setAlpha(alpha);
}
@@ -721,7 +809,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
int offset = getRelativeChildOffset(0);
for (int i = 0; i < index; ++i) {
- offset += getScaledMeasuredWidth(getPageAt(i)) + mPageSpacing;
+ offset += (!mVertical ? getScaledMeasuredWidth(getPageAt(i)) :
+ getScaledMeasuredHeight(getPageAt(i))) + mPageSpacing;
}
if (childOffsets != null) {
childOffsets[index] = offset;
@@ -734,9 +823,16 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
if (mChildRelativeOffsets != null && mChildRelativeOffsets[index] != -1) {
return mChildRelativeOffsets[index];
} else {
- final int padding = getPaddingLeft() + getPaddingRight();
- final int offset = getPaddingLeft() +
- (getMeasuredWidth() - padding - getChildWidth(index)) / 2;
+ int offset;
+ if (!mVertical) {
+ final int padding = mPaddingLeft + mPaddingRight;
+ offset = mPaddingLeft +
+ (getMeasuredWidth() - padding - getChildWidth(index)) / 2;
+ } else {
+ final int padding = mPaddingTop + mPaddingBottom;
+ offset = mPaddingTop +
+ (getMeasuredHeight() - padding - getChildHeight(index)) / 2;
+ }
if (mChildRelativeOffsets != null) {
mChildRelativeOffsets[index] = offset;
}
@@ -744,6 +840,20 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
}
+ protected int getScaledRelativeChildOffset(int index) {
+ int offset;
+ if (!mVertical) {
+ final int padding = mPaddingLeft + mPaddingRight;
+ offset = mPaddingLeft + (getMeasuredWidth() - padding -
+ getScaledMeasuredWidth(getPageAt(index))) / 2;
+ } else {
+ final int padding = mPaddingTop + mPaddingBottom;
+ offset = mPaddingTop + (getMeasuredHeight() - padding -
+ getScaledMeasuredHeight(getPageAt(index))) / 2;
+ }
+ return offset;
+ }
+
protected int getScaledMeasuredWidth(View child) {
// This functions are called enough times that it actually makes a difference in the
// profiler -- so just inline the max() here
@@ -753,29 +863,55 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
return (int) (maxWidth * mLayoutScale + 0.5f);
}
+ protected int getScaledMeasuredHeight(View child) {
+ // This functions are called enough times that it actually makes a difference in the
+ // profiler -- so just inline the max() here
+ final int measuredHeight = child.getMeasuredHeight();
+ final int minHeight = mMinimumHeight;
+ final int maxHeight = (minHeight > measuredHeight) ? minHeight : measuredHeight;
+ return (int) (maxHeight * mLayoutScale + 0.5f);
+ }
+
protected void getVisiblePages(int[] range) {
final int pageCount = getChildCount();
if (pageCount > 0) {
- final int screenWidth = getMeasuredWidth();
- int leftScreen = 0;
- int rightScreen = 0;
- View currPage = getPageAt(leftScreen);
- while (leftScreen < pageCount - 1 &&
- currPage.getX() + currPage.getWidth() -
- currPage.getPaddingRight() < getScrollX()) {
- leftScreen++;
- currPage = getPageAt(leftScreen);
- }
- rightScreen = leftScreen;
- currPage = getPageAt(rightScreen + 1);
- while (rightScreen < pageCount - 1 &&
- currPage.getX() - currPage.getPaddingLeft() < getScrollX() + screenWidth) {
- rightScreen++;
- currPage = getPageAt(rightScreen + 1);
+ if (!mVertical) {
+ final int pageWidth = getScaledMeasuredWidth(getPageAt(0));
+ final int screenWidth = getMeasuredWidth();
+ int x = getScaledRelativeChildOffset(0) + pageWidth;
+ int leftScreen = 0;
+ int rightScreen = 0;
+ while (leftScreen < pageCount - 1 && x + getPageAt(leftScreen).getTranslationX() <= mScrollX) {
+ leftScreen++;
+ x += getScaledMeasuredWidth(getPageAt(leftScreen)) + mPageSpacing;
+ }
+ rightScreen = leftScreen;
+
+ while (rightScreen < pageCount - 1 && x + getPageAt(rightScreen + 1).getTranslationX() < mScrollX + screenWidth) {
+ rightScreen++;
+ x += getScaledMeasuredWidth(getPageAt(rightScreen)) + mPageSpacing;
+ }
+ range[0] = leftScreen;
+ range[1] = rightScreen;
+ } else {
+ final int pageHeight = getScaledMeasuredHeight(getPageAt(0));
+ final int screenHeight = getMeasuredHeight();
+ int y = getScaledRelativeChildOffset(0) + pageHeight;
+ int topScreen = 0;
+ int bottomScreen = 0;
+ while (y <= mScrollY && topScreen < pageCount - 1) {
+ topScreen++;
+ y += getScaledMeasuredHeight(getPageAt(topScreen)) + mPageSpacing;
+ }
+ bottomScreen = topScreen;
+ while (y < mScrollY + screenHeight && bottomScreen < pageCount - 1) {
+ bottomScreen++;
+ y += getScaledMeasuredHeight(getPageAt(bottomScreen)) + mPageSpacing;
+ }
+ range[0] = topScreen;
+ range[1] = bottomScreen;
}
- range[0] = leftScreen;
- range[1] = rightScreen;
} else {
range[0] = -1;
range[1] = -1;
@@ -783,31 +919,32 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
protected boolean shouldDrawChild(View child) {
- return child.getAlpha() > 0;
+ return child.getAlpha() > 0 && child.getVisibility() == VISIBLE;
}
@Override
protected void dispatchDraw(Canvas canvas) {
- int halfScreenSize = getMeasuredWidth() / 2;
- // mOverScrollX is equal to getScrollX() when we're within the normal scroll range.
- // Otherwise it is equal to the scaled overscroll position.
- int screenCenter = mOverScrollX + halfScreenSize;
-
- if (screenCenter != mLastScreenCenter || mForceScreenScrolled) {
- // set mForceScreenScrolled before calling screenScrolled so that screenScrolled can
- // set it for the next frame
- mForceScreenScrolled = false;
- screenScrolled(screenCenter);
- mLastScreenCenter = screenCenter;
+ if (!mVertical) {
+ if (mOverScrollX != mLastScreenScroll || mForceScreenScrolled) {
+ screenScrolled(mOverScrollX);
+ mLastScreenScroll = mOverScrollX;
+ mForceScreenScrolled = false;
+ }
+ } else {
+ if (mOverScrollY != mLastScreenScroll || mForceScreenScrolled) {
+ screenScrolled(mOverScrollY);
+ mLastScreenScroll = mOverScrollY;
+ mForceScreenScrolled = false;
+ }
}
// Find out which screens are visible; as an optimization we only call draw on them
final int pageCount = getChildCount();
if (pageCount > 0) {
getVisiblePages(mTempVisiblePagesRange);
- final int leftScreen = mTempVisiblePagesRange[0];
- final int rightScreen = mTempVisiblePagesRange[1];
- if (leftScreen != -1 && rightScreen != -1) {
+ final int leftTopScreen = mTempVisiblePagesRange[0];
+ final int rightBottomScreen = mTempVisiblePagesRange[1];
+ if (leftTopScreen != -1 && rightBottomScreen != -1) {
final long drawingTime = getDrawingTime();
// Clip to the bounds
canvas.save();
@@ -816,8 +953,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
for (int i = getChildCount() - 1; i >= 0; i--) {
final View v = getPageAt(i);
- if (mForceDrawAllChildrenNextFrame ||
- (leftScreen <= i && i <= rightScreen && shouldDrawChild(v))) {
+ if ((mForceDrawAllChildrenNextFrame || (leftTopScreen <= i && i <= rightBottomScreen))
+ && shouldDrawChild(v)) {
drawChild(canvas, v, drawingTime);
}
}
@@ -930,14 +1067,15 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
* Return true if a tap at (x, y) should trigger a flip to the previous page.
*/
protected boolean hitsPreviousPage(float x, float y) {
- return (x < getRelativeChildOffset(mCurrentPage) - mPageSpacing);
+ return ((!mVertical ? x : y) < getRelativeChildOffset(mCurrentPage) - mPageSpacing);
}
/**
* Return true if a tap at (x, y) should trigger a flip to the next page.
*/
protected boolean hitsNextPage(float x, float y) {
- return (x > (getMeasuredWidth() - getRelativeChildOffset(mCurrentPage) + mPageSpacing));
+ return ((!mVertical ? x : y) > ((!mVertical ? getMeasuredWidth() : getMeasuredHeight()) -
+ getRelativeChildOffset(mCurrentPage) + mPageSpacing));
}
@Override
@@ -985,10 +1123,13 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
final float y = ev.getY();
// Remember location of down touch
mDownMotionX = x;
+ mDownMotionY = y;
mLastMotionX = x;
mLastMotionY = y;
mLastMotionXRemainder = 0;
+ mLastMotionYRemainder = 0;
mTotalMotionX = 0;
+ mTotalMotionY = 0;
mActivePointerId = ev.getPointerId(0);
mAllowLongPress = true;
@@ -997,8 +1138,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
* otherwise don't. mScroller.isFinished should be false when
* being flinged.
*/
- final int xDist = Math.abs(mScroller.getFinalX() - mScroller.getCurrX());
- final boolean finishedScrolling = (mScroller.isFinished() || xDist < mTouchSlop);
+ final int xyDist = Math.abs(!mVertical ? (mScroller.getFinalX() - mScroller.getCurrX()) :
+ (mScroller.getFinalY() - mScroller.getCurrY()));
+ final boolean finishedScrolling = (mScroller.isFinished() || xyDist < mTouchSlop);
if (finishedScrolling) {
mTouchState = TOUCH_STATE_REST;
mScroller.abortAnimation();
@@ -1065,19 +1207,31 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
final int touchSlop = Math.round(touchSlopScale * mTouchSlop);
boolean xPaged = xDiff > mPagingTouchSlop;
+ boolean yPaged = yDiff > mPagingTouchSlop;
boolean xMoved = xDiff > touchSlop;
boolean yMoved = yDiff > touchSlop;
- if (xMoved || xPaged || yMoved) {
- if (mUsePagingTouchSlop ? xPaged : xMoved) {
- // Scroll if the user moved far enough along the X axis
- mTouchState = TOUCH_STATE_SCROLLING;
- mTotalMotionX += Math.abs(mLastMotionX - x);
- mLastMotionX = x;
- mLastMotionXRemainder = 0;
- mTouchX = getScrollX();
- mSmoothingTime = System.nanoTime() / NANOTIME_DIV;
- pageBeginMoving();
+ if (xMoved || (!mVertical ? xPaged : yPaged) || yMoved) {
+ if (!mVertical) {
+ if (mUsePagingTouchSlop ? xPaged : xMoved) {
+ // Scroll if the user moved far enough along the X axis
+ mTouchState = TOUCH_STATE_SCROLLING;
+ mTotalMotionX += Math.abs(mLastMotionX - x);
+ mLastMotionX = x;
+ mLastMotionXRemainder = 0;
+ mTouchX = mScrollX;
+ pageBeginMoving();
+ }
+ } else {
+ if (mUsePagingTouchSlop ? yPaged : yMoved) {
+ // Scroll if the user moved far enough along the X axis
+ mTouchState = TOUCH_STATE_SCROLLING;
+ mTotalMotionY += Math.abs(mLastMotionY - y);
+ mLastMotionY = y;
+ mLastMotionYRemainder = 0;
+ mTouchY = mScrollY;
+ pageBeginMoving();
+ }
}
// Either way, cancel any pending longpress
cancelCurrentPageLongPress();
@@ -1097,10 +1251,12 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
}
- protected float getScrollProgress(int screenCenter, View v, int page) {
- final int halfScreenSize = getMeasuredWidth() / 2;
+ protected float getScrollProgress(int screenScroll, View v, int page) {
+ final int halfScreenSize = (!mVertical ? getMeasuredWidth() : getMeasuredHeight()) / 2;
+ int screenCenter = screenScroll + (!mVertical ? getMeasuredWidth() : getMeasuredHeight()) / 2;
- int totalDistance = getScaledMeasuredWidth(v) + mPageSpacing;
+ int totalDistance = (!mVertical ? getScaledMeasuredWidth(v) :
+ getScaledMeasuredHeight(v)) + mPageSpacing;
int delta = screenCenter - (getChildOffset(page) -
getRelativeChildOffset(page) + halfScreenSize);
@@ -1118,7 +1274,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
protected void acceleratedOverScroll(float amount) {
- int screenSize = getMeasuredWidth();
+ int screenSize = !mVertical ? getMeasuredWidth() : getMeasuredHeight();
// We want to reach the max over scroll effect when the user has
// over scrolled half the size of the screen
@@ -1133,17 +1289,27 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
int overScrollAmount = (int) Math.round(f * screenSize);
if (amount < 0) {
- mOverScrollX = overScrollAmount;
- super.scrollTo(0, getScrollY());
+ if (!mVertical) {
+ mOverScrollX = overScrollAmount;
+ mScrollX = 0;
+ } else {
+ mOverScrollY = overScrollAmount;
+ mScrollY = 0;
+ }
} else {
- mOverScrollX = mMaxScrollX + overScrollAmount;
- super.scrollTo(mMaxScrollX, getScrollY());
+ if (!mVertical) {
+ mOverScrollX = mMaxScrollX + overScrollAmount;
+ mScrollX = mMaxScrollX;
+ } else {
+ mOverScrollY = mMaxScrollY + overScrollAmount;
+ mScrollY = mMaxScrollY;
+ }
}
invalidate();
}
protected void dampedOverScroll(float amount) {
- int screenSize = getMeasuredWidth();
+ int screenSize = !mVertical ? getMeasuredWidth() : getMeasuredHeight();
float f = (amount / screenSize);
@@ -1157,11 +1323,21 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
int overScrollAmount = (int) Math.round(OVERSCROLL_DAMP_FACTOR * f * screenSize);
if (amount < 0) {
- mOverScrollX = overScrollAmount;
- super.scrollTo(0, getScrollY());
+ if (!mVertical) {
+ mOverScrollX = overScrollAmount;
+ mScrollX = 0;
+ } else {
+ mOverScrollY = overScrollAmount;
+ mScrollY = 0;
+ }
} else {
- mOverScrollX = mMaxScrollX + overScrollAmount;
- super.scrollTo(mMaxScrollX, getScrollY());
+ if (!mVertical) {
+ mOverScrollX = mMaxScrollX + overScrollAmount;
+ mScrollX = mMaxScrollX;
+ } else {
+ mOverScrollY = mMaxScrollY + overScrollAmount;
+ mScrollY = mMaxScrollY;
+ }
}
invalidate();
}
@@ -1199,8 +1375,11 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
// Remember where the motion event started
mDownMotionX = mLastMotionX = ev.getX();
+ mDownMotionY = mLastMotionY = ev.getY();
mLastMotionXRemainder = 0;
+ mLastMotionYRemainder = 0;
mTotalMotionX = 0;
+ mTotalMotionY = 0;
mActivePointerId = ev.getPointerId(0);
if (mTouchState == TOUCH_STATE_SCROLLING) {
pageBeginMoving();
@@ -1213,23 +1392,39 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
final int pointerIndex = ev.findPointerIndex(mActivePointerId);
final float x = ev.getX(pointerIndex);
final float deltaX = mLastMotionX + mLastMotionXRemainder - x;
+ final float y = ev.getY(pointerIndex);
+ final float deltaY = mLastMotionY + mLastMotionYRemainder - y;
mTotalMotionX += Math.abs(deltaX);
+ mTotalMotionY += Math.abs(deltaY);
// Only scroll and update mLastMotionX if we have moved some discrete amount. We
// keep the remainder because we are actually testing if we've moved from the last
// scrolled position (which is discrete).
- if (Math.abs(deltaX) >= 1.0f) {
- mTouchX += deltaX;
- mSmoothingTime = System.nanoTime() / NANOTIME_DIV;
- if (!mDeferScrollUpdate) {
- scrollBy((int) deltaX, 0);
- if (DEBUG) Log.d(TAG, "onTouchEvent().Scrolling: " + deltaX);
+ if (Math.abs(!mVertical ? deltaX : deltaY) >= 1.0f) {
+ if (!mVertical) {
+ mTouchX += deltaX;
+ mSmoothingTime = System.nanoTime() / NANOTIME_DIV;
+ if (!mDeferScrollUpdate) {
+ scrollBy((int) deltaX, 0);
+ if (DEBUG) Log.d(TAG, "onTouchEvent().Scrolling: " + deltaX);
+ } else {
+ invalidate();
+ }
+ mLastMotionX = x;
+ mLastMotionXRemainder = deltaX - (int) deltaX;
} else {
- invalidate();
+ mTouchY += deltaY;
+ mSmoothingTime = System.nanoTime() / NANOTIME_DIV;
+ if (!mDeferScrollUpdate) {
+ scrollBy(0, (int) deltaY);
+ if (DEBUG) Log.d(TAG, "onTouchEvent().Scrolling: " + deltaY);
+ } else {
+ invalidate();
+ }
+ mLastMotionY = y;
+ mLastMotionYRemainder = deltaY - (int) deltaY;
}
- mLastMotionX = x;
- mLastMotionXRemainder = deltaX - (int) deltaX;
} else {
awakenScrollBars();
}
@@ -1243,25 +1438,30 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
final int activePointerId = mActivePointerId;
final int pointerIndex = ev.findPointerIndex(activePointerId);
final float x = ev.getX(pointerIndex);
+ final float y = ev.getY(pointerIndex);
final VelocityTracker velocityTracker = mVelocityTracker;
velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
int velocityX = (int) velocityTracker.getXVelocity(activePointerId);
+ int velocityY = (int) velocityTracker.getYVelocity(activePointerId);
final int deltaX = (int) (x - mDownMotionX);
+ final int deltaY = (int) (y - mDownMotionY);
final int pageWidth = getScaledMeasuredWidth(getPageAt(mCurrentPage));
- boolean isSignificantMove = Math.abs(deltaX) > pageWidth *
+ boolean isSignificantMove = Math.abs(!mVertical ? deltaX : deltaY) > pageWidth *
SIGNIFICANT_MOVE_THRESHOLD;
mTotalMotionX += Math.abs(mLastMotionX + mLastMotionXRemainder - x);
+ mTotalMotionY += Math.abs(mLastMotionY + mLastMotionYRemainder - y);
boolean isFling = mTotalMotionX > MIN_LENGTH_FOR_FLING &&
- Math.abs(velocityX) > mFlingThresholdVelocity;
+ Math.abs(!mVertical ? velocityX : velocityY) > mFlingThresholdVelocity;
// In the case that the page is moved far to one direction and then is flung
// in the opposite direction, we use a threshold to determine whether we should
// just return to the starting page, or if we should skip one further.
boolean returnToOriginalPage = false;
- if (Math.abs(deltaX) > pageWidth * RETURN_TO_ORIGINAL_PAGE_THRESHOLD &&
- Math.signum(velocityX) != Math.signum(deltaX) && isFling) {
+ if (Math.abs(!mVertical ? deltaX : deltaY) > pageWidth * RETURN_TO_ORIGINAL_PAGE_THRESHOLD &&
+ Math.signum(!mVertical ? velocityX : velocityY) !=
+ Math.signum(!mVertical ? deltaX : deltaY) && isFling) {
returnToOriginalPage = true;
}
@@ -1269,17 +1469,32 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
// We give flings precedence over large moves, which is why we short-circuit our
// test for a large move if a fling has been registered. That is, a large
// move to the left and fling to the right will register as a fling to the right.
- if (((isSignificantMove && deltaX > 0 && !isFling) ||
- (isFling && velocityX > 0)) && mCurrentPage > 0) {
- finalPage = returnToOriginalPage ? mCurrentPage : mCurrentPage - 1;
- snapToPageWithVelocity(finalPage, velocityX);
- } else if (((isSignificantMove && deltaX < 0 && !isFling) ||
- (isFling && velocityX < 0)) &&
- mCurrentPage < getChildCount() - 1) {
- finalPage = returnToOriginalPage ? mCurrentPage : mCurrentPage + 1;
- snapToPageWithVelocity(finalPage, velocityX);
+ if (!mVertical) {
+ if (((isSignificantMove && deltaX > 0 && !isFling) ||
+ (isFling && velocityX > 0)) && mCurrentPage > 0) {
+ finalPage = returnToOriginalPage ? mCurrentPage : mCurrentPage - 1;
+ snapToPageWithVelocity(finalPage, velocityX);
+ } else if (((isSignificantMove && deltaX < 0 && !isFling) ||
+ (isFling && velocityX < 0)) &&
+ mCurrentPage < getChildCount() - 1) {
+ finalPage = returnToOriginalPage ? mCurrentPage : mCurrentPage + 1;
+ snapToPageWithVelocity(finalPage, velocityX);
+ } else {
+ snapToDestination();
+ }
} else {
- snapToDestination();
+ if (((isSignificantMove && deltaY > 0 && !isFling) ||
+ (isFling && velocityY > 0)) && mCurrentPage > 0) {
+ finalPage = returnToOriginalPage ? mCurrentPage : mCurrentPage - 1;
+ snapToPageWithVelocity(finalPage, velocityY);
+ } else if (((isSignificantMove && deltaY < 0 && !isFling) ||
+ (isFling && velocityY < 0)) &&
+ mCurrentPage < getChildCount() - 1) {
+ finalPage = returnToOriginalPage ? mCurrentPage : mCurrentPage + 1;
+ snapToPageWithVelocity(finalPage, velocityY);
+ } else {
+ snapToDestination();
+ }
}
} else if (mTouchState == TOUCH_STATE_PREV_PAGE) {
// at this point we have not moved beyond the touch slop
@@ -1379,8 +1594,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
// TODO: Make this decision more intelligent.
final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
mLastMotionX = mDownMotionX = ev.getX(newPointerIndex);
- mLastMotionY = ev.getY(newPointerIndex);
+ mLastMotionY = mDownMotionY = ev.getY(newPointerIndex);
mLastMotionXRemainder = 0;
+ mLastMotionYRemainder = 0;
mActivePointerId = ev.getPointerId(newPointerIndex);
if (mVelocityTracker != null) {
mVelocityTracker.clear();
@@ -1401,12 +1617,13 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
protected int getChildIndexForRelativeOffset(int relativeOffset) {
final int childCount = getChildCount();
- int left;
- int right;
+ int leftTop;
+ int rightBottom;
for (int i = 0; i < childCount; ++i) {
- left = getRelativeChildOffset(i);
- right = (left + getScaledMeasuredWidth(getPageAt(i)));
- if (left <= relativeOffset && relativeOffset <= right) {
+ leftTop = getRelativeChildOffset(i);
+ rightBottom = (leftTop + (!mVertical ? getScaledMeasuredWidth(getPageAt(i)) :
+ getScaledMeasuredHeight(getPageAt(i))));
+ if (leftTop <= relativeOffset && relativeOffset <= rightBottom) {
return i;
}
}
@@ -1416,21 +1633,36 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
protected int getChildWidth(int index) {
// This functions are called enough times that it actually makes a difference in the
// profiler -- so just inline the max() here
- final int measuredWidth = getPageAt(index).getMeasuredWidth();
+ final int measuredWidth = getPageAt(index) != null ? getPageAt(index).getMeasuredWidth() : 0;
final int minWidth = mMinimumWidth;
return (minWidth > measuredWidth) ? minWidth : measuredWidth;
}
+ protected int getChildHeight(int index) {
+ // This functions are called enough times that it actually makes a difference in the
+ // profiler -- so just inline the max() here
+ final int measuredHeight = getPageAt(index) != null ? getPageAt(index).getMeasuredHeight() : 0;
+ final int minHeight = mMinimumHeight;
+ return (minHeight > measuredHeight) ? minHeight : measuredHeight;
+ }
+
int getPageNearestToCenterOfScreen() {
int minDistanceFromScreenCenter = Integer.MAX_VALUE;
int minDistanceFromScreenCenterIndex = -1;
- int screenCenter = getScrollX() + (getMeasuredWidth() / 2);
+ int screenCenter = !mVertical ? mScrollX + (getMeasuredWidth() / 2) :
+ mScrollY + (getMeasuredHeight() / 2);
final int childCount = getChildCount();
for (int i = 0; i < childCount; ++i) {
- View layout = (View) getPageAt(i);
- int childWidth = getScaledMeasuredWidth(layout);
- int halfChildWidth = (childWidth / 2);
- int childCenter = getChildOffset(i) + halfChildWidth;
+ View layout = getPageAt(i);
+ int halfChild;
+ if (!mVertical) {
+ int childWidth = getScaledMeasuredWidth(layout);
+ halfChild = (childWidth / 2);
+ } else {
+ int childHeight = getScaledMeasuredHeight(layout);
+ halfChild = (childHeight / 2);
+ }
+ int childCenter = getChildOffset(i) + halfChild;
int distanceFromScreenCenter = Math.abs(childCenter - screenCenter);
if (distanceFromScreenCenter < minDistanceFromScreenCenter) {
minDistanceFromScreenCenter = distanceFromScreenCenter;
@@ -1444,8 +1676,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
snapToPage(getPageNearestToCenterOfScreen(), PAGE_SNAP_ANIMATION_DURATION);
}
- private static class ScrollInterpolator implements Interpolator {
- public ScrollInterpolator() {
+ public static class QuintInterpolator implements Interpolator {
+ public QuintInterpolator() {
}
public float getInterpolation(float t) {
@@ -1454,6 +1686,44 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
}
+ public static class QuadInterpolator implements Interpolator {
+ public QuadInterpolator() {
+ }
+
+ public float getInterpolation(float t) {
+ t -= 1.0f;
+ return -(t*t*t*t - 1);
+ }
+ }
+
+ public static class OvershootInterpolator implements Interpolator {
+ private static final float DEFAULT_TENSION = 1.3f;
+ private float mTension;
+
+ public OvershootInterpolator() {
+ mTension = DEFAULT_TENSION;
+ }
+
+ public void setDistance(int distance) {
+ mTension = distance > 0 ? DEFAULT_TENSION / distance : DEFAULT_TENSION;
+ }
+
+ public void disableSettle() {
+ mTension = 0.f;
+ }
+
+ public float getInterpolation(float t) {
+ // _o(t) = t * t * ((tension + 1) * t + tension)
+ // o(t) = _o(t - 1) + 1
+ t -= 1.0f;
+ return t * t * ((mTension + 1) * t + mTension) + 1.0f;
+ }
+ }
+
+ protected Interpolator getScrollInterpolator() {
+ return new QuintInterpolator();
+ }
+
// We want the duration of the page snap animation to be influenced by the distance that
// the screen has to travel, however, we don't want this duration to be effected in a
// purely linear fashion. Instead, we use this method to moderate the effect that the distance
@@ -1466,13 +1736,13 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
protected void snapToPageWithVelocity(int whichPage, int velocity) {
whichPage = Math.max(0, Math.min(whichPage, getChildCount() - 1));
- int halfScreenSize = getMeasuredWidth() / 2;
+ int halfScreenSize = (!mVertical ? getMeasuredWidth() : getMeasuredHeight()) / 2;
if (DEBUG) Log.d(TAG, "snapToPage.getChildOffset(): " + getChildOffset(whichPage));
if (DEBUG) Log.d(TAG, "snapToPageWithVelocity.getRelativeChildOffset(): "
+ getMeasuredWidth() + ", " + getChildWidth(whichPage));
- final int newX = getChildOffset(whichPage) - getRelativeChildOffset(whichPage);
- int delta = newX - mUnboundedScrollX;
+ final int newXY = getChildOffset(whichPage) - getRelativeChildOffset(whichPage);
+ int delta = newXY - (!mVertical ? mUnboundedScrollX : mUnboundedScrollY);
int duration = 0;
if (Math.abs(velocity) < mMinFlingVelocity) {
@@ -1512,9 +1782,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
if (DEBUG) Log.d(TAG, "snapToPage.getChildOffset(): " + getChildOffset(whichPage));
if (DEBUG) Log.d(TAG, "snapToPage.getRelativeChildOffset(): " + getMeasuredWidth() + ", "
+ getChildWidth(whichPage));
- int newX = getChildOffset(whichPage) - getRelativeChildOffset(whichPage);
- final int sX = mUnboundedScrollX;
- final int delta = newX - sX;
+ int newXY = getChildOffset(whichPage) - getRelativeChildOffset(whichPage);
+ final int sXY = !mVertical ? mUnboundedScrollX : mUnboundedScrollY;
+ final int delta = newXY - sXY;
snapToPage(whichPage, delta, duration);
}
@@ -1534,7 +1804,11 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
if (!mScroller.isFinished()) mScroller.abortAnimation();
- mScroller.startScroll(mUnboundedScrollX, 0, delta, 0, duration);
+ if (!mVertical) {
+ mScroller.startScroll(mUnboundedScrollX, 0, delta, 0, duration);
+ } else {
+ mScroller.startScroll(0, mUnboundedScrollY, 0, delta, duration);
+ }
// Load associated pages immediately if someone else is handling the scroll, otherwise defer
// loading associated pages until the scroll settles
@@ -1729,7 +2003,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
if (mHasScrollIndicator && mScrollIndicator == null) {
ViewGroup parent = (ViewGroup) getParent();
if (parent != null) {
- mScrollIndicator = (View) (parent.findViewById(R.id.paged_view_indicator));
+ mScrollIndicator = parent.findViewById(getScrollingIndicatorId());
mHasScrollIndicator = mScrollIndicator != null;
if (mHasScrollIndicator) {
mScrollIndicator.setVisibility(View.VISIBLE);
@@ -1743,6 +2017,10 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
return true;
}
+ protected int getScrollingIndicatorId() {
+ return R.id.paged_view_indicator;
+ }
+
Runnable hideScrollingIndicatorRunnable = new Runnable() {
@Override
public void run() {
@@ -1756,10 +2034,15 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
protected void showScrollingIndicator(boolean immediately) {
+ showScrollingIndicator(immediately, sScrollIndicatorFadeInDuration);
+ }
+
+ protected void showScrollingIndicator(boolean immediately, int duration) {
mShouldShowScrollIndicator = true;
mShouldShowScrollIndicatorImmediately = true;
if (getChildCount() <= 1) return;
if (!isScrollingIndicatorEnabled()) return;
+ if (mHandleScrollIndicator) return;
mShouldShowScrollIndicator = false;
getScrollingIndicator();
@@ -1772,7 +2055,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
mScrollIndicator.setAlpha(1f);
} else {
mScrollIndicatorAnimator = LauncherAnimUtils.ofFloat(mScrollIndicator, "alpha", 1f);
- mScrollIndicatorAnimator.setDuration(sScrollIndicatorFadeInDuration);
+ mScrollIndicatorAnimator.setDuration(duration);
mScrollIndicatorAnimator.start();
}
}
@@ -1785,8 +2068,13 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
protected void hideScrollingIndicator(boolean immediately) {
+ hideScrollingIndicator(immediately, sScrollIndicatorFadeOutDuration);
+ }
+
+ protected void hideScrollingIndicator(boolean immediately, int duration) {
if (getChildCount() <= 1) return;
if (!isScrollingIndicatorEnabled()) return;
+ if (mHandleScrollIndicator) return;
getScrollingIndicator();
if (mScrollIndicator != null) {
@@ -1798,7 +2086,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
mScrollIndicator.setAlpha(0f);
} else {
mScrollIndicatorAnimator = LauncherAnimUtils.ofFloat(mScrollIndicator, "alpha", 0f);
- mScrollIndicatorAnimator.setDuration(sScrollIndicatorFadeOutDuration);
+ mScrollIndicatorAnimator.setDuration(duration);
mScrollIndicatorAnimator.addListener(new AnimatorListenerAdapter() {
private boolean cancelled = false;
@Override
@@ -1817,6 +2105,22 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
}
+ protected void enableScrollingIndicator() {
+ mHasScrollIndicator = true;
+ getScrollingIndicator();
+ if (mScrollIndicator != null) {
+ mScrollIndicator.setVisibility(View.VISIBLE);
+ }
+ }
+
+ protected void disableScrollingIndicator() {
+ if (mScrollIndicator != null) {
+ mScrollIndicator.setVisibility(View.GONE);
+ }
+ mHasScrollIndicator = false;
+ mScrollIndicator = null;
+ }
+
/**
* To be overridden by subclasses to determine whether the scroll indicator should stretch to
* fill its space on the track or not.
@@ -1828,6 +2132,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
private void updateScrollingIndicator() {
if (getChildCount() <= 1) return;
if (!isScrollingIndicatorEnabled()) return;
+ if (mHandleScrollIndicator) return;
getScrollingIndicator();
if (mScrollIndicator != null) {
@@ -1841,27 +2146,48 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
private void updateScrollingIndicatorPosition() {
if (!isScrollingIndicatorEnabled()) return;
if (mScrollIndicator == null) return;
+ if (mHandleScrollIndicator) return;
int numPages = getChildCount();
- int pageWidth = getMeasuredWidth();
+ int pageSize = !mVertical ? getMeasuredWidth() : getMeasuredHeight();
int lastChildIndex = Math.max(0, getChildCount() - 1);
- int maxScrollX = getChildOffset(lastChildIndex) - getRelativeChildOffset(lastChildIndex);
- int trackWidth = pageWidth - mScrollIndicatorPaddingLeft - mScrollIndicatorPaddingRight;
- int indicatorWidth = mScrollIndicator.getMeasuredWidth() -
- mScrollIndicator.getPaddingLeft() - mScrollIndicator.getPaddingRight();
-
- float offset = Math.max(0f, Math.min(1f, (float) getScrollX() / maxScrollX));
- int indicatorSpace = trackWidth / numPages;
- int indicatorPos = (int) (offset * (trackWidth - indicatorSpace)) + mScrollIndicatorPaddingLeft;
- if (hasElasticScrollIndicator()) {
- if (mScrollIndicator.getMeasuredWidth() != indicatorSpace) {
- mScrollIndicator.getLayoutParams().width = indicatorSpace;
- mScrollIndicator.requestLayout();
+ int maxScroll = getChildOffset(lastChildIndex) - getRelativeChildOffset(lastChildIndex);
+ if (!mVertical) {
+ int trackWidth = pageSize - mScrollIndicatorPaddingLeft - mScrollIndicatorPaddingRight;
+ int indicatorWidth = mScrollIndicator.getMeasuredWidth() -
+ mScrollIndicator.getPaddingLeft() - mScrollIndicator.getPaddingRight();
+
+ float offset = Math.max(0f, Math.min(1f, (float) getScrollX() / maxScroll));
+ int indicatorSpace = trackWidth / numPages;
+ int indicatorPos = (int) (offset * (trackWidth - indicatorSpace)) + mScrollIndicatorPaddingLeft;
+ if (hasElasticScrollIndicator()) {
+ if (mScrollIndicator.getMeasuredWidth() != indicatorSpace) {
+ mScrollIndicator.getLayoutParams().width = indicatorSpace;
+ mScrollIndicator.requestLayout();
+ }
+ } else {
+ int indicatorCenterOffset = indicatorSpace / 2 - indicatorWidth / 2;
+ indicatorPos += indicatorCenterOffset;
}
+ mScrollIndicator.setTranslationX(indicatorPos);
} else {
- int indicatorCenterOffset = indicatorSpace / 2 - indicatorWidth / 2;
- indicatorPos += indicatorCenterOffset;
+ int trackHeight = pageSize - mScrollIndicatorPaddingTop - mScrollIndicatorPaddingBottom;
+ int indicatorHeight = mScrollIndicator.getMeasuredHeight() -
+ mScrollIndicator.getPaddingTop() - mScrollIndicator.getPaddingBottom();
+
+ float offset = Math.max(0f, Math.min(1f, (float) getScrollY() / maxScroll));
+ int indicatorSpace = trackHeight / numPages;
+ int indicatorPos = (int) (offset * (trackHeight - indicatorSpace)) + mScrollIndicatorPaddingTop;
+ if (hasElasticScrollIndicator()) {
+ if (mScrollIndicator.getMeasuredHeight() != indicatorSpace) {
+ mScrollIndicator.getLayoutParams().height = indicatorSpace;
+ mScrollIndicator.requestLayout();
+ }
+ } else {
+ int indicatorCenterOffset = indicatorSpace / 2 - indicatorHeight / 2;
+ indicatorPos += indicatorCenterOffset;
+ }
+ mScrollIndicator.setTranslationY(indicatorPos);
}
- mScrollIndicator.setTranslationX(indicatorPos);
}
public void showScrollIndicatorTrack() {
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/cyanogenmod/trebuchet/PagedViewCellLayout.java
index 6f73e6341..e211abfec 100644
--- a/src/com/android/launcher2/PagedViewCellLayout.java
+++ b/src/com/cyanogenmod/trebuchet/PagedViewCellLayout.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.content.res.Resources;
@@ -24,15 +24,13 @@ import android.view.View;
import android.view.ViewDebug;
import android.view.ViewGroup;
-import com.android.launcher.R;
-
/**
* An abstraction of the original CellLayout which supports laying out items
* which span multiple cells into a grid-like layout. Also supports dimming
* to give a preview of its contents.
*/
public class PagedViewCellLayout extends ViewGroup implements Page {
- static final String TAG = "PagedViewCellLayout";
+ private static final String TAG = "Trebuchet.PagedViewCellLayout";
private int mCellCountX;
private int mCellCountY;
@@ -66,8 +64,8 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
resources.getDimensionPixelSize(R.dimen.apps_customize_cell_width);
mOriginalCellHeight = mCellHeight =
resources.getDimensionPixelSize(R.dimen.apps_customize_cell_height);
- mCellCountX = LauncherModel.getCellCountX();
- mCellCountY = LauncherModel.getCellCountY();
+ mCellCountX = LauncherModel.getWorkspaceCellCountX();
+ mCellCountY = LauncherModel.getWorkspaceCellCountY();
mOriginalWidthGap = mOriginalHeightGap = mWidthGap = mHeightGap = -1;
mMaxGap = resources.getDimensionPixelSize(R.dimen.apps_customize_max_gap);
diff --git a/src/com/android/launcher2/PagedViewCellLayoutChildren.java b/src/com/cyanogenmod/trebuchet/PagedViewCellLayoutChildren.java
index 187a22d55..b82e197ee 100644
--- a/src/com/android/launcher2/PagedViewCellLayoutChildren.java
+++ b/src/com/cyanogenmod/trebuchet/PagedViewCellLayoutChildren.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.graphics.Rect;
@@ -27,7 +27,7 @@ import android.view.ViewGroup;
* to give a preview of its contents.
*/
public class PagedViewCellLayoutChildren extends ViewGroup {
- static final String TAG = "PagedViewCellLayout";
+ private static final String TAG = "Trebuchet.PagedViewCellLayout";
private boolean mCenterContent;
diff --git a/src/com/android/launcher2/PagedViewGridLayout.java b/src/com/cyanogenmod/trebuchet/PagedViewGridLayout.java
index 90bfe88ec..844265423 100644
--- a/src/com/android/launcher2/PagedViewGridLayout.java
+++ b/src/com/cyanogenmod/trebuchet/PagedViewGridLayout.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.view.MotionEvent;
@@ -26,7 +26,7 @@ import android.widget.GridLayout;
* The grid based layout used strictly for the widget/wallpaper tab of the AppsCustomize pane
*/
public class PagedViewGridLayout extends GridLayout implements Page {
- static final String TAG = "PagedViewGridLayout";
+ private static final String TAG = "Trebuchet.PagedViewGridLayout";
private int mCellCountX;
private int mCellCountY;
diff --git a/src/com/android/launcher2/PagedViewIcon.java b/src/com/cyanogenmod/trebuchet/PagedViewIcon.java
index d2aa31f86..d56c6e24b 100644
--- a/src/com/android/launcher2/PagedViewIcon.java
+++ b/src/com/cyanogenmod/trebuchet/PagedViewIcon.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.graphics.Bitmap;
@@ -32,7 +32,7 @@ public class PagedViewIcon extends TextView {
}
@SuppressWarnings("unused")
- private static final String TAG = "PagedViewIcon";
+ private static final String TAG = "Trebuchet.PagedViewIcon";
private static final float PRESS_ALPHA = 0.4f;
private PagedViewIcon.PressedCallback mPressedCallback;
diff --git a/src/com/android/launcher2/PagedViewIconCache.java b/src/com/cyanogenmod/trebuchet/PagedViewIconCache.java
index d65f68baf..8086fa709 100644
--- a/src/com/android/launcher2/PagedViewIconCache.java
+++ b/src/com/cyanogenmod/trebuchet/PagedViewIconCache.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import java.util.ArrayList;
import java.util.HashMap;
diff --git a/src/com/android/launcher2/PagedViewWidget.java b/src/com/cyanogenmod/trebuchet/PagedViewWidget.java
index b804ab0a2..eae0f0273 100644
--- a/src/com/android/launcher2/PagedViewWidget.java
+++ b/src/com/cyanogenmod/trebuchet/PagedViewWidget.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.appwidget.AppWidgetProviderInfo;
import android.content.Context;
@@ -29,13 +29,11 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
-import com.android.launcher.R;
-
/**
* The linear layout used strictly for the widget/wallpaper tab of the customization tray
*/
public class PagedViewWidget extends LinearLayout {
- static final String TAG = "PagedViewWidgetLayout";
+ private static final String TAG = "Trebuchet.PagedViewWidgetLayout";
private static boolean sDeletePreviewsWhenDetachedFromWindow = true;
@@ -108,8 +106,8 @@ public class PagedViewWidget extends LinearLayout {
name.setText(info.label);
final TextView dims = (TextView) findViewById(R.id.widget_dims);
if (dims != null) {
- int hSpan = Math.min(cellSpan[0], LauncherModel.getCellCountX());
- int vSpan = Math.min(cellSpan[1], LauncherModel.getCellCountY());
+ int hSpan = Math.min(cellSpan[0], LauncherModel.getWorkspaceCellCountX());
+ int vSpan = Math.min(cellSpan[1], LauncherModel.getWorkspaceCellCountY());
dims.setText(String.format(mDimensionsFormatString, hSpan, vSpan));
}
}
@@ -135,7 +133,7 @@ public class PagedViewWidget extends LinearLayout {
return maxSize;
}
- void applyPreview(FastBitmapDrawable preview, int index) {
+ void applyPreview(FastBitmapDrawable preview) {
final PagedViewWidgetImageView image =
(PagedViewWidgetImageView) findViewById(R.id.widget_preview);
if (preview != null) {
diff --git a/src/com/android/launcher2/PagedViewWidgetImageView.java b/src/com/cyanogenmod/trebuchet/PagedViewWidgetImageView.java
index 992817786..aa392bbc8 100644
--- a/src/com/android/launcher2/PagedViewWidgetImageView.java
+++ b/src/com/cyanogenmod/trebuchet/PagedViewWidgetImageView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.graphics.Canvas;
diff --git a/src/com/android/launcher2/PagedViewWithDraggableItems.java b/src/com/cyanogenmod/trebuchet/PagedViewWithDraggableItems.java
index 9cdd74f24..1f0befa6c 100644
--- a/src/com/android/launcher2/PagedViewWithDraggableItems.java
+++ b/src/com/cyanogenmod/trebuchet/PagedViewWithDraggableItems.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.util.AttributeSet;
diff --git a/src/com/android/launcher2/PendingAddItemInfo.java b/src/com/cyanogenmod/trebuchet/PendingAddItemInfo.java
index a1e7b06a5..3e6ea909f 100644
--- a/src/com/android/launcher2/PendingAddItemInfo.java
+++ b/src/com/cyanogenmod/trebuchet/PendingAddItemInfo.java
@@ -14,13 +14,14 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.appwidget.AppWidgetHostView;
import android.appwidget.AppWidgetProviderInfo;
import android.content.ComponentName;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
+import android.content.Intent;
import android.os.Parcelable;
/**
diff --git a/src/com/android/launcher2/PreloadReceiver.java b/src/com/cyanogenmod/trebuchet/PreloadReceiver.java
index 08350b6ff..c7723fcad 100644
--- a/src/com/android/launcher2/PreloadReceiver.java
+++ b/src/com/cyanogenmod/trebuchet/PreloadReceiver.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -23,7 +23,7 @@ import android.text.TextUtils;
import android.util.Log;
public class PreloadReceiver extends BroadcastReceiver {
- private static final String TAG = "Launcher.PreloadReceiver";
+ private static final String TAG = "Trebuchet.PreloadReceiver";
private static final boolean LOGD = false;
public static final String EXTRA_WORKSPACE_NAME =
@@ -36,7 +36,7 @@ public class PreloadReceiver extends BroadcastReceiver {
if (provider != null) {
String name = intent.getStringExtra(EXTRA_WORKSPACE_NAME);
final int workspaceResId = !TextUtils.isEmpty(name)
- ? context.getResources().getIdentifier(name, "xml", "com.android.launcher") : 0;
+ ? context.getResources().getIdentifier(name, "xml", "com.cyanogenmod.trebuchet") : 0;
if (LOGD) {
Log.d(TAG, "workspace name: " + name + " id: " + workspaceResId);
}
diff --git a/src/com/android/launcher2/SearchDropTargetBar.java b/src/com/cyanogenmod/trebuchet/SearchDropTargetBar.java
index fada48a25..075adae53 100644
--- a/src/com/android/launcher2/SearchDropTargetBar.java
+++ b/src/com/cyanogenmod/trebuchet/SearchDropTargetBar.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -27,7 +27,8 @@ import android.view.View;
import android.view.animation.AccelerateInterpolator;
import android.widget.FrameLayout;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
+import com.cyanogenmod.trebuchet.preference.PreferencesProvider;
/*
* Ths bar will manage the transition between the QSB search bar and the delete drop
@@ -43,11 +44,14 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
private static final AccelerateInterpolator sAccelerateInterpolator =
new AccelerateInterpolator();
+ private boolean mShowQSBSearchBar;
+
private boolean mIsSearchBarHidden;
private View mQSBSearchBar;
private View mDropTargetBar;
private ButtonDropTarget mInfoDropTarget;
private ButtonDropTarget mDeleteDropTarget;
+ private ButtonDropTarget mEditDropTarget;
private int mBarHeight;
private boolean mDeferOnDragEnd = false;
@@ -60,17 +64,22 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
public SearchDropTargetBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
+
+ mShowQSBSearchBar = PreferencesProvider.Interface.Homescreen.getShowSearchBar();
}
public void setup(Launcher launcher, DragController dragController) {
dragController.addDragListener(this);
dragController.addDragListener(mInfoDropTarget);
dragController.addDragListener(mDeleteDropTarget);
+ dragController.addDragListener(mEditDropTarget);
dragController.addDropTarget(mInfoDropTarget);
dragController.addDropTarget(mDeleteDropTarget);
+ dragController.addDropTarget(mEditDropTarget);
dragController.setFlingToDeleteDropTarget(mDeleteDropTarget);
mInfoDropTarget.setLauncher(launcher);
mDeleteDropTarget.setLauncher(launcher);
+ mEditDropTarget.setLauncher(launcher);
}
private void prepareStartAnimation(View v) {
@@ -100,14 +109,20 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
mDropTargetBar = findViewById(R.id.drag_target_bar);
mInfoDropTarget = (ButtonDropTarget) mDropTargetBar.findViewById(R.id.info_target_text);
mDeleteDropTarget = (ButtonDropTarget) mDropTargetBar.findViewById(R.id.delete_target_text);
+ mEditDropTarget = (ButtonDropTarget) mDropTargetBar.findViewById(R.id.edit_target_text);
mBarHeight = getResources().getDimensionPixelSize(R.dimen.qsb_bar_height);
mInfoDropTarget.setSearchDropTargetBar(this);
mDeleteDropTarget.setSearchDropTargetBar(this);
+ mEditDropTarget.setSearchDropTargetBar(this);
mEnableDropDownDropTargets =
getResources().getBoolean(R.bool.config_useDropTargetDownTransition);
+ if (!mShowQSBSearchBar) {
+ mQSBSearchBar.setVisibility(View.GONE);
+ }
+
// Create the various fade animations
if (mEnableDropDownDropTargets) {
mDropTargetBar.setTranslationY(-mBarHeight);
@@ -136,30 +151,34 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
*/
public void showSearchBar(boolean animated) {
if (!mIsSearchBarHidden) return;
- if (animated) {
- prepareStartAnimation(mQSBSearchBar);
- mQSBSearchBarAnim.reverse();
- } else {
- mQSBSearchBarAnim.cancel();
- if (mEnableDropDownDropTargets) {
- mQSBSearchBar.setTranslationY(0);
+ if (mShowQSBSearchBar) {
+ if (animated) {
+ prepareStartAnimation(mQSBSearchBar);
+ mQSBSearchBarAnim.reverse();
} else {
- mQSBSearchBar.setAlpha(1f);
+ mQSBSearchBarAnim.cancel();
+ if (mEnableDropDownDropTargets) {
+ mQSBSearchBar.setTranslationY(0);
+ } else {
+ mQSBSearchBar.setAlpha(1f);
+ }
}
}
mIsSearchBarHidden = false;
}
public void hideSearchBar(boolean animated) {
if (mIsSearchBarHidden) return;
- if (animated) {
- prepareStartAnimation(mQSBSearchBar);
- mQSBSearchBarAnim.start();
- } else {
- mQSBSearchBarAnim.cancel();
- if (mEnableDropDownDropTargets) {
- mQSBSearchBar.setTranslationY(-mBarHeight);
+ if (mShowQSBSearchBar) {
+ if (animated) {
+ prepareStartAnimation(mQSBSearchBar);
+ mQSBSearchBarAnim.start();
} else {
- mQSBSearchBar.setAlpha(0f);
+ mQSBSearchBarAnim.cancel();
+ if (mEnableDropDownDropTargets) {
+ mQSBSearchBar.setTranslationY(-mBarHeight);
+ } else {
+ mQSBSearchBar.setAlpha(0f);
+ }
}
}
mIsSearchBarHidden = true;
@@ -183,7 +202,7 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
// Animate out the QSB search bar, and animate in the drop target bar
prepareStartAnimation(mDropTargetBar);
mDropTargetBarAnim.start();
- if (!mIsSearchBarHidden) {
+ if (!mIsSearchBarHidden && mShowQSBSearchBar) {
prepareStartAnimation(mQSBSearchBar);
mQSBSearchBarAnim.start();
}
@@ -199,7 +218,7 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
// Restore the QSB search bar, and animate out the drop target bar
prepareStartAnimation(mDropTargetBar);
mDropTargetBarAnim.reverse();
- if (!mIsSearchBarHidden) {
+ if (!mIsSearchBarHidden && mShowQSBSearchBar) {
prepareStartAnimation(mQSBSearchBar);
mQSBSearchBarAnim.reverse();
}
diff --git a/src/com/android/launcher2/ShortcutAndWidgetContainer.java b/src/com/cyanogenmod/trebuchet/ShortcutAndWidgetContainer.java
index 8daf3954d..ade2cfb00 100644
--- a/src/com/android/launcher2/ShortcutAndWidgetContainer.java
+++ b/src/com/cyanogenmod/trebuchet/ShortcutAndWidgetContainer.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.app.WallpaperManager;
import android.content.Context;
@@ -25,7 +25,7 @@ import android.view.View;
import android.view.ViewGroup;
public class ShortcutAndWidgetContainer extends ViewGroup {
- static final String TAG = "CellLayoutChildren";
+ private static final String TAG = "Trebuchet.CellLayoutChildren";
// These are temporary variables to prevent having to allocate a new object just to
// return an (x, y) value from helper functions. Do NOT use them to maintain other state.
diff --git a/src/com/android/launcher2/ShortcutInfo.java b/src/com/cyanogenmod/trebuchet/ShortcutInfo.java
index 968d3b836..8f0d8d31b 100644
--- a/src/com/android/launcher2/ShortcutInfo.java
+++ b/src/com/cyanogenmod/trebuchet/ShortcutInfo.java
@@ -14,9 +14,10 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import java.util.ArrayList;
+import java.util.Arrays;
import android.content.ComponentName;
import android.content.ContentValues;
@@ -35,6 +36,12 @@ class ShortcutInfo extends ItemInfo {
Intent intent;
/**
+ * Indicates whether the title comes from an application's resource (if false)
+ * or from a custom title (if true.)
+ */
+ boolean customTitle;
+
+ /**
* Indicates whether the icon comes from an application's resource (if false)
* or from a custom Bitmap (if true.)
*/
@@ -57,6 +64,11 @@ class ShortcutInfo extends ItemInfo {
*/
private Bitmap mIcon;
+ /**
+ * Title change listener
+ */
+ private ShortcutListener mListener;
+
ShortcutInfo() {
itemType = LauncherSettings.BaseLauncherColumns.ITEM_TYPE_SHORTCUT;
}
@@ -119,11 +131,24 @@ class ShortcutInfo extends ItemInfo {
itemType = LauncherSettings.BaseLauncherColumns.ITEM_TYPE_APPLICATION;
}
+ public void setTitle(CharSequence title) {
+ this.title = title;
+ this.customTitle = true;
+ if (mListener != null) {
+ mListener.onTitleChanged(title);
+ }
+ }
+
+ void setListener(ShortcutListener listener) {
+ mListener = listener;
+ }
+
@Override
void onAddToDatabase(ContentValues values) {
super.onAddToDatabase(values);
- String titleStr = title != null ? title.toString() : null;
+ String titleStr = title != null && (customTitle || itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) ?
+ title.toString() : null;
values.put(LauncherSettings.BaseLauncherColumns.TITLE, titleStr);
String uri = intent != null ? intent.toUri(0) : null;
@@ -150,10 +175,10 @@ class ShortcutInfo extends ItemInfo {
@Override
public String toString() {
- return "ShortcutInfo(title=" + title.toString() + "intent=" + intent + "id=" + this.id
+ return "ShortcutInfo(title=" + (title != null ? title.toString() : "unknown ") + "intent=" + intent + "id=" + this.id
+ " type=" + this.itemType + " container=" + this.container + " screen=" + screen
+ " cellX=" + cellX + " cellY=" + cellY + " spanX=" + spanX + " spanY=" + spanY
- + " dropPos=" + dropPos + ")";
+ + " dropPos=" + Arrays.toString(dropPos) + ")";
}
public static void dumpShortcutInfoList(String tag, String label,
@@ -164,5 +189,9 @@ class ShortcutInfo extends ItemInfo {
+ " customIcon=" + info.customIcon);
}
}
+
+ interface ShortcutListener {
+ public void onTitleChanged(CharSequence title);
+ }
}
diff --git a/src/com/android/launcher2/SpringLoadedDragController.java b/src/com/cyanogenmod/trebuchet/SpringLoadedDragController.java
index d96aab794..a48a1f473 100644
--- a/src/com/android/launcher2/SpringLoadedDragController.java
+++ b/src/com/cyanogenmod/trebuchet/SpringLoadedDragController.java
@@ -14,7 +14,9 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
+
+import android.util.Log;
public class SpringLoadedDragController implements OnAlarmListener {
// how long the user must hover over a mini-screen before it unshrinks
@@ -50,10 +52,10 @@ public class SpringLoadedDragController implements OnAlarmListener {
public void onAlarm(Alarm alarm) {
if (mScreen != null) {
// Snap to the screen that we are hovering over now
- Workspace w = mLauncher.getWorkspace();
- int page = w.indexOfChild(mScreen);
- if (page != w.getCurrentPage()) {
- w.snapToPage(page);
+ PagedView pagedView = (PagedView) mScreen.getParent();
+ int page = pagedView.indexOfChild(mScreen);
+ if (page != pagedView.getCurrentPage()) {
+ pagedView.snapToPage(page);
}
} else {
mLauncher.getDragController().cancelDrag();
diff --git a/src/com/android/launcher2/StrokedTextView.java b/src/com/cyanogenmod/trebuchet/StrokedTextView.java
index 4e28d17d7..be2bd0681 100644
--- a/src/com/android/launcher2/StrokedTextView.java
+++ b/src/com/cyanogenmod/trebuchet/StrokedTextView.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.content.res.TypedArray;
@@ -27,7 +27,7 @@ import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.TextView;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
/**
* This class adds a stroke to the generic TextView allowing the text to stand out better against
@@ -105,12 +105,12 @@ public class StrokedTextView extends TextView {
final int drawableLeft = getPaddingLeft();
final int drawableTop = getPaddingTop();
final Drawable[] drawables = getCompoundDrawables();
- for (int i = 0; i < drawables.length; ++i) {
- if (drawables[i] != null) {
- drawables[i].setBounds(drawableLeft, drawableTop,
- drawableLeft + drawables[i].getIntrinsicWidth(),
- drawableTop + drawables[i].getIntrinsicHeight());
- drawables[i].draw(mCanvas);
+ for (Drawable drawable : drawables) {
+ if (drawable != null) {
+ drawable.setBounds(drawableLeft, drawableTop,
+ drawableLeft + drawable.getIntrinsicWidth(),
+ drawableTop + drawable.getIntrinsicHeight());
+ drawable.draw(mCanvas);
}
}
diff --git a/src/com/android/launcher2/UninstallShortcutReceiver.java b/src/com/cyanogenmod/trebuchet/UninstallShortcutReceiver.java
index 02590c9f6..6df068aa0 100644
--- a/src/com/android/launcher2/UninstallShortcutReceiver.java
+++ b/src/com/cyanogenmod/trebuchet/UninstallShortcutReceiver.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
@@ -25,7 +25,7 @@ import android.database.Cursor;
import android.net.Uri;
import android.widget.Toast;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
import java.net.URISyntaxException;
import java.util.ArrayList;
@@ -141,7 +141,7 @@ public class UninstallShortcutReceiver extends BroadcastReceiver {
newApps = sharedPrefs.getStringSet(InstallShortcutReceiver.NEW_APPS_LIST_KEY, newApps);
synchronized (newApps) {
do {
- appRemoved = newApps.remove(intent.toUri(0).toString());
+ appRemoved = newApps.remove(intent.toUri(0));
} while (appRemoved);
}
if (appRemoved) {
diff --git a/src/com/android/launcher2/UserInitializeReceiver.java b/src/com/cyanogenmod/trebuchet/UserInitializeReceiver.java
index bf3330acc..9bd11a108 100644
--- a/src/com/android/launcher2/UserInitializeReceiver.java
+++ b/src/com/cyanogenmod/trebuchet/UserInitializeReceiver.java
@@ -14,12 +14,12 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import java.io.IOException;
import java.util.ArrayList;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
import android.app.WallpaperManager;
import android.content.BroadcastReceiver;
@@ -36,7 +36,7 @@ public class UserInitializeReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
final Resources resources = context.getResources();
// Context.getPackageName() may return the "original" package name,
- // com.android.launcher2; Resources needs the real package name,
+ // com.cyanogenmod.trebuchet; Resources needs the real package name,
// com.android.launcher. So we ask Resources for what it thinks the
// package name should be.
final String packageName = resources.getResourcePackageName(R.array.wallpapers);
@@ -51,6 +51,7 @@ public class UserInitializeReceiver extends BroadcastReceiver {
try {
wpm.setResource(resid);
} catch (IOException e) {
+ // Ignore
}
return;
}
diff --git a/src/com/android/launcher2/Utilities.java b/src/com/cyanogenmod/trebuchet/Utilities.java
index d3e451642..b9520b3a5 100644
--- a/src/com/android/launcher2/Utilities.java
+++ b/src/com/cyanogenmod/trebuchet/Utilities.java
@@ -14,9 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
-
-import java.util.Random;
+package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.content.res.Resources;
@@ -34,14 +32,12 @@ import android.graphics.drawable.Drawable;
import android.graphics.drawable.PaintDrawable;
import android.util.DisplayMetrics;
-import com.android.launcher.R;
-
/**
* Various utilities shared amongst the Launcher's classes.
*/
final class Utilities {
@SuppressWarnings("unused")
- private static final String TAG = "Launcher.Utilities";
+ private static final String TAG = "Trebuchet.Utilities";
private static int sIconWidth = -1;
private static int sIconHeight = -1;
@@ -249,27 +245,4 @@ final class Utilities {
sDisabledPaint.setColorFilter(new ColorMatrixColorFilter(cm));
sDisabledPaint.setAlpha(0x88);
}
-
- /** Only works for positive numbers. */
- static int roundToPow2(int n) {
- int orig = n;
- n >>= 1;
- int mask = 0x8000000;
- while (mask != 0 && (n & mask) == 0) {
- mask >>= 1;
- }
- while (mask != 0) {
- n |= mask;
- mask >>= 1;
- }
- n += 1;
- if (n != orig) {
- n <<= 1;
- }
- return n;
- }
-
- static int generateRandomId() {
- return new Random(System.currentTimeMillis()).nextInt(1 << 24);
- }
}
diff --git a/src/com/android/launcher2/WallpaperChooser.java b/src/com/cyanogenmod/trebuchet/WallpaperChooser.java
index 77e1e6ffb..c220706db 100644
--- a/src/com/android/launcher2/WallpaperChooser.java
+++ b/src/com/cyanogenmod/trebuchet/WallpaperChooser.java
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.R;
import android.app.Activity;
import android.app.DialogFragment;
@@ -25,7 +25,7 @@ import android.os.Bundle;
public class WallpaperChooser extends Activity {
@SuppressWarnings("unused")
- private static final String TAG = "Launcher.WallpaperChooser";
+ private static final String TAG = "Trebuchet.WallpaperChooser";
@Override
public void onCreate(Bundle icicle) {
diff --git a/src/com/android/launcher2/WallpaperChooserDialogFragment.java b/src/com/cyanogenmod/trebuchet/WallpaperChooserDialogFragment.java
index b99d8ecb3..b140a4195 100644
--- a/src/com/android/launcher2/WallpaperChooserDialogFragment.java
+++ b/src/com/cyanogenmod/trebuchet/WallpaperChooserDialogFragment.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.app.Activity;
import android.app.Dialog;
@@ -34,23 +34,21 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
-import android.widget.AdapterView;
import android.widget.BaseAdapter;
-import android.widget.Gallery;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.SpinnerAdapter;
-
-import com.android.launcher.R;
+import com.cyanogenmod.trebuchet.widget.CustomAdapterView;
+import com.cyanogenmod.trebuchet.widget.EcoGallery;
import java.io.IOException;
import java.util.ArrayList;
public class WallpaperChooserDialogFragment extends DialogFragment implements
- AdapterView.OnItemSelectedListener, AdapterView.OnItemClickListener {
+ CustomAdapterView.OnItemSelectedListener, CustomAdapterView.OnItemClickListener {
- private static final String TAG = "Launcher.WallpaperChooserDialogFragment";
- private static final String EMBEDDED_KEY = "com.android.launcher2."
+ private static final String TAG = "Trebuchet.WallpaperChooserDialogFragment";
+ private static final String EMBEDDED_KEY = "com.cyanogenmod.trebuchet."
+ "WallpaperChooserDialogFragment.EMBEDDED_KEY";
private boolean mEmbedded;
@@ -139,7 +137,7 @@ public class WallpaperChooserDialogFragment extends DialogFragment implements
View view = inflater.inflate(R.layout.wallpaper_chooser, container, false);
view.setBackground(mWallpaperDrawable);
- final Gallery gallery = (Gallery) view.findViewById(R.id.gallery);
+ final EcoGallery gallery = (EcoGallery) view.findViewById(R.id.gallery);
gallery.setCallbackDuringFling(false);
gallery.setOnItemSelectedListener(this);
gallery.setAdapter(new ImageAdapter(getActivity()));
@@ -171,13 +169,13 @@ public class WallpaperChooserDialogFragment extends DialogFragment implements
// Click handler for the Dialog's GridView
@Override
- public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+ public void onItemClick(CustomAdapterView<?> parent, View view, int position, long id) {
selectWallpaper(position);
}
// Selection handler for the embedded Gallery view
@Override
- public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+ public void onItemSelected(CustomAdapterView<?> parent, View view, int position, long id) {
if (mLoader != null && mLoader.getStatus() != WallpaperLoader.Status.FINISHED) {
mLoader.cancel();
}
@@ -185,7 +183,7 @@ public class WallpaperChooserDialogFragment extends DialogFragment implements
}
@Override
- public void onNothingSelected(AdapterView<?> parent) {
+ public void onNothingSelected(CustomAdapterView<?> parent) {
}
private void findWallpapers() {
@@ -194,8 +192,8 @@ public class WallpaperChooserDialogFragment extends DialogFragment implements
final Resources resources = getResources();
// Context.getPackageName() may return the "original" package name,
- // com.android.launcher2; Resources needs the real package name,
- // com.android.launcher. So we ask Resources for what it thinks the
+ // com.cyanogenmod.trebuchet; Resources needs the real package name,
+ // com.cyanogenmod.trebuchet. So we ask Resources for what it thinks the
// package name should be.
final String packageName = resources.getResourcePackageName(R.array.wallpapers);
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/cyanogenmod/trebuchet/Workspace.java
index 2c44aca07..cab5f61b2 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/cyanogenmod/trebuchet/Workspace.java
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2008 The Android Open Source Project
+ * Copytight (C) 2011 The CyanogenMod Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +15,7 @@
* limitations under the License.
*/
-package com.android.launcher2;
+package com.cyanogenmod.trebuchet;
import android.animation.Animator;
import android.animation.AnimatorSet;
@@ -32,29 +33,36 @@ import android.content.SharedPreferences;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
+import android.graphics.Camera;
import android.graphics.Canvas;
import android.graphics.Matrix;
+import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.Region.Op;
+import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.IBinder;
import android.os.Parcelable;
import android.util.AttributeSet;
+import android.util.DisplayMetrics;
import android.util.Log;
import android.util.SparseArray;
import android.view.Display;
+import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
+import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
+import android.view.animation.Interpolator;
import android.widget.ImageView;
import android.widget.TextView;
-import com.android.launcher.R;
-import com.android.launcher2.FolderIcon.FolderRingAnimator;
-import com.android.launcher2.LauncherSettings.Favorites;
+import com.cyanogenmod.trebuchet.FolderIcon.FolderRingAnimator;
+import com.cyanogenmod.trebuchet.LauncherSettings.Favorites;
+import com.cyanogenmod.trebuchet.preference.PreferencesProvider;
import java.net.URISyntaxException;
import java.util.ArrayList;
@@ -67,12 +75,13 @@ import java.util.Set;
* Each page contains a number of icons, folders or widgets the user can
* interact with. A workspace is meant to be used with a fixed width only.
*/
-public class Workspace extends SmoothPagedView
+public class Workspace extends PagedView
implements DropTarget, DragSource, DragScroller, View.OnTouchListener,
DragController.DragListener, LauncherTransitionable, ViewGroup.OnHierarchyChangeListener {
- private static final String TAG = "Launcher.Workspace";
+ private static final String TAG = "Trebuchet.Workspace";
// Y rotation to apply to the workspace screens
+ private static final float WORKSPACE_ROTATION = 12.5f;
private static final float WORKSPACE_OVERSCROLL_ROTATION = 24f;
private static final int CHILDREN_OUTLINE_FADE_OUT_DELAY = 0;
@@ -83,6 +92,9 @@ public class Workspace extends SmoothPagedView
private static final int ADJACENT_SCREEN_DROP_DURATION = 300;
private static final int FLING_THRESHOLD_VELOCITY = 500;
+ // Pivot point for rotate anim
+ private float mRotatePivotPoint = -1;
+
// These animators are used to fade the children's outlines
private ObjectAnimator mChildrenOutlineFadeInAnimation;
private ObjectAnimator mChildrenOutlineFadeOutAnimation;
@@ -94,16 +106,16 @@ public class Workspace extends SmoothPagedView
private Drawable mBackground;
boolean mDrawBackground = true;
private float mBackgroundAlpha = 0;
- private float mOverScrollMaxBackgroundAlpha = 0.0f;
private float mWallpaperScrollRatio = 1.0f;
- private int mOriginalPageSpacing;
private final WallpaperManager mWallpaperManager;
+ private boolean mWallpaperHack;
+ private Bitmap mWallpaperBitmap;
+ private float mWallpaperScroll;
+ private int[] mWallpaperOffsets = new int[2];
+ private Paint mPaint = new Paint();
private IBinder mWindowToken;
- private static final float WALLPAPER_SCREENS_SPAN = 2f;
-
- private int mDefaultPage;
/**
* CellInfo for the cell that is currently being dragged
@@ -143,9 +155,7 @@ public class Workspace extends SmoothPagedView
private int[] mTempCell = new int[2];
private int[] mTempEstimate = new int[2];
private float[] mDragViewVisualCenter = new float[2];
- private float[] mTempDragCoordinates = new float[2];
private float[] mTempCellLayoutCenterCoordinates = new float[2];
- private float[] mTempDragBottomRightCoordinates = new float[2];
private Matrix mTempInverseMatrix = new Matrix();
private SpringLoadedDragController mSpringLoadedDragController;
@@ -157,7 +167,7 @@ public class Workspace extends SmoothPagedView
// State variable that indicates whether the pages are small (ie when you're
// in all apps or customize mode)
- enum State { NORMAL, SPRING_LOADED, SMALL };
+ enum State { NORMAL, SPRING_LOADED, SMALL }
private State mState = State.NORMAL;
private boolean mIsSwitchingState = false;
@@ -165,6 +175,8 @@ public class Workspace extends SmoothPagedView
boolean mIsDragOccuring = false;
boolean mChildrenLayersEnabled = true;
+ private boolean mIsLandscape;
+
/** Is the user is dragging an item near the edge of a page? */
private boolean mInScrollArea = false;
@@ -174,21 +186,24 @@ public class Workspace extends SmoothPagedView
private final int[] mTempXY = new int[2];
private int[] mTempVisiblePagesRange = new int[2];
private float mOverscrollFade = 0;
- private boolean mOverscrollTransformsSet;
+ private boolean mScrollTransformsDirty = false;
+ private boolean mOverscrollTransformsDirty = false;
public static final int DRAG_BITMAP_PADDING = 2;
- private boolean mWorkspaceFadeInAdjacentScreens;
- enum WallpaperVerticalOffset { TOP, MIDDLE, BOTTOM };
+ // Camera and Matrix used to determine the final position of a neighboring CellLayout
+ private final Matrix mMatrix = new Matrix();
+ private final Camera mCamera = new Camera();
+ private final float mTempFloat2[] = new float[2];
+
int mWallpaperWidth;
int mWallpaperHeight;
- WallpaperOffsetInterpolator mWallpaperOffset;
+ WallpaperOffsetInterpolator mWallpaperInterpolator;
boolean mUpdateWallpaperOffsetImmediately = false;
private Runnable mDelayedResizeRunnable;
private Runnable mDelayedSnapToPageRunnable;
private Point mDisplaySize = new Point();
private boolean mIsStaticWallpaper;
private int mWallpaperTravelWidth;
- private int mSpringLoadedPageSpacing;
private int mCameraDistance;
// Variables relating to the creation of user folders by hovering shortcuts over shortcuts
@@ -244,21 +259,61 @@ public class Workspace extends SmoothPagedView
private float[] mOldScaleYs;
private float[] mOldBackgroundAlphas;
private float[] mOldAlphas;
+ private float[] mOldRotations;
+ private float[] mOldRotationYs;
private float[] mNewTranslationXs;
private float[] mNewTranslationYs;
private float[] mNewScaleXs;
private float[] mNewScaleYs;
private float[] mNewBackgroundAlphas;
private float[] mNewAlphas;
+ private float[] mNewRotations;
private float[] mNewRotationYs;
private float mTransitionProgress;
+ public enum TransitionEffect {
+ Standard,
+ Tablet,
+ ZoomIn,
+ ZoomOut,
+ RotateUp,
+ RotateDown,
+ Spin,
+ Flip,
+ CubeIn,
+ CubeOut,
+ Stack,
+ Accordian,
+ CylinderIn,
+ CylinderOut
+ }
+ private TransitionEffect mTransitionEffect = TransitionEffect.Standard;
+
private final Runnable mBindPages = new Runnable() {
@Override
public void run() {
mLauncher.getModel().bindRemainingSynchronousPages();
}
};
+ // Preferences
+ private int mNumberHomescreens;
+ private int mDefaultHomescreen;
+ private boolean mStretchScreens;
+ private boolean mShowSearchBar;
+ private boolean mShowHotseat;
+ private boolean mResizeAnyWidget;
+ private boolean mHideIconLabels;
+ private boolean mScrollWallpaper;
+ private int mWallpaperSize;
+ private boolean mShowScrollingIndicator;
+ private boolean mFadeScrollingIndicator;
+ private int mScrollingIndicatorPosition;
+ private boolean mShowDockDivider;
+ private boolean mShowOutlines;
+
+ private static final int SCROLLING_INDICATOR_DOCK = 0;
+ private static final int SCROLLING_INDICATOR_TOP = 1;
+ private static final int SCROLLING_INDICATOR_BOTTOM = 2;
/**
* Used to inflate the Workspace from XML.
@@ -280,7 +335,6 @@ public class Workspace extends SmoothPagedView
public Workspace(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mContentIsRefreshable = false;
- mOriginalPageSpacing = mPageSpacing;
mDragEnforcer = new DropTarget.DragEnforcer(context);
// With workspace, data is available straight from the get-go
@@ -288,10 +342,11 @@ public class Workspace extends SmoothPagedView
mLauncher = (Launcher) context;
final Resources res = getResources();
- mWorkspaceFadeInAdjacentScreens = res.getBoolean(R.bool.config_workspaceFadeAdjacentScreens);
- mFadeInAdjacentScreens = false;
+ mHandleFadeInAdjacentScreens = true;
mWallpaperManager = WallpaperManager.getInstance(context);
+ mUsePagingTouchSlop = false;
+
int cellCountX = DEFAULT_CELL_COUNT_X;
int cellCountY = DEFAULT_CELL_COUNT_Y;
@@ -299,48 +354,59 @@ public class Workspace extends SmoothPagedView
R.styleable.Workspace, defStyle, 0);
if (LauncherApplication.isScreenLarge()) {
- // Determine number of rows/columns dynamically
- // TODO: This code currently fails on tablets with an aspect ratio < 1.3.
- // Around that ratio we should make cells the same size in portrait and
- // landscape
- TypedArray actionBarSizeTypedArray =
- context.obtainStyledAttributes(new int[] { android.R.attr.actionBarSize });
- final float actionBarHeight = actionBarSizeTypedArray.getDimension(0, 0f);
-
- Point minDims = new Point();
- Point maxDims = new Point();
- mLauncher.getWindowManager().getDefaultDisplay().getCurrentSizeRange(minDims, maxDims);
-
- cellCountX = 1;
- while (CellLayout.widthInPortrait(res, cellCountX + 1) <= minDims.x) {
- cellCountX++;
- }
-
- cellCountY = 1;
- while (actionBarHeight + CellLayout.heightInLandscape(res, cellCountY + 1)
- <= minDims.y) {
- cellCountY++;
- }
+ int[] cellCount = getCellCountsForLarge(context);
+ cellCountX = cellCount[0];
+ cellCountY = cellCount[1];
}
mSpringLoadedShrinkFactor =
res.getInteger(R.integer.config_workspaceSpringLoadShrinkPercentage) / 100.0f;
- mSpringLoadedPageSpacing =
- res.getDimensionPixelSize(R.dimen.workspace_spring_loaded_page_spacing);
mCameraDistance = res.getInteger(R.integer.config_cameraDistance);
// if the value is manually specified, use that instead
cellCountX = a.getInt(R.styleable.Workspace_cellCountX, cellCountX);
cellCountY = a.getInt(R.styleable.Workspace_cellCountY, cellCountY);
- mDefaultPage = a.getInt(R.styleable.Workspace_defaultScreen, 1);
a.recycle();
setOnHierarchyChangeListener(this);
+ // if there is a value set it the preferences, use that instead
+ if (!LauncherApplication.isScreenLarge()) {
+ cellCountX = PreferencesProvider.Interface.Homescreen.getCellCountX(cellCountX);
+ cellCountY = PreferencesProvider.Interface.Homescreen.getCellCountY(cellCountY);
+ }
+
LauncherModel.updateWorkspaceLayoutCells(cellCountX, cellCountY);
setHapticFeedbackEnabled(false);
+ // Preferences
+ mNumberHomescreens = PreferencesProvider.Interface.Homescreen.getNumberHomescreens();
+ mDefaultHomescreen = PreferencesProvider.Interface.Homescreen.getDefaultHomescreen(mNumberHomescreens / 2);
+ if (mDefaultHomescreen >= mNumberHomescreens) {
+ mDefaultHomescreen = mNumberHomescreens / 2;
+ }
+
+ mStretchScreens = PreferencesProvider.Interface.Homescreen.getStretchScreens();
+ mShowSearchBar = PreferencesProvider.Interface.Homescreen.getShowSearchBar();
+ mShowHotseat = PreferencesProvider.Interface.Dock.getShowDock();
+ mHideIconLabels = PreferencesProvider.Interface.Homescreen.getHideIconLabels();
+ mTransitionEffect = PreferencesProvider.Interface.Homescreen.Scrolling.getTransitionEffect(
+ res.getString(R.string.config_workspaceDefaultTransitionEffect));
+ mScrollWallpaper = PreferencesProvider.Interface.Homescreen.Scrolling.getScrollWallpaper();
+ mWallpaperHack = PreferencesProvider.Interface.Homescreen.Scrolling.getWallpaperHack(
+ res.getBoolean(R.bool.config_workspaceDefaultWallpaperHack));
+ mWallpaperSize = PreferencesProvider.Interface.Homescreen.Scrolling.getWallpaperSize();
+ mShowOutlines = PreferencesProvider.Interface.Homescreen.Scrolling.getShowOutlines(
+ res.getBoolean(R.bool.config_workspaceDefaultShowOutlines));
+ mFadeInAdjacentScreens = PreferencesProvider.Interface.Homescreen.Scrolling.getFadeInAdjacentScreens(
+ res.getBoolean(R.bool.config_workspaceDefualtFadeInAdjacentScreens));
+ mShowScrollingIndicator = PreferencesProvider.Interface.Homescreen.Indicator.getShowScrollingIndicator();
+ mFadeScrollingIndicator = PreferencesProvider.Interface.Homescreen.Indicator.getFadeScrollingIndicator();
+ mScrollingIndicatorPosition = PreferencesProvider.Interface.Homescreen.Indicator.getScrollingIndicatorPosition();
+ mShowDockDivider = PreferencesProvider.Interface.Dock.getShowDivider() && mShowHotseat;
+
initWorkspace();
+ checkWallpaper();
// Disable multitouch across the workspace/all apps/customize tray
setMotionEventSplittingEnabled(true);
@@ -351,14 +417,43 @@ public class Workspace extends SmoothPagedView
}
}
+ public static int[] getCellCountsForLarge(Context context) {
+ int[] cellCount = new int[2];
+
+ final Resources res = context.getResources();
+ // Determine number of rows/columns dynamically
+ // TODO: This code currently fails on tablets with an aspect ratio < 1.3.
+ // Around that ratio we should make cells the same size in portrait and
+ // landscape
+ TypedArray actionBarSizeTypedArray =
+ context.obtainStyledAttributes(new int[] { android.R.attr.actionBarSize });
+ DisplayMetrics displayMetrics = res.getDisplayMetrics();
+ final float actionBarHeight = actionBarSizeTypedArray.getDimension(0, 0f);
+ final float systemBarHeight = res.getDimension(R.dimen.status_bar_height);
+ final float smallestScreenDim = res.getConfiguration().smallestScreenWidthDp *
+ displayMetrics.density;
+
+ cellCount[0] = 1;
+ while (CellLayout.widthInPortrait(res, cellCount[0] + 1) <= smallestScreenDim) {
+ cellCount[0]++;
+ }
+
+ cellCount[1] = 1;
+ while (actionBarHeight + CellLayout.heightInLandscape(res, cellCount[1] + 1)
+ <= smallestScreenDim - systemBarHeight) {
+ cellCount[1]++;
+ }
+ return cellCount;
+ }
+
// estimate the size of a widget with spans hSpan, vSpan. return MAX_VALUE for each
// dimension if unsuccessful
public int[] estimateItemSize(int hSpan, int vSpan,
- ItemInfo itemInfo, boolean springLoaded) {
+ boolean springLoaded) {
int[] size = new int[2];
if (getChildCount() > 0) {
CellLayout cl = (CellLayout) mLauncher.getWorkspace().getChildAt(0);
- Rect r = estimateItemPosition(cl, itemInfo, 0, 0, hSpan, vSpan);
+ Rect r = estimateItemPosition(cl, 0, 0, hSpan, vSpan);
size[0] = r.width();
size[1] = r.height();
if (springLoaded) {
@@ -372,8 +467,7 @@ public class Workspace extends SmoothPagedView
return size;
}
}
- public Rect estimateItemPosition(CellLayout cl, ItemInfo pendingInfo,
- int hCell, int vCell, int hSpan, int vSpan) {
+ public Rect estimateItemPosition(CellLayout cl, int hCell, int vCell, int hSpan, int vSpan) {
Rect r = new Rect();
cl.cellToRect(hCell, vCell, hSpan, vSpan, r);
return r;
@@ -393,6 +487,7 @@ public class Workspace extends SmoothPagedView
mIsDragOccuring = false;
updateChildrenLayersEnabled(false);
mLauncher.unlockScreenOrientation(false);
+ mLauncher.getHotseat().setChildrenOutlineAlpha(0f);
// Re-enable any Un/InstallShortcutReceiver and now process any queued items
InstallShortcutReceiver.disableAndFlushInstallQueue(getContext());
@@ -404,33 +499,81 @@ public class Workspace extends SmoothPagedView
*/
protected void initWorkspace() {
Context context = getContext();
- mCurrentPage = mDefaultPage;
- Launcher.setScreen(mCurrentPage);
+ mCurrentPage = mDefaultHomescreen;
LauncherApplication app = (LauncherApplication)context.getApplicationContext();
mIconCache = app.getIconCache();
setWillNotDraw(false);
setChildrenDrawnWithCacheEnabled(true);
final Resources res = getResources();
+
+ LayoutInflater inflater =
+ (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ for (int i = 0; i < mNumberHomescreens; i++) {
+ CellLayout screen = (CellLayout) inflater.inflate(R.layout.workspace_screen, null);
+ if (mStretchScreens) {
+ screen.setCellGaps(-1, -1);
+ }
+ addView(screen);
+ }
+
try {
mBackground = res.getDrawable(R.drawable.apps_customize_bg);
} catch (Resources.NotFoundException e) {
// In this case, we will skip drawing background protection
}
- mWallpaperOffset = new WallpaperOffsetInterpolator();
+ if (!mShowSearchBar) {
+ int paddingLeft = (int) res.getDimension(R.dimen.workspace_left_padding_qsb_hidden);
+ int paddingTop = (int) res.getDimension(R.dimen.workspace_top_padding_qsb_hidden);
+ setPadding(paddingLeft, paddingTop, getPaddingRight(), getPaddingBottom());
+ }
+
+ if (!mShowHotseat) {
+ int paddingRight = (int) res.getDimension(R.dimen.workspace_right_padding_hotseat_hidden);
+ int paddingBottom = (int) res.getDimension(R.dimen.workspace_bottom_padding_hotseat_hidden);
+ setPadding(getPaddingLeft(), getPaddingTop(), paddingRight, paddingBottom);
+
+ View dockScrollingIndicator = findViewById(R.id.paged_view_indicator_dock);
+ ((MarginLayoutParams)dockScrollingIndicator.getLayoutParams()).bottomMargin = 0;
+ }
+
+ if (!mShowScrollingIndicator) {
+ disableScrollingIndicator();
+ }
+
+ mWallpaperInterpolator = new WallpaperOffsetInterpolator();
Display display = mLauncher.getWindowManager().getDefaultDisplay();
display.getSize(mDisplaySize);
- mWallpaperTravelWidth = (int) (mDisplaySize.x *
- wallpaperTravelToScreenWidthRatio(mDisplaySize.x, mDisplaySize.y));
+ if (mScrollWallpaper) {
+ mWallpaperTravelWidth = (int) (mDisplaySize.x *
+ wallpaperTravelToScreenWidthRatio(mDisplaySize.x, mDisplaySize.y));
+ }
mMaxDistanceForFolderCreation = (0.55f * res.getDimensionPixelSize(R.dimen.app_icon_size));
mFlingThresholdVelocity = (int) (FLING_THRESHOLD_VELOCITY * mDensity);
}
- @Override
- protected int getScrollMode() {
- return SmoothPagedView.X_LARGE_MODE;
+ protected void checkWallpaper() {
+ if (mWallpaperHack) {
+ if (mWallpaperBitmap != null) {
+ mWallpaperBitmap = null;
+ }
+ if (mWallpaperManager.getWallpaperInfo() == null) {
+ Drawable wallpaper = mWallpaperManager.getDrawable();
+ if (wallpaper instanceof BitmapDrawable) {
+ mWallpaperBitmap = ((BitmapDrawable) wallpaper).getBitmap();
+ }
+ }
+ }
+ mLauncher.setWallpaperVisibility(mWallpaperBitmap == null);
+
+ // Make sure wallpaper gets redrawn to avoid ghost wallpapers
+ invalidate();
+ }
+
+ public boolean isRenderingWallpaper() {
+ return mWallpaperHack && mWallpaperBitmap != null;
}
@Override
@@ -512,30 +655,44 @@ public class Workspace extends SmoothPagedView
+ " (was " + screen + "); skipping child");
return;
}
+ } else if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
+ if (screen < 0 || screen >= mLauncher.getHotseat().getChildCount()) {
+ Log.e(TAG, "The screen must be >= 0 and < " + getChildCount()
+ + " (was " + screen + "); skipping child");
+ return;
+ }
}
final CellLayout layout;
if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
- layout = mLauncher.getHotseat().getLayout();
+ // 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
+ y = mLauncher.getHotseat().getCellYFromOrder(x);
+ x = mLauncher.getHotseat().getCellXFromOrder(x);
+ screen = mLauncher.getHotseat().getScreenFromOrder(screen);
+ layout = (CellLayout) mLauncher.getHotseat().getPageAt(screen);
child.setOnKeyListener(null);
- // Hide folder title in the hotseat
+ // Hide titles in the hotseat
if (child instanceof FolderIcon) {
((FolderIcon) child).setTextVisible(false);
- }
-
- if (screen < 0) {
- screen = mLauncher.getHotseat().getOrderInHotseat(x, y);
- } else {
- // 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
- x = mLauncher.getHotseat().getCellXFromOrder(screen);
- y = mLauncher.getHotseat().getCellYFromOrder(screen);
+ } else if (child instanceof BubbleTextView) {
+ ((BubbleTextView) child).setTextVisible(false);
}
} else {
- // Show folder title if not in the hotseat
- if (child instanceof FolderIcon) {
- ((FolderIcon) child).setTextVisible(true);
+ if (!mHideIconLabels) {
+ // Show titles if not in the hotseat
+ if (child instanceof FolderIcon) {
+ ((FolderIcon) child).setTextVisible(true);
+ } else if (child instanceof BubbleTextView) {
+ ((BubbleTextView) child).setTextVisible(true);
+ }
+ } else {
+ if (child instanceof FolderIcon) {
+ ((FolderIcon) child).setTextVisible(false);
+ } else if (child instanceof BubbleTextView) {
+ ((BubbleTextView) child).setTextVisible(false);
+ }
}
layout = (CellLayout) getChildAt(screen);
@@ -559,7 +716,7 @@ public class Workspace extends SmoothPagedView
}
// Get the canonical child id to uniquely represent this view in this screen
- int childId = LauncherModel.getCellLayoutChildId(container, screen, x, y, spanX, spanY);
+ int childId = LauncherModel.getCellLayoutChildId(container, screen, x, y);
boolean markCellsAsOccupied = !(child instanceof Folder);
if (!layout.addViewToCellLayout(child, insert ? 0 : -1, childId, lp, markCellsAsOccupied)) {
// TODO: This branch occurs when the workspace is adding views
@@ -639,11 +796,7 @@ public class Workspace extends SmoothPagedView
@Override
public boolean dispatchUnhandledMove(View focused, int direction) {
- if (isSmall() || !isFinishedSwitchingState()) {
- // when the home screens are shrunken, shouldn't allow side-scrolling
- return false;
- }
- return super.dispatchUnhandledMove(focused, direction);
+ return !isSmall() && isFinishedSwitchingState() && super.dispatchUnhandledMove(focused, direction);
}
@Override
@@ -739,15 +892,14 @@ public class Workspace extends SmoothPagedView
}
}
- // Only show page outlines as we pan if we are on large screen
- if (LauncherApplication.isScreenLarge()) {
+ if (mShowOutlines) {
showOutlines();
- mIsStaticWallpaper = mWallpaperManager.getWallpaperInfo() == null;
}
+ mIsStaticWallpaper = mWallpaperManager.getWallpaperInfo() == null;
// If we are not fading in adjacent screens, we still need to restore the alpha in case the
// user scrolls while we are transitioning (should not affect dispatchDraw optimizations)
- if (!mWorkspaceFadeInAdjacentScreens) {
+ if (!mFadeInAdjacentScreens) {
for (int i = 0; i < getChildCount(); ++i) {
((CellLayout) getPageAt(i)).setShortcutAndWidgetAlpha(1f);
}
@@ -755,10 +907,16 @@ public class Workspace extends SmoothPagedView
// Show the scroll indicator as you pan the page
showScrollingIndicator(false);
+
+ if (mScrollWallpaper && mWallpaperHack && mWallpaperBitmap != null) {
+ mLauncher.setWallpaperVisibility(false);
+ }
}
protected void onPageEndMoving() {
- super.onPageEndMoving();
+ if (mFadeScrollingIndicator) {
+ hideScrollingIndicator(false);
+ }
if (isHardwareAccelerated()) {
updateChildrenLayersEnabled(false);
@@ -774,17 +932,16 @@ public class Workspace extends SmoothPagedView
mDragController.forceMoveEvent();
}
} else {
- // If we are not mid-dragging, hide the page outlines if we are on a large screen
- if (LauncherApplication.isScreenLarge()) {
+ // If we are not mid-dragging, hide the page outlines
+ if (mShowOutlines) {
hideOutlines();
}
// Hide the scroll indicator as you pan the page
- if (!mDragController.isDragging()) {
+ if (mFadeScrollingIndicator && !mDragController.isDragging()) {
hideScrollingIndicator(false);
}
}
- mOverScrollMaxBackgroundAlpha = 0.0f;
if (mDelayedResizeRunnable != null) {
mDelayedResizeRunnable.run();
@@ -795,13 +952,36 @@ public class Workspace extends SmoothPagedView
mDelayedSnapToPageRunnable.run();
mDelayedSnapToPageRunnable = null;
}
+
+ // Update wallpaper offsets to match hack (for recent apps window)
+ if (mScrollWallpaper && mWallpaperHack && mWallpaperBitmap != null) {
+ mLauncher.setWallpaperVisibility(true);
+ mWallpaperManager.setWallpaperOffsetSteps(1.0f / (getChildCount() - 1), 1.0f);
+ mWallpaperManager.setWallpaperOffsets(mWindowToken, mWallpaperScroll, 0);
+ }
}
@Override
- protected void notifyPageSwitchListener() {
- super.notifyPageSwitchListener();
- Launcher.setScreen(mCurrentPage);
- };
+ protected int getScrollingIndicatorId() {
+ switch (mScrollingIndicatorPosition) {
+ case SCROLLING_INDICATOR_TOP:
+ return R.id.paged_view_indicator_top;
+ case SCROLLING_INDICATOR_BOTTOM:
+ return R.id.paged_view_indicator_bottom;
+ case SCROLLING_INDICATOR_DOCK:
+ default:
+ return R.id.paged_view_indicator_dock;
+ }
+ }
+
+ @Override
+ protected void flashScrollingIndicator(boolean animated) {
+ if (mFadeScrollingIndicator) {
+ super.flashScrollingIndicator(animated);
+ } else {
+ showScrollingIndicator(true);
+ }
+ }
// As a ratio of screen height, the total distance we want the parallax effect to span
// horizontally
@@ -849,12 +1029,18 @@ public class Workspace extends SmoothPagedView
mWallpaperWidth = (int) (maxDim * wallpaperTravelToScreenWidthRatio(maxDim, minDim));
mWallpaperHeight = maxDim;
} else {
- mWallpaperWidth = Math.max((int) (minDim * WALLPAPER_SCREENS_SPAN), maxDim);
+ int screens = mWallpaperSize;
+ mWallpaperWidth = Math.max(minDim * screens, maxDim);
mWallpaperHeight = maxDim;
}
new Thread("setWallpaperDimension") {
public void run() {
mWallpaperManager.suggestDesiredDimensions(mWallpaperWidth, mWallpaperHeight);
+ post(new Runnable() {
+ public void run() {
+ checkWallpaper();
+ }
+ });
}
}.start();
}
@@ -896,7 +1082,14 @@ public class Workspace extends SmoothPagedView
private void syncWallpaperOffsetWithScroll() {
final boolean enableWallpaperEffects = isHardwareAccelerated();
if (enableWallpaperEffects) {
- mWallpaperOffset.setFinalX(wallpaperOffsetForCurrentScroll());
+ mWallpaperInterpolator.setFinalX(wallpaperOffsetForCurrentScroll());
+ }
+ }
+
+ private void centerWallpaperOffset() {
+ mWallpaperScroll = 0.5f;
+ if (mWindowToken != null) {
+ mWallpaperManager.setWallpaperOffsets(mWindowToken, 0.5f, 0);
}
}
@@ -905,20 +1098,20 @@ public class Workspace extends SmoothPagedView
}
private void updateWallpaperOffsets() {
- boolean updateNow = false;
- boolean keepUpdating = true;
+ boolean updateNow;
+ boolean keepUpdating;
if (mUpdateWallpaperOffsetImmediately) {
updateNow = true;
keepUpdating = false;
- mWallpaperOffset.jumpToFinal();
+ mWallpaperInterpolator.jumpToFinal();
mUpdateWallpaperOffsetImmediately = false;
} else {
- updateNow = keepUpdating = mWallpaperOffset.computeScrollOffset();
+ updateNow = keepUpdating = mWallpaperInterpolator.computeScrollOffset();
}
if (updateNow) {
- if (mWindowToken != null) {
- mWallpaperManager.setWallpaperOffsets(mWindowToken,
- mWallpaperOffset.getCurrX(), mWallpaperOffset.getCurrY());
+ mWallpaperScroll = mWallpaperInterpolator.getCurrX();
+ if (!mWallpaperHack && mWindowToken != null) {
+ mWallpaperManager.setWallpaperOffsets(mWindowToken, mWallpaperScroll, 0);
}
}
if (keepUpdating) {
@@ -929,13 +1122,17 @@ public class Workspace extends SmoothPagedView
@Override
protected void updateCurrentPageScroll() {
super.updateCurrentPageScroll();
- computeWallpaperScrollRatio(mCurrentPage);
+ if (mScrollWallpaper) {
+ computeWallpaperScrollRatio(mCurrentPage);
+ }
}
@Override
protected void snapToPage(int whichPage) {
super.snapToPage(whichPage);
- computeWallpaperScrollRatio(whichPage);
+ if (mScrollWallpaper) {
+ computeWallpaperScrollRatio(whichPage);
+ }
}
@Override
@@ -968,16 +1165,18 @@ public class Workspace extends SmoothPagedView
}
}
+ @Override
+ protected Interpolator getScrollInterpolator() {
+ return new PagedView.QuadInterpolator();
+ }
+
class WallpaperOffsetInterpolator {
float mFinalHorizontalWallpaperOffset = 0.0f;
- float mFinalVerticalWallpaperOffset = 0.5f;
float mHorizontalWallpaperOffset = 0.0f;
- float mVerticalWallpaperOffset = 0.5f;
long mLastWallpaperOffsetUpdateTime;
boolean mIsMovingFast;
boolean mOverrideHorizontalCatchupConstant;
float mHorizontalCatchupConstant = 0.35f;
- float mVerticalCatchupConstant = 0.35f;
public WallpaperOffsetInterpolator() {
}
@@ -990,16 +1189,18 @@ public class Workspace extends SmoothPagedView
mHorizontalCatchupConstant = f;
}
- public void setVerticalCatchupConstant(float f) {
- mVerticalCatchupConstant = f;
- }
-
public boolean computeScrollOffset() {
- if (Float.compare(mHorizontalWallpaperOffset, mFinalHorizontalWallpaperOffset) == 0 &&
- Float.compare(mVerticalWallpaperOffset, mFinalVerticalWallpaperOffset) == 0) {
+ if (Float.compare(mHorizontalWallpaperOffset, mFinalHorizontalWallpaperOffset) == 0) {
mIsMovingFast = false;
return false;
}
+
+ // Don't have any lag between workspace and wallpaper on non-large devices
+ if (!LauncherApplication.isScreenLarge()) {
+ mHorizontalWallpaperOffset = mFinalHorizontalWallpaperOffset;
+ return true;
+ }
+
boolean isLandscape = mDisplaySize.x > mDisplaySize.y;
long currentTime = System.currentTimeMillis();
@@ -1021,28 +1222,19 @@ public class Workspace extends SmoothPagedView
// slow
fractionToCatchUpIn1MsHorizontal = isLandscape ? 0.27f : 0.5f;
}
- float fractionToCatchUpIn1MsVertical = mVerticalCatchupConstant;
fractionToCatchUpIn1MsHorizontal /= 33f;
- fractionToCatchUpIn1MsVertical /= 33f;
final float UPDATE_THRESHOLD = 0.00001f;
float hOffsetDelta = mFinalHorizontalWallpaperOffset - mHorizontalWallpaperOffset;
- float vOffsetDelta = mFinalVerticalWallpaperOffset - mVerticalWallpaperOffset;
- boolean jumpToFinalValue = Math.abs(hOffsetDelta) < UPDATE_THRESHOLD &&
- Math.abs(vOffsetDelta) < UPDATE_THRESHOLD;
+ boolean jumpToFinalValue = Math.abs(hOffsetDelta) < UPDATE_THRESHOLD;
- // Don't have any lag between workspace and wallpaper on non-large devices
if (!LauncherApplication.isScreenLarge() || jumpToFinalValue) {
mHorizontalWallpaperOffset = mFinalHorizontalWallpaperOffset;
- mVerticalWallpaperOffset = mFinalVerticalWallpaperOffset;
} else {
- float percentToCatchUpVertical =
- Math.min(1.0f, timeSinceLastUpdate * fractionToCatchUpIn1MsVertical);
float percentToCatchUpHorizontal =
Math.min(1.0f, timeSinceLastUpdate * fractionToCatchUpIn1MsHorizontal);
mHorizontalWallpaperOffset += percentToCatchUpHorizontal * hOffsetDelta;
- mVerticalWallpaperOffset += percentToCatchUpVertical * vOffsetDelta;
}
mLastWallpaperOffsetUpdateTime = System.currentTimeMillis();
@@ -1057,36 +1249,25 @@ public class Workspace extends SmoothPagedView
return mFinalHorizontalWallpaperOffset;
}
- public float getCurrY() {
- return mVerticalWallpaperOffset;
- }
-
- public float getFinalY() {
- return mFinalVerticalWallpaperOffset;
- }
-
public void setFinalX(float x) {
mFinalHorizontalWallpaperOffset = Math.max(0f, Math.min(x, 1.0f));
}
- public void setFinalY(float y) {
- mFinalVerticalWallpaperOffset = Math.max(0f, Math.min(y, 1.0f));
- }
-
public void jumpToFinal() {
mHorizontalWallpaperOffset = mFinalHorizontalWallpaperOffset;
- mVerticalWallpaperOffset = mFinalVerticalWallpaperOffset;
}
}
@Override
public void computeScroll() {
super.computeScroll();
- syncWallpaperOffsetWithScroll();
+ if (mScrollWallpaper) {
+ syncWallpaperOffsetWithScroll();
+ }
}
void showOutlines() {
- if (!isSmall() && !mIsSwitchingState) {
+ if (!mIsSwitchingState) {
if (mChildrenOutlineFadeOutAnimation != null) mChildrenOutlineFadeOutAnimation.cancel();
if (mChildrenOutlineFadeInAnimation != null) mChildrenOutlineFadeInAnimation.cancel();
mChildrenOutlineFadeInAnimation = LauncherAnimUtils.ofFloat(this, "childrenOutlineAlpha", 1.0f);
@@ -1096,7 +1277,7 @@ public class Workspace extends SmoothPagedView
}
void hideOutlines() {
- if (!isSmall() && !mIsSwitchingState) {
+ if (!mIsSwitchingState) {
if (mChildrenOutlineFadeInAnimation != null) mChildrenOutlineFadeInAnimation.cancel();
if (mChildrenOutlineFadeOutAnimation != null) mChildrenOutlineFadeOutAnimation.cancel();
mChildrenOutlineFadeOutAnimation = LauncherAnimUtils.ofFloat(this, "childrenOutlineAlpha", 0.0f);
@@ -1147,7 +1328,7 @@ public class Workspace extends SmoothPagedView
mBackgroundFadeOutAnimation = LauncherAnimUtils.ofFloat(startAlpha, finalAlpha);
mBackgroundFadeOutAnimation.addUpdateListener(new AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator animation) {
- setBackgroundAlpha(((Float) animation.getAnimatedValue()).floatValue());
+ setBackgroundAlpha((Float) animation.getAnimatedValue());
}
});
mBackgroundFadeOutAnimation.setInterpolator(new DecelerateInterpolator(1.5f));
@@ -1170,6 +1351,31 @@ public class Workspace extends SmoothPagedView
return mBackgroundAlpha;
}
+ /**
+ * Due to 3D transformations, if two CellLayouts are theoretically touching each other,
+ * on the xy plane, when one is rotated along the y-axis, the gap between them is perceived
+ * as being larger. This method computes what offset the rotated view should be translated
+ * in order to minimize this perceived gap.
+ * @param degrees Angle of the view
+ * @param width Width of the view
+ * @param height Height of the view
+ * @return Offset to be used in a View.setTranslationX() call
+ */
+ protected float getOffsetXForRotation(float degrees, int width, int height) {
+ mMatrix.reset();
+ mCamera.save();
+ mCamera.rotateY(Math.abs(degrees));
+ mCamera.getMatrix(mMatrix);
+ mCamera.restore();
+
+ mMatrix.preTranslate(-width * 0.5f, -height * 0.5f);
+ mMatrix.postTranslate(width * 0.5f, height * 0.5f);
+ mTempFloat2[0] = width;
+ mTempFloat2[1] = height;
+ mMatrix.mapPoints(mTempFloat2);
+ return (width - mTempFloat2[0]) * (degrees > 0.0f ? 1.0f : -1.0f);
+ }
+
float backgroundAlphaInterpolator(float r) {
float pivotA = 0.1f;
float pivotB = 0.4f;
@@ -1182,82 +1388,361 @@ public class Workspace extends SmoothPagedView
}
}
- float overScrollBackgroundAlphaInterpolator(float r) {
- float threshold = 0.08f;
+ private void setChildrenBackgroundAlphaMultipliers(float a) {
+ for (int i = 0; i < getChildCount(); i++) {
+ CellLayout child = (CellLayout) getChildAt(i);
+ child.setBackgroundAlphaMultiplier(a);
+ }
+ }
- if (r > mOverScrollMaxBackgroundAlpha) {
- mOverScrollMaxBackgroundAlpha = r;
- } else if (r < mOverScrollMaxBackgroundAlpha) {
- r = mOverScrollMaxBackgroundAlpha;
+ private void screenScrolledStandard(int screenScroll) {
+ for (int i = 0; i < getChildCount(); i++) {
+ CellLayout cl = (CellLayout) getPageAt(i);
+ if (cl != null) {
+ float scrollProgress = getScrollProgress(screenScroll, cl, i);
+ if (mFadeInAdjacentScreens && !isSmall()) {
+ setCellLayoutFadeAdjacent(cl, scrollProgress);
+ }
+ }
}
+ }
- return Math.min(r / threshold, 1.0f);
+ private void screenScrolledTablet(int screenScroll) {
+ for (int i = 0; i < getChildCount(); i++) {
+ CellLayout cl = (CellLayout) getPageAt(i);
+ if (cl != null) {
+ float scrollProgress = getScrollProgress(screenScroll, cl, i);
+ float rotation = WORKSPACE_ROTATION * scrollProgress;
+ float translationX = getOffsetXForRotation(rotation, cl.getWidth(), cl.getHeight());
+
+ cl.setTranslationX(translationX);
+ cl.setRotationY(rotation);
+ if (mFadeInAdjacentScreens && !isSmall()) {
+ setCellLayoutFadeAdjacent(cl, scrollProgress);
+ }
+ }
+ }
+ invalidate();
}
- private void updatePageAlphaValues(int screenCenter) {
- boolean isInOverscroll = mOverScrollX < 0 || mOverScrollX > mMaxScrollX;
- if (mWorkspaceFadeInAdjacentScreens &&
- mState == State.NORMAL &&
- !mIsSwitchingState &&
- !isInOverscroll) {
- for (int i = 0; i < getChildCount(); i++) {
- CellLayout child = (CellLayout) getChildAt(i);
- if (child != null) {
- float scrollProgress = getScrollProgress(screenCenter, child, i);
- float alpha = 1 - Math.abs(scrollProgress);
- child.getShortcutsAndWidgets().setAlpha(alpha);
- if (!mIsDragOccuring) {
- child.setBackgroundAlphaMultiplier(
- backgroundAlphaInterpolator(Math.abs(scrollProgress)));
- } else {
- child.setBackgroundAlphaMultiplier(1f);
+ private void screenScrolledZoom(int screenScroll, boolean in) {
+ for (int i = 0; i < getChildCount(); i++) {
+ CellLayout cl = (CellLayout) getPageAt(i);
+ if (cl != null) {
+ float scrollProgress = getScrollProgress(screenScroll, cl, i);
+ float scale = 1.0f + (in ? -0.2f : 0.1f) * Math.abs(scrollProgress);
+
+ // Extra translation to account for the increase in size
+ if (!in) {
+ float translationX = cl.getMeasuredWidth() * 0.1f * -scrollProgress;
+ cl.setTranslationX(translationX);
+ }
+
+ cl.setScaleX(scale);
+ cl.setScaleY(scale);
+ if (mFadeInAdjacentScreens && !isSmall()) {
+ setCellLayoutFadeAdjacent(cl, scrollProgress);
+ }
+ }
+ }
+ }
+
+ private void screenScrolledRotate(int screenScroll, boolean up) {
+ for (int i = 0; i < getChildCount(); i++) {
+ CellLayout cl = (CellLayout) getPageAt(i);
+ if (cl != null) {
+ float scrollProgress = getScrollProgress(screenScroll, cl, i);
+ float rotation =
+ (up ? WORKSPACE_ROTATION : -WORKSPACE_ROTATION) * scrollProgress;
+
+ if (mRotatePivotPoint < 0) {
+ mRotatePivotPoint =
+ (cl.getMeasuredWidth() * 0.5f) /
+ (float) Math.tan(Math.toRadians((double) (WORKSPACE_ROTATION * 0.5f)));
+ }
+
+ cl.setPivotX(cl.getMeasuredWidth() * 0.5f);
+ cl.setPivotY(cl.getMeasuredHeight() * 0.5f);
+
+ float translationX = cl.getMeasuredWidth() * scrollProgress;
+ float translationY = 0.0f;
+
+ translationX += (up ? -1.0f : 1.0f) *
+ Math.sin(Math.toRadians((double) rotation)) * (mRotatePivotPoint + cl.getMeasuredHeight() * 0.5f);
+ translationY += (up ? -1.0f : 1.0f) *
+ (1.0f - Math.cos(Math.toRadians((double) rotation))) * (mRotatePivotPoint + cl.getMeasuredHeight() * 0.5f);
+
+ cl.setRotation(rotation);
+ cl.setTranslationX(translationX);
+ cl.setTranslationY(translationY);
+ if (mFadeInAdjacentScreens && !isSmall()) {
+ setCellLayoutFadeAdjacent(cl, scrollProgress);
+ }
+ }
+ }
+ }
+
+ private void screenScrolledCube(int screenScroll, boolean in) {
+ for (int i = 0; i < getChildCount(); i++) {
+ CellLayout cl = (CellLayout) getPageAt(i);
+ if (cl != null) {
+ float scrollProgress = getScrollProgress(screenScroll, cl, i);
+ float rotation = (in ? 90.0f : -90.0f) * scrollProgress;
+ float scale = 1.0f - Math.abs(scrollProgress) * 0.2f;
+
+ if (in) {
+ cl.setCameraDistance(mDensity * mCameraDistance);
+ cl.setPivotX(scrollProgress < 0 ? 0 : cl.getMeasuredWidth());
+ } else {
+ cl.setScaleX(scale);
+ cl.setScaleY(scale);
+ cl.setPivotX((scrollProgress + 1) * cl.getMeasuredWidth() * 0.5f);
+ }
+ cl.setPivotY(cl.getMeasuredHeight() * 0.5f);
+ cl.setRotationY(rotation);
+ if (mFadeInAdjacentScreens && !isSmall()) {
+ setCellLayoutFadeAdjacent(cl, scrollProgress);
+ }
+ }
+ }
+ }
+
+ private void screenScrolledStack(int screenScroll) {
+ for (int i = 0; i < getChildCount(); i++) {
+ CellLayout cl = (CellLayout) getPageAt(i);
+ if (cl != null) {
+ float scrollProgress = getScrollProgress(screenScroll, cl, i);
+ float interpolatedProgress =
+ mZInterpolator.getInterpolation(Math.abs(Math.min(scrollProgress, 0)));
+ float scale = (1 - interpolatedProgress) + interpolatedProgress * 0.76f;
+ float translationX = Math.min(0, scrollProgress) * cl.getMeasuredWidth();
+ float alpha;
+
+ if (!LauncherApplication.isScreenLarge() || scrollProgress < 0) {
+ alpha = scrollProgress < 0 ? mAlphaInterpolator.getInterpolation(
+ 1 - Math.abs(scrollProgress)) : 1.0f;
+ } else {
+ // On large screens we need to fade the page as it nears its leftmost position
+ alpha = mLeftScreenAlphaInterpolator.getInterpolation(1 - scrollProgress);
+ }
+
+ cl.setTranslationX(translationX);
+ cl.setScaleX(scale);
+ cl.setScaleY(scale);
+ cl.setAlpha(alpha);
+
+ // If the view has 0 alpha, we set it to be invisible so as to prevent
+ // it from accepting touches
+ if (alpha <= 0) {
+ cl.setVisibility(INVISIBLE);
+ } else if (cl.getVisibility() != VISIBLE) {
+ cl.setVisibility(VISIBLE);
+ }
+ }
+ }
+ invalidate();
+ }
+
+ private void screenScrolledAccordian(int screenScroll) {
+ for (int i = 0; i < getChildCount(); i++) {
+ CellLayout cl = (CellLayout) getPageAt(i);
+ if (cl != null) {
+ float scrollProgress = getScrollProgress(screenScroll, cl, i);
+ float scaleX = 1.0f - Math.abs(scrollProgress);
+
+ cl.setPivotX(scrollProgress < 0 ? 0 : cl.getMeasuredWidth());
+ cl.setScaleX(scaleX);
+ if (scaleX == 0.0f) {
+ cl.setVisibility(INVISIBLE);
+ } else if (cl.getVisibility() != VISIBLE) {
+ cl.setVisibility(VISIBLE);
+ }
+ if (mFadeInAdjacentScreens && !isSmall()) {
+ setCellLayoutFadeAdjacent(cl, scrollProgress);
+ }
+ }
+ }
+ }
+
+ private void screenScrolledSpin(int screenScroll) {
+ for (int i = 0; i < getChildCount(); i++) {
+ CellLayout cl = (CellLayout) getPageAt(i);
+ if (cl != null) {
+ float scrollProgress = getScrollProgress(screenScroll, cl, i);
+ float rotation = 180.0f * scrollProgress;
+
+ if (getMeasuredHeight() > getMeasuredWidth()) {
+ float translationX = (getMeasuredHeight() - getMeasuredWidth()) / 2.0f * -scrollProgress;
+ cl.setTranslationX(translationX);
+ }
+
+ cl.setRotation(rotation);
+
+ if (mFadeInAdjacentScreens && !isSmall()) {
+ setCellLayoutFadeAdjacent(cl, scrollProgress);
+ }
+ }
+ }
+ }
+
+ private void screenScrolledFlip(int screenScroll) {
+ for (int i = 0; i < getChildCount(); i++) {
+ CellLayout cl = (CellLayout) getPageAt(i);
+ if (cl != null) {
+ float scrollProgress = getScrollProgress(screenScroll, cl, i);
+ float rotation = -180.0f * scrollProgress;
+
+ if (scrollProgress >= -0.5f && scrollProgress <= 0.5f) {
+ cl.setCameraDistance(mDensity * mCameraDistance);
+ cl.setTranslationX(cl.getMeasuredWidth() * scrollProgress);
+ cl.setPivotX(cl.getMeasuredWidth() * 0.5f);
+ cl.setPivotY(cl.getMeasuredHeight() * 0.5f);
+ cl.setRotationY(rotation);
+ if (cl.getVisibility() != VISIBLE) {
+ cl.setVisibility(VISIBLE);
+ }
+ if (mFadeInAdjacentScreens && !isSmall()) {
+ setCellLayoutFadeAdjacent(cl, scrollProgress);
}
+ } else {
+ cl.setVisibility(INVISIBLE);
}
}
}
+ invalidate();
}
- private void setChildrenBackgroundAlphaMultipliers(float a) {
+ private void screenScrolledCylinder(int screenScroll, boolean in) {
for (int i = 0; i < getChildCount(); i++) {
- CellLayout child = (CellLayout) getChildAt(i);
- child.setBackgroundAlphaMultiplier(a);
+ CellLayout cl = (CellLayout) getPageAt(i);
+ if (cl != null) {
+ float scrollProgress = getScrollProgress(screenScroll, cl, i);
+ float rotation = (in ? WORKSPACE_ROTATION : -WORKSPACE_ROTATION) * scrollProgress;
+
+ cl.setPivotX((scrollProgress + 1) * cl.getMeasuredWidth() * 0.5f);
+ cl.setPivotY(cl.getMeasuredHeight() * 0.5f);
+ cl.setRotationY(rotation);
+ if (mFadeInAdjacentScreens && !isSmall()) {
+ setCellLayoutFadeAdjacent(cl, scrollProgress);
+ }
+ }
}
}
@Override
- protected void screenScrolled(int screenCenter) {
- super.screenScrolled(screenCenter);
-
- updatePageAlphaValues(screenCenter);
+ protected void screenScrolled(int screenScroll) {
+ super.screenScrolled(screenScroll);
enableHwLayersOnVisiblePages();
- if (mOverScrollX < 0 || mOverScrollX > mMaxScrollX) {
- int index = mOverScrollX < 0 ? 0 : getChildCount() - 1;
- CellLayout cl = (CellLayout) getChildAt(index);
- float scrollProgress = getScrollProgress(screenCenter, cl, index);
- cl.setOverScrollAmount(Math.abs(scrollProgress), index == 0);
- float rotation = - WORKSPACE_OVERSCROLL_ROTATION * scrollProgress;
- cl.setRotationY(rotation);
- setFadeForOverScroll(Math.abs(scrollProgress));
- if (!mOverscrollTransformsSet) {
- mOverscrollTransformsSet = true;
- cl.setCameraDistance(mDensity * mCameraDistance);
- cl.setPivotX(cl.getMeasuredWidth() * (index == 0 ? 0.75f : 0.25f));
- cl.setPivotY(cl.getMeasuredHeight() * 0.5f);
- cl.setOverscrollTransformsDirty(true);
+ if (isSwitchingState()) return;
+ if (isSmall()) {
+ for (int i = 0; i < getChildCount(); i++) {
+ CellLayout cl = (CellLayout) getPageAt(i);
+ if (cl != null) {
+ float scrollProgress = getScrollProgress(screenScroll, cl, i);
+ float rotation = WORKSPACE_ROTATION * scrollProgress;
+ cl.setRotationY(rotation);
+ }
}
} else {
- if (mOverscrollFade != 0) {
- setFadeForOverScroll(0);
+ boolean isInOverscroll = mOverScrollX < 0 || mOverScrollX > mMaxScrollX;
+
+ if (isInOverscroll && !mOverscrollTransformsDirty) {
+ mScrollTransformsDirty = true;
+ }
+ if (!isInOverscroll || mScrollTransformsDirty) {
+ // Limit the "normal" effects to mScrollX
+ int scroll = mScrollX;
+
+ // Reset transforms when we aren't in overscroll
+ if (mOverscrollFade != 0) {
+ setFadeForOverScroll(0);
+ }
+ if (mOverscrollTransformsDirty) {
+ mOverscrollTransformsDirty = false;
+ ((CellLayout) getChildAt(0)).resetOverscrollTransforms();
+ ((CellLayout) getChildAt(getChildCount() - 1)).resetOverscrollTransforms();
+ }
+
+ switch (mTransitionEffect) {
+ case Standard:
+ screenScrolledStandard(scroll);
+ break;
+ case Tablet:
+ screenScrolledTablet(scroll);
+ break;
+ case ZoomIn:
+ screenScrolledZoom(scroll, true);
+ break;
+ case ZoomOut:
+ screenScrolledZoom(scroll, false);
+ break;
+ case RotateUp:
+ screenScrolledRotate(scroll, true);
+ break;
+ case RotateDown:
+ screenScrolledRotate(scroll, false);
+ break;
+ case Spin:
+ screenScrolledSpin(scroll);
+ break;
+ case Flip:
+ screenScrolledFlip(scroll);
+ break;
+ case CubeIn:
+ screenScrolledCube(scroll, true);
+ break;
+ case CubeOut:
+ screenScrolledCube(scroll, false);
+ break;
+ case Stack:
+ screenScrolledStack(scroll);
+ break;
+ case Accordian:
+ screenScrolledAccordian(scroll);
+ break;
+ case CylinderIn:
+ screenScrolledCylinder(scroll, true);
+ break;
+ case CylinderOut:
+ screenScrolledCylinder(scroll, false);
+ break;
+ }
+ mScrollTransformsDirty = false;
}
- if (mOverscrollTransformsSet) {
- mOverscrollTransformsSet = false;
- ((CellLayout) getChildAt(0)).resetOverscrollTransforms();
- ((CellLayout) getChildAt(getChildCount() - 1)).resetOverscrollTransforms();
+
+ if (isInOverscroll) {
+ int index = mOverScrollX < 0 ? 0 : getChildCount() - 1;
+ CellLayout cl = (CellLayout) getChildAt(index);
+ if (getChildCount() > 1) {
+ float scrollProgress = getScrollProgress(screenScroll, cl, index);
+ cl.setOverScrollAmount(Math.abs(scrollProgress), index == 0);
+ float rotation = -WORKSPACE_OVERSCROLL_ROTATION * scrollProgress;
+ cl.setRotationY(rotation);
+ setFadeForOverScroll(Math.abs(scrollProgress));
+ if (!mOverscrollTransformsDirty) {
+ mOverscrollTransformsDirty = true;
+ cl.setCameraDistance(mDensity * mCameraDistance);
+ cl.setPivotY(cl.getMeasuredHeight() * 0.5f);
+ cl.setPivotX(cl.getMeasuredWidth() * (index == 0 ? 0.75f : 0.25f));
+ cl.setOverscrollTransformsDirty(true);
+ }
+ }
}
}
}
+ private void setCellLayoutFadeAdjacent(CellLayout child, float scrollProgress) {
+ float alpha = 1 - Math.abs(scrollProgress);
+ child.getShortcutsAndWidgets().setAlpha(alpha);
+ if (!mIsDragOccuring) {
+ child.setBackgroundAlphaMultiplier(
+ backgroundAlphaInterpolator(Math.abs(scrollProgress)));
+ } else {
+ child.setBackgroundAlphaMultiplier(1f);
+ }
+ }
+
@Override
protected void overScroll(float amount) {
acceleratedOverScroll(amount);
@@ -1282,9 +1767,44 @@ public class Workspace extends SmoothPagedView
super.onLayout(changed, left, top, right, bottom);
}
+
+ protected void onSizeChanged (int w, int h, int oldw, int oldh) {
+ super.onSizeChanged(w, h, oldw, oldh);
+
+ getLocationOnScreen(mWallpaperOffsets);
+ }
+
@Override
protected void onDraw(Canvas canvas) {
- updateWallpaperOffsets();
+ if (mScrollWallpaper) {
+ updateWallpaperOffsets();
+ }
+
+ // Draw the wallpaper if necessary
+ if (mWallpaperHack && mWallpaperBitmap != null) {
+ float x = getScrollX();
+ float y = getScrollY();
+
+ int width = getWidth();
+ int height = getHeight();
+ int wallpaperWidth = mWallpaperBitmap.getWidth();
+ int wallpaperHeight = mWallpaperBitmap.getHeight();
+
+ if (width + mWallpaperOffsets[0] > wallpaperWidth) {
+ // Wallpaper is smaller than screen
+ x += (width - wallpaperWidth) / 2;
+ } else {
+ x -= mWallpaperScroll * (wallpaperWidth - (width + mWallpaperOffsets[0])) + mWallpaperOffsets[0];
+ }
+ if (height + mWallpaperOffsets[0] > wallpaperHeight) {
+ // Wallpaper is smaller than screen
+ y += (height - wallpaperHeight) / 2;
+ } else {
+ y -= mWallpaperOffsets[1];
+ }
+
+ canvas.drawBitmap(mWallpaperBitmap, x, y, mPaint);
+ }
// Draw the background gradient if necessary
if (mBackground != null && mBackgroundAlpha > 0.0f && mDrawBackground) {
@@ -1504,16 +2024,18 @@ public class Workspace extends SmoothPagedView
}
private final ZoomInInterpolator mZoomInInterpolator = new ZoomInInterpolator();
+ private final ZInterpolator mZInterpolator = new ZInterpolator(0.5f);
+ private AccelerateInterpolator mAlphaInterpolator = new AccelerateInterpolator(0.9f);
+ private DecelerateInterpolator mLeftScreenAlphaInterpolator = new DecelerateInterpolator(4);
- /*
- *
- * We call these methods (onDragStartedWithItemSpans/onDragStartedWithSize) whenever we
- * start a drag in Launcher, regardless of whether the drag has ever entered the Workspace
- *
- * These methods mark the appropriate pages as accepting drops (which alters their visual
- * appearance).
- *
- */
+ /**
+ * We call these methods (onDragStartedWithItemSpans/onDragStartedWithSize) whenever we
+ * start a drag in Launcher, regardless of whether the drag has ever entered the Workspace
+ *
+ * These methods mark the appropriate pages as accepting drops (which alters their visual
+ * appearance).
+ *
+ */
public void onDragStartedWithItem(View v) {
final Canvas canvas = new Canvas();
@@ -1524,7 +2046,7 @@ public class Workspace extends SmoothPagedView
public void onDragStartedWithItem(PendingAddItemInfo info, Bitmap b, boolean clipAlpha) {
final Canvas canvas = new Canvas();
- int[] size = estimateItemSize(info.spanX, info.spanY, info, false);
+ int[] size = estimateItemSize(info.spanX, info.spanY, false);
// The outline is used to visualize where the item will land if dropped
mDragOutline = createDragOutline(b, canvas, DRAG_BITMAP_PADDING, size[0],
@@ -1545,12 +2067,15 @@ public class Workspace extends SmoothPagedView
mOldScaleYs = new float[childCount];
mOldBackgroundAlphas = new float[childCount];
mOldAlphas = new float[childCount];
+ mOldRotations = new float[childCount];
+ mOldRotationYs = new float[childCount];
mNewTranslationXs = new float[childCount];
mNewTranslationYs = new float[childCount];
mNewScaleXs = new float[childCount];
mNewScaleYs = new float[childCount];
mNewBackgroundAlphas = new float[childCount];
mNewAlphas = new float[childCount];
+ mNewRotations = new float[childCount];
mNewRotationYs = new float[childCount];
}
@@ -1581,13 +2106,10 @@ public class Workspace extends SmoothPagedView
final boolean stateIsSmall = (state == State.SMALL);
float finalScaleFactor = 1.0f;
float finalBackgroundAlpha = stateIsSpringLoaded ? 1.0f : 0f;
- float translationX = 0;
- float translationY = 0;
boolean zoomIn = true;
if (state != State.NORMAL) {
finalScaleFactor = mSpringLoadedShrinkFactor - (stateIsSmall ? 0.1f : 0);
- setPageSpacing(mSpringLoadedPageSpacing);
if (oldStateIsNormal && stateIsSmall) {
zoomIn = false;
setLayoutScale(finalScaleFactor);
@@ -1597,7 +2119,6 @@ public class Workspace extends SmoothPagedView
setLayoutScale(finalScaleFactor);
}
} else {
- setPageSpacing(mOriginalPageSpacing);
setLayoutScale(1.0f);
}
@@ -1606,10 +2127,108 @@ public class Workspace extends SmoothPagedView
getResources().getInteger(R.integer.config_appsCustomizeWorkspaceShrinkTime);
for (int i = 0; i < getChildCount(); i++) {
final CellLayout cl = (CellLayout) getChildAt(i);
- float finalAlpha = (!mWorkspaceFadeInAdjacentScreens || stateIsSpringLoaded ||
+ float rotation = 0f;
+ float rotationY = 0f;
+ float translationX = 0f;
+ float translationY = 0f;
+ float scale = finalScaleFactor;
+ float finalAlpha = (!mFadeInAdjacentScreens || stateIsSpringLoaded ||
(i == mCurrentPage)) ? 1f : 0f;
- float currentAlpha = cl.getShortcutsAndWidgets().getAlpha();
- float initialAlpha = currentAlpha;
+ float initialAlpha = cl.getShortcutsAndWidgets().getAlpha();
+
+ // Tablet effect
+ if (mTransitionEffect == TransitionEffect.Tablet || stateIsSmall || stateIsSpringLoaded) {
+ translationX = getOffsetXForRotation(rotationY, cl.getMeasuredWidth(), cl.getMeasuredHeight());
+ if (i < mCurrentPage) {
+ rotationY = WORKSPACE_ROTATION;
+ } else if (i > mCurrentPage) {
+ rotationY = -WORKSPACE_ROTATION;
+ }
+ }
+
+ // Zoom Effects
+ if ((mTransitionEffect == TransitionEffect.ZoomIn ||
+ mTransitionEffect == TransitionEffect.ZoomOut) && stateIsNormal) {
+ if (i != mCurrentPage) {
+ scale = (mTransitionEffect == TransitionEffect.ZoomIn ? 0.5f : 1.1f);
+ }
+ }
+
+ // Stack Effect
+ if (mTransitionEffect == TransitionEffect.Stack) {
+ if (stateIsSpringLoaded) {
+ cl.setVisibility(VISIBLE);
+ } else if (stateIsNormal) {
+ if (i <= mCurrentPage) {
+ cl.setVisibility(VISIBLE);
+ } else {
+ cl.setVisibility(INVISIBLE);
+ }
+ }
+ }
+
+
+ // Flip Effect
+ if (mTransitionEffect == TransitionEffect.Flip) {
+ if (stateIsSpringLoaded) {
+ cl.setVisibility(VISIBLE);
+ } else if (stateIsNormal) {
+ if (i == mCurrentPage) {
+ cl.setVisibility(VISIBLE);
+ } else {
+ cl.setVisibility(INVISIBLE);
+ }
+ }
+ }
+
+ // Rotate Effects
+ if ((mTransitionEffect == TransitionEffect.RotateUp ||
+ mTransitionEffect == TransitionEffect.RotateDown) && stateIsNormal) {
+ boolean up = mTransitionEffect == TransitionEffect.RotateUp;
+ rotation = (up ? WORKSPACE_ROTATION : -WORKSPACE_ROTATION) * Math.max(-1.0f, Math.min(1.0f , mCurrentPage - i));
+ translationX = cl.getMeasuredWidth() * (Math.max(-1.0f, Math.min(1.0f, i - mCurrentPage))) +
+ (up ? -1.0f : 1.0f) * (float) Math.sin(Math.toRadians((double) rotation)) *
+ (mRotatePivotPoint + cl.getMeasuredHeight() * 0.5f);
+ translationY += (up ? -1.0f : 1.0f) * (1.0f - Math.cos(Math.toRadians((double) rotation))) *
+ (mRotatePivotPoint + cl.getMeasuredHeight() * 0.5f);
+ }
+
+ // Cube Effects
+ if ((mTransitionEffect == TransitionEffect.CubeIn || mTransitionEffect == TransitionEffect.CubeOut) && stateIsNormal) {
+ if (i < mCurrentPage) {
+ rotationY = mTransitionEffect == TransitionEffect.CubeOut ? -90.0f : 90.0f;
+ } else if (i > mCurrentPage) {
+ rotationY = mTransitionEffect == TransitionEffect.CubeOut ? 90.0f : -90.0f;
+ }
+ }
+
+ // Cylinder Effects
+ if ((mTransitionEffect == TransitionEffect.CylinderIn || mTransitionEffect == TransitionEffect.CylinderOut) && stateIsNormal) {
+ if (i < mCurrentPage) {
+ rotationY = mTransitionEffect == TransitionEffect.CylinderOut ? -WORKSPACE_ROTATION : WORKSPACE_ROTATION;
+ } else if (i > mCurrentPage) {
+ rotationY = mTransitionEffect == TransitionEffect.CylinderOut ? WORKSPACE_ROTATION : -WORKSPACE_ROTATION;
+ }
+ }
+
+ // Accordian Effect
+ if (mTransitionEffect == TransitionEffect.Accordian) {
+ if (stateIsSpringLoaded) {
+ cl.setVisibility(VISIBLE);
+ } else if (stateIsNormal) {
+ if (i == mCurrentPage) {
+ cl.setVisibility(VISIBLE);
+ } else {
+ cl.setVisibility(INVISIBLE);
+ }
+ }
+ }
+
+ if (stateIsSmall || stateIsSpringLoaded) {
+ cl.setCameraDistance(1280 * mDensity);
+ cl.setPivotX(cl.getMeasuredWidth() * 0.5f);
+ cl.setPivotY(cl.getMeasuredHeight() * 0.5f);
+ }
// Determine the pages alpha during the state transition
if ((oldStateIsSmall && stateIsNormal) ||
@@ -1633,12 +2252,16 @@ public class Workspace extends SmoothPagedView
mOldScaleXs[i] = cl.getScaleX();
mOldScaleYs[i] = cl.getScaleY();
mOldBackgroundAlphas[i] = cl.getBackgroundAlpha();
+ mOldRotations[i] = cl.getRotation();
+ mOldRotationYs[i] = cl.getRotationY();
mNewTranslationXs[i] = translationX;
mNewTranslationYs[i] = translationY;
- mNewScaleXs[i] = finalScaleFactor;
- mNewScaleYs[i] = finalScaleFactor;
+ mNewScaleXs[i] = scale;
+ mNewScaleYs[i] = scale;
mNewBackgroundAlphas[i] = finalBackgroundAlpha;
+ mNewRotations[i] = rotation;
+ mNewRotationYs[i] = rotationY;
} else {
cl.setTranslationX(translationX);
cl.setTranslationY(translationY);
@@ -1646,6 +2269,8 @@ public class Workspace extends SmoothPagedView
cl.setScaleY(finalScaleFactor);
cl.setBackgroundAlpha(finalBackgroundAlpha);
cl.setShortcutAndWidgetAlpha(finalAlpha);
+ cl.setRotation(rotation);
+ cl.setRotationY(rotationY);
}
}
@@ -1661,6 +2286,7 @@ public class Workspace extends SmoothPagedView
cl.setScaleY(mNewScaleYs[i]);
cl.setBackgroundAlpha(mNewBackgroundAlphas[i]);
cl.setShortcutAndWidgetAlpha(mNewAlphas[i]);
+ cl.setRotation(mNewRotations[i]);
cl.setRotationY(mNewRotationYs[i]);
} else {
LauncherViewPropertyAnimator a = new LauncherViewPropertyAnimator(cl);
@@ -1668,6 +2294,8 @@ public class Workspace extends SmoothPagedView
.translationY(mNewTranslationYs[i])
.scaleX(mNewScaleXs[i])
.scaleY(mNewScaleYs[i])
+ .rotation(mNewRotations[i])
+ .rotationY(mNewRotationYs[i])
.setDuration(duration)
.setInterpolator(mZoomInInterpolator);
anim.play(a);
@@ -1730,13 +2358,13 @@ public class Workspace extends SmoothPagedView
@Override
public void onLauncherTransitionEnd(Launcher l, boolean animated, boolean toWorkspace) {
mIsSwitchingState = false;
- mWallpaperOffset.setOverrideHorizontalCatchupConstant(false);
+ mWallpaperInterpolator.setOverrideHorizontalCatchupConstant(false);
updateChildrenLayersEnabled(false);
// The code in getChangeStateAnimation to determine initialAlpha and finalAlpha will ensure
// ensure that only the current page is visible during (and subsequently, after) the
// transition animation. If fade adjacent pages is disabled, then re-enable the page
// visibility after the transition animation.
- if (!mWorkspaceFadeInAdjacentScreens) {
+ if (!mFadeInAdjacentScreens) {
for (int i = 0; i < getChildCount(); i++) {
final CellLayout cl = (CellLayout) getChildAt(i);
cl.setShortcutAndWidgetAlpha(1f);
@@ -1770,11 +2398,13 @@ public class Workspace extends SmoothPagedView
d.draw(destCanvas);
} else {
if (v instanceof FolderIcon) {
- // For FolderIcons the text can bleed into the icon area, and so we need to
- // hide the text completely (which can't be achieved by clipping).
- if (((FolderIcon) v).getTextVisible()) {
- ((FolderIcon) v).setTextVisible(false);
- textVisible = true;
+ if (!mHideIconLabels) {
+ // For FolderIcons the text can bleed into the icon area, and so we need to
+ // hide the text completely (which can't be achieved by clipping).
+ if (((FolderIcon) v).getTextVisible()) {
+ ((FolderIcon) v).setTextVisible(false);
+ textVisible = true;
+ }
}
} else if (v instanceof BubbleTextView) {
final BubbleTextView tv = (BubbleTextView) v;
@@ -1790,7 +2420,7 @@ public class Workspace extends SmoothPagedView
v.draw(destCanvas);
// Restore text visibility of FolderIcon if necessary
- if (textVisible) {
+ if (!mHideIconLabels && textVisible) {
((FolderIcon) v).setTextVisible(true);
}
}
@@ -1938,8 +2568,8 @@ public class Workspace extends SmoothPagedView
}
void addApplicationShortcut(ShortcutInfo info, CellLayout target, long container, int screen,
- int cellX, int cellY, boolean insertAtFirst, int intersectX, int intersectY) {
- View view = mLauncher.createShortcut(R.layout.application, target, (ShortcutInfo) info);
+ boolean insertAtFirst, int intersectX, int intersectY) {
+ View view = mLauncher.createShortcut(R.layout.application, target, info);
final int[] cellXY = new int[2];
target.findCellForSpanThatIntersects(cellXY, 1, 1, intersectX, intersectY);
@@ -1975,8 +2605,8 @@ public class Workspace extends SmoothPagedView
mapPointFromSelfToChild(dropTargetLayout, mDragViewVisualCenter, null);
}
- int spanX = 1;
- int spanY = 1;
+ int spanX;
+ int spanY;
if (mDragInfo != null) {
final CellLayout.CellInfo dragCellInfo = mDragInfo;
spanX = dragCellInfo.spanX;
@@ -2016,18 +2646,7 @@ public class Workspace extends SmoothPagedView
// Don't accept the drop if there's no room for the item
if (!foundCell) {
- // Don't show the message if we are dropping on the AllApps button and the hotseat
- // is full
- boolean isHotseat = mLauncher.isHotseatLayout(dropTargetLayout);
- if (mTargetCell != null && isHotseat) {
- Hotseat hotseat = mLauncher.getHotseat();
- if (hotseat.isAllAppsButtonRank(
- hotseat.getOrderInHotseat(mTargetCell[0], mTargetCell[1]))) {
- return false;
- }
- }
-
- mLauncher.showOutOfSpaceMessage(isHotseat);
+ mLauncher.showOutOfSpaceMessage(mLauncher.isHotseatLayout(dropTargetLayout));
return false;
}
}
@@ -2055,7 +2674,10 @@ public class Workspace extends SmoothPagedView
return false;
}
- boolean aboveShortcut = (dropOverView.getTag() instanceof ShortcutInfo);
+ ItemInfo aboveInfo = (ItemInfo) dropOverView.getTag();
+ boolean aboveShortcut =
+ (aboveInfo.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION ||
+ aboveInfo.itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT);
boolean willBecomeShortcut =
(info.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION ||
info.itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT);
@@ -2063,7 +2685,7 @@ public class Workspace extends SmoothPagedView
return (aboveShortcut && willBecomeShortcut);
}
- boolean willAddToExistingUserFolder(Object dragInfo, CellLayout target, int[] targetCell,
+ boolean willAddToExistingUserFolder(ItemInfo dragInfo, CellLayout target, int[] targetCell,
float distance) {
if (distance > mMaxDistanceForFolderCreation) return false;
View dropOverView = target.getChildAt(targetCell[0], targetCell[1]);
@@ -2099,7 +2721,10 @@ public class Workspace extends SmoothPagedView
if (v == null || hasntMoved || !mCreateUserFolderOnDrop) return false;
mCreateUserFolderOnDrop = false;
- final int screen = (targetCell == null) ? mDragInfo.screen : indexOfChild(target);
+ final int screen = (targetCell == null) ? mDragInfo.screen :
+ (mLauncher.isHotseatLayout(target) ?
+ mLauncher.getHotseat().indexOfChild(target) :
+ indexOfChild(target));
boolean aboveShortcut = (v.getTag() instanceof ShortcutInfo);
boolean willBecomeShortcut = (newView.getTag() instanceof ShortcutInfo);
@@ -2137,7 +2762,7 @@ public class Workspace extends SmoothPagedView
return false;
}
- boolean addToExistingFolderIfNecessary(View newView, CellLayout target, int[] targetCell,
+ boolean addToExistingFolderIfNecessary(CellLayout target, int[] targetCell,
float distance, DragObject d, boolean external) {
if (distance > mMaxDistanceForFolderCreation) return false;
@@ -2147,7 +2772,7 @@ public class Workspace extends SmoothPagedView
if (dropOverView instanceof FolderIcon) {
FolderIcon fi = (FolderIcon) dropOverView;
- if (fi.acceptDrop(d.dragInfo)) {
+ if (fi.acceptDrop((ItemInfo)d.dragInfo)) {
fi.onDrop(d);
// if the drag started here, we need to remove it from the workspace
@@ -2193,7 +2818,9 @@ public class Workspace extends SmoothPagedView
LauncherSettings.Favorites.CONTAINER_HOTSEAT :
LauncherSettings.Favorites.CONTAINER_DESKTOP;
int screen = (mTargetCell[0] < 0) ?
- mDragInfo.screen : indexOfChild(dropTargetLayout);
+ mDragInfo.screen : (hasMovedIntoHotseat ?
+ mLauncher.getHotseat().indexOfChild(dropTargetLayout) :
+ indexOfChild(dropTargetLayout));
int spanX = mDragInfo != null ? mDragInfo.spanX : 1;
int spanY = mDragInfo != null ? mDragInfo.spanY : 1;
// First we find the cell nearest to point at which the item is
@@ -2211,7 +2838,7 @@ public class Workspace extends SmoothPagedView
return;
}
- if (addToExistingFolderIfNecessary(cell, dropTargetLayout, mTargetCell,
+ if (addToExistingFolderIfNecessary(dropTargetLayout, mTargetCell,
distance, d, false)) {
return;
}
@@ -2247,6 +2874,8 @@ public class Workspace extends SmoothPagedView
if (mCurrentPage != screen && !hasMovedIntoHotseat) {
snapScreen = screen;
snapToPage(screen);
+ } else if (mLauncher.getHotseat().getCurrentPage() != screen && hasMovedIntoHotseat) {
+ mLauncher.getHotseat().snapToPage(screen);
}
if (foundCell) {
@@ -2266,7 +2895,7 @@ public class Workspace extends SmoothPagedView
lp.cellVSpan = item.spanY;
lp.isLockedToGrid = true;
cell.setId(LauncherModel.getCellLayoutChildId(container, mDragInfo.screen,
- mTargetCell[0], mTargetCell[1], mDragInfo.spanX, mDragInfo.spanY));
+ mTargetCell[0], mTargetCell[1]));
if (container != LauncherSettings.Favorites.CONTAINER_HOTSEAT &&
cell instanceof LauncherAppWidgetHostView) {
@@ -2275,16 +2904,13 @@ public class Workspace extends SmoothPagedView
// in its final location
final LauncherAppWidgetHostView hostView = (LauncherAppWidgetHostView) cell;
- AppWidgetProviderInfo pinfo = hostView.getAppWidgetInfo();
- if (pinfo != null &&
- pinfo.resizeMode != AppWidgetProviderInfo.RESIZE_NONE) {
- final Runnable addResizeFrame = new Runnable() {
+ final Runnable addResizeFrame = new Runnable() {
public void run() {
DragLayer dragLayer = mLauncher.getDragLayer();
- dragLayer.addResizeFrame(info, hostView, cellLayout);
+ dragLayer.addResizeFrame(hostView, cellLayout);
}
- };
- resizeRunnable = (new Runnable() {
+ };
+ resizeRunnable = new Runnable() {
public void run() {
if (!isPageMoving()) {
addResizeFrame.run();
@@ -2292,8 +2918,7 @@ public class Workspace extends SmoothPagedView
mDelayedResizeRunnable = addResizeFrame;
}
}
- });
- }
+ };
}
LauncherModel.moveItemInDatabase(mLauncher, info, container, screen, lp.cellX,
@@ -2365,19 +2990,6 @@ public class Workspace extends SmoothPagedView
}
}
- public void getViewLocationRelativeToSelf(View v, int[] location) {
- getLocationInWindow(location);
- int x = location[0];
- int y = location[1];
-
- v.getLocationInWindow(location);
- int vX = location[0];
- int vY = location[1];
-
- location[0] = vX - x;
- location[1] = vY - y;
- }
-
public void onDragEnter(DragObject d) {
mDragEnforcer.onDragEnter();
mCreateUserFolderOnDrop = false;
@@ -2390,7 +3002,7 @@ public class Workspace extends SmoothPagedView
// Because we don't have space in the Phone UI (the CellLayouts run to the edge) we
// don't need to show the outlines
- if (LauncherApplication.isScreenLarge()) {
+ if (mShowOutlines) {
showOutlines();
}
}
@@ -2411,7 +3023,7 @@ public class Workspace extends SmoothPagedView
int height = smallestSize.y - paddingTop - paddingBottom;
mLandscapeCellLayoutMetrics = new Rect();
CellLayout.getMetrics(mLandscapeCellLayoutMetrics, res,
- width, height, LauncherModel.getCellCountX(), LauncherModel.getCellCountY(),
+ width, height, LauncherModel.getWorkspaceCellCountX(), LauncherModel.getWorkspaceCellCountY(),
orientation);
}
return mLandscapeCellLayoutMetrics;
@@ -2425,7 +3037,7 @@ public class Workspace extends SmoothPagedView
int height = largestSize.y - paddingTop - paddingBottom;
mPortraitCellLayoutMetrics = new Rect();
CellLayout.getMetrics(mPortraitCellLayoutMetrics, res,
- width, height, LauncherModel.getCellCountX(), LauncherModel.getCellCountY(),
+ width, height, LauncherModel.getWorkspaceCellCountX(), LauncherModel.getWorkspaceCellCountY(),
orientation);
}
return mPortraitCellLayoutMetrics;
@@ -2439,10 +3051,12 @@ public class Workspace extends SmoothPagedView
// Here we store the final page that will be dropped to, if the workspace in fact
// receives the drop
if (mInScrollArea) {
- if (isPageMoving()) {
+ PagedView target = mDragInfo != null && mDragInfo.container == Favorites.CONTAINER_HOTSEAT ?
+ mLauncher.getHotseat() : this;
+ if (target.isPageMoving()) {
// If the user drops while the page is scrolling, we should use that page as the
// destination instead of the page that is being hovered over.
- mDropToLayout = (CellLayout) getPageAt(getNextPage());
+ mDropToLayout = (CellLayout) target.getPageAt(target.getNextPage());
} else {
mDropToLayout = mDragOverlappingLayout;
}
@@ -2532,7 +3146,7 @@ public class Workspace extends SmoothPagedView
private void cleanupAddToFolder() {
if (mDragOverFolderIcon != null) {
- mDragOverFolderIcon.onDragExit(null);
+ mDragOverFolderIcon.onDragExit();
mDragOverFolderIcon = null;
}
}
@@ -2586,9 +3200,9 @@ public class Workspace extends SmoothPagedView
void mapPointFromSelfToHotseatLayout(Hotseat hotseat, float[] xy) {
- hotseat.getLayout().getMatrix().invert(mTempInverseMatrix);
- xy[0] = xy[0] - hotseat.getLeft() - hotseat.getLayout().getLeft();
- xy[1] = xy[1] - hotseat.getTop() - hotseat.getLayout().getTop();
+ hotseat.getPageAt(hotseat.getNextPage()).getMatrix().invert(mTempInverseMatrix);
+ xy[0] = xy[0] - (hotseat.getLeft() - hotseat.getScrollX()) - hotseat.getPageAt(hotseat.getNextPage()).getLeft();
+ xy[1] = xy[1] - (hotseat.getTop() - hotseat.getScrollY()) - hotseat.getPageAt(hotseat.getNextPage()).getTop();
mTempInverseMatrix.mapPoints(xy);
}
@@ -2608,62 +3222,20 @@ public class Workspace extends SmoothPagedView
xy[1] -= (getScrollY() - v.getTop());
}
- static private float squaredDistance(float[] point1, float[] point2) {
+ static float squaredDistance(float[] point1, float[] point2) {
float distanceX = point1[0] - point2[0];
float distanceY = point2[1] - point2[1];
return distanceX * distanceX + distanceY * distanceY;
}
- /*
- *
- * Returns true if the passed CellLayout cl overlaps with dragView
- *
- */
- boolean overlaps(CellLayout cl, DragView dragView,
- int dragViewX, int dragViewY, Matrix cachedInverseMatrix) {
- // Transform the coordinates of the item being dragged to the CellLayout's coordinates
- final float[] draggedItemTopLeft = mTempDragCoordinates;
- draggedItemTopLeft[0] = dragViewX;
- draggedItemTopLeft[1] = dragViewY;
- final float[] draggedItemBottomRight = mTempDragBottomRightCoordinates;
- draggedItemBottomRight[0] = draggedItemTopLeft[0] + dragView.getDragRegionWidth();
- draggedItemBottomRight[1] = draggedItemTopLeft[1] + dragView.getDragRegionHeight();
-
- // Transform the dragged item's top left coordinates
- // to the CellLayout's local coordinates
- mapPointFromSelfToChild(cl, draggedItemTopLeft, cachedInverseMatrix);
- float overlapRegionLeft = Math.max(0f, draggedItemTopLeft[0]);
- float overlapRegionTop = Math.max(0f, draggedItemTopLeft[1]);
-
- if (overlapRegionLeft <= cl.getWidth() && overlapRegionTop >= 0) {
- // Transform the dragged item's bottom right coordinates
- // to the CellLayout's local coordinates
- mapPointFromSelfToChild(cl, draggedItemBottomRight, cachedInverseMatrix);
- float overlapRegionRight = Math.min(cl.getWidth(), draggedItemBottomRight[0]);
- float overlapRegionBottom = Math.min(cl.getHeight(), draggedItemBottomRight[1]);
-
- if (overlapRegionRight >= 0 && overlapRegionBottom <= cl.getHeight()) {
- float overlap = (overlapRegionRight - overlapRegionLeft) *
- (overlapRegionBottom - overlapRegionTop);
- if (overlap > 0) {
- return true;
- }
- }
- }
- return false;
- }
-
- /*
- *
+ /**
* This method returns the CellLayout that is currently being dragged to. In order to drag
* to a CellLayout, either the touch point must be directly over the CellLayout, or as a second
* strategy, we see if the dragView is overlapping any CellLayout and choose the closest one
*
* Return null if no CellLayout is currently being dragged over
- *
*/
- private CellLayout findMatchingPageForDragOver(
- DragView dragView, float originX, float originY, boolean exact) {
+ private CellLayout findMatchingPageForDragOver(float originX, float originY, boolean exact) {
// We loop through all the screens (ie CellLayouts) and see which ones overlap
// with the item being dragged and then choose the one that's closest to the touch point
final int screenCount = getChildCount();
@@ -2766,11 +3338,11 @@ public class Workspace extends SmoothPagedView
if (mLauncher.getHotseat() != null && !isExternalDragWidget(d)) {
mLauncher.getHotseat().getHitRect(r);
if (r.contains(d.x, d.y)) {
- layout = mLauncher.getHotseat().getLayout();
+ layout = mLauncher.getHotseat().findMatchingPageForDragOver(d.x, d.y, false);
}
}
if (layout == null) {
- layout = findMatchingPageForDragOver(d.dragView, d.x, d.y, false);
+ layout = findMatchingPageForDragOver(d.x, d.y, false);
}
if (layout != mDragTargetLayout) {
@@ -2778,12 +3350,8 @@ public class Workspace extends SmoothPagedView
setCurrentDragOverlappingLayout(layout);
boolean isInSpringLoadedMode = (mState == State.SPRING_LOADED);
- if (isInSpringLoadedMode) {
- if (mLauncher.isHotseatLayout(layout)) {
- mSpringLoadedDragController.cancel();
- } else {
- mSpringLoadedDragController.setAlarm(mDragTargetLayout);
- }
+ if (isInSpringLoadedMode || mLauncher.isHotseatLayout(mDragTargetLayout)) {
+ mSpringLoadedDragController.setAlarm(mDragTargetLayout);
}
}
} else {
@@ -2791,7 +3359,7 @@ public class Workspace extends SmoothPagedView
if (mLauncher.getHotseat() != null && !isDragWidget(d)) {
mLauncher.getHotseat().getHitRect(r);
if (r.contains(d.x, d.y)) {
- layout = mLauncher.getHotseat().getLayout();
+ layout = mLauncher.getHotseat().findMatchingPageForDragOver(d.x, d.y, false);
}
}
if (layout == null) {
@@ -2800,9 +3368,15 @@ public class Workspace extends SmoothPagedView
if (layout != mDragTargetLayout) {
setCurrentDropLayout(layout);
setCurrentDragOverlappingLayout(layout);
+
+ if (mLauncher.isHotseatLayout(mDragTargetLayout)) {
+ mSpringLoadedDragController.setAlarm(mDragTargetLayout);
+ }
}
}
+ mLauncher.getHotseat().setChildrenOutlineAlpha(mLauncher.isHotseatLayout(layout) ? 1f : 0f);
+
// Handle the drag over
if (mDragTargetLayout != null) {
// We want the point to be mapped to the dragTarget.
@@ -2898,8 +3472,6 @@ public class Workspace extends SmoothPagedView
if (mDragMode == DRAG_MODE_CREATE_FOLDER && !userFolderPending) {
setDragMode(DRAG_MODE_NONE);
}
-
- return;
}
class FolderCreationAlarmListener implements OnAlarmListener {
@@ -2981,7 +3553,7 @@ public class Workspace extends SmoothPagedView
*/
public boolean addExternalItemToScreen(ItemInfo dragInfo, CellLayout layout) {
if (layout.findCellForSpan(mTempEstimate, dragInfo.spanX, dragInfo.spanY)) {
- onDropExternal(dragInfo.dropPos, (ItemInfo) dragInfo, (CellLayout) layout, false);
+ onDropExternal(dragInfo.dropPos, dragInfo, layout, false);
return true;
}
mLauncher.showOutOfSpaceMessage(mLauncher.isHotseatLayout(layout));
@@ -3021,18 +3593,24 @@ public class Workspace extends SmoothPagedView
final long container = mLauncher.isHotseatLayout(cellLayout) ?
LauncherSettings.Favorites.CONTAINER_HOTSEAT :
LauncherSettings.Favorites.CONTAINER_DESKTOP;
- final int screen = indexOfChild(cellLayout);
- if (!mLauncher.isHotseatLayout(cellLayout) && screen != mCurrentPage
- && mState != State.SPRING_LOADED) {
- snapToPage(screen);
+ final int screen = mLauncher.isHotseatLayout(cellLayout) ?
+ mLauncher.getHotseat().indexOfChild(cellLayout) :
+ indexOfChild(cellLayout);
+ if (mState != State.SPRING_LOADED) {
+ if (!mLauncher.isHotseatLayout(cellLayout) && screen != mCurrentPage) {
+ snapToPage(screen);
+ } else if (mLauncher.isHotseatLayout(cellLayout) && screen != mLauncher.getHotseat().getCurrentPage()) {
+ mLauncher.getHotseat().snapToPage(screen);
+ }
}
if (info instanceof PendingAddItemInfo) {
final PendingAddItemInfo pendingInfo = (PendingAddItemInfo) dragInfo;
boolean findNearestVacantCell = true;
- if (pendingInfo.itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) {
- mTargetCell = findNearestArea((int) touchXY[0], (int) touchXY[1], spanX, spanY,
+ if (pendingInfo.itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT ||
+ pendingInfo.itemType == LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS) {
+ mTargetCell = findNearestArea(touchXY[0], touchXY[1], spanX, spanY,
cellLayout, mTargetCell);
float distance = cellLayout.getDistanceFromCell(mDragViewVisualCenter[0],
mDragViewVisualCenter[1], mTargetCell);
@@ -3105,11 +3683,12 @@ public class Workspace extends SmoothPagedView
animationStyle, finalView, true);
} else {
// This is for other drag/drop cases, like dragging from All Apps
- View view = null;
+ View view;
switch (info.itemType) {
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
+ case LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS:
if (info.container == NO_ID && info instanceof ApplicationInfo) {
// Came from all apps -- make a copy
info = new ShortcutInfo((ApplicationInfo) info);
@@ -3119,7 +3698,10 @@ public class Workspace extends SmoothPagedView
break;
case LauncherSettings.Favorites.ITEM_TYPE_FOLDER:
view = FolderIcon.fromXml(R.layout.folder_icon, mLauncher, cellLayout,
- (FolderInfo) info, mIconCache);
+ (FolderInfo) info);
+ if (mHideIconLabels) {
+ ((FolderIcon) view).setTextVisible(false);
+ }
break;
default:
throw new IllegalStateException("Unknown item type: " + info.itemType);
@@ -3128,7 +3710,7 @@ public class Workspace extends SmoothPagedView
// First we find the cell nearest to point at which the item is
// dropped, without any consideration to whether there is an item there.
if (touchXY != null) {
- mTargetCell = findNearestArea((int) touchXY[0], (int) touchXY[1], spanX, spanY,
+ mTargetCell = findNearestArea(touchXY[0], touchXY[1], spanX, spanY,
cellLayout, mTargetCell);
float distance = cellLayout.getDistanceFromCell(mDragViewVisualCenter[0],
mDragViewVisualCenter[1], mTargetCell);
@@ -3137,7 +3719,7 @@ public class Workspace extends SmoothPagedView
true, d.dragView, d.postAnimationRunnable)) {
return;
}
- if (addToExistingFolderIfNecessary(view, cellLayout, mTargetCell, distance, d,
+ if (addToExistingFolderIfNecessary(cellLayout, mTargetCell, distance, d,
true)) {
return;
}
@@ -3175,7 +3757,7 @@ public class Workspace extends SmoothPagedView
public Bitmap createWidgetBitmap(ItemInfo widgetInfo, View layout) {
int[] unScaledSize = mLauncher.getWorkspace().estimateItemSize(widgetInfo.spanX,
- widgetInfo.spanY, widgetInfo, false);
+ widgetInfo.spanY, false);
int visibility = layout.getVisibility();
layout.setVisibility(VISIBLE);
@@ -3195,13 +3777,13 @@ public class Workspace extends SmoothPagedView
private void getFinalPositionForDropAnimation(int[] loc, float[] scaleXY,
DragView dragView, CellLayout layout, ItemInfo info, int[] targetCell,
- boolean external, boolean scale) {
+ boolean scale) {
// Now we animate the dragView, (ie. the widget or shortcut preview) into its final
// location and size on the home screen.
int spanX = info.spanX;
int spanY = info.spanY;
- Rect r = estimateItemPosition(layout, info, targetCell[0], targetCell[1], spanX, spanY);
+ Rect r = estimateItemPosition(layout, targetCell[0], targetCell[1], spanX, spanY);
loc[0] = r.left;
loc[1] = r.top;
@@ -3239,7 +3821,7 @@ public class Workspace extends SmoothPagedView
float scaleXY[] = new float[2];
boolean scalePreview = !(info instanceof PendingAddShortcutInfo);
getFinalPositionForDropAnimation(finalPos, scaleXY, dragView, cellLayout, info, mTargetCell,
- external, scalePreview);
+ scalePreview);
Resources res = mLauncher.getResources();
int duration = res.getInteger(R.integer.config_dropAnimMaxDuration) - 200;
@@ -3266,7 +3848,7 @@ public class Workspace extends SmoothPagedView
if (animationType == ANIMATE_INTO_POSITION_AND_REMAIN) {
endStyle = DragLayer.ANIMATION_END_REMAIN_VISIBLE;
} else {
- endStyle = DragLayer.ANIMATION_END_DISAPPEAR;;
+ endStyle = DragLayer.ANIMATION_END_DISAPPEAR;
}
Runnable onComplete = new Runnable() {
@@ -3325,16 +3907,6 @@ public class Workspace extends SmoothPagedView
}
/**
- * Return the current CellInfo describing our current drag; this method exists
- * so that Launcher can sync this object with the correct info when the activity is created/
- * destroyed
- *
- */
- public CellLayout.CellInfo getDragInfo() {
- return mDragInfo;
- }
-
- /**
* Calculate the nearest cell where the given object would be dropped.
*
* pixelX and pixelY should be in the coordinate system of layout
@@ -3353,6 +3925,11 @@ public class Workspace extends SmoothPagedView
// needed
updateChildrenLayersEnabled(false);
setWallpaperDimension();
+ if (!mScrollWallpaper) {
+ centerWallpaperOffset();
+ }
+
+ mIsLandscape = LauncherApplication.isScreenLandscape(mLauncher);
}
/**
@@ -3372,14 +3949,14 @@ public class Workspace extends SmoothPagedView
} else if (mDragInfo != null) {
CellLayout cellLayout;
if (mLauncher.isHotseatLayout(target)) {
- cellLayout = mLauncher.getHotseat().getLayout();
+ cellLayout = (CellLayout) mLauncher.getHotseat().getChildAt(mDragInfo.screen);
} else {
cellLayout = (CellLayout) getChildAt(mDragInfo.screen);
}
cellLayout.onDropChild(mDragInfo.cell);
- }
- if (d.cancelled && mDragInfo.cell != null) {
+ if (mDragInfo.cell != null) {
mDragInfo.cell.setVisibility(VISIBLE);
+ }
}
mDragOutline = null;
mDragInfo = null;
@@ -3395,7 +3972,7 @@ public class Workspace extends SmoothPagedView
int container = Favorites.CONTAINER_DESKTOP;
if (mLauncher.isHotseatLayout(cl)) {
- screen = -1;
+ screen = mLauncher.getHotseat().indexOfChild(cl);
container = Favorites.CONTAINER_HOTSEAT;
}
@@ -3431,12 +4008,6 @@ public class Workspace extends SmoothPagedView
}
@Override
- protected void onRestoreInstanceState(Parcelable state) {
- super.onRestoreInstanceState(state);
- Launcher.setScreen(mCurrentPage);
- }
-
- @Override
protected void dispatchRestoreInstanceState(SparseArray<Parcelable> container) {
// We don't dispatch restoreInstanceState to our children using this code path.
// Some pages will be restored immediately as their items are bound immediately, and
@@ -3561,8 +4132,11 @@ public class Workspace extends SmoothPagedView
for (int screen = 0; screen < screenCount; screen++) {
layouts.add(((CellLayout) getChildAt(screen)));
}
- if (mLauncher.getHotseat() != null) {
- layouts.add(mLauncher.getHotseat().getLayout());
+ Hotseat hotseat = mLauncher.getHotseat();
+ if (hotseat != null) {
+ for (int screen = 0; screen < hotseat.getChildCount(); screen++) {
+ layouts.add((CellLayout) hotseat.getPageAt(screen));
+ }
}
return layouts;
}
@@ -3579,8 +4153,11 @@ public class Workspace extends SmoothPagedView
for (int screen = 0; screen < screenCount; screen++) {
childrenLayouts.add(((CellLayout) getChildAt(screen)).getShortcutsAndWidgets());
}
- if (mLauncher.getHotseat() != null) {
- childrenLayouts.add(mLauncher.getHotseat().getLayout().getShortcutsAndWidgets());
+ Hotseat hotseat = mLauncher.getHotseat();
+ if (hotseat != null) {
+ for (int screen = 0; screen < hotseat.getChildCount(); screen++) {
+ childrenLayouts.add(((CellLayout) hotseat.getPageAt(screen)).getShortcutsAndWidgets());
+ }
}
return childrenLayouts;
}
@@ -3654,10 +4231,10 @@ public class Workspace extends SmoothPagedView
if (tag instanceof ShortcutInfo) {
final ShortcutInfo info = (ShortcutInfo) tag;
final Intent intent = info.intent;
- final ComponentName name = intent.getComponent();
- if (name != null) {
- if (packageNames.contains(name.getPackageName())) {
+ if (intent != null) {
+ final ComponentName name = intent.getComponent();
+ if (name != null && packageNames.contains(name.getPackageName())) {
LauncherModel.deleteItemFromDatabase(mLauncher, info);
childrenToRemove.add(view);
}
@@ -3665,12 +4242,10 @@ public class Workspace extends SmoothPagedView
} else if (tag instanceof FolderInfo) {
final FolderInfo info = (FolderInfo) tag;
final ArrayList<ShortcutInfo> contents = info.contents;
- final int contentsCount = contents.size();
final ArrayList<ShortcutInfo> appsToRemoveFromFolder =
new ArrayList<ShortcutInfo>();
- for (int k = 0; k < contentsCount; k++) {
- final ShortcutInfo appInfo = contents.get(k);
+ for (final ShortcutInfo appInfo : contents) {
final Intent intent = appInfo.intent;
final ComponentName name = intent.getComponent();
@@ -3746,7 +4321,9 @@ public class Workspace extends SmoothPagedView
for (ItemInfo info : shortcuts) {
LauncherModel.deleteItemFromDatabase(context, info);
}
- } catch (URISyntaxException e) {}
+ } catch (URISyntaxException e) {
+ // Ignore
+ }
}
}
}
@@ -3767,12 +4344,13 @@ public class Workspace extends SmoothPagedView
// return null for some shortcuts (for instance, for shortcuts to
// web pages.)
final Intent intent = info.intent;
- final ComponentName name = intent.getComponent();
- if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION &&
- Intent.ACTION_MAIN.equals(intent.getAction()) && name != null) {
- final int appCount = apps.size();
- for (int k = 0; k < appCount; k++) {
- ApplicationInfo app = apps.get(k);
+ if (intent != null && info.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION &&
+ Intent.ACTION_MAIN.equals(intent.getAction())) {
+ final ComponentName name = intent.getComponent();
+ if (name == null) {
+ continue;
+ }
+ for (ApplicationInfo app : apps) {
if (app.componentName.equals(name)) {
BubbleTextView shortcut = (BubbleTextView) view;
info.updateIcon(mIconCache);
@@ -3789,12 +4367,12 @@ public class Workspace extends SmoothPagedView
void moveToDefaultScreen(boolean animate) {
if (!isSmall()) {
if (animate) {
- snapToPage(mDefaultPage);
+ snapToPage(mDefaultHomescreen);
} else {
- setCurrentPage(mDefaultPage);
+ setCurrentPage(mDefaultHomescreen);
}
}
- getChildAt(mDefaultPage).requestFocus();
+ getChildAt(mDefaultHomescreen).requestFocus();
}
@Override
@@ -3827,8 +4405,8 @@ public class Workspace extends SmoothPagedView
final View scrollIndicator = getScrollingIndicator();
cancelScrollingIndicatorAnimations();
- if (qsbDivider != null) qsbDivider.setAlpha(reducedFade);
- if (dockDivider != null) dockDivider.setAlpha(reducedFade);
- scrollIndicator.setAlpha(1 - fade);
+ if (qsbDivider != null && mShowSearchBar) qsbDivider.setAlpha(reducedFade);
+ if (dockDivider != null && mShowDockDivider) dockDivider.setAlpha(reducedFade);
+ if (scrollIndicator != null && mShowScrollingIndicator) scrollIndicator.setAlpha(1 - fade);
}
}
diff --git a/src/com/cyanogenmod/trebuchet/preference/DoubleNumberPickerPreference.java b/src/com/cyanogenmod/trebuchet/preference/DoubleNumberPickerPreference.java
new file mode 100644
index 000000000..81b766a44
--- /dev/null
+++ b/src/com/cyanogenmod/trebuchet/preference/DoubleNumberPickerPreference.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright (C) 2011 The CyanogenMod 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.
+ */
+
+package com.cyanogenmod.trebuchet.preference;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.preference.DialogPreference;
+import android.preference.Preference;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.TextView;
+import android.widget.EditText;
+import android.widget.NumberPicker;
+import com.cyanogenmod.trebuchet.R;
+
+/*
+ * @author Danesh
+ * @author nebkat
+ */
+
+public class DoubleNumberPickerPreference extends DialogPreference {
+ private int mMin1, mMax1, mDefault1;
+ private int mMin2, mMax2, mDefault2;
+
+ private String mMaxExternalKey1, mMinExternalKey1;
+ private String mMaxExternalKey2, mMinExternalKey2;
+
+ private String mPickerTitle1;
+ private String mPickerTitle2;
+
+ private NumberPicker mNumberPicker1;
+ private NumberPicker mNumberPicker2;
+
+ public DoubleNumberPickerPreference(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ TypedArray dialogType = context.obtainStyledAttributes(attrs,
+ com.android.internal.R.styleable.DialogPreference, 0, 0);
+ TypedArray doubleNumberPickerType = context.obtainStyledAttributes(attrs,
+ R.styleable.DoubleNumberPickerPreference, 0, 0);
+
+ mMaxExternalKey1 = doubleNumberPickerType.getString(R.styleable.DoubleNumberPickerPreference_maxExternal1);
+ mMinExternalKey1 = doubleNumberPickerType.getString(R.styleable.DoubleNumberPickerPreference_minExternal1);
+ mMaxExternalKey2 = doubleNumberPickerType.getString(R.styleable.DoubleNumberPickerPreference_maxExternal2);
+ mMinExternalKey2 = doubleNumberPickerType.getString(R.styleable.DoubleNumberPickerPreference_minExternal2);
+
+ mPickerTitle1 = doubleNumberPickerType.getString(R.styleable.DoubleNumberPickerPreference_pickerTitle1);
+ mPickerTitle2 = doubleNumberPickerType.getString(R.styleable.DoubleNumberPickerPreference_pickerTitle2);
+
+ mMax1 = doubleNumberPickerType.getInt(R.styleable.DoubleNumberPickerPreference_max1, 5);
+ mMin1 = doubleNumberPickerType.getInt(R.styleable.DoubleNumberPickerPreference_min1, 0);
+ mMax2 = doubleNumberPickerType.getInt(R.styleable.DoubleNumberPickerPreference_max2, 5);
+ mMin2 = doubleNumberPickerType.getInt(R.styleable.DoubleNumberPickerPreference_min2, 0);
+
+ mDefault1 = doubleNumberPickerType.getInt(R.styleable.DoubleNumberPickerPreference_defaultValue1, mMin1);
+ mDefault2 = doubleNumberPickerType.getInt(R.styleable.DoubleNumberPickerPreference_defaultValue2, mMin2);
+
+ dialogType.recycle();
+ doubleNumberPickerType.recycle();
+ }
+
+ @Override
+ protected View onCreateDialogView() {
+ int max1 = mMax1;
+ int min1 = mMin1;
+ int max2 = mMax2;
+ int min2 = mMin2;
+
+ // External values
+ if (mMaxExternalKey1 != null) {
+ max1 = getSharedPreferences().getInt(mMaxExternalKey1, mMax1);
+ }
+ if (mMinExternalKey1 != null) {
+ min1 = getSharedPreferences().getInt(mMinExternalKey1, mMin1);
+ }
+ if (mMaxExternalKey2 != null) {
+ max2 = getSharedPreferences().getInt(mMaxExternalKey2, mMax2);
+ }
+ if (mMinExternalKey2 != null) {
+ min2 = getSharedPreferences().getInt(mMinExternalKey2, mMin2);
+ }
+
+ LayoutInflater inflater =
+ (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ View view = inflater.inflate(R.layout.double_number_picker_dialog, null);
+
+ mNumberPicker1 = (NumberPicker) view.findViewById(R.id.number_picker_1);
+ mNumberPicker2 = (NumberPicker) view.findViewById(R.id.number_picker_2);
+
+ if (mNumberPicker1 == null || mNumberPicker2 == null) {
+ throw new RuntimeException("mNumberPicker1 or mNumberPicker2 is null!");
+ }
+
+ // Initialize state
+ mNumberPicker1.setWrapSelectorWheel(false);
+ mNumberPicker1.setMaxValue(max1);
+ mNumberPicker1.setMinValue(min1);
+ mNumberPicker1.setValue(getPersistedValue(1));
+ mNumberPicker2.setWrapSelectorWheel(false);
+ mNumberPicker2.setMaxValue(max2);
+ mNumberPicker2.setMinValue(min2);
+ mNumberPicker2.setValue(getPersistedValue(2));
+
+ // Titles
+ TextView pickerTitle1 = (TextView) view.findViewById(R.id.picker_title_1);
+ TextView pickerTitle2 = (TextView) view.findViewById(R.id.picker_title_2);
+
+ if (pickerTitle1 != null && pickerTitle2 != null) {
+ pickerTitle1.setText(mPickerTitle1);
+ pickerTitle2.setText(mPickerTitle2);
+ }
+
+ // No keyboard popup
+ EditText textInput1 = (EditText) mNumberPicker1.findViewById(com.android.internal.R.id.numberpicker_input);
+ EditText textInput2 = (EditText) mNumberPicker2.findViewById(com.android.internal.R.id.numberpicker_input);
+ if (textInput1 != null && textInput2 != null) {
+ textInput1.setCursorVisible(false);
+ textInput1.setFocusable(false);
+ textInput1.setFocusableInTouchMode(false);
+ textInput2.setCursorVisible(false);
+ textInput2.setFocusable(false);
+ textInput2.setFocusableInTouchMode(false);
+ }
+
+ return view;
+ }
+
+ private int getPersistedValue(int value) {
+ String[] values = getPersistedString(mDefault1 + "|" + mDefault2).split("\\|");
+ if (value == 1) {
+ try {
+ return Integer.parseInt(values[0]);
+ } catch (NumberFormatException e) {
+ return mDefault1;
+ }
+ } else {
+ try {
+ return Integer.parseInt(values[1]);
+ } catch (NumberFormatException e) {
+ return mDefault2;
+ }
+ }
+ }
+
+ @Override
+ protected void onDialogClosed(boolean positiveResult) {
+ if (positiveResult) {
+ persistString(mNumberPicker1.getValue() + "|" + mNumberPicker2.getValue());
+ }
+ }
+
+ public void setMin1(int min) {
+ mMin1 = min;
+ }
+ public void setMax1(int max) {
+ mMax1 = max;
+ }
+ public void setMin2(int min) {
+ mMin2 = min;
+ }
+ public void setMax2(int max) {
+ mMax2 = max;
+ }
+ public void setDefault1(int def) {
+ mDefault1 = def;
+ }
+ public void setDefault2(int def) {
+ mDefault2 = def;
+ }
+
+}
diff --git a/src/com/cyanogenmod/trebuchet/preference/HiddenAppsActivity.java b/src/com/cyanogenmod/trebuchet/preference/HiddenAppsActivity.java
new file mode 100644
index 000000000..05aea7fbd
--- /dev/null
+++ b/src/com/cyanogenmod/trebuchet/preference/HiddenAppsActivity.java
@@ -0,0 +1,234 @@
+package com.cyanogenmod.trebuchet.preference;
+
+import android.app.AlertDialog;
+import android.app.ListActivity;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.pm.ResolveInfo;
+import android.content.pm.PackageManager;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.preference.PreferenceManager;
+import android.util.SparseBooleanArray;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.widget.ArrayAdapter;
+import android.widget.Checkable;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.cyanogenmod.trebuchet.R;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+public class HiddenAppsActivity extends ListActivity implements MenuItem.OnMenuItemClickListener {
+
+ private boolean mSaved;
+
+ private static final int MENU_DELETE = 0;
+
+ private PackageManager mPackageManager;
+
+ private AppsAdapter mAppsAdapter;
+
+ protected void onCreate(Bundle savedInstanceState) {
+ requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
+ super.onCreate(savedInstanceState);
+
+ setTitle(R.string.hidden_apps_title);
+ setContentView(R.layout.hidden_apps_list);
+
+ getActionBar().setDisplayHomeAsUpEnabled(true);
+ setProgressBarIndeterminateVisibility(true);
+ setProgressBarIndeterminate(true);
+
+ mPackageManager = getPackageManager();
+ mAppsAdapter = new AppsAdapter(this, R.layout.hidden_apps_list_item);
+ mAppsAdapter.setNotifyOnChange(true);
+
+ setListAdapter(mAppsAdapter);
+
+ AsyncTask<Void, Void, Void> refreshAppsTask = new AsyncTask<Void, Void, Void>(){
+
+ @Override
+ protected void onPostExecute(Void result) {
+ restore();
+ setProgressBarIndeterminateVisibility(false);
+ setProgressBarIndeterminate(false);
+ super.onPostExecute(result);
+ }
+
+ @Override
+ protected Void doInBackground(Void... params) {
+ refreshApps();
+ return null;
+ }
+ };
+ refreshAppsTask.execute(null, null, null);
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ save();
+ }
+
+ private void save() {
+ if (!mSaved) {
+ StringBuilder string = new StringBuilder("");
+
+ SparseBooleanArray checked = getListView().getCheckedItemPositions();
+
+ for (int i = 0; i < checked.size(); i++) {
+ if (checked.valueAt(i)) {
+ ResolveInfo app = (ResolveInfo) getListView().getItemAtPosition(checked.keyAt(i));
+ if (string.length() > 0) string.append("|");
+ string.append(new ComponentName(app.activityInfo.packageName, app.activityInfo.name).flattenToString());
+
+ }
+ }
+
+ SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
+ editor.putString("ui_drawer_hidden_apps", string.toString());
+ editor.putBoolean(PreferencesProvider.PREFERENCES_CHANGED, true);
+ editor.commit();
+
+ mSaved = true;
+ }
+ }
+
+ private void restore() {
+ List<ComponentName> apps = new ArrayList<ComponentName>();
+ String[] flattened = PreferenceManager.getDefaultSharedPreferences(this)
+ .getString("ui_drawer_hidden_apps", "").split("\\|");
+ for (String flat : flattened) {
+ apps.add(ComponentName.unflattenFromString(flat));
+ }
+
+ for (int i = 0; i < getListAdapter().getCount(); i++) {
+ ResolveInfo info = (ResolveInfo) getListAdapter().getItem(i);
+ if (apps.contains(new ComponentName(info.activityInfo.packageName, info.activityInfo.name))) {
+ getListView().setItemChecked(i, true);
+ }
+ }
+
+ mSaved = true;
+
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+
+ menu.add(0, MENU_DELETE, 0, R.string.menu_hidden_apps_delete)
+ .setOnMenuItemClickListener(this)
+ .setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+
+ return true;
+ }
+
+ @Override
+ public boolean onMenuItemClick(MenuItem item) {
+ switch (item.getItemId()) {
+ case MENU_DELETE:
+ delete();
+ return true;
+ }
+ return false;
+ }
+
+ private void delete() {
+ for (int i = 0; i < getListView().getCount(); i++) {
+ getListView().setItemChecked(i, false);
+ }
+
+ mSaved = false;
+ }
+
+ private void refreshApps() {
+ final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
+ mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
+ final List<ResolveInfo> apps = mPackageManager.queryIntentActivities(mainIntent, 0);
+ Collections.sort(apps, new ResolveInfo.DisplayNameComparator(mPackageManager));
+
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ mAppsAdapter.clear();
+ mAppsAdapter.addAll(apps);
+ }
+ });
+ }
+
+ @Override
+ public boolean onMenuItemSelected(int featureId, MenuItem item) {
+ boolean result = super.onMenuItemSelected(featureId, item);
+ if (item.getItemId() == android.R.id.home) {
+ finish();
+ return true;
+ }
+ return result;
+ }
+
+ private class AppsAdapter extends ArrayAdapter<ResolveInfo> {
+
+ private final LayoutInflater mInfaltor;
+
+ public AppsAdapter(Context context, int textViewResourceId) {
+ super(context, textViewResourceId);
+
+ mInfaltor = LayoutInflater.from(context);
+
+ }
+
+ @Override
+ public long getItemId(int id) {
+ return id;
+ }
+
+ @Override
+ public View getView(final int position, View convertView, ViewGroup parent) {
+ final ResolveInfo info = getItem(position);
+
+ if(convertView == null) {
+ convertView = mInfaltor.inflate(R.layout.hidden_apps_list_item, parent, false);
+ }
+
+ final View item = convertView;
+
+ ImageView icon = (ImageView) item.findViewById(R.id.icon);
+ TextView title = (TextView) item.findViewById(R.id.title);
+
+ icon.setImageDrawable(info.loadIcon(mPackageManager));
+ title.setText(info.loadLabel(mPackageManager));
+
+ item.setTag(info.activityInfo.packageName);
+
+ item.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ getListView().setItemChecked(position, !((Checkable) item).isChecked());
+ mSaved = false;
+ }
+ });
+
+ return convertView;
+ }
+
+ @Override
+ public boolean hasStableIds() {
+ return true;
+ }
+ }
+}
diff --git a/src/com/cyanogenmod/trebuchet/preference/NumberPickerPreference.java b/src/com/cyanogenmod/trebuchet/preference/NumberPickerPreference.java
new file mode 100644
index 000000000..8e1058c77
--- /dev/null
+++ b/src/com/cyanogenmod/trebuchet/preference/NumberPickerPreference.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2011 The CyanogenMod 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.
+ */
+
+package com.cyanogenmod.trebuchet.preference;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.preference.Preference;
+import android.preference.DialogPreference;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.LinearLayout;
+import android.widget.NumberPicker;
+
+import com.cyanogenmod.trebuchet.R;
+
+/*
+ * @author Danesh
+ * @author nebkat
+ */
+
+public class NumberPickerPreference extends DialogPreference {
+ private int mMin, mMax, mDefault;
+
+ private String mMaxExternalKey, mMinExternalKey;
+
+ private NumberPicker mNumberPicker;
+
+ public NumberPickerPreference(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ TypedArray dialogType = context.obtainStyledAttributes(attrs,
+ com.android.internal.R.styleable.DialogPreference, 0, 0);
+ TypedArray numberPickerType = context.obtainStyledAttributes(attrs,
+ R.styleable.NumberPickerPreference, 0, 0);
+
+ mMaxExternalKey = numberPickerType.getString(R.styleable.NumberPickerPreference_maxExternal);
+ mMinExternalKey = numberPickerType.getString(R.styleable.NumberPickerPreference_minExternal);
+
+ mMax = numberPickerType.getInt(R.styleable.NumberPickerPreference_max, 5);
+ mMin = numberPickerType.getInt(R.styleable.NumberPickerPreference_min, 0);
+
+ mDefault = dialogType.getInt(com.android.internal.R.styleable.Preference_defaultValue, mMin);
+
+ dialogType.recycle();
+ numberPickerType.recycle();
+ }
+
+ @Override
+ protected View onCreateDialogView() {
+ int max = mMax;
+ int min = mMin;
+
+ // External values
+ if (mMaxExternalKey != null) {
+ max = getSharedPreferences().getInt(mMaxExternalKey, mMax);
+ }
+ if (mMinExternalKey != null) {
+ min = getSharedPreferences().getInt(mMinExternalKey, mMin);
+ }
+
+ LayoutInflater inflater =
+ (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ View view = inflater.inflate(R.layout.number_picker_dialog, null);
+
+ mNumberPicker = (NumberPicker) view.findViewById(R.id.number_picker);
+
+ // Initialize state
+ mNumberPicker.setMaxValue(max);
+ mNumberPicker.setMinValue(min);
+ mNumberPicker.setValue(getPersistedInt(mDefault));
+ mNumberPicker.setWrapSelectorWheel(false);
+
+ // No keyboard popup
+ EditText textInput = (EditText) mNumberPicker.findViewById(com.android.internal.R.id.numberpicker_input);
+ textInput.setCursorVisible(false);
+ textInput.setFocusable(false);
+ textInput.setFocusableInTouchMode(false);
+
+ return view;
+ }
+
+ @Override
+ protected void onDialogClosed(boolean positiveResult) {
+ if (positiveResult) {
+ persistInt(mNumberPicker.getValue());
+ }
+ }
+
+}
diff --git a/src/com/cyanogenmod/trebuchet/preference/Preferences.java b/src/com/cyanogenmod/trebuchet/preference/Preferences.java
new file mode 100644
index 000000000..8b18e2aa7
--- /dev/null
+++ b/src/com/cyanogenmod/trebuchet/preference/Preferences.java
@@ -0,0 +1,257 @@
+/*
+ * Copyright (C) 2011 The CyanogenMod 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.
+ */
+
+package com.cyanogenmod.trebuchet.preference;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.content.res.Resources;
+import android.os.Bundle;
+import android.preference.Preference;
+import android.preference.PreferenceActivity;
+import android.preference.PreferenceFragment;
+import android.preference.PreferenceScreen;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ImageView;
+import android.widget.ListAdapter;
+import android.widget.TextView;
+
+import com.cyanogenmod.trebuchet.LauncherApplication;
+import com.cyanogenmod.trebuchet.R;
+
+import java.util.List;
+
+public class Preferences extends PreferenceActivity
+ implements SharedPreferences.OnSharedPreferenceChangeListener {
+
+ private static final String TAG = "Trebuchet.Preferences";
+
+ private SharedPreferences mPreferences;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ mPreferences = getSharedPreferences(PreferencesProvider.PREFERENCES_KEY,
+ Context.MODE_PRIVATE);
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ mPreferences.registerOnSharedPreferenceChangeListener(this);
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ mPreferences.unregisterOnSharedPreferenceChangeListener(this);
+ }
+
+ @Override
+ public void onBuildHeaders(List<Header> target) {
+ loadHeadersFromResource(R.xml.preferences_headers, target);
+ updateHeaders(target);
+ }
+
+ private void updateHeaders(List<Header> headers) {
+ int i = 0;
+ while (i < headers.size()) {
+ Header header = headers.get(i);
+
+ // Version preference
+ if (header.id == R.id.preferences_application_version) {
+ header.title = getString(R.string.application_name) + " " + getString(R.string.application_version);
+ }
+
+ // Increment if not removed
+ if (headers.get(i) == header) {
+ i++;
+ }
+ }
+ }
+
+ @Override
+ public void setListAdapter(ListAdapter adapter) {
+ if (adapter == null) {
+ super.setListAdapter(null);
+ } else {
+ super.setListAdapter(new HeaderAdapter(this, getHeaders()));
+ }
+ }
+
+ @Override
+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
+ SharedPreferences.Editor editor = mPreferences.edit();
+ editor.putBoolean(PreferencesProvider.PREFERENCES_CHANGED, true);
+ editor.commit();
+ }
+
+ public static class HomescreenFragment extends PreferenceFragment {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ addPreferencesFromResource(R.xml.preferences_homescreen);
+
+ PreferenceScreen preferenceScreen = getPreferenceScreen();
+ if (LauncherApplication.isScreenLarge()) {
+ preferenceScreen.removePreference(findPreference("ui_homescreen_grid"));
+ }
+ }
+ }
+
+ public static class DrawerFragment extends PreferenceFragment {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ addPreferencesFromResource(R.xml.preferences_drawer);
+ }
+ }
+
+ public static class DockFragment extends PreferenceFragment {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ addPreferencesFromResource(R.xml.preferences_dock);
+ }
+ }
+
+ public static class GeneralFragment extends PreferenceFragment {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ addPreferencesFromResource(R.xml.preferences_general);
+ }
+ }
+
+ private static class HeaderAdapter extends ArrayAdapter<Header> {
+ private static final int HEADER_TYPE_NORMAL = 0;
+ private static final int HEADER_TYPE_CATEGORY = 1;
+
+ private static final int HEADER_TYPE_COUNT = HEADER_TYPE_CATEGORY + 1;
+
+ private static class HeaderViewHolder {
+ ImageView icon;
+ TextView title;
+ TextView summary;
+ }
+
+ private LayoutInflater mInflater;
+
+ static int getHeaderType(Header header) {
+ if (header.id == R.id.preferences_application_section) {
+ return HEADER_TYPE_CATEGORY;
+ } else {
+ return HEADER_TYPE_NORMAL;
+ }
+ }
+
+ @Override
+ public int getItemViewType(int position) {
+ Header header = getItem(position);
+ return getHeaderType(header);
+ }
+
+ @Override
+ public boolean areAllItemsEnabled() {
+ return false; // because of categories
+ }
+
+ @Override
+ public boolean isEnabled(int position) {
+ return getItemViewType(position) != HEADER_TYPE_CATEGORY;
+ }
+
+ @Override
+ public int getViewTypeCount() {
+ return HEADER_TYPE_COUNT;
+ }
+
+ @Override
+ public boolean hasStableIds() {
+ return true;
+ }
+
+ public HeaderAdapter(Context context, List<Header> objects) {
+ super(context, 0, objects);
+
+ mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ HeaderViewHolder holder;
+ Header header = getItem(position);
+ int headerType = getHeaderType(header);
+ View view = null;
+
+ if (convertView == null) {
+ holder = new HeaderViewHolder();
+ switch (headerType) {
+ case HEADER_TYPE_CATEGORY:
+ view = new TextView(getContext(), null,
+ android.R.attr.listSeparatorTextViewStyle);
+ holder.title = (TextView) view;
+ break;
+
+ case HEADER_TYPE_NORMAL:
+ view = mInflater.inflate(
+ R.layout.preference_header_item, parent,
+ false);
+ holder.icon = (ImageView) view.findViewById(R.id.icon);
+ holder.title = (TextView)
+ view.findViewById(com.android.internal.R.id.title);
+ holder.summary = (TextView)
+ view.findViewById(com.android.internal.R.id.summary);
+ break;
+ }
+ view.setTag(holder);
+ } else {
+ view = convertView;
+ holder = (HeaderViewHolder) view.getTag();
+ }
+
+ // All view fields must be updated every time, because the view may be recycled
+ switch (headerType) {
+ case HEADER_TYPE_CATEGORY:
+ holder.title.setText(header.getTitle(getContext().getResources()));
+ break;
+
+ case HEADER_TYPE_NORMAL:
+ holder.icon.setImageResource(header.iconRes);
+ holder.title.setText(header.getTitle(getContext().getResources()));
+ CharSequence summary = header.getSummary(getContext().getResources());
+ if (!TextUtils.isEmpty(summary)) {
+ holder.summary.setVisibility(View.VISIBLE);
+ holder.summary.setText(summary);
+ } else {
+ holder.summary.setVisibility(View.GONE);
+ }
+ break;
+ }
+
+ return view;
+ }
+ }
+}
diff --git a/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java
new file mode 100644
index 000000000..a484f72ee
--- /dev/null
+++ b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java
@@ -0,0 +1,216 @@
+/*
+ * Copyright (C) 2011 The CyanogenMod 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.
+ */
+
+package com.cyanogenmod.trebuchet.preference;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+
+import com.cyanogenmod.trebuchet.LauncherApplication;
+import com.cyanogenmod.trebuchet.Workspace;
+import com.cyanogenmod.trebuchet.AppsCustomizePagedView;
+
+import java.util.Map;
+
+public final class PreferencesProvider {
+ public static final String PREFERENCES_KEY = "com.cyanogenmod.trebuchet_preferences";
+
+ public static final String PREFERENCES_CHANGED = "preferences_changed";
+
+ private static Map<String, ?> sKeyValues;
+
+ public static void load(Context context) {
+ SharedPreferences preferences = context.getSharedPreferences(PREFERENCES_KEY, 0);
+ sKeyValues = preferences.getAll();
+ }
+
+ private static int getInt(String key, int def) {
+ return sKeyValues.containsKey(key) && sKeyValues.get(key) instanceof Integer ?
+ (Integer) sKeyValues.get(key) : def;
+ }
+
+ private static boolean getBoolean(String key, boolean def) {
+ return sKeyValues.containsKey(key) && sKeyValues.get(key) instanceof Boolean ?
+ (Boolean) sKeyValues.get(key) : def;
+ }
+
+ private static String getString(String key, String def) {
+ return sKeyValues.containsKey(key) && sKeyValues.get(key) instanceof String ?
+ (String) sKeyValues.get(key) : def;
+ }
+
+ public static class Interface {
+ public static class Homescreen {
+ public static int getNumberHomescreens() {
+ return getInt("ui_homescreen_screens", 5);
+ }
+ public static int getDefaultHomescreen(int def) {
+ return getInt("ui_homescreen_default_screen", def + 1) - 1;
+ }
+ public static int getCellCountX(int def) {
+ String[] values = getString("ui_homescreen_grid", "0|" + def).split("\\|");
+ try {
+ return Integer.parseInt(values[1]);
+ } catch (NumberFormatException e) {
+ return def;
+ }
+ }
+ public static int getCellCountY(int def) {
+ String[] values = getString("ui_homescreen_grid", def + "|0").split("\\|");
+ try {
+ return Integer.parseInt(values[0]);
+ } catch (NumberFormatException e) {
+ return def;
+ }
+ }
+ public static boolean getStretchScreens() {
+ return getBoolean("ui_homescreen_stretch_screens", false);
+ }
+ public static boolean getShowSearchBar() {
+ return getBoolean("ui_homescreen_general_search", true);
+ }
+ public static boolean getHideIconLabels() {
+ return getBoolean("ui_homescreen_general_hide_icon_labels", false);
+ }
+ public static class Scrolling {
+ public static Workspace.TransitionEffect getTransitionEffect(String def) {
+ try {
+ return Workspace.TransitionEffect.valueOf(
+ getString("ui_homescreen_scrolling_transition_effect", def));
+ } catch (IllegalArgumentException iae) {
+ // Continue
+ }
+
+ try {
+ return Workspace.TransitionEffect.valueOf(def);
+ } catch (IllegalArgumentException iae) {
+ // Continue
+ }
+
+ return Workspace.TransitionEffect.Standard;
+ }
+ public static boolean getScrollWallpaper() {
+ return getBoolean("ui_homescreen_scrolling_scroll_wallpaper", true);
+ }
+ public static boolean getWallpaperHack(boolean def) {
+ return getBoolean("ui_homescreen_scrolling_wallpaper_hack", def);
+ }
+ public static int getWallpaperSize() {
+ return getInt("ui_homescreen_scrolling_wallpaper_size", 2);
+ }
+ public static boolean getFadeInAdjacentScreens(boolean def) {
+ return getBoolean("ui_homescreen_scrolling_fade_adjacent_screens", def);
+ }
+ public static boolean getShowOutlines(boolean def) {
+ return getBoolean("ui_homescreen_scrolling_show_outlines", def);
+ }
+ }
+ public static class Indicator {
+ public static boolean getShowScrollingIndicator() {
+ return getBoolean("ui_homescreen_indicator_enable", true);
+ }
+ public static boolean getFadeScrollingIndicator() {
+ return getBoolean("ui_homescreen_indicator_fade", true);
+ }
+ public static int getScrollingIndicatorPosition() {
+ return Integer.parseInt(getString("ui_homescreen_indicator_position", "0"));
+ }
+ }
+ }
+
+ public static class Drawer {
+ public static boolean getVertical() {
+ return getString("ui_drawer_orientation", "horizontal").equals("vertical");
+ }
+ public static boolean getJoinWidgetsApps() {
+ return getBoolean("ui_drawer_widgets_join_apps", true);
+ }
+ public static String getHiddenApps() {
+ return getString("ui_drawer_hidden_apps", "");
+ }
+ public static class Scrolling {
+ public static AppsCustomizePagedView.TransitionEffect getTransitionEffect(String def) {
+ try {
+ return AppsCustomizePagedView.TransitionEffect.valueOf(
+ getString("ui_drawer_scrolling_transition_effect", def));
+ } catch (IllegalArgumentException iae) {
+ // Continue
+ }
+
+ try {
+ return AppsCustomizePagedView.TransitionEffect.valueOf(def);
+ } catch (IllegalArgumentException iae) {
+ // Continue
+ }
+
+ return AppsCustomizePagedView.TransitionEffect.Standard;
+ }
+ public static boolean getFadeInAdjacentScreens() {
+ return getBoolean("ui_drawer_scrolling_fade_adjacent_screens", false);
+ }
+ }
+ public static class Indicator {
+ public static boolean getShowScrollingIndicator() {
+ return getBoolean("ui_drawer_indicator_enable", true);
+ }
+ public static boolean getFadeScrollingIndicator() {
+ return getBoolean("ui_drawer_indicator_fade", true);
+ }
+ public static int getScrollingIndicatorPosition() {
+ return Integer.parseInt(getString("ui_drawer_indicator_position", "0"));
+ }
+ }
+ }
+
+ public static class Dock {
+ public static boolean getShowDock() {
+ return getBoolean("ui_dock_enabled", true);
+ }
+ public static int getNumberPages() {
+ return getInt("ui_dock_pages", 1);
+ }
+ public static int getDefaultPage(int def) {
+ return getInt("ui_dock_default_page", def + 1) - 1;
+ }
+ public static int getNumberIcons(int def) {
+ return getInt("ui_dock_icons", def);
+ }
+ public static int getIconScale(int def) {
+ return getInt("ui_dock_icon_scale", def);
+ }
+ public static boolean getShowDivider() {
+ return getBoolean("ui_dock_divider", true);
+ }
+ }
+
+ public static class Icons {
+
+ }
+
+ public static class General {
+ public static boolean getAutoRotate(boolean def) {
+ return getBoolean("ui_general_orientation", def);
+ }
+ public static boolean getFullscreenMode() {
+ return getBoolean("ui_general_fullscreen", false);
+ }
+ }
+ }
+
+ public static class Application {
+
+ }
+}
diff --git a/src/com/cyanogenmod/trebuchet/preference/SeekBarDialogPreference.java b/src/com/cyanogenmod/trebuchet/preference/SeekBarDialogPreference.java
new file mode 100644
index 000000000..5d2c8d022
--- /dev/null
+++ b/src/com/cyanogenmod/trebuchet/preference/SeekBarDialogPreference.java
@@ -0,0 +1,82 @@
+package com.cyanogenmod.trebuchet.preference;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.preference.DialogPreference;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.SeekBar;
+import android.widget.TextView;
+
+import com.cyanogenmod.trebuchet.R;
+
+/**
+ * @author nebkat
+ */
+public class SeekBarDialogPreference extends DialogPreference implements SeekBar.OnSeekBarChangeListener {
+ private int mMax, mMin, mDefault;
+
+ private String mPrefix, mSuffix;
+
+ private TextView mValueText;
+ private SeekBar mSeekBar;
+
+ public SeekBarDialogPreference(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ TypedArray dialogType = context.obtainStyledAttributes(attrs,
+ com.android.internal.R.styleable.DialogPreference, 0, 0);
+ TypedArray seekBarType = context.obtainStyledAttributes(attrs,
+ R.styleable.SeekBarDialogPreference, 0, 0);
+
+ mMax = seekBarType.getInt(R.styleable.SeekBarDialogPreference_max, 100);
+ mMin = seekBarType.getInt(R.styleable.SeekBarDialogPreference_min, 0);
+
+ mDefault = dialogType.getInt(com.android.internal.R.styleable.Preference_defaultValue, mMin);
+
+ mPrefix = seekBarType.getString(R.styleable.SeekBarDialogPreference_prefix);
+ mSuffix = seekBarType.getString(R.styleable.SeekBarDialogPreference_suffix);
+ if (mPrefix == null) {
+ mPrefix = "";
+ }
+ if (mSuffix == null) {
+ mSuffix = "%";
+ }
+
+ dialogType.recycle();
+ seekBarType.recycle();
+ }
+
+ @Override
+ protected View onCreateDialogView() {
+ LayoutInflater inflater =
+ (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ View view = inflater.inflate(R.layout.seekbar_dialog, null);
+
+ mValueText = (TextView) view.findViewById(R.id.value);
+
+ mSeekBar = (SeekBar) view.findViewById(R.id.seekbar);
+ mSeekBar.setOnSeekBarChangeListener(this);
+ mSeekBar.setMax(mMax - mMin);
+ mSeekBar.setProgress(getPersistedInt(mDefault) - mMin);
+
+ mValueText.setText(mPrefix + getPersistedInt(mDefault) + mSuffix);
+
+ return view;
+ }
+
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
+ mValueText.setText(mPrefix + (progress + mMin) + mSuffix);
+ }
+
+ public void onStartTrackingTouch(SeekBar seekBar) {}
+ public void onStopTrackingTouch(SeekBar seekBar) {}
+
+ @Override
+ protected void onDialogClosed(boolean positiveResult) {
+ if (positiveResult) {
+ persistInt(mSeekBar.getProgress() + mMin);
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/com/cyanogenmod/trebuchet/widget/CheckableLinearLayout.java b/src/com/cyanogenmod/trebuchet/widget/CheckableLinearLayout.java
new file mode 100644
index 000000000..0e87f801f
--- /dev/null
+++ b/src/com/cyanogenmod/trebuchet/widget/CheckableLinearLayout.java
@@ -0,0 +1,50 @@
+package com.cyanogenmod.trebuchet.widget;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.CheckBox;
+import android.widget.Checkable;
+import android.widget.LinearLayout;
+
+import com.cyanogenmod.trebuchet.R;
+
+/*
+ * This class is useful for using inside of ListView that needs to have checkable items.
+ */
+public class CheckableLinearLayout extends LinearLayout implements Checkable {
+ private CheckBox mCheckBox;
+
+ public CheckableLinearLayout(Context context) {
+ super(context);
+ }
+
+ public CheckableLinearLayout(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public CheckableLinearLayout(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ @Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+
+ mCheckBox = (CheckBox) findViewById(R.id.checkbox);
+ }
+
+ @Override
+ public boolean isChecked() {
+ return mCheckBox.isChecked();
+ }
+
+ @Override
+ public void setChecked(boolean checked) {
+ mCheckBox.setChecked(checked);
+ }
+
+ @Override
+ public void toggle() {
+ mCheckBox.toggle();
+ }
+} \ No newline at end of file
diff --git a/src/com/cyanogenmod/trebuchet/widget/CustomAbsSpinner.java b/src/com/cyanogenmod/trebuchet/widget/CustomAbsSpinner.java
new file mode 100644
index 000000000..7861f50b0
--- /dev/null
+++ b/src/com/cyanogenmod/trebuchet/widget/CustomAbsSpinner.java
@@ -0,0 +1,507 @@
+/*
+ * Copyright (C) 2013 The CyanogenMod Project
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.cyanogenmod.trebuchet.widget;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.database.DataSetObserver;
+import android.graphics.Rect;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.AttributeSet;
+import android.util.SparseArray;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.animation.Interpolator;
+import android.widget.ArrayAdapter;
+import android.widget.SpinnerAdapter;
+import com.cyanogenmod.trebuchet.R;
+
+public abstract class CustomAbsSpinner extends CustomAdapterView<SpinnerAdapter> {
+
+ SpinnerAdapter mAdapter;
+
+ int mHeightMeasureSpec;
+ int mWidthMeasureSpec;
+ boolean mBlockLayoutRequests;
+ int mSelectionLeftPadding = 0;
+ int mSelectionTopPadding = 0;
+ int mSelectionRightPadding = 0;
+ int mSelectionBottomPadding = 0;
+ Rect mSpinnerPadding = new Rect();
+ View mSelectedView = null;
+ Interpolator mInterpolator;
+
+ RecycleBin mRecycler = new RecycleBin();
+ private DataSetObserver mDataSetObserver;
+
+
+ /** Temporary frame to hold a child View's frame rectangle */
+ private Rect mTouchFrame;
+
+ public CustomAbsSpinner(Context context) {
+ super(context);
+ initAbsSpinner();
+ }
+
+ public CustomAbsSpinner(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public CustomAbsSpinner(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ initAbsSpinner();
+
+ TypedArray a = context.obtainStyledAttributes(attrs,
+ R.styleable.CustomAbsSpinner, defStyle, 0);
+
+ CharSequence[] entries = a.getTextArray(R.styleable.CustomAbsSpinner_entries);
+ if (entries != null) {
+ ArrayAdapter<CharSequence> adapter =
+ new ArrayAdapter<CharSequence>(context,
+ android.R.layout.simple_spinner_item, entries);
+ adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ setAdapter(adapter);
+ }
+
+ a.recycle();
+ }
+
+ /**
+ * Common code for different constructor flavors
+ */
+ private void initAbsSpinner() {
+ setFocusable(true);
+ setWillNotDraw(false);
+ }
+
+
+ /**
+ * The Adapter is used to provide the data which backs this Spinner.
+ * It also provides methods to transform spinner items based on their position
+ * relative to the selected item.
+ * @param adapter The SpinnerAdapter to use for this Spinner
+ */
+ @Override
+ public void setAdapter(SpinnerAdapter adapter) {
+ if (null != mAdapter) {
+ mAdapter.unregisterDataSetObserver(mDataSetObserver);
+ resetList();
+ }
+
+ mAdapter = adapter;
+
+ mOldSelectedPosition = INVALID_POSITION;
+ mOldSelectedRowId = INVALID_ROW_ID;
+
+ if (mAdapter != null) {
+ mOldItemCount = mItemCount;
+ mItemCount = mAdapter.getCount();
+ checkFocus();
+
+ mDataSetObserver = new AdapterDataSetObserver();
+ mAdapter.registerDataSetObserver(mDataSetObserver);
+
+ int position = mItemCount > 0 ? 0 : INVALID_POSITION;
+
+ setSelectedPositionInt(position);
+ setNextSelectedPositionInt(position);
+
+ if (mItemCount == 0) {
+ // Nothing selected
+ checkSelectionChanged();
+ }
+
+ } else {
+ checkFocus();
+ resetList();
+ // Nothing selected
+ checkSelectionChanged();
+ }
+
+ requestLayout();
+ }
+
+ /**
+ * Clear out all children from the list
+ */
+ void resetList() {
+ mDataChanged = false;
+ mNeedSync = false;
+
+ removeAllViewsInLayout();
+ mOldSelectedPosition = INVALID_POSITION;
+ mOldSelectedRowId = INVALID_ROW_ID;
+
+ setSelectedPositionInt(INVALID_POSITION);
+ setNextSelectedPositionInt(INVALID_POSITION);
+ invalidate();
+ }
+
+ /**
+ * @see android.view.View#measure(int, int)
+ *
+ * Figure out the dimensions of this Spinner. The width comes from
+ * the widthMeasureSpec as Spinnners can't have their width set to
+ * UNSPECIFIED. The height is based on the height of the selected item
+ * plus padding.
+ */
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ int widthMode = MeasureSpec.getMode(widthMeasureSpec);
+ int widthSize;
+ int heightSize;
+
+ int paddingLeft = getPaddingLeft();
+ int paddingRight = getPaddingRight();
+ int paddingTop = getPaddingTop();
+ int paddingBottom = getPaddingBottom();
+
+ mSpinnerPadding.left = paddingLeft > mSelectionLeftPadding ? paddingLeft
+ : mSelectionLeftPadding;
+ mSpinnerPadding.top = paddingTop > mSelectionTopPadding ? paddingTop
+ : mSelectionTopPadding;
+ mSpinnerPadding.right = paddingRight > mSelectionRightPadding ? paddingRight
+ : mSelectionRightPadding;
+ mSpinnerPadding.bottom = paddingBottom > mSelectionBottomPadding ? paddingBottom
+ : mSelectionBottomPadding;
+
+ if (mDataChanged) {
+ handleDataChanged();
+ }
+
+ int preferredHeight = 0;
+ int preferredWidth = 0;
+ boolean needsMeasuring = true;
+
+ int selectedPosition = getSelectedItemPosition();
+ if (selectedPosition >= 0 && mAdapter != null) {
+ // Try looking in the recycler. (Maybe we were measured once already)
+ View view = mRecycler.get();
+ if (view == null) {
+ // Make a new one
+ view = mAdapter.getView(selectedPosition, null, this);
+ }
+
+ if (view != null) {
+ // Put in recycler for re-measuring and/or layout
+ mRecycler.add(selectedPosition, view);
+ }
+
+ if (view != null) {
+ if (view.getLayoutParams() == null) {
+ mBlockLayoutRequests = true;
+ view.setLayoutParams(generateDefaultLayoutParams());
+ mBlockLayoutRequests = false;
+ }
+ measureChild(view, widthMeasureSpec, heightMeasureSpec);
+
+ preferredHeight = getChildHeight(view) + mSpinnerPadding.top + mSpinnerPadding.bottom;
+ preferredWidth = getChildWidth(view) + mSpinnerPadding.left + mSpinnerPadding.right;
+
+ needsMeasuring = false;
+ }
+ }
+
+ if (needsMeasuring) {
+ // No views -- just use padding
+ preferredHeight = mSpinnerPadding.top + mSpinnerPadding.bottom;
+ if (widthMode == MeasureSpec.UNSPECIFIED) {
+ preferredWidth = mSpinnerPadding.left + mSpinnerPadding.right;
+ }
+ }
+
+ preferredHeight = Math.max(preferredHeight, getSuggestedMinimumHeight());
+ preferredWidth = Math.max(preferredWidth, getSuggestedMinimumWidth());
+
+ heightSize = resolveSize(preferredHeight, heightMeasureSpec);
+ widthSize = resolveSize(preferredWidth, widthMeasureSpec);
+
+ setMeasuredDimension(widthSize, heightSize);
+ mHeightMeasureSpec = heightMeasureSpec;
+ mWidthMeasureSpec = widthMeasureSpec;
+ }
+
+
+ int getChildHeight(View child) {
+ return child.getMeasuredHeight();
+ }
+
+ int getChildWidth(View child) {
+ return child.getMeasuredWidth();
+ }
+
+ @Override
+ protected ViewGroup.LayoutParams generateDefaultLayoutParams() {
+ return new ViewGroup.LayoutParams(
+ ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT);
+ }
+
+ void recycleAllViews() {
+ int childCount = getChildCount();
+ final CustomAbsSpinner.RecycleBin recycleBin = mRecycler;
+
+ // All views go in recycler
+ for (int i=0; i<childCount; i++) {
+ View v = getChildAt(i);
+ int index = mFirstPosition + i;
+ recycleBin.put(index, v);
+ }
+ }
+
+ @Override
+ void handleDataChanged() {
+ // FIXME -- this is called from both measure and layout.
+ // This is harmless right now, but we don't want to do redundant work if
+ // this gets more complicated
+ super.handleDataChanged();
+ }
+
+
+
+ /**
+ * Jump directly to a specific item in the adapter data.
+ */
+ public void setSelection(int position, boolean animate) {
+ // Animate only if requested position is already on screen somewhere
+ boolean shouldAnimate = animate && mFirstPosition <= position &&
+ position <= mFirstPosition + getChildCount() - 1;
+ setSelectionInt(position, shouldAnimate);
+ }
+
+
+ @Override
+ public void setSelection(int position) {
+ setNextSelectedPositionInt(position);
+ requestLayout();
+ invalidate();
+ }
+
+
+ /**
+ * Makes the item at the supplied position selected.
+ *
+ * @param position Position to select
+ * @param animate Should the transition be animated
+ *
+ */
+ void setSelectionInt(int position, boolean animate) {
+ if (position != mOldSelectedPosition) {
+ mBlockLayoutRequests = true;
+ int delta = position - mSelectedPosition;
+ setNextSelectedPositionInt(position);
+ layout(delta, animate);
+ mBlockLayoutRequests = false;
+ }
+ }
+
+ abstract void layout(int delta, boolean animate);
+
+ @Override
+ public View getSelectedView() {
+ if (mItemCount > 0 && mSelectedPosition >= 0) {
+ return getChildAt(mSelectedPosition - mFirstPosition);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Override to prevent spamming ourselves with layout requests
+ * as we place views
+ *
+ * @see android.view.View#requestLayout()
+ */
+ @Override
+ public void requestLayout() {
+ if (!mBlockLayoutRequests) {
+ super.requestLayout();
+ }
+ }
+
+
+
+ @Override
+ public SpinnerAdapter getAdapter() {
+ return mAdapter;
+ }
+
+ @Override
+ public int getCount() {
+ return mItemCount;
+ }
+
+ /**
+ * Maps a point to a position in the list.
+ *
+ * @param x X in local coordinate
+ * @param y Y in local coordinate
+ * @return The position of the item which contains the specified point, or
+ * {@link #INVALID_POSITION} if the point does not intersect an item.
+ */
+ public int pointToPosition(int x, int y) {
+ Rect frame = mTouchFrame;
+ if (frame == null) {
+ mTouchFrame = new Rect();
+ frame = mTouchFrame;
+ }
+
+ final int count = getChildCount();
+ for (int i = count - 1; i >= 0; i--) {
+ View child = getChildAt(i);
+ if (child.getVisibility() == View.VISIBLE) {
+ child.getHitRect(frame);
+ if (frame.contains(x, y)) {
+ return mFirstPosition + i;
+ }
+ }
+ }
+ return INVALID_POSITION;
+ }
+
+ static class SavedState extends BaseSavedState {
+ long selectedId;
+ int position;
+
+ /**
+ * Constructor called from {@link CustomAbsSpinner#onSaveInstanceState()}
+ */
+ SavedState(Parcelable superState) {
+ super(superState);
+ }
+
+ /**
+ * Constructor called from {@link #CREATOR}
+ */
+ private SavedState(Parcel in) {
+ super(in);
+ selectedId = in.readLong();
+ position = in.readInt();
+ }
+
+ @Override
+ public void writeToParcel(Parcel out, int flags) {
+ super.writeToParcel(out, flags);
+ out.writeLong(selectedId);
+ out.writeInt(position);
+ }
+
+ @Override
+ public String toString() {
+ return "AbsSpinner.SavedState{"
+ + Integer.toHexString(System.identityHashCode(this))
+ + " selectedId=" + selectedId
+ + " position=" + position + "}";
+ }
+
+ public static final Parcelable.Creator<SavedState> CREATOR
+ = new Parcelable.Creator<SavedState>() {
+ public SavedState createFromParcel(Parcel in) {
+ return new SavedState(in);
+ }
+
+ public SavedState[] newArray(int size) {
+ return new SavedState[size];
+ }
+ };
+ }
+
+ @Override
+ public Parcelable onSaveInstanceState() {
+ Parcelable superState = super.onSaveInstanceState();
+ SavedState ss = new SavedState(superState);
+ ss.selectedId = getSelectedItemId();
+ if (ss.selectedId >= 0) {
+ ss.position = getSelectedItemPosition();
+ } else {
+ ss.position = INVALID_POSITION;
+ }
+ return ss;
+ }
+
+ @Override
+ public void onRestoreInstanceState(Parcelable state) {
+ SavedState ss = (SavedState) state;
+
+ super.onRestoreInstanceState(ss.getSuperState());
+
+ if (ss.selectedId >= 0) {
+ mDataChanged = true;
+ mNeedSync = true;
+ mSyncRowId = ss.selectedId;
+ mSyncPosition = ss.position;
+ mSyncMode = SYNC_SELECTED_POSITION;
+ requestLayout();
+ }
+ }
+
+ class RecycleBin {
+ private SparseArray<View> mScrapHeap = new SparseArray<View>();
+
+ public void put(int position, View v) {
+ mScrapHeap.put(position, v);
+ }
+
+ public void add(int position, View v) {
+ mScrapHeap.put(mScrapHeap.size(), v);
+ }
+ public View get() {
+ if (mScrapHeap.size() < 1) return null;
+
+ View result = mScrapHeap.valueAt(0);
+ int key = mScrapHeap.keyAt(0);
+
+ if (result != null) {
+ mScrapHeap.delete(key);
+ }
+ return result;
+ }
+
+ View get(int position) {
+ // System.out.print("Looking for " + position);
+ View result = mScrapHeap.get(position);
+ if (result != null) {
+ // System.out.println(" HIT");
+ mScrapHeap.delete(position);
+ } else {
+ // System.out.println(" MISS");
+ }
+ return result;
+ }
+
+ View peek(int position) {
+ // System.out.print("Looking for " + position);
+ return mScrapHeap.get(position);
+ }
+
+ void clear() {
+ final SparseArray<View> scrapHeap = mScrapHeap;
+
+ final int count = scrapHeap.size();
+ for (int i = 0; i < count; i++) {
+ final View view = scrapHeap.valueAt(i);
+ if (view != null) {
+ removeDetachedView(view, true);
+ }
+ }
+
+ scrapHeap.clear();
+ }
+ }
+}
diff --git a/src/com/cyanogenmod/trebuchet/widget/CustomAdapterView.java b/src/com/cyanogenmod/trebuchet/widget/CustomAdapterView.java
new file mode 100644
index 000000000..fd3e8f5ff
--- /dev/null
+++ b/src/com/cyanogenmod/trebuchet/widget/CustomAdapterView.java
@@ -0,0 +1,1130 @@
+/*
+ * Copyright (C) 2013 The CyanogenMod Project
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.cyanogenmod.trebuchet.widget;
+
+import android.content.Context;
+import android.database.DataSetObserver;
+import android.os.Parcelable;
+import android.os.SystemClock;
+import android.util.AttributeSet;
+import android.util.SparseArray;
+import android.view.ContextMenu;
+import android.view.SoundEffectConstants;
+import android.view.View;
+import android.view.ViewDebug;
+import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
+import android.widget.Adapter;
+import android.widget.ListView;
+
+public abstract class CustomAdapterView<T extends Adapter> extends ViewGroup {
+
+ /**
+ * The item view type returned by {@link Adapter#getItemViewType(int)} when
+ * the adapter does not want the item's view recycled.
+ */
+ public static final int ITEM_VIEW_TYPE_IGNORE = -1;
+
+ /**
+ * The item view type returned by {@link Adapter#getItemViewType(int)} when
+ * the item is a header or footer.
+ */
+ public static final int ITEM_VIEW_TYPE_HEADER_OR_FOOTER = -2;
+
+ /**
+ * The position of the first child displayed
+ */
+ int mFirstPosition = 0;
+
+ /**
+ * The offset in pixels from the top of the AdapterView to the top
+ * of the view to select during the next layout.
+ */
+ int mSpecificTop;
+
+ /**
+ * Position from which to start looking for mSyncRowId
+ */
+ int mSyncPosition;
+
+ /**
+ * Row id to look for when data has changed
+ */
+ long mSyncRowId = INVALID_ROW_ID;
+
+ /**
+ * Height of the view when mSyncPosition and mSyncRowId where set
+ */
+ long mSyncHeight;
+
+ /**
+ * True if we need to sync to mSyncRowId
+ */
+ boolean mNeedSync = false;
+
+ /**
+ * Indicates whether to sync based on the selection or position. Possible
+ * values are {@link #SYNC_SELECTED_POSITION} or
+ * {@link #SYNC_FIRST_POSITION}.
+ */
+ int mSyncMode;
+
+ /**
+ * Our height after the last layout
+ */
+ private int mLayoutHeight;
+
+ /**
+ * Sync based on the selected child
+ */
+ static final int SYNC_SELECTED_POSITION = 0;
+
+ /**
+ * Sync based on the first child displayed
+ */
+ static final int SYNC_FIRST_POSITION = 1;
+
+ /**
+ * Maximum amount of time to spend in {@link #findSyncPosition()}
+ */
+ static final int SYNC_MAX_DURATION_MILLIS = 100;
+
+ /**
+ * Indicates that this view is currently being laid out.
+ */
+ boolean mInLayout = false;
+
+ /**
+ * The listener that receives notifications when an item is selected.
+ */
+ OnItemSelectedListener mOnItemSelectedListener;
+
+ /**
+ * The listener that receives notifications when an item is clicked.
+ */
+ OnItemClickListener mOnItemClickListener;
+
+ /**
+ * The listener that receives notifications when an item is long clicked.
+ */
+ OnItemLongClickListener mOnItemLongClickListener;
+
+ /**
+ * True if the data has changed since the last layout
+ */
+ boolean mDataChanged;
+
+ /**
+ * The position within the adapter's data set of the item to select
+ * during the next layout.
+ */
+ int mNextSelectedPosition = INVALID_POSITION;
+
+ /**
+ * The item id of the item to select during the next layout.
+ */
+ long mNextSelectedRowId = INVALID_ROW_ID;
+
+ /**
+ * The position within the adapter's data set of the currently selected item.
+ */
+ int mSelectedPosition = INVALID_POSITION;
+
+ /**
+ * The item id of the currently selected item.
+ */
+ long mSelectedRowId = INVALID_ROW_ID;
+
+ /**
+ * View to show if there are no items to show.
+ */
+ private View mEmptyView;
+
+ /**
+ * The number of items in the current adapter.
+ */
+ int mItemCount;
+
+ /**
+ * The number of items in the adapter before a data changed event occured.
+ */
+ int mOldItemCount;
+
+ /**
+ * Represents an invalid position. All valid positions are in the range 0 to 1 less than the
+ * number of items in the current adapter.
+ */
+ public static final int INVALID_POSITION = -1;
+
+ /**
+ * Represents an empty or invalid row id
+ */
+ public static final long INVALID_ROW_ID = Long.MIN_VALUE;
+
+ /**
+ * The last selected position we used when notifying
+ */
+ int mOldSelectedPosition = INVALID_POSITION;
+
+ /**
+ * The id of the last selected position we used when notifying
+ */
+ long mOldSelectedRowId = INVALID_ROW_ID;
+
+ /**
+ * Indicates what focusable state is requested when calling setFocusable().
+ * In addition to this, this view has other criteria for actually
+ * determining the focusable state (such as whether its empty or the text
+ * filter is shown).
+ *
+ * @see #setFocusable(boolean)
+ * @see #checkFocus()
+ */
+ private boolean mDesiredFocusableState;
+ private boolean mDesiredFocusableInTouchModeState;
+
+ private SelectionNotifier mSelectionNotifier;
+ /**
+ * When set to true, calls to requestLayout() will not propagate up the parent hierarchy.
+ * This is used to layout the children during a layout pass.
+ */
+ boolean mBlockLayoutRequests = false;
+
+ public CustomAdapterView(Context context) {
+ super(context);
+ }
+
+ public CustomAdapterView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public CustomAdapterView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+
+ /**
+ * Interface definition for a callback to be invoked when an item in this
+ * AdapterView has been clicked.
+ */
+ public interface OnItemClickListener {
+
+ /**
+ * Callback method to be invoked when an item in this AdapterView has
+ * been clicked.
+ * <p>
+ * Implementers can call getItemAtPosition(position) if they need
+ * to access the data associated with the selected item.
+ *
+ * @param parent The AdapterView where the click happened.
+ * @param view The view within the AdapterView that was clicked (this
+ * will be a view provided by the adapter)
+ * @param position The position of the view in the adapter.
+ * @param id The row id of the item that was clicked.
+ */
+ void onItemClick(CustomAdapterView<?> parent, View view, int position, long id);
+ }
+
+ /**
+ * Register a callback to be invoked when an item in this AdapterView has
+ * been clicked.
+ *
+ * @param listener The callback that will be invoked.
+ */
+ public void setOnItemClickListener(OnItemClickListener listener) {
+ mOnItemClickListener = listener;
+ }
+
+ /**
+ * @return The callback to be invoked with an item in this AdapterView has
+ * been clicked, or null id no callback has been set.
+ */
+ public final OnItemClickListener getOnItemClickListener() {
+ return mOnItemClickListener;
+ }
+
+ /**
+ * Call the OnItemClickListener, if it is defined.
+ *
+ * @param view The view within the AdapterView that was clicked.
+ * @param position The position of the view in the adapter.
+ * @param id The row id of the item that was clicked.
+ * @return True if there was an assigned OnItemClickListener that was
+ * called, false otherwise is returned.
+ */
+ public boolean performItemClick(View view, int position, long id) {
+ if (mOnItemClickListener != null) {
+ playSoundEffect(SoundEffectConstants.CLICK);
+ mOnItemClickListener.onItemClick(this, view, position, id);
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Interface definition for a callback to be invoked when an item in this
+ * view has been clicked and held.
+ */
+ public interface OnItemLongClickListener {
+ /**
+ * Callback method to be invoked when an item in this view has been
+ * clicked and held.
+ *
+ * Implementers can call getItemAtPosition(position) if they need to access
+ * the data associated with the selected item.
+ *
+ * @param parent The AbsListView where the click happened
+ * @param view The view within the AbsListView that was clicked
+ * @param position The position of the view in the list
+ * @param id The row id of the item that was clicked
+ *
+ * @return true if the callback consumed the long click, false otherwise
+ */
+ boolean onItemLongClick(CustomAdapterView<?> parent, View view, int position, long id);
+ }
+
+
+ /**
+ * Register a callback to be invoked when an item in this AdapterView has
+ * been clicked and held
+ *
+ * @param listener The callback that will run
+ */
+ public void setOnItemLongClickListener(OnItemLongClickListener listener) {
+ if (!isLongClickable()) {
+ setLongClickable(true);
+ }
+ mOnItemLongClickListener = listener;
+ }
+
+ /**
+ * @return The callback to be invoked with an item in this AdapterView has
+ * been clicked and held, or null id no callback as been set.
+ */
+ public final OnItemLongClickListener getOnItemLongClickListener() {
+ return mOnItemLongClickListener;
+ }
+
+ /**
+ * Interface definition for a callback to be invoked when
+ * an item in this view has been selected.
+ */
+ public interface OnItemSelectedListener {
+ /**
+ * Callback method to be invoked when an item in this view has been
+ * selected.
+ *
+ * Impelmenters can call getItemAtPosition(position) if they need to access the
+ * data associated with the selected item.
+ *
+ * @param parent The AdapterView where the selection happened
+ * @param view The view within the AdapterView that was clicked
+ * @param position The position of the view in the adapter
+ * @param id The row id of the item that is selected
+ */
+ void onItemSelected(CustomAdapterView<?> parent, View view, int position, long id);
+
+ /**
+ * Callback method to be invoked when the selection disappears from this
+ * view. The selection can disappear for instance when touch is activated
+ * or when the adapter becomes empty.
+ *
+ * @param parent The AdapterView that now contains no selected item.
+ */
+ void onNothingSelected(CustomAdapterView<?> parent);
+ }
+
+
+ /**
+ * Register a callback to be invoked when an item in this AdapterView has
+ * been selected.
+ *
+ * @param listener The callback that will run
+ */
+ public void setOnItemSelectedListener(OnItemSelectedListener listener) {
+ mOnItemSelectedListener = listener;
+ }
+
+ public final OnItemSelectedListener getOnItemSelectedListener() {
+ return mOnItemSelectedListener;
+ }
+
+ /**
+ * Extra menu information provided to the
+ * {@link android.view.View.OnCreateContextMenuListener#onCreateContextMenu(ContextMenu, View, ContextMenuInfo) }
+ * callback when a context menu is brought up for this AdapterView.
+ *
+ */
+ public static class AdapterContextMenuInfo implements ContextMenu.ContextMenuInfo {
+
+ public AdapterContextMenuInfo(View targetView, int position, long id) {
+ this.targetView = targetView;
+ this.position = position;
+ this.id = id;
+ }
+
+ /**
+ * The child view for which the context menu is being displayed. This
+ * will be one of the children of this AdapterView.
+ */
+ public View targetView;
+
+ /**
+ * The position in the adapter for which the context menu is being
+ * displayed.
+ */
+ public int position;
+
+ /**
+ * The row id of the item for which the context menu is being displayed.
+ */
+ public long id;
+ }
+
+ /**
+ * Returns the adapter currently associated with this widget.
+ *
+ * @return The adapter used to provide this view's content.
+ */
+ public abstract T getAdapter();
+
+ /**
+ * Sets the adapter that provides the data and the views to represent the data
+ * in this widget.
+ *
+ * @param adapter The adapter to use to create this view's content.
+ */
+ public abstract void setAdapter(T adapter);
+
+ /**
+ * This method is not supported and throws an UnsupportedOperationException when called.
+ *
+ * @param child Ignored.
+ *
+ * @throws UnsupportedOperationException Every time this method is invoked.
+ */
+ @Override
+ public void addView(View child) {
+ throw new UnsupportedOperationException("addView(View) is not supported in AdapterView");
+ }
+
+ /**
+ * This method is not supported and throws an UnsupportedOperationException when called.
+ *
+ * @param child Ignored.
+ * @param index Ignored.
+ *
+ * @throws UnsupportedOperationException Every time this method is invoked.
+ */
+ @Override
+ public void addView(View child, int index) {
+ throw new UnsupportedOperationException("addView(View, int) is not supported in AdapterView");
+ }
+
+ /**
+ * This method is not supported and throws an UnsupportedOperationException when called.
+ *
+ * @param child Ignored.
+ * @param params Ignored.
+ *
+ * @throws UnsupportedOperationException Every time this method is invoked.
+ */
+ @Override
+ public void addView(View child, LayoutParams params) {
+ throw new UnsupportedOperationException("addView(View, LayoutParams) "
+ + "is not supported in AdapterView");
+ }
+
+ /**
+ * This method is not supported and throws an UnsupportedOperationException when called.
+ *
+ * @param child Ignored.
+ * @param index Ignored.
+ * @param params Ignored.
+ *
+ * @throws UnsupportedOperationException Every time this method is invoked.
+ */
+ @Override
+ public void addView(View child, int index, LayoutParams params) {
+ throw new UnsupportedOperationException("addView(View, int, LayoutParams) "
+ + "is not supported in AdapterView");
+ }
+
+ /**
+ * This method is not supported and throws an UnsupportedOperationException when called.
+ *
+ * @param child Ignored.
+ *
+ * @throws UnsupportedOperationException Every time this method is invoked.
+ */
+ @Override
+ public void removeView(View child) {
+ throw new UnsupportedOperationException("removeView(View) is not supported in AdapterView");
+ }
+
+ /**
+ * This method is not supported and throws an UnsupportedOperationException when called.
+ *
+ * @param index Ignored.
+ *
+ * @throws UnsupportedOperationException Every time this method is invoked.
+ */
+ @Override
+ public void removeViewAt(int index) {
+ throw new UnsupportedOperationException("removeViewAt(int) is not supported in AdapterView");
+ }
+
+ /**
+ * This method is not supported and throws an UnsupportedOperationException when called.
+ *
+ * @throws UnsupportedOperationException Every time this method is invoked.
+ */
+ @Override
+ public void removeAllViews() {
+ throw new UnsupportedOperationException("removeAllViews() is not supported in AdapterView");
+ }
+
+ @Override
+ protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+ mLayoutHeight = getHeight();
+ }
+
+ /**
+ * Return the position of the currently selected item within the adapter's data set
+ *
+ * @return int Position (starting at 0), or {@link #INVALID_POSITION} if there is nothing selected.
+ */
+ @ViewDebug.CapturedViewProperty
+ public int getSelectedItemPosition() {
+ return mNextSelectedPosition;
+ }
+
+ /**
+ * @return The id corresponding to the currently selected item, or {@link #INVALID_ROW_ID}
+ * if nothing is selected.
+ */
+ @ViewDebug.CapturedViewProperty
+ public long getSelectedItemId() {
+ return mNextSelectedRowId;
+ }
+
+ /**
+ * @return The view corresponding to the currently selected item, or null
+ * if nothing is selected
+ */
+ public abstract View getSelectedView();
+
+ /**
+ * @return The data corresponding to the currently selected item, or
+ * null if there is nothing selected.
+ */
+ public Object getSelectedItem() {
+ T adapter = getAdapter();
+ int selection = getSelectedItemPosition();
+ if (adapter != null && adapter.getCount() > 0 && selection >= 0) {
+ return adapter.getItem(selection);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * @return The number of items owned by the Adapter associated with this
+ * AdapterView. (This is the number of data items, which may be
+ * larger than the number of visible view.)
+ */
+ @ViewDebug.CapturedViewProperty
+ public int getCount() {
+ return mItemCount;
+ }
+
+ /**
+ * Get the position within the adapter's data set for the view, where view is a an adapter item
+ * or a descendant of an adapter item.
+ *
+ * @param view an adapter item, or a descendant of an adapter item. This must be visible in this
+ * AdapterView at the time of the call.
+ * @return the position within the adapter's data set of the view, or {@link #INVALID_POSITION}
+ * if the view does not correspond to a list item (or it is not currently visible).
+ */
+ public int getPositionForView(View view) {
+ View listItem = view;
+ try {
+ View v;
+ while (!(v = (View) listItem.getParent()).equals(this)) {
+ listItem = v;
+ }
+ } catch (ClassCastException e) {
+ // We made it up to the window without find this list view
+ return INVALID_POSITION;
+ }
+
+ // Search the children for the list item
+ final int childCount = getChildCount();
+ for (int i = 0; i < childCount; i++) {
+ if (getChildAt(i).equals(listItem)) {
+ return mFirstPosition + i;
+ }
+ }
+
+ // Child not found!
+ return INVALID_POSITION;
+ }
+
+ /**
+ * Returns the position within the adapter's data set for the first item
+ * displayed on screen.
+ *
+ * @return The position within the adapter's data set
+ */
+ public int getFirstVisiblePosition() {
+ return mFirstPosition;
+ }
+
+ /**
+ * Returns the position within the adapter's data set for the last item
+ * displayed on screen.
+ *
+ * @return The position within the adapter's data set
+ */
+ public int getLastVisiblePosition() {
+ return mFirstPosition + getChildCount() - 1;
+ }
+
+ /**
+ * Sets the currently selected item. To support accessibility subclasses that
+ * override this method must invoke the overriden super method first.
+ *
+ * @param position Index (starting at 0) of the data item to be selected.
+ */
+ public abstract void setSelection(int position);
+
+ /**
+ * Sets the view to show if the adapter is empty
+ */
+ public void setEmptyView(View emptyView) {
+ mEmptyView = emptyView;
+
+ final T adapter = getAdapter();
+ final boolean empty = ((adapter == null) || adapter.isEmpty());
+ updateEmptyStatus(empty);
+ }
+
+ /**
+ * When the current adapter is empty, the AdapterView can display a special view
+ * call the empty view. The empty view is used to provide feedback to the user
+ * that no data is available in this AdapterView.
+ *
+ * @return The view to show if the adapter is empty.
+ */
+ public View getEmptyView() {
+ return mEmptyView;
+ }
+
+ /**
+ * Indicates whether this view is in filter mode. Filter mode can for instance
+ * be enabled by a user when typing on the keyboard.
+ *
+ * @return True if the view is in filter mode, false otherwise.
+ */
+ boolean isInFilterMode() {
+ return false;
+ }
+
+ @Override
+ public void setFocusable(boolean focusable) {
+ final T adapter = getAdapter();
+ final boolean empty = adapter == null || adapter.getCount() == 0;
+
+ mDesiredFocusableState = focusable;
+ if (!focusable) {
+ mDesiredFocusableInTouchModeState = false;
+ }
+
+ super.setFocusable(focusable && (!empty || isInFilterMode()));
+ }
+
+ @Override
+ public void setFocusableInTouchMode(boolean focusable) {
+ final T adapter = getAdapter();
+ final boolean empty = adapter == null || adapter.getCount() == 0;
+
+ mDesiredFocusableInTouchModeState = focusable;
+ if (focusable) {
+ mDesiredFocusableState = true;
+ }
+
+ super.setFocusableInTouchMode(focusable && (!empty || isInFilterMode()));
+ }
+
+ void checkFocus() {
+ final T adapter = getAdapter();
+ final boolean empty = adapter == null || adapter.getCount() == 0;
+ final boolean focusable = !empty || isInFilterMode();
+ // The order in which we set focusable in touch mode/focusable may matter
+ // for the client, see View.setFocusableInTouchMode() comments for more
+ // details
+ super.setFocusableInTouchMode(focusable && mDesiredFocusableInTouchModeState);
+ super.setFocusable(focusable && mDesiredFocusableState);
+ if (mEmptyView != null) {
+ updateEmptyStatus((adapter == null) || adapter.isEmpty());
+ }
+ }
+
+ /**
+ * Update the status of the list based on the empty parameter. If empty is true and
+ * we have an empty view, display it. In all the other cases, make sure that the listview
+ * is VISIBLE and that the empty view is GONE (if it's not null).
+ */
+ private void updateEmptyStatus(boolean empty) {
+ if (isInFilterMode()) {
+ empty = false;
+ }
+
+ if (empty) {
+ if (mEmptyView != null) {
+ mEmptyView.setVisibility(View.VISIBLE);
+ setVisibility(View.GONE);
+ } else {
+ // If the caller just removed our empty view, make sure the list view is visible
+ setVisibility(View.VISIBLE);
+ }
+
+ // We are now GONE, so pending layouts will not be dispatched.
+ // Force one here to make sure that the state of the list matches
+ // the state of the adapter.
+ if (mDataChanged) {
+ this.onLayout(false, getLeft(), getTop(), getRight(), getBottom());
+ }
+ } else {
+ if (mEmptyView != null) mEmptyView.setVisibility(View.GONE);
+ setVisibility(View.VISIBLE);
+ }
+ }
+
+ /**
+ * Gets the data associated with the specified position in the list.
+ *
+ * @param position Which data to get
+ * @return The data associated with the specified position in the list
+ */
+ public Object getItemAtPosition(int position) {
+ T adapter = getAdapter();
+ return (adapter == null || position < 0) ? null : adapter.getItem(position);
+ }
+
+ public long getItemIdAtPosition(int position) {
+ T adapter = getAdapter();
+ return (adapter == null || position < 0) ? INVALID_ROW_ID : adapter.getItemId(position);
+ }
+
+ @Override
+ public void setOnClickListener(OnClickListener l) {
+ throw new RuntimeException("Don't call setOnClickListener for an AdapterView. "
+ + "You probably want setOnItemClickListener instead");
+ }
+
+ /**
+ * Override to prevent freezing of any views created by the adapter.
+ */
+ @Override
+ protected void dispatchSaveInstanceState(SparseArray<Parcelable> container) {
+ dispatchFreezeSelfOnly(container);
+ }
+
+ /**
+ * Override to prevent thawing of any views created by the adapter.
+ */
+ @Override
+ protected void dispatchRestoreInstanceState(SparseArray<Parcelable> container) {
+ dispatchThawSelfOnly(container);
+ }
+
+ class AdapterDataSetObserver extends DataSetObserver {
+
+ private Parcelable mInstanceState = null;
+
+ @Override
+ public void onChanged() {
+ mDataChanged = true;
+ mOldItemCount = mItemCount;
+ mItemCount = getAdapter().getCount();
+
+ // Detect the case where a cursor that was previously invalidated has
+ // been repopulated with new data.
+ if (CustomAdapterView.this.getAdapter().hasStableIds() && mInstanceState != null
+ && mOldItemCount == 0 && mItemCount > 0) {
+ CustomAdapterView.this.onRestoreInstanceState(mInstanceState);
+ mInstanceState = null;
+ } else {
+ rememberSyncState();
+ }
+ checkFocus();
+ requestLayout();
+ }
+
+ @Override
+ public void onInvalidated() {
+ mDataChanged = true;
+
+ if (CustomAdapterView.this.getAdapter().hasStableIds()) {
+ // Remember the current state for the case where our hosting activity is being
+ // stopped and later restarted
+ mInstanceState = CustomAdapterView.this.onSaveInstanceState();
+ }
+
+ // Data is invalid so we should reset our state
+ mOldItemCount = mItemCount;
+ mItemCount = 0;
+ mSelectedPosition = INVALID_POSITION;
+ mSelectedRowId = INVALID_ROW_ID;
+ mNextSelectedPosition = INVALID_POSITION;
+ mNextSelectedRowId = INVALID_ROW_ID;
+ mNeedSync = false;
+
+ checkFocus();
+ requestLayout();
+ }
+
+ public void clearSavedState() {
+ mInstanceState = null;
+ }
+ }
+
+ @Override
+ protected void onDetachedFromWindow() {
+ super.onDetachedFromWindow();
+ removeCallbacks(mSelectionNotifier);
+ }
+
+ private class SelectionNotifier implements Runnable {
+ public void run() {
+ if (mDataChanged) {
+ // Data has changed between when this SelectionNotifier
+ // was posted and now. We need to wait until the AdapterView
+ // has been synched to the new data.
+ if (getAdapter() != null) {
+ post(this);
+ }
+ } else {
+ fireOnSelected();
+ }
+ }
+ }
+
+ void selectionChanged() {
+ if (mOnItemSelectedListener != null) {
+ if (mInLayout || mBlockLayoutRequests) {
+ // If we are in a layout traversal, defer notification
+ // by posting. This ensures that the view tree is
+ // in a consistent state and is able to accomodate
+ // new layout or invalidate requests.
+ if (mSelectionNotifier == null) {
+ mSelectionNotifier = new SelectionNotifier();
+ }
+ post(mSelectionNotifier);
+ } else {
+ fireOnSelected();
+ }
+ }
+
+ // we fire selection events here not in View
+ if (mSelectedPosition != ListView.INVALID_POSITION && isShown() && !isInTouchMode()) {
+ sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
+ }
+ }
+
+ private void fireOnSelected() {
+ if (mOnItemSelectedListener == null)
+ return;
+
+ int selection = this.getSelectedItemPosition();
+ if (selection >= 0) {
+ View v = getSelectedView();
+ mOnItemSelectedListener.onItemSelected(this, v, selection,
+ getAdapter().getItemId(selection));
+ } else {
+ mOnItemSelectedListener.onNothingSelected(this);
+ }
+ }
+
+ @Override
+ public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
+ boolean populated = false;
+ // This is an exceptional case which occurs when a window gets the
+ // focus and sends a focus event via its focused child to announce
+ // current focus/selection. AdapterView fires selection but not focus
+ // events so we change the event type here.
+ if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED) {
+ event.setEventType(AccessibilityEvent.TYPE_VIEW_SELECTED);
+ }
+
+ // we send selection events only from AdapterView to avoid
+ // generation of such event for each child
+ View selectedView = getSelectedView();
+ if (selectedView != null) {
+ populated = selectedView.dispatchPopulateAccessibilityEvent(event);
+ }
+
+ if (!populated) {
+ if (selectedView != null) {
+ event.setEnabled(selectedView.isEnabled());
+ }
+ event.setItemCount(getCount());
+ event.setCurrentItemIndex(getSelectedItemPosition());
+ }
+
+ return populated;
+ }
+
+ @Override
+ protected boolean canAnimate() {
+ return super.canAnimate() && mItemCount > 0;
+ }
+
+ void handleDataChanged() {
+ final int count = mItemCount;
+ boolean found = false;
+
+ if (count > 0) {
+
+ int newPos;
+
+ // Find the row we are supposed to sync to
+ if (mNeedSync) {
+ // Update this first, since setNextSelectedPositionInt inspects
+ // it
+ mNeedSync = false;
+
+ // See if we can find a position in the new data with the same
+ // id as the old selection
+ newPos = findSyncPosition();
+ if (newPos >= 0) {
+ // Verify that new selection is selectable
+ int selectablePos = lookForSelectablePosition(newPos, true);
+ if (selectablePos == newPos) {
+ // Same row id is selected
+ setNextSelectedPositionInt(newPos);
+ found = true;
+ }
+ }
+ }
+ if (!found) {
+ // Try to use the same position if we can't find matching data
+ newPos = getSelectedItemPosition();
+
+ // Pin position to the available range
+ if (newPos >= count) {
+ newPos = count - 1;
+ }
+ if (newPos < 0) {
+ newPos = 0;
+ }
+
+ // Make sure we select something selectable -- first look down
+ int selectablePos = lookForSelectablePosition(newPos, true);
+ if (selectablePos < 0) {
+ // Looking down didn't work -- try looking up
+ selectablePos = lookForSelectablePosition(newPos, false);
+ }
+ if (selectablePos >= 0) {
+ setNextSelectedPositionInt(selectablePos);
+ checkSelectionChanged();
+ found = true;
+ }
+ }
+ }
+ if (!found) {
+ // Nothing is selected
+ mSelectedPosition = INVALID_POSITION;
+ mSelectedRowId = INVALID_ROW_ID;
+ mNextSelectedPosition = INVALID_POSITION;
+ mNextSelectedRowId = INVALID_ROW_ID;
+ mNeedSync = false;
+ checkSelectionChanged();
+ }
+ }
+
+ void checkSelectionChanged() {
+ if ((mSelectedPosition != mOldSelectedPosition) || (mSelectedRowId != mOldSelectedRowId)) {
+ selectionChanged();
+ mOldSelectedPosition = mSelectedPosition;
+ mOldSelectedRowId = mSelectedRowId;
+ }
+ }
+
+ /**
+ * Searches the adapter for a position matching mSyncRowId. The search starts at mSyncPosition
+ * and then alternates between moving up and moving down until 1) we find the right position, or
+ * 2) we run out of time, or 3) we have looked at every position
+ *
+ * @return Position of the row that matches mSyncRowId, or {@link #INVALID_POSITION} if it can't
+ * be found
+ */
+ int findSyncPosition() {
+ int count = mItemCount;
+
+ if (count == 0) {
+ return INVALID_POSITION;
+ }
+
+ long idToMatch = mSyncRowId;
+ int seed = mSyncPosition;
+
+ // If there isn't a selection don't hunt for it
+ if (idToMatch == INVALID_ROW_ID) {
+ return INVALID_POSITION;
+ }
+
+ // Pin seed to reasonable values
+ seed = Math.max(0, seed);
+ seed = Math.min(count - 1, seed);
+
+ long endTime = SystemClock.uptimeMillis() + SYNC_MAX_DURATION_MILLIS;
+
+ long rowId;
+
+ // first position scanned so far
+ int first = seed;
+
+ // last position scanned so far
+ int last = seed;
+
+ // True if we should move down on the next iteration
+ boolean next = false;
+
+ // True when we have looked at the first item in the data
+ boolean hitFirst;
+
+ // True when we have looked at the last item in the data
+ boolean hitLast;
+
+ // Get the item ID locally (instead of getItemIdAtPosition), so
+ // we need the adapter
+ T adapter = getAdapter();
+ if (adapter == null) {
+ return INVALID_POSITION;
+ }
+
+ while (SystemClock.uptimeMillis() <= endTime) {
+ rowId = adapter.getItemId(seed);
+ if (rowId == idToMatch) {
+ // Found it!
+ return seed;
+ }
+
+ hitLast = last == count - 1;
+ hitFirst = first == 0;
+
+ if (hitLast && hitFirst) {
+ // Looked at everything
+ break;
+ }
+
+ if (hitFirst || (next && !hitLast)) {
+ // Either we hit the top, or we are trying to move down
+ last++;
+ seed = last;
+ // Try going up next time
+ next = false;
+ } else if (hitLast || (!next && !hitFirst)) {
+ // Either we hit the bottom, or we are trying to move up
+ first--;
+ seed = first;
+ // Try going down next time
+ next = true;
+ }
+
+ }
+
+ return INVALID_POSITION;
+ }
+
+ /**
+ * Find a position that can be selected (i.e., is not a separator).
+ *
+ * @param position The starting position to look at.
+ * @param lookDown Whether to look down for other positions.
+ * @return The next selectable position starting at position and then searching either up or
+ * down. Returns {@link #INVALID_POSITION} if nothing can be found.
+ */
+ int lookForSelectablePosition(int position, boolean lookDown) {
+ return position;
+ }
+
+ /**
+ * Utility to keep mSelectedPosition and mSelectedRowId in sync
+ * @param position Our current position
+ */
+ void setSelectedPositionInt(int position) {
+ mSelectedPosition = position;
+ mSelectedRowId = getItemIdAtPosition(position);
+ }
+
+ /**
+ * Utility to keep mNextSelectedPosition and mNextSelectedRowId in sync
+ * @param position Intended value for mSelectedPosition the next time we go
+ * through layout
+ */
+ void setNextSelectedPositionInt(int position) {
+ mNextSelectedPosition = position;
+ mNextSelectedRowId = getItemIdAtPosition(position);
+ // If we are trying to sync to the selection, update that too
+ if (mNeedSync && mSyncMode == SYNC_SELECTED_POSITION && position >= 0) {
+ mSyncPosition = position;
+ mSyncRowId = mNextSelectedRowId;
+ }
+ }
+
+ /**
+ * Remember enough information to restore the screen state when the data has
+ * changed.
+ *
+ */
+ void rememberSyncState() {
+ if (getChildCount() > 0) {
+ mNeedSync = true;
+ mSyncHeight = mLayoutHeight;
+ if (mSelectedPosition >= 0) {
+ // Sync the selection state
+ View v = getChildAt(mSelectedPosition - mFirstPosition);
+ mSyncRowId = mNextSelectedRowId;
+ mSyncPosition = mNextSelectedPosition;
+ if (v != null) {
+ mSpecificTop = v.getTop();
+ }
+ mSyncMode = SYNC_SELECTED_POSITION;
+ } else {
+ // Sync the based on the offset of the first view
+ View v = getChildAt(0);
+ T adapter = getAdapter();
+ if (mFirstPosition >= 0 && mFirstPosition < adapter.getCount()) {
+ mSyncRowId = adapter.getItemId(mFirstPosition);
+ } else {
+ mSyncRowId = NO_ID;
+ }
+ mSyncPosition = mFirstPosition;
+ if (v != null) {
+ mSpecificTop = v.getTop();
+ }
+ mSyncMode = SYNC_FIRST_POSITION;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/com/cyanogenmod/trebuchet/widget/EcoGallery.java b/src/com/cyanogenmod/trebuchet/widget/EcoGallery.java
new file mode 100644
index 000000000..8c7a7415d
--- /dev/null
+++ b/src/com/cyanogenmod/trebuchet/widget/EcoGallery.java
@@ -0,0 +1,1363 @@
+/*
+ * Copyright (C) 2013 The CyanogenMod Project
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.cyanogenmod.trebuchet.widget;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.Rect;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.ContextMenu;
+import android.view.GestureDetector;
+import android.view.Gravity;
+import android.view.HapticFeedbackConstants;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.view.SoundEffectConstants;
+import android.view.View;
+import android.view.ViewConfiguration;
+import android.view.ViewGroup;
+import android.view.animation.Transformation;
+import android.widget.Scroller;
+import com.cyanogenmod.trebuchet.R;
+
+import java.lang.reflect.Field;
+
+public class EcoGallery extends CustomAbsSpinner implements GestureDetector.OnGestureListener {
+
+ private static final String TAG = "Gallery";
+
+ private static final boolean localLOGV = false;
+
+ /**
+ * Duration in milliseconds from the start of a scroll during which we're
+ * unsure whether the user is scrolling or flinging.
+ */
+ private static final int SCROLL_TO_FLING_UNCERTAINTY_TIMEOUT = 250;
+
+ private static final String LOG_TAG = null;
+
+ /**
+ * Horizontal spacing between items.
+ */
+ private int mSpacing = 0;
+
+ /**
+ * How long the transition animation should run when a child view changes
+ * position, measured in milliseconds.
+ */
+ private int mAnimationDuration = 200;
+
+ /**
+ * The alpha of items that are not selected.
+ */
+ private float mUnselectedAlpha;
+
+ /**
+ * Left most edge of a child seen so far during layout.
+ */
+ private int mLeftMost;
+
+ /**
+ * Right most edge of a child seen so far during layout.
+ */
+ private int mRightMost;
+
+ private int mGravity;
+
+ /**
+ * Helper for detecting touch gestures.
+ */
+ private GestureDetector mGestureDetector;
+
+ /**
+ * The position of the item that received the user's down touch.
+ */
+ private int mDownTouchPosition;
+
+ /**
+ * The view of the item that received the user's down touch.
+ */
+ private View mDownTouchView;
+
+ /**
+ * Executes the delta scrolls from a fling or scroll movement.
+ */
+ private FlingRunnable mFlingRunnable = new FlingRunnable();
+
+ /**
+ * Sets mSuppressSelectionChanged = false. This is used to set it to false
+ * in the future. It will also trigger a selection changed.
+ */
+ private Runnable mDisableSuppressSelectionChangedRunnable = new Runnable() {
+ public void run() {
+ mSuppressSelectionChanged = false;
+ selectionChanged();
+ }
+ };
+
+ /**
+ * When fling runnable runs, it resets this to false. Any method along the
+ * path until the end of its run() can set this to true to abort any
+ * remaining fling. For example, if we've reached either the leftmost or
+ * rightmost item, we will set this to true.
+ */
+ private boolean mShouldStopFling;
+
+ /**
+ * The currently selected item's child.
+ */
+ private View mSelectedChild;
+
+ /**
+ * Whether to continuously callback on the item selected listener during a
+ * fling.
+ */
+ private boolean mShouldCallbackDuringFling = true;
+
+ /**
+ * Whether to callback when an item that is not selected is clicked.
+ */
+ private boolean mShouldCallbackOnUnselectedItemClick = true;
+
+ /**
+ * If true, do not callback to item selected listener.
+ */
+ private boolean mSuppressSelectionChanged;
+
+ /**
+ * If true, we have received the "invoke" (center or enter buttons) key
+ * down. This is checked before we action on the "invoke" key up, and is
+ * subsequently cleared.
+ */
+ private boolean mReceivedInvokeKeyDown;
+
+ private AdapterContextMenuInfo mContextMenuInfo;
+
+
+ /**
+ * If true, this onScroll is the first for this user's drag (remember, a
+ * drag sends many onScrolls).
+ */
+ private boolean mIsFirstScroll;
+
+ public EcoGallery(Context context) {
+ this(context, null);
+ }
+
+ public EcoGallery(Context context, AttributeSet attrs) {
+ this(context, attrs, R.attr.ecoGalleryStyle);
+ }
+
+ public EcoGallery(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+
+ mGestureDetector = new GestureDetector(context, this);
+ mGestureDetector.setIsLongpressEnabled(true);
+
+ TypedArray a = context.obtainStyledAttributes(
+ attrs, R.styleable.EcoGallery, defStyle, 0);
+
+ int index = a.getInt(R.styleable.EcoGallery_gravity, -1);
+ if (index >= 0) {
+ setGravity(index);
+ }
+
+ int animationDuration =
+ a.getInt(R.styleable.EcoGallery_animationDuration, -1);
+ if (animationDuration > 0) {
+ setAnimationDuration(animationDuration);
+ }
+
+ int spacing =
+ a.getDimensionPixelOffset(R.styleable.EcoGallery_spacing, 0);
+ setSpacing(spacing);
+
+ float unselectedAlpha = a.getFloat(
+ R.styleable.EcoGallery_unselectedAlpha, 0.5f);
+ setUnselectedAlpha(unselectedAlpha);
+
+ a.recycle();
+
+ // We draw the selected item last (because otherwise the item to the
+ // right overlaps it)
+ mGroupFlags |= FLAG_USE_CHILD_DRAWING_ORDER;
+ mGroupFlags |= FLAG_SUPPORT_STATIC_TRANSFORMATIONS;
+ }
+
+ /**
+ * Whether or not to callback on any {@link #getOnItemSelectedListener()}
+ * while the items are being flinged. If false, only the final selected item
+ * will cause the callback. If true, all items between the first and the
+ * final will cause callbacks.
+ *
+ * @param shouldCallback Whether or not to callback on the listener while
+ * the items are being flinged.
+ */
+ public void setCallbackDuringFling(boolean shouldCallback) {
+ mShouldCallbackDuringFling = shouldCallback;
+ }
+
+ /**
+ * Whether or not to callback when an item that is not selected is clicked.
+ * If false, the item will become selected (and re-centered). If true, the
+ * {@link #getOnItemClickListener()} will get the callback.
+ *
+ * @param shouldCallback Whether or not to callback on the listener when a
+ * item that is not selected is clicked.
+ * @hide
+ */
+ public void setCallbackOnUnselectedItemClick(boolean shouldCallback) {
+ mShouldCallbackOnUnselectedItemClick = shouldCallback;
+ }
+
+ /**
+ * Sets how long the transition animation should run when a child view
+ * changes position. Only relevant if animation is turned on.
+ *
+ * @param animationDurationMillis The duration of the transition, in
+ * milliseconds.
+ *
+ * @attr ref android.R.styleable#Gallery_animationDuration
+ */
+ public void setAnimationDuration(int animationDurationMillis) {
+ mAnimationDuration = animationDurationMillis;
+ }
+
+ /**
+ * Sets the spacing between items in a Gallery
+ *
+ * @param spacing The spacing in pixels between items in the Gallery
+ *
+ * @attr ref android.R.styleable#Gallery_spacing
+ */
+ public void setSpacing(int spacing) {
+ mSpacing = spacing;
+ }
+
+ /**
+ * Sets the alpha of items that are not selected in the Gallery.
+ *
+ * @param unselectedAlpha the alpha for the items that are not selected.
+ *
+ * @attr ref android.R.styleable#Gallery_unselectedAlpha
+ */
+ public void setUnselectedAlpha(float unselectedAlpha) {
+ mUnselectedAlpha = unselectedAlpha;
+ }
+
+ @Override
+ protected boolean getChildStaticTransformation(View child, Transformation t) {
+
+ t.clear();
+ t.setAlpha(child == mSelectedChild ? 1.0f : mUnselectedAlpha);
+
+ return true;
+ }
+
+ @Override
+ protected int computeHorizontalScrollExtent() {
+ // Only 1 item is considered to be selected
+ return 1;
+ }
+
+ @Override
+ protected int computeHorizontalScrollOffset() {
+ // Current scroll position is the same as the selected position
+ return mSelectedPosition;
+ }
+
+ @Override
+ protected int computeHorizontalScrollRange() {
+ // Scroll range is the same as the item count
+ return mItemCount;
+ }
+
+ @Override
+ protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
+ return p instanceof LayoutParams;
+ }
+
+ @Override
+ protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) {
+ return new LayoutParams(p);
+ }
+
+ @Override
+ public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attrs) {
+ return new LayoutParams(getContext(), attrs);
+ }
+
+ @Override
+ protected ViewGroup.LayoutParams generateDefaultLayoutParams() {
+ /*
+ * Gallery expects EcoGallery.LayoutParams.
+ */
+ return new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT);
+ }
+
+ @Override
+ protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ super.onLayout(changed, l, t, r, b);
+
+ /*
+ * Remember that we are in layout to prevent more layout request from
+ * being generated.
+ */
+ mInLayout = true;
+ layout(0, false);
+
+ mInLayout = false;
+ }
+
+ @Override
+ int getChildHeight(View child) {
+ return child.getMeasuredHeight();
+ }
+
+ /**
+ * Tracks a motion scroll. In reality, this is used to do just about any
+ * movement to items (touch scroll, arrow-key scroll, set an item as selected).
+ *
+ * @param deltaX Change in X from the previous event.
+ */
+ void trackMotionScroll(int deltaX) {
+
+ if (getChildCount() == 0) {
+ return;
+ }
+
+ boolean toLeft = deltaX < 0;
+
+ int limitedDeltaX = getLimitedMotionScrollAmount(toLeft, deltaX);
+ if (limitedDeltaX != deltaX) {
+ // The above call returned a limited amount, so stop any scrolls/flings
+ mFlingRunnable.endFling(false);
+ onFinishedMovement();
+ }
+
+ offsetChildrenLeftAndRight(limitedDeltaX);
+
+ detachOffScreenChildren(toLeft);
+
+ if (toLeft) {
+ // If moved left, there will be empty space on the right
+ fillToGalleryRight();
+ } else {
+ // Similarly, empty space on the left
+ fillToGalleryLeft();
+ }
+
+ setSelectionToCenterChild();
+
+ invalidate();
+ }
+
+ int getLimitedMotionScrollAmount(boolean motionToLeft, int deltaX) {
+ int extremeItemPosition = motionToLeft ? mItemCount - 1 : 0;
+ View extremeChild = getChildAt(extremeItemPosition - mFirstPosition);
+
+ if (extremeChild == null) {
+ return deltaX;
+ }
+
+ int extremeChildCenter = getCenterOfView(extremeChild);
+ int galleryCenter = getCenterOfGallery();
+
+ if (motionToLeft) {
+ if (extremeChildCenter <= galleryCenter) {
+
+ // The extreme child is past his boundary point!
+ return 0;
+ }
+ } else {
+ if (extremeChildCenter >= galleryCenter) {
+
+ // The extreme child is past his boundary point!
+ return 0;
+ }
+ }
+
+ int centerDifference = galleryCenter - extremeChildCenter;
+
+ return motionToLeft
+ ? Math.max(centerDifference, deltaX)
+ : Math.min(centerDifference, deltaX);
+ }
+
+ /**
+ * Offset the horizontal location of all children of this view by the
+ * specified number of pixels.
+ *
+ * @param offset the number of pixels to offset
+ */
+ private void offsetChildrenLeftAndRight(int offset) {
+ for (int i = getChildCount() - 1; i >= 0; i--) {
+ getChildAt(i).offsetLeftAndRight(offset);
+ }
+ }
+
+ /**
+ * @return The center of this Gallery.
+ */
+ private int getCenterOfGallery() {
+ int paddingLeft = getPaddingLeft();
+ return (getWidth() - paddingLeft - getPaddingRight()) / 2 + paddingLeft;
+ }
+
+ /**
+ * @return The center of the given view.
+ */
+ private static int getCenterOfView(View view) {
+ return view.getLeft() + view.getWidth() / 2;
+ }
+
+ /**
+ * Detaches children that are off the screen (i.e.: Gallery bounds).
+ *
+ * @param toLeft Whether to detach children to the left of the Gallery, or
+ * to the right.
+ */
+ private void detachOffScreenChildren(boolean toLeft) {
+ int numChildren = getChildCount();
+ int firstPosition = mFirstPosition;
+ int start = 0;
+ int count = 0;
+
+ if (toLeft) {
+ final int galleryLeft = getPaddingLeft();
+ for (int i = 0; i < numChildren; i++) {
+ final View child = getChildAt(i);
+ if (child.getRight() >= galleryLeft) {
+ break;
+ } else {
+ count++;
+ mRecycler.add(firstPosition + i, child);
+ }
+ }
+ } else {
+ final int galleryRight = getWidth() - getPaddingRight();
+ for (int i = numChildren - 1; i >= 0; i--) {
+ final View child = getChildAt(i);
+ if (child.getLeft() <= galleryRight) {
+ break;
+ } else {
+ start = i;
+ count++;
+ mRecycler.add(firstPosition + i, child);
+ }
+ }
+ }
+
+ detachViewsFromParent(start, count);
+
+ if (toLeft) {
+ mFirstPosition += count;
+ }
+ }
+
+ /**
+ * Scrolls the items so that the selected item is in its 'slot' (its center
+ * is the gallery's center).
+ */
+ private void scrollIntoSlots() {
+
+ if (getChildCount() == 0 || mSelectedChild == null) return;
+
+ int selectedCenter = getCenterOfView(mSelectedChild);
+ int targetCenter = getCenterOfGallery();
+
+ int scrollAmount = targetCenter - selectedCenter;
+ if (scrollAmount != 0) {
+ mFlingRunnable.startUsingDistance(scrollAmount);
+ } else {
+ onFinishedMovement();
+ }
+ }
+
+ private void onFinishedMovement() {
+ if (mSuppressSelectionChanged) {
+ mSuppressSelectionChanged = false;
+
+ // We haven't been callbacking during the fling, so do it now
+ super.selectionChanged();
+ }
+ invalidate();
+ }
+
+ @Override
+ void selectionChanged() {
+ if (!mSuppressSelectionChanged) {
+ super.selectionChanged();
+ }
+ }
+
+ /**
+ * Looks for the child that is closest to the center and sets it as the
+ * selected child.
+ */
+ private void setSelectionToCenterChild() {
+
+ View selView = mSelectedChild;
+ if (mSelectedChild == null) return;
+
+ int galleryCenter = getCenterOfGallery();
+
+ // Common case where the current selected position is correct
+ if (selView.getLeft() <= galleryCenter && selView.getRight() >= galleryCenter) {
+ return;
+ }
+
+ // TODO better search
+ int closestEdgeDistance = Integer.MAX_VALUE;
+ int newSelectedChildIndex = 0;
+ for (int i = getChildCount() - 1; i >= 0; i--) {
+
+ View child = getChildAt(i);
+
+ if (child.getLeft() <= galleryCenter && child.getRight() >= galleryCenter) {
+ // This child is in the center
+ newSelectedChildIndex = i;
+ break;
+ }
+
+ int childClosestEdgeDistance = Math.min(Math.abs(child.getLeft() - galleryCenter),
+ Math.abs(child.getRight() - galleryCenter));
+ if (childClosestEdgeDistance < closestEdgeDistance) {
+ closestEdgeDistance = childClosestEdgeDistance;
+ newSelectedChildIndex = i;
+ }
+ }
+
+ int newPos = mFirstPosition + newSelectedChildIndex;
+
+ if (newPos != mSelectedPosition) {
+ setSelectedPositionInt(newPos);
+ setNextSelectedPositionInt(newPos);
+ checkSelectionChanged();
+ }
+ }
+
+ /**
+ * Creates and positions all views for this Gallery.
+ * <p>
+ * We layout rarely, most of the time {@link #trackMotionScroll(int)} takes
+ * care of repositioning, adding, and removing children.
+ *
+ * @param delta Change in the selected position. +1 means the selection is
+ * moving to the right, so views are scrolling to the left. -1
+ * means the selection is moving to the left.
+ */
+ @Override
+ void layout(int delta, boolean animate) {
+
+ int childrenLeft = mSpinnerPadding.left;
+ int childrenWidth = getRight() - getLeft() - mSpinnerPadding.left - mSpinnerPadding.right;
+
+ if (mDataChanged) {
+ handleDataChanged();
+ }
+
+ // Handle an empty gallery by removing all views.
+ if (mItemCount == 0) {
+ resetList();
+ return;
+ }
+
+ // Update to the new selected position.
+ if (mNextSelectedPosition >= 0) {
+ setSelectedPositionInt(mNextSelectedPosition);
+ }
+
+ // All views go in recycler while we are in layout
+ recycleAllViews();
+
+ // Clear out old views
+ detachAllViewsFromParent();
+
+ /*
+ * These will be used to give initial positions to views entering the
+ * gallery as we scroll
+ */
+ mRightMost = 0;
+ mLeftMost = 0;
+
+ // Make selected view and center it
+
+ /*
+ * mFirstPosition will be decreased as we add views to the left later
+ * on. The 0 for x will be offset in a couple lines down.
+ */
+ mFirstPosition = mSelectedPosition;
+ View sel = makeAndAddView(mSelectedPosition, 0, 0, true);
+
+ // Put the selected child in the center
+ int selectedOffset = childrenLeft + (childrenWidth / 2) - (sel.getWidth() / 2);
+ sel.offsetLeftAndRight(selectedOffset);
+
+ fillToGalleryRight();
+ fillToGalleryLeft();
+
+ invalidate();
+ checkSelectionChanged();
+
+ mDataChanged = false;
+ mNeedSync = false;
+ setNextSelectedPositionInt(mSelectedPosition);
+
+ updateSelectedItemMetadata();
+ }
+
+ private void fillToGalleryLeft() {
+ int itemSpacing = mSpacing;
+ int galleryLeft = getPaddingLeft();
+
+ // Set state for initial iteration
+ View prevIterationView = getChildAt(0);
+ int curPosition;
+ int curRightEdge;
+
+ if (prevIterationView != null) {
+ curPosition = mFirstPosition - 1;
+ curRightEdge = prevIterationView.getLeft() - itemSpacing;
+ } else {
+ // No children available!
+ curPosition = 0;
+ curRightEdge = getRight() - getLeft() - getPaddingRight();
+ mShouldStopFling = true;
+ }
+
+ while (curRightEdge > galleryLeft && curPosition >= 0) {
+ prevIterationView = makeAndAddView(curPosition, curPosition - mSelectedPosition,
+ curRightEdge, false);
+
+ // Remember some state
+ mFirstPosition = curPosition;
+
+ // Set state for next iteration
+ curRightEdge = prevIterationView.getLeft() - itemSpacing;
+ curPosition--;
+ }
+ }
+
+ private void fillToGalleryRight() {
+ int itemSpacing = mSpacing;
+ int galleryRight = getRight() - getLeft() - getPaddingRight();
+ int numChildren = getChildCount();
+ int numItems = mItemCount;
+
+ // Set state for initial iteration
+ View prevIterationView = getChildAt(numChildren - 1);
+ int curPosition;
+ int curLeftEdge;
+
+ if (prevIterationView != null) {
+ curPosition = mFirstPosition + numChildren;
+ curLeftEdge = prevIterationView.getRight() + itemSpacing;
+ } else {
+ mFirstPosition = curPosition = mItemCount - 1;
+ curLeftEdge = getPaddingLeft();
+ mShouldStopFling = true;
+ }
+
+ while (curLeftEdge < galleryRight && curPosition < numItems) {
+ prevIterationView = makeAndAddView(curPosition, curPosition - mSelectedPosition,
+ curLeftEdge, true);
+
+ // Set state for next iteration
+ curLeftEdge = prevIterationView.getRight() + itemSpacing;
+ curPosition++;
+ }
+ }
+
+ /**
+ * Obtain a view, either by pulling an existing view from the recycler or by
+ * getting a new one from the adapter. If we are animating, make sure there
+ * is enough information in the view's layout parameters to animate from the
+ * old to new positions.
+ *
+ * @param position Position in the gallery for the view to obtain
+ * @param offset Offset from the selected position
+ * @param x X-coordinate indicating where this view should be placed. This
+ * will either be the left or right edge of the view, depending on
+ * the fromLeft parameter
+ * @param fromLeft Are we positioning views based on the left edge? (i.e.,
+ * building from left to right)?
+ * @return A view that has been added to the gallery
+ */
+ private View makeAndAddView(int position, int offset, int x,
+ boolean fromLeft) {
+
+ View child;
+
+ child = mRecycler.get();
+ // pass child as convertview
+ child = mAdapter.getView(position, child, this);
+
+ // Position the view
+ setUpChild(child, offset, x, fromLeft);
+
+ return child;
+ }
+
+ /**
+ * Helper for makeAndAddView to set the position of a view and fill out its
+ * layout paramters.
+ *
+ * @param child The view to position
+ * @param offset Offset from the selected position
+ * @param x X-coordintate indicating where this view should be placed. This
+ * will either be the left or right edge of the view, depending on
+ * the fromLeft paramter
+ * @param fromLeft Are we posiitoning views based on the left edge? (i.e.,
+ * building from left to right)?
+ */
+ private void setUpChild(View child, int offset, int x, boolean fromLeft) {
+
+ // Respect layout params that are already in the view. Otherwise
+ // make some up...
+ LayoutParams lp = (LayoutParams)
+ child.getLayoutParams();
+ if (lp == null) {
+ lp = (LayoutParams) generateDefaultLayoutParams();
+ }
+
+ addViewInLayout(child, fromLeft ? -1 : 0, lp);
+
+ child.setSelected(offset == 0);
+
+ // Get measure specs
+ int childHeightSpec = ViewGroup.getChildMeasureSpec(mHeightMeasureSpec,
+ mSpinnerPadding.top + mSpinnerPadding.bottom, lp.height);
+ int childWidthSpec = ViewGroup.getChildMeasureSpec(mWidthMeasureSpec,
+ mSpinnerPadding.left + mSpinnerPadding.right, lp.width);
+
+ // Measure child
+ child.measure(childWidthSpec, childHeightSpec);
+
+ int childLeft;
+ int childRight;
+
+ // Position vertically based on gravity setting
+ int childTop = calculateTop(child, true);
+ int childBottom = childTop + child.getMeasuredHeight();
+
+ int width = child.getMeasuredWidth();
+ if (fromLeft) {
+ childLeft = x;
+ childRight = childLeft + width;
+ } else {
+ childLeft = x - width;
+ childRight = x;
+ }
+
+ child.layout(childLeft, childTop, childRight, childBottom);
+ }
+
+ /**
+ * Figure out vertical placement based on mGravity
+ *
+ * @param child Child to place
+ * @return Where the top of the child should be
+ */
+ private int calculateTop(View child, boolean duringLayout) {
+ int myHeight = duringLayout ? getMeasuredHeight() : getHeight();
+ int childHeight = duringLayout ? child.getMeasuredHeight() : child.getHeight();
+
+ int childTop = 0;
+
+ switch (mGravity) {
+ case Gravity.TOP:
+ childTop = mSpinnerPadding.top;
+ break;
+ case Gravity.CENTER_VERTICAL:
+ int availableSpace = myHeight - mSpinnerPadding.bottom
+ - mSpinnerPadding.top - childHeight;
+ childTop = mSpinnerPadding.top + (availableSpace / 2);
+ break;
+ case Gravity.BOTTOM:
+ childTop = myHeight - mSpinnerPadding.bottom - childHeight;
+ break;
+ }
+ return childTop;
+ }
+
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+
+ // Give everything to the gesture detector
+ boolean retValue = mGestureDetector.onTouchEvent(event);
+
+ int action = event.getAction();
+ if (action == MotionEvent.ACTION_UP) {
+ // Helper method for lifted finger
+ onUp();
+ } else if (action == MotionEvent.ACTION_CANCEL) {
+ onCancel();
+ }
+
+ return retValue;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean onSingleTapUp(MotionEvent e) {
+
+ if (mDownTouchPosition >= 0) {
+
+ // An item tap should make it selected, so scroll to this child.
+ scrollToChild(mDownTouchPosition - mFirstPosition);
+
+ // Also pass the click so the client knows, if it wants to.
+ if (mShouldCallbackOnUnselectedItemClick || mDownTouchPosition == mSelectedPosition) {
+ performItemClick(mDownTouchView, mDownTouchPosition, mAdapter
+ .getItemId(mDownTouchPosition));
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
+
+ if (!mShouldCallbackDuringFling) {
+ // We want to suppress selection changes
+
+ // Remove any future code to set mSuppressSelectionChanged = false
+ removeCallbacks(mDisableSuppressSelectionChangedRunnable);
+
+ // This will get reset once we scroll into slots
+ if (!mSuppressSelectionChanged) mSuppressSelectionChanged = true;
+ }
+
+ // Fling the gallery!
+ mFlingRunnable.startUsingVelocity((int) -velocityX);
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
+
+ if (localLOGV) Log.v(TAG, String.valueOf(e2.getX() - e1.getX()));
+
+ /*
+ * Now's a good time to tell our parent to stop intercepting our events!
+ * The user has moved more than the slop amount, since GestureDetector
+ * ensures this before calling this method. Also, if a parent is more
+ * interested in this touch's events than we are, it would have
+ * intercepted them by now (for example, we can assume when a Gallery is
+ * in the ListView, a vertical scroll would not end up in this method
+ * since a ListView would have intercepted it by now).
+ */
+ getParent().requestDisallowInterceptTouchEvent(true);
+
+ // As the user scrolls, we want to callback selection changes so related-
+ // info on the screen is up-to-date with the gallery's selection
+ if (!mShouldCallbackDuringFling) {
+ if (mIsFirstScroll) {
+ /*
+ * We're not notifying the client of selection changes during
+ * the fling, and this scroll could possibly be a fling. Don't
+ * do selection changes until we're sure it is not a fling.
+ */
+ if (!mSuppressSelectionChanged) mSuppressSelectionChanged = true;
+ postDelayed(mDisableSuppressSelectionChangedRunnable, SCROLL_TO_FLING_UNCERTAINTY_TIMEOUT);
+ }
+ } else {
+ if (mSuppressSelectionChanged) mSuppressSelectionChanged = false;
+ }
+
+ // Track the motion
+ trackMotionScroll(-1 * (int) distanceX);
+
+ mIsFirstScroll = false;
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean onDown(MotionEvent e) {
+
+ // Kill any existing fling/scroll
+ mFlingRunnable.stop(false);
+
+ // Get the item's view that was touched
+ mDownTouchPosition = pointToPosition((int) e.getX(), (int) e.getY());
+
+ if (mDownTouchPosition >= 0) {
+ mDownTouchView = getChildAt(mDownTouchPosition - mFirstPosition);
+ mDownTouchView.setPressed(true);
+ }
+
+ // Reset the multiple-scroll tracking state
+ mIsFirstScroll = true;
+
+ // Must return true to get matching events for this down event.
+ return true;
+ }
+
+ /**
+ * Called when a touch event's action is MotionEvent.ACTION_UP.
+ */
+ void onUp() {
+
+ if (mFlingRunnable.mScroller.isFinished()) {
+ scrollIntoSlots();
+ }
+
+ dispatchUnpress();
+ }
+
+ /**
+ * Called when a touch event's action is MotionEvent.ACTION_CANCEL.
+ */
+ void onCancel() {
+ onUp();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void onLongPress(MotionEvent e) {
+
+ if (mDownTouchPosition < 0) {
+ return;
+ }
+
+ performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
+ long id = getItemIdAtPosition(mDownTouchPosition);
+ dispatchLongPress(mDownTouchView, mDownTouchPosition, id);
+ }
+
+ // Unused methods from GestureDetector.OnGestureListener below
+
+ /**
+ * {@inheritDoc}
+ */
+ public void onShowPress(MotionEvent e) {
+ }
+
+ // Unused methods from GestureDetector.OnGestureListener above
+
+ private void dispatchPress(View child) {
+
+ if (child != null) {
+ child.setPressed(true);
+ }
+
+ setPressed(true);
+ }
+
+ private void dispatchUnpress() {
+
+ for (int i = getChildCount() - 1; i >= 0; i--) {
+ getChildAt(i).setPressed(false);
+ }
+
+ setPressed(false);
+ }
+
+ @Override
+ public void dispatchSetSelected(boolean selected) {
+ /*
+ * We don't want to pass the selected state given from its parent to its
+ * children since this widget itself has a selected state to give to its
+ * children.
+ */
+ }
+
+ @Override
+ protected void dispatchSetPressed(boolean pressed) {
+
+ // Show the pressed state on the selected child
+ if (mSelectedChild != null) {
+ mSelectedChild.setPressed(pressed);
+ }
+ }
+
+ @Override
+ protected ContextMenu.ContextMenuInfo getContextMenuInfo() {
+ return mContextMenuInfo;
+ }
+
+ @Override
+ public boolean showContextMenuForChild(View originalView) {
+
+ final int longPressPosition = getPositionForView(originalView);
+ if (longPressPosition < 0) {
+ return false;
+ }
+
+ final long longPressId = mAdapter.getItemId(longPressPosition);
+ return dispatchLongPress(originalView, longPressPosition, longPressId);
+ }
+
+ @Override
+ public boolean showContextMenu() {
+
+ if (isPressed() && mSelectedPosition >= 0) {
+ int index = mSelectedPosition - mFirstPosition;
+ View v = getChildAt(index);
+ return dispatchLongPress(v, mSelectedPosition, mSelectedRowId);
+ }
+
+ return false;
+ }
+
+ private boolean dispatchLongPress(View view, int position, long id) {
+ boolean handled = false;
+
+ if (mOnItemLongClickListener != null) {
+ handled = mOnItemLongClickListener.onItemLongClick(this, mDownTouchView,
+ mDownTouchPosition, id);
+ }
+
+ if (!handled) {
+ mContextMenuInfo = new AdapterContextMenuInfo(view, position, id);
+ handled = super.showContextMenuForChild(this);
+ }
+
+ if (handled) {
+ performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
+ }
+
+ return handled;
+ }
+
+ @Override
+ public boolean dispatchKeyEvent(KeyEvent event) {
+ // Gallery steals all key events
+ return event.dispatch(this, null, null);
+ }
+
+ /**
+ * Handles left, right, and clicking
+ * @see android.view.View#onKeyDown
+ */
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ switch (keyCode) {
+
+ case KeyEvent.KEYCODE_DPAD_LEFT:
+ if (movePrevious()) {
+ playSoundEffect(SoundEffectConstants.NAVIGATION_LEFT);
+ }
+ return true;
+
+ case KeyEvent.KEYCODE_DPAD_RIGHT:
+ if (moveNext()) {
+ playSoundEffect(SoundEffectConstants.NAVIGATION_RIGHT);
+ }
+ return true;
+
+ case KeyEvent.KEYCODE_DPAD_CENTER:
+ case KeyEvent.KEYCODE_ENTER:
+ mReceivedInvokeKeyDown = true;
+ // fallthrough to default handling
+ }
+
+ return super.onKeyDown(keyCode, event);
+ }
+
+ @Override
+ public boolean onKeyUp(int keyCode, KeyEvent event) {
+ switch (keyCode) {
+ case KeyEvent.KEYCODE_DPAD_CENTER:
+ case KeyEvent.KEYCODE_ENTER: {
+
+ if (mReceivedInvokeKeyDown) {
+ if (mItemCount > 0) {
+
+ dispatchPress(mSelectedChild);
+ postDelayed(new Runnable() {
+ public void run() {
+ dispatchUnpress();
+ }
+ }, ViewConfiguration.getPressedStateDuration());
+
+ int selectedIndex = mSelectedPosition - mFirstPosition;
+ performItemClick(getChildAt(selectedIndex), mSelectedPosition, mAdapter
+ .getItemId(mSelectedPosition));
+ }
+ }
+
+ // Clear the flag
+ mReceivedInvokeKeyDown = false;
+
+ return true;
+ }
+ }
+
+ return super.onKeyUp(keyCode, event);
+ }
+
+ boolean movePrevious() {
+ if (mItemCount > 0 && mSelectedPosition > 0) {
+ scrollToChild(mSelectedPosition - mFirstPosition - 1);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ boolean moveNext() {
+ if (mItemCount > 0 && mSelectedPosition < mItemCount - 1) {
+ scrollToChild(mSelectedPosition - mFirstPosition + 1);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private boolean scrollToChild(int childPosition) {
+ View child = getChildAt(childPosition);
+
+ if (child != null) {
+ int distance = getCenterOfGallery() - getCenterOfView(child);
+ mFlingRunnable.startUsingDistance(distance);
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ void setSelectedPositionInt(int position) {
+ super.setSelectedPositionInt(position);
+
+ // Updates any metadata we keep about the selected item.
+ updateSelectedItemMetadata();
+ }
+
+ private void updateSelectedItemMetadata() {
+
+ View oldSelectedChild = mSelectedChild;
+
+ View child = mSelectedChild = getChildAt(mSelectedPosition - mFirstPosition);
+ if (child == null) {
+ return;
+ }
+
+ child.setSelected(true);
+ child.setFocusable(true);
+
+ if (hasFocus()) {
+ child.requestFocus();
+ }
+
+ // We unfocus the old child down here so the above hasFocus check
+ // returns true
+ if (oldSelectedChild != null) {
+
+ // Make sure its drawable state doesn't contain 'selected'
+ oldSelectedChild.setSelected(false);
+
+ // Make sure it is not focusable anymore, since otherwise arrow keys
+ // can make this one be focused
+ oldSelectedChild.setFocusable(false);
+ }
+
+ }
+
+ /**
+ * Describes how the child views are aligned.
+ * @param gravity
+ *
+ * @attr ref android.R.styleable#Gallery_gravity
+ */
+ public void setGravity(int gravity)
+ {
+ if (mGravity != gravity) {
+ mGravity = gravity;
+ requestLayout();
+ }
+ }
+
+ @Override
+ protected int getChildDrawingOrder(int childCount, int i) {
+ int selectedIndex = mSelectedPosition - mFirstPosition;
+
+ // Just to be safe
+ if (selectedIndex < 0) return i;
+
+ if (i == childCount - 1) {
+ // Draw the selected child last
+ return selectedIndex;
+ } else if (i >= selectedIndex) {
+ // Move the children to the right of the selected child earlier one
+ return i + 1;
+ } else {
+ // Keep the children to the left of the selected child the same
+ return i;
+ }
+ }
+
+ @Override
+ protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {
+ super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
+
+ /*
+ * The gallery shows focus by focusing the selected item. So, give
+ * focus to our selected item instead. We steal keys from our
+ * selected item elsewhere.
+ */
+ if (gainFocus && mSelectedChild != null) {
+ mSelectedChild.requestFocus(direction);
+ }
+
+ }
+
+ /**
+ * Responsible for fling behavior. Use {@link #startUsingVelocity(int)} to
+ * initiate a fling. Each frame of the fling is handled in {@link #run()}.
+ * A FlingRunnable will keep re-posting itself until the fling is done.
+ *
+ */
+ private class FlingRunnable implements Runnable {
+ /**
+ * Tracks the decay of a fling scroll
+ */
+ private Scroller mScroller;
+
+ /**
+ * X value reported by mScroller on the previous fling
+ */
+ private int mLastFlingX;
+
+ public FlingRunnable() {
+ mScroller = new Scroller(getContext());
+ }
+
+ private void startCommon() {
+ // Remove any pending flings
+ removeCallbacks(this);
+ }
+
+ public void startUsingVelocity(int initialVelocity) {
+ if (initialVelocity == 0) return;
+
+ startCommon();
+
+ int initialX = initialVelocity < 0 ? Integer.MAX_VALUE : 0;
+ mLastFlingX = initialX;
+ mScroller.fling(initialX, 0, initialVelocity, 0,
+ 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE);
+ post(this);
+ }
+
+ public void startUsingDistance(int distance) {
+ if (distance == 0) return;
+
+ startCommon();
+
+ mLastFlingX = 0;
+ mScroller.startScroll(0, 0, -distance, 0, mAnimationDuration);
+ post(this);
+ }
+
+ public void stop(boolean scrollIntoSlots) {
+ removeCallbacks(this);
+ endFling(scrollIntoSlots);
+ }
+
+ private void endFling(boolean scrollIntoSlots) {
+ /*
+ * Force the scroller's status to finished (without setting its
+ * position to the end)
+ */
+ mScroller.forceFinished(true);
+
+ if (scrollIntoSlots) scrollIntoSlots();
+ }
+
+ public void run() {
+
+ if (mItemCount == 0) {
+ endFling(true);
+ return;
+ }
+
+ mShouldStopFling = false;
+
+ final Scroller scroller = mScroller;
+ boolean more = scroller.computeScrollOffset();
+ final int x = scroller.getCurrX();
+
+ // Flip sign to convert finger direction to list items direction
+ // (e.g. finger moving down means list is moving towards the top)
+ int delta = mLastFlingX - x;
+
+ // Pretend that each frame of a fling scroll is a touch scroll
+ if (delta > 0) {
+ // Moving towards the left. Use first view as mDownTouchPosition
+ mDownTouchPosition = mFirstPosition;
+
+ // Don't fling more than 1 screen
+ delta = Math.min(getWidth() - getPaddingLeft() - getPaddingRight() - 1, delta);
+ } else {
+ // Moving towards the right. Use last view as mDownTouchPosition
+ int offsetToLast = getChildCount() - 1;
+ mDownTouchPosition = mFirstPosition + offsetToLast;
+
+ // Don't fling more than 1 screen
+ delta = Math.max(-(getWidth() - getPaddingRight() - getPaddingLeft() - 1), delta);
+ }
+
+ trackMotionScroll(delta);
+
+ if (more && !mShouldStopFling) {
+ mLastFlingX = x;
+ post(this);
+ } else {
+ endFling(true);
+ }
+ }
+
+ }
+
+ /**
+ * Gallery extends LayoutParams to provide a place to hold current
+ * Transformation information along with previous position/transformation
+ * info.
+ *
+ */
+ public static class LayoutParams extends ViewGroup.LayoutParams {
+ public LayoutParams(Context c, AttributeSet attrs) {
+ super(c, attrs);
+ }
+
+ public LayoutParams(int w, int h) {
+ super(w, h);
+ }
+
+ public LayoutParams(ViewGroup.LayoutParams source) {
+ super(source);
+ }
+ }
+}
diff --git a/src/com/cyanogenmod/trebuchet/widget/InertCheckBox.java b/src/com/cyanogenmod/trebuchet/widget/InertCheckBox.java
new file mode 100644
index 000000000..bab357b15
--- /dev/null
+++ b/src/com/cyanogenmod/trebuchet/widget/InertCheckBox.java
@@ -0,0 +1,69 @@
+package com.cyanogenmod.trebuchet.widget;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.widget.CheckBox;
+
+
+// CheckBox that does not react to any user event in order to let the container handle them.
+public class InertCheckBox extends CheckBox {
+
+ @SuppressWarnings("unused")
+ public InertCheckBox(Context context) {
+ super(context);
+ }
+
+ @SuppressWarnings("unused")
+ public InertCheckBox(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @SuppressWarnings("unused")
+ public InertCheckBox(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+ // Make the checkbox not respond to any user event
+ return false;
+ }
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ // Make the checkbox not respond to any user event
+ return false;
+ }
+
+ @Override
+ public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) {
+ // Make the checkbox not respond to any user event
+ return false;
+ }
+
+ @Override
+ public boolean onKeyPreIme(int keyCode, KeyEvent event) {
+ // Make the checkbox not respond to any user event
+ return false;
+ }
+
+ @Override
+ public boolean onKeyShortcut(int keyCode, KeyEvent event) {
+ // Make the checkbox not respond to any user event
+ return false;
+ }
+
+ @Override
+ public boolean onKeyUp(int keyCode, KeyEvent event) {
+ // Make the checkbox not respond to any user event
+ return false;
+ }
+
+ @Override
+ public boolean onTrackballEvent(MotionEvent event) {
+ // Make the checkbox not respond to any user event
+ return false;
+ }
+} \ No newline at end of file
diff --git a/tests/stress/Android.mk b/tests/stress/Android.mk
index 68289bd3e..4678f677d 100644
--- a/tests/stress/Android.mk
+++ b/tests/stress/Android.mk
@@ -22,10 +22,10 @@ LOCAL_JAVA_LIBRARIES := android.test.runner
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_PACKAGE_NAME := LauncherRotationStressTest
+LOCAL_PACKAGE_NAME := TrebuchetRotationStressTest
LOCAL_CERTIFICATE := shared
-LOCAL_INSTRUMENTATION_FOR := Launcher2
+LOCAL_INSTRUMENTATION_FOR := Trebuchet
include $(BUILD_PACKAGE)
diff --git a/tests/stress/AndroidManifest.xml b/tests/stress/AndroidManifest.xml
index 0df3a9da3..71c9e7afd 100644
--- a/tests/stress/AndroidManifest.xml
+++ b/tests/stress/AndroidManifest.xml
@@ -24,6 +24,6 @@
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.android.launcher"
- android:label="Rotation stress test using Launcher2">
+ android:label="Rotation stress test using Trebuchet">
</instrumentation>
</manifest>
diff --git a/tests/stress/src/com/android/launcher2/stress/LauncherRotationStressTest.java b/tests/stress/src/com/cyanogenmod/trebuchet/stress/LauncherRotationStressTest.java
index d21fd53ba..e2ced63a6 100644
--- a/tests/stress/src/com/android/launcher2/stress/LauncherRotationStressTest.java
+++ b/tests/stress/src/com/cyanogenmod/trebuchet/stress/LauncherRotationStressTest.java
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package com.android.launcher2.stress;
+package com.cyanogenmod.trebuchet.stress;
-import com.android.launcher2.Launcher;
+import com.cyanogenmod.trebuchet.Launcher;
import android.content.pm.ActivityInfo;
import android.os.SystemClock;
@@ -26,13 +26,13 @@ import android.test.RepetitiveTest;
import android.util.Log;
/**
- * Run rotation stress test using Launcher2 for 50 iterations.
+ * Run rotation stress test using Trebuchet for 50 iterations.
*/
public class LauncherRotationStressTest extends ActivityInstrumentationTestCase2<Launcher> {
private static final int NUM_ITERATIONS = 50;
private static final int WAIT_TIME_MS = 500;
- private static final String LOG_TAG = "LauncherRotationStressTest";
+ private static final String LOG_TAG = "TrebuchetRotationStressTest";
public LauncherRotationStressTest() {
super(Launcher.class);