New small/large screen division for Launcher.

Previously the dp division between the two was set at 600dp
(7" tablets). This has now been bumped up to 720dp
(10" tablets).

Change-Id: I1f0419e504fc3bb606156c1cf6fbe03956274184
This commit is contained in:
Andrew Flynn
2012-02-29 13:33:22 -08:00
parent 79b79dd579
commit 0dca1ec414
51 changed files with 327 additions and 205 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -18,7 +18,7 @@
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:background="@drawable/hotseat_bg_panel"
launcher:cellCountX="1"
launcher:cellCountY="5">
launcher:cellCountY="@integer/hotseat_cell_count">
<com.android.launcher2.CellLayout
android:id="@+id/layout"
android:layout_width="wrap_content"

View File

@@ -30,8 +30,8 @@
android:paddingLeft="@dimen/qsb_bar_height"
android:paddingRight="@dimen/button_bar_height"
launcher:defaultScreen="2"
launcher:cellCountX="4"
launcher:cellCountY="4"
launcher:cellCountX="@integer/cell_count_x"
launcher:cellCountY="@integer/cell_count_y"
launcher:pageSpacing="@dimen/workspace_page_spacing"
launcher:scrollIndicatorPaddingLeft="@dimen/qsb_bar_height"
launcher:scrollIndicatorPaddingRight="@dimen/button_bar_height">

View File

@@ -17,7 +17,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:background="@drawable/hotseat_bg_panel"
launcher:cellCountX="5"
launcher:cellCountX="@integer/hotseat_cell_count"
launcher:cellCountY="1">
<com.android.launcher2.CellLayout
android:id="@+id/layout"

View File

@@ -47,8 +47,8 @@
android:paddingTop="@dimen/qsb_bar_height_inset"
android:paddingBottom="@dimen/button_bar_height"
launcher:defaultScreen="2"
launcher:cellCountX="4"
launcher:cellCountY="4"
launcher:cellCountX="@integer/cell_count_x"
launcher:cellCountY="@integer/cell_count_y"
launcher:pageSpacing="@dimen/workspace_page_spacing"
launcher:scrollIndicatorPaddingLeft="@dimen/workspace_divider_padding_left"
launcher:scrollIndicatorPaddingRight="@dimen/workspace_divider_padding_right">

View File

@@ -19,30 +19,8 @@
<dimen name="folderClingMarginTop">50dp</dimen>
<!-- Workspace -->
<dimen name="workspace_width_gap">0dp</dimen>
<dimen name="workspace_height_gap">0dp</dimen>
<dimen name="workspace_top_padding">8dp</dimen>
<dimen name="workspace_bottom_padding">8dp</dimen>
<dimen name="workspace_left_padding">8dp</dimen>
<dimen name="workspace_right_padding">8dp</dimen>
<dimen name="workspace_divider_padding_top">6dp</dimen>
<dimen name="workspace_divider_padding_bottom">6dp</dimen>
<dimen name="hotseat_width_gap">0dp</dimen>
<dimen name="hotseat_height_gap">0dp</dimen>
<dimen name="hotseat_top_padding">-1dp</dimen>
<dimen name="hotseat_bottom_padding">-1dp</dimen>
<dimen name="hotseat_left_padding">-1dp</dimen>
<dimen name="hotseat_right_padding">-1dp</dimen>
<dimen name="qsb_bar_height">48dp</dimen>
<!-- height of the bottom row of controls -->
<dimen name="button_bar_height">80dip</dimen>
<!-- Because portal animations go beyond the bounds of an icon, we need
to make the dock layout slightly larger than the button_bar_height -->
<dimen name="button_bar_height_top_padding">8dp</dimen>
<dimen name="button_bar_height_bottom_padding">8dp</dimen>
<dimen name="button_bar_width_left_padding">8dp</dimen>
<dimen name="button_bar_width_right_padding">8dp</dimen>
<dimen name="button_bar_height_plus_padding">80dp</dimen>
</resources>

View File

@@ -19,22 +19,9 @@
<dimen name="folderClingMarginTop">70dp</dimen>
<!-- Workspace -->
<dimen name="workspace_width_gap">0dp</dimen>
<dimen name="workspace_height_gap">0dp</dimen>
<dimen name="workspace_top_padding">8dp</dimen>
<dimen name="workspace_bottom_padding">8dp</dimen>
<dimen name="workspace_left_padding">8dp</dimen>
<dimen name="workspace_right_padding">8dp</dimen>
<dimen name="workspace_divider_padding_left">6dp</dimen>
<dimen name="workspace_divider_padding_right">6dp</dimen>
<dimen name="hotseat_width_gap">0dp</dimen>
<dimen name="hotseat_height_gap">0dp</dimen>
<dimen name="hotseat_top_padding">-1dp</dimen>
<dimen name="hotseat_bottom_padding">-1dp</dimen>
<dimen name="hotseat_left_padding">-1dp</dimen>
<dimen name="hotseat_right_padding">-1dp</dimen>
<!-- qsb_bar_height_inset represents qsb_bar_height minus the padding
that we put on each page for allowing folders to draw out of bounds -->
<dimen name="qsb_bar_height_inset">48dp</dimen>
@@ -42,15 +29,6 @@
<dimen name="qsb_padding_left">6dp</dimen>
<dimen name="qsb_padding_right">6dp</dimen>
<dimen name="search_bar_height">48dp</dimen>
<!-- height of the bottom row of controls -->
<dimen name="button_bar_height">80dip</dimen>
<!-- Because portal animations go beyond the bounds of an icon, we need
to make the dock layout slightly larger than the button_bar_height -->
<dimen name="button_bar_height_top_padding">8dp</dimen>
<dimen name="button_bar_height_bottom_padding">8dp</dimen>
<dimen name="button_bar_width_left_padding">8dp</dimen>
<dimen name="button_bar_width_right_padding">8dp</dimen>
<dimen name="button_bar_height_plus_padding">80dp</dimen>
<!-- AppsCustomize -->
<dimen name="apps_customize_pageLayoutPaddingTop">16dp</dimen>

View File

@@ -17,4 +17,28 @@
<resources>
<!-- Drag padding to add to the bottom of drop targets -->
<dimen name="drop_target_drag_padding">20dp</dimen>
<!-- Workspace -->
<dimen name="workspace_width_gap">0dp</dimen>
<dimen name="workspace_height_gap">0dp</dimen>
<dimen name="workspace_top_padding">8dp</dimen>
<dimen name="workspace_bottom_padding">8dp</dimen>
<dimen name="workspace_left_padding">8dp</dimen>
<dimen name="workspace_right_padding">8dp</dimen>
<!-- Hotseat -->
<dimen name="hotseat_width_gap">0dp</dimen>
<dimen name="hotseat_height_gap">0dp</dimen>
<dimen name="hotseat_top_padding">-1dp</dimen>
<dimen name="hotseat_bottom_padding">-1dp</dimen>
<dimen name="hotseat_left_padding">-1dp</dimen>
<dimen name="hotseat_right_padding">-1dp</dimen>
<!-- height of the bottom row of controls -->
<dimen name="button_bar_height">80dip</dimen>
<!-- Because portal animations go beyond the bounds of an icon, we need
to make the dock layout slightly larger than the button_bar_height -->
<dimen name="button_bar_height_bottom_padding">8dp</dimen>
<dimen name="button_bar_width_left_padding">8dp</dimen>
<dimen name="button_bar_width_right_padding">8dp</dimen>
<dimen name="button_bar_height_plus_padding">80dp</dimen>
</resources>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -15,33 +15,28 @@
-->
<resources>
<dimen name="app_icon_size">65dp</dimen>
<dimen name="app_icon_padding_top">2dp</dimen>
<!-- Hotseat -->
<dimen name="hotseat_cell_width">75dp</dimen>
<dimen name="hotseat_cell_height">85dp</dimen>
<!-- Workspace -->
<dimen name="workspace_left_padding">24dip</dimen>
<dimen name="workspace_right_padding">24dip</dimen>
<!-- We need padding on the screens for portals to look right -->
<dimen name="workspace_top_padding">12dip</dimen>
<dimen name="workspace_bottom_padding">12dip</dimen>
<dimen name="workspace_cell_width">96dp</dimen>
<dimen name="workspace_cell_height">86dp</dimen>
<dimen name="workspace_width_gap">32dp</dimen>
<dimen name="workspace_height_gap">2dp</dimen>
<dimen name="workspace_page_spacing">50dp</dimen>
<dimen name="workspace_height_gap">0dp</dimen>
<!-- the area at the edge of the screen that makes the workspace go left
or right while you're dragging. -->
<dimen name="scroll_zone">100dip</dimen>
<!-- Folders -->
<!-- The size of the image which sits behind the preview of the folder contents -->
<dimen name="folder_preview_size">70dp</dimen>
<dimen name="folder_cell_width">86dp</dimen>
<dimen name="folder_cell_height">86dp</dimen>
<!-- AppsCustomize -->
<dimen name="apps_customize_pageLayoutWidthGap">36dp</dimen>
<dimen name="apps_customize_pageLayoutHeightGap">8dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingTop">20dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingBottom">14dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingLeft">30dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingRight">30dp</dimen>
<integer name="apps_customize_widget_cell_count_x">3</integer>
<integer name="apps_customize_widget_cell_count_y">2</integer>
<integer name="apps_customize_cling_focused_x">4</integer>
<integer name="apps_customize_cling_focused_y">2</integer>
<!-- Cling -->
<!-- The offset for the text in the cling -->
<dimen name="cling_text_block_offset_x">140dp</dimen>
<dimen name="cling_text_block_offset_y">80dp</dimen>
</resources>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -15,36 +15,20 @@
-->
<resources>
<!-- Workspace -->
<dimen name="workspace_width_gap">0dp</dimen>
<dimen name="workspace_height_gap">32dp</dimen>
<!-- AppsCustomize -->
<dimen name="apps_customize_cell_width">96dp</dimen>
<dimen name="apps_customize_cell_height">96dp</dimen>
<!-- Workspace -->
<!-- the area at the edge of the screen that makes the workspace go left
or right while you're dragging. -->
<dimen name="scroll_zone">40dp</dimen>
<dimen name="workspace_left_padding">15dip</dimen>
<dimen name="workspace_right_padding">15dip</dimen>
<dimen name="workspace_top_padding">25dip</dimen>
<dimen name="workspace_bottom_padding">25dip</dimen>
<dimen name="workspace_width_gap">0dp</dimen>
<dimen name="workspace_height_gap">32dp</dimen>
<dimen name="workspace_page_spacing">16dp</dimen>
<dimen name="apps_customize_pageLayoutWidthGap">24dp</dimen>
<dimen name="apps_customize_pageLayoutHeightGap">36dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingTop">25dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingBottom">10dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingLeft">30dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingRight">30dp</dimen>
<integer name="apps_customize_widget_cell_count_x">2</integer>
<integer name="apps_customize_widget_cell_count_y">3</integer>
<integer name="apps_customize_cling_focused_x">2</integer>
<integer name="apps_customize_cling_focused_y">2</integer>
<!-- Cling -->
<!-- The offset for the text in the cling -->
<dimen name="cling_text_block_offset_x">80dp</dimen>
<dimen name="cling_text_block_offset_y">160dp</dimen>
</resources>
<!-- Hotseat -->
<dimen name="hotseat_cell_width">75dp</dimen>
<dimen name="hotseat_cell_height">75dp</dimen>
</resources>

View File

@@ -1,26 +1,12 @@
<resources>
<bool name="config_largeHeap">true</bool>
<!-- AllApps/Customize/AppsCustomize -->
<!-- Out of 100, the percent to shrink the workspace during spring loaded mode. -->
<integer name="config_workspaceSpringLoadShrinkPercentage">90</integer>
<!-- Workspace -->
<!-- Whether or not the drop targets drop down as opposed to fade in -->
<bool name="config_useDropTargetDownTransition">true</bool>
<!-- Whether or not to fade the side pages -->
<bool name="config_workspaceFadeAdjacentScreens">true</bool>
<!-- When dragging items on the workspace, how much bigger (in pixels) the dragged view
should be, as compared to the original view. If 0, it will not be scaled at all.
Should be an even number, for pixel alignment. -->
<integer name="config_dragViewExtraPixels">0</integer>
<!-- When shrinking the workspace, this is the percentage of its original size. -->
<integer name="config_workspaceShrinkPercent">17</integer>
<integer name="cell_count_x">6</integer>
<integer name="cell_count_y">6</integer>
<integer name="hotseat_cell_count">7</integer>
<integer name="hotseat_all_apps_index">3</integer>
<!-- Folders -->
<!-- Folder max bounds and max number of items. Note: folder_max_count_x * folder_max_count_y
>= folder_max_num_items. When these are set to -1, they are automatically determined. -->
>= folder_max_num_items. When these are set to -1, they are automatically determined. -->
<integer name="folder_max_count_x">-1</integer>
<integer name="folder_max_count_y">-1</integer>
<integer name="folder_max_num_items">-1</integer>

View File

@@ -15,67 +15,39 @@
-->
<resources>
<!-- QSB -->
<dimen name="toolbar_button_vertical_padding">12dip</dimen>
<dimen name="toolbar_button_horizontal_padding">12dip</dimen>
<!-- Workspace -->
<dimen name="qsb_bar_height">56dp</dimen>
<!-- This should be @dimen/qsb_bar_height - @dimen/workspace_top_padding
to fix the extra space given to draw portals -->
<dimen name="workspace_content_large_only_top_margin">36dp</dimen>
<dimen name="workspace_cell_width">96dip</dimen>
<dimen name="workspace_cell_height">96dip</dimen>
<dimen name="folder_cell_width">96dp</dimen>
<dimen name="folder_cell_height">96dp</dimen>
<dimen name="app_icon_size">72dp</dimen>
<integer name="app_icon_hotseat_scale_percent">78</integer>
<dimen name="app_icon_drawable_padding">3dp</dimen>
<dimen name="app_icon_padding_top">4dp</dimen>
<!-- AppsCustomize -->
<dimen name="apps_customize_tab_bar_height">60dp</dimen>
<dimen name="apps_customize_tab_bar_margin_top">8dp</dimen>
<dimen name="apps_customize_cell_width">96dp</dimen>
<dimen name="apps_customize_cell_height">98dp</dimen>
<dimen name="apps_customize_widget_cell_width_gap">36dp</dimen>
<dimen name="apps_customize_widget_cell_height_gap">36dp</dimen>
<!-- Workspace -->
<dimen name="workspace_cell_width">96dp</dimen>
<dimen name="workspace_cell_height">96dp</dimen>
<!-- The corner radius to draw the external drop icon rounded rect -->
<dimen name="external_drop_icon_rect_radius">10dp</dimen>
<!-- Size of icons in workspace -->
<dimen name="app_icon_size">72dp</dimen>
<!-- extra horizontal spacing between mini screen thumbnails ie. in all
apps and in customization mode -->
<dimen name="smallScreenExtraSpacing">0dip</dimen>
<!-- Vertical spacing between edge of screen and mini cell layouts when they
are minimized to the bottom in all apps -->
<dimen name="allAppsSmallScreenVerticalMarginLandscape">30dip</dimen>
<dimen name="allAppsSmallScreenVerticalMarginPortrait">60dip</dimen>
<dimen name="all_apps_button_vertical_padding">4dip</dimen>
<!-- roughly a status bar (for determining how many rows of icons are in home) -->
<dimen name="status_bar_height">48dip</dimen>
<!-- dimensions for the wallpaper picker wallpaper thumbnail width -->
<dimen name="wallpaper_chooser_grid_width">196dp</dimen>
<dimen name="wallpaper_chooser_grid_height">140dp</dimen>
<dimen name="live_wallpaper_grid_item_padding">8dip</dimen>
<!-- How much the content view of an alert dialog should be inset (currently used
for the WallpaperChooser in XLarge mode) -->
<dimen name="alert_dialog_content_inset">0dp</dimen>
<!-- When dragging items on the workspace, the number of dps by which the position of
the drag view should be offset from the position of the original view. -->
<dimen name="dragViewOffsetX">0dp</dimen>
<dimen name="dragViewOffsetY">-12dp</dimen>
<!-- Hotseat -->
<dimen name="hotseat_width_gap">-1dp</dimen>
<dimen name="hotseat_height_gap">-1dp</dimen>
<dimen name="button_bar_height">94dip</dimen>
<dimen name="button_bar_height_bottom_padding">9dp</dimen>
<dimen name="button_bar_height_top_padding">9dp</dimen>
<dimen name="button_bar_width_left_padding">9dp</dimen>
<dimen name="button_bar_width_right_padding">9dp</dimen>
<dimen name="button_bar_height_plus_padding">94dp</dimen>
<!-- Folders -->
<!-- The size of the image which sits behind the preview of the folder contents -->
<dimen name="folder_preview_size">78dp</dimen>
<!-- The amount that the preview contents are inset from the preview background -->
<dimen name="folder_preview_padding">4dp</dimen>
<dimen name="folder_preview_size">75dp</dimen>
<dimen name="folder_cell_width">96dp</dimen>
<dimen name="folder_cell_height">96dp</dimen>
<dimen name="folder_icon_padding_top">0dp</dimen>
<!-- AppsCustomize -->
<dimen name="apps_customize_cell_width">96dp</dimen>
<dimen name="apps_customize_cell_height">98dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingLeft">10dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingRight">10dp</dimen>
<dimen name="apps_customize_tab_bar_height">60dp</dimen>
<dimen name="apps_customize_tab_bar_margin_top">8dp</dimen>
<dimen name="apps_customize_widget_cell_width_gap">36dp</dimen>
<dimen name="apps_customize_widget_cell_height_gap">36dp</dimen>
</resources>

View File

@@ -15,12 +15,33 @@
-->
<resources>
<integer name="apps_customize_widget_cell_count_x">4</integer>
<integer name="apps_customize_widget_cell_count_y">2</integer>
<!-- AppsCustomize -->
<dimen name="apps_customize_pageLayoutWidthGap">28dp</dimen>
<dimen name="apps_customize_pageLayoutHeightGap">16dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingLeft">16dp</dimen>
<dimen name="apps_customize_pageLayoutPaddingRight">16dp</dimen>
</resources>
<!-- Workspace -->
<dimen name="workspace_left_padding">24dip</dimen>
<dimen name="workspace_right_padding">24dip</dimen>
<!-- We need padding on the screens for portals to look right -->
<dimen name="workspace_top_padding">12dip</dimen>
<dimen name="workspace_bottom_padding">12dip</dimen>
<dimen name="workspace_width_gap">32dp</dimen>
<dimen name="workspace_height_gap">2dp</dimen>
<dimen name="workspace_page_spacing">50dp</dimen>
<!-- the area at the edge of the screen that makes the workspace go left
or right while you're dragging. -->
<dimen name="scroll_zone">100dip</dimen>
<integer name="apps_customize_widget_cell_count_x">4</integer>
<integer name="apps_customize_widget_cell_count_y">2</integer>
<integer name="apps_customize_cling_focused_x">4</integer>
<integer name="apps_customize_cling_focused_y">2</integer>
<!-- Cling -->
<!-- The offset for the text in the cling -->
<dimen name="cling_text_block_offset_x">140dp</dimen>
<dimen name="cling_text_block_offset_y">80dp</dimen>
</resources>

View File

@@ -15,9 +15,6 @@
-->
<resources>
<!-- Workspace -->
<dimen name="workspace_page_spacing">24dp</dimen>
<!-- AppsCustomize -->
<integer name="apps_customize_maxCellCountX">-1</integer>
<integer name="apps_customize_maxCellCountY">7</integer>
@@ -29,4 +26,25 @@
xlarge -->
<integer name="apps_customize_widget_cell_count_x">3</integer>
<integer name="apps_customize_widget_cell_count_y">3</integer>
</resources>
<!-- Workspace -->
<!-- the area at the edge of the screen that makes the workspace go left
or right while you're dragging. -->
<dimen name="scroll_zone">40dp</dimen>
<dimen name="workspace_left_padding">15dip</dimen>
<dimen name="workspace_right_padding">15dip</dimen>
<dimen name="workspace_top_padding">25dip</dimen>
<dimen name="workspace_bottom_padding">25dip</dimen>
<dimen name="workspace_width_gap">0dp</dimen>
<dimen name="workspace_height_gap">32dp</dimen>
<dimen name="workspace_page_spacing">24dp</dimen>
<integer name="apps_customize_cling_focused_x">2</integer>
<integer name="apps_customize_cling_focused_y">2</integer>
<!-- Cling -->
<!-- The offset for the text in the cling -->
<dimen name="cling_text_block_offset_x">80dp</dimen>
<dimen name="cling_text_block_offset_y">160dp</dimen>
</resources>

View File

@@ -0,0 +1,22 @@
<resources>
<bool name="config_largeHeap">true</bool>
<bool name="is_large_screen">true</bool>
<!-- AllApps/Customize/AppsCustomize -->
<!-- Out of 100, the percent to shrink the workspace during spring loaded mode. -->
<integer name="config_workspaceSpringLoadShrinkPercentage">90</integer>
<!-- Workspace -->
<!-- Whether or not the drop targets drop down as opposed to fade in -->
<bool name="config_useDropTargetDownTransition">true</bool>
<!-- Whether or not to fade the side pages -->
<bool name="config_workspaceFadeAdjacentScreens">true</bool>
<!-- When dragging items on the workspace, how much bigger (in pixels) the dragged view
should be, as compared to the original view. If 0, it will not be scaled at all.
Should be an even number, for pixel alignment. -->
<integer name="config_dragViewExtraPixels">0</integer>
<!-- When shrinking the workspace, this is the percentage of its original size. -->
<integer name="config_workspaceShrinkPercent">17</integer>
</resources>

View File

@@ -15,9 +15,56 @@
-->
<resources>
<!-- QSB -->
<dimen name="toolbar_button_vertical_padding">12dip</dimen>
<dimen name="toolbar_button_horizontal_padding">12dip</dimen>
<!-- Workspace -->
<dimen name="qsb_bar_height">56dp</dimen>
<!-- This should be @dimen/qsb_bar_height - @dimen/workspace_top_padding
to fix the extra space given to draw portals -->
<dimen name="workspace_content_large_only_top_margin">36dp</dimen>
<dimen name="workspace_cell_width">96dip</dimen>
<dimen name="workspace_cell_height">96dip</dimen>
<!-- AppsCustomize -->
<integer name="apps_customize_maxCellCountX">-1</integer>
<integer name="apps_customize_maxCellCountY">-1</integer>
<dimen name="app_widget_preview_padding_left">0dp</dimen>
<dimen name="app_widget_preview_padding_top">10dp</dimen>
</resources>
<!-- The corner radius to draw the external drop icon rounded rect -->
<dimen name="external_drop_icon_rect_radius">10dp</dimen>
<!-- Size of icons in workspace -->
<dimen name="app_icon_size">72dp</dimen>
<integer name="app_icon_hotseat_scale_percent">-1</integer>
<!-- extra horizontal spacing between mini screen thumbnails ie. in all
apps and in customization mode -->
<dimen name="smallScreenExtraSpacing">0dip</dimen>
<!-- Vertical spacing between edge of screen and mini cell layouts when they
are minimized to the bottom in all apps -->
<dimen name="allAppsSmallScreenVerticalMarginLandscape">30dip</dimen>
<dimen name="allAppsSmallScreenVerticalMarginPortrait">60dip</dimen>
<dimen name="all_apps_button_vertical_padding">4dip</dimen>
<!-- roughly a status bar (for determining how many rows of icons are in home) -->
<dimen name="status_bar_height">48dip</dimen>
<!-- dimensions for the wallpaper picker wallpaper thumbnail width -->
<dimen name="wallpaper_chooser_grid_width">196dp</dimen>
<dimen name="wallpaper_chooser_grid_height">140dp</dimen>
<dimen name="live_wallpaper_grid_item_padding">8dip</dimen>
<!-- How much the content view of an alert dialog should be inset (currently used
for the WallpaperChooser in XLarge mode) -->
<dimen name="alert_dialog_content_inset">0dp</dimen>
<!-- When dragging items on the workspace, the number of dps by which the position of
the drag view should be offset from the position of the original view. -->
<dimen name="dragViewOffsetX">0dp</dimen>
<dimen name="dragViewOffsetY">-12dp</dimen>
</resources>

View File

@@ -32,4 +32,5 @@
<color name="workspace_all_apps_and_delete_zone_text_color">#CCFFFFFF</color>
<color name="workspace_all_apps_and_delete_zone_text_shadow_color">#A0000000</color>
<color name="workspace_icon_text_color">#FFF</color>
</resources>

View File

@@ -1,6 +1,7 @@
<resources>
<bool name="config_hardwareAccelerated">true</bool>
<bool name="config_largeHeap">false</bool>
<bool name="is_large_screen">false</bool>
<!-- AllApps/Customize/AppsCustomize -->
<!-- The alpha of the AppsCustomize bg in spring loaded mode -->
@@ -90,4 +91,9 @@
<integer name="folder_max_count_x">4</integer>
<integer name="folder_max_count_y">4</integer>
<integer name="folder_max_num_items">16</integer>
<integer name="cell_count_x">4</integer>
<integer name="cell_count_y">4</integer>
<integer name="hotseat_cell_count">5</integer>
<integer name="hotseat_all_apps_index">2</integer>
</resources>

View File

@@ -37,6 +37,7 @@
<dimen name="workspace_max_gap">16dp</dimen>
<dimen name="folder_cell_width">74dp</dimen>
<dimen name="folder_cell_height">82dp</dimen>
<dimen name="folder_icon_padding_top">2dp</dimen>
<dimen name="workspace_divider_padding_left">3dp</dimen>
<dimen name="workspace_divider_padding_right">3dp</dimen>
<dimen name="workspace_divider_padding_top">0dp</dimen>
@@ -47,6 +48,7 @@
<dimen name="hotseat_height_gap">-1dp</dimen>
<dimen name="workspace_overscroll_drawable_padding">0dp</dimen>
<dimen name="app_icon_drawable_padding">6dp</dimen>
<dimen name="app_icon_padding_top">8dp</dimen>
<!-- QSB -->
@@ -64,6 +66,7 @@
<dimen name="apps_customize_tab_bar_height">52dp</dimen>
<dimen name="apps_customize_tab_bar_margin_top">0dp</dimen>
<dimen name="app_icon_size">48dp</dimen>
<integer name="app_icon_hotseat_scale_percent">-1</integer>
<!-- The width can be 72dp because we don't have L/R padding -->
<dimen name="apps_customize_cell_width">74dp</dimen>
<dimen name="apps_customize_cell_height">82dp</dimen>

View File

@@ -63,13 +63,13 @@
<item name="android:singleLine">true</item>
<item name="android:ellipsize">marquee</item>
<item name="android:textSize">12sp</item>
<item name="android:textColor">#FFF</item>
<item name="android:textColor">@color/workspace_icon_text_color</item>
<item name="android:shadowRadius">2.0</item>
<item name="android:shadowColor">#B0000000</item>
</style>
<style name="WorkspaceIcon.Portrait">
<item name="android:drawablePadding">8dp</item>
<item name="android:drawablePadding">@dimen/app_icon_drawable_padding</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:paddingRight">4dp</item>
<item name="android:paddingTop">@dimen/app_icon_padding_top</item>
@@ -86,7 +86,7 @@
<style name="WorkspaceIcon.Portrait.Folder">
<item name="android:drawablePadding">0dp</item>
<item name="android:paddingTop">2dp</item>
<item name="android:paddingTop">@dimen/folder_icon_padding_top</item>
</style>
<style name="WorkspaceIcon.Landscape.Folder">
<item name="android:drawablePadding">0dp</item>

View File

@@ -176,6 +176,7 @@ public class BubbleTextView extends TextView {
// The translate of scrollX and scrollY is necessary when drawing TextViews, because
// they set scrollX and scrollY to large values to achieve centered text
destCanvas.save();
destCanvas.scale(getScaleX(), getScaleY(), getWidth() / 2, getHeight() / 2);
destCanvas.translate(-getScrollX() + padding / 2, -getScrollY() + padding / 2);
destCanvas.clipRect(clipRect, Op.REPLACE);
draw(destCanvas);
@@ -286,6 +287,14 @@ public class BubbleTextView extends TextView {
canvas.translate(-scrollX, -scrollY);
}
}
// If text is transparent, don't draw any shadow
if (getCurrentTextColor() == android.R.color.transparent) {
getPaint().clearShadowLayer();
super.draw(canvas);
return;
}
// We enhance the shadow by drawing the shadow twice
getPaint().setShadowLayer(SHADOW_LARGE_RADIUS, 0.0f, SHADOW_Y_OFFSET, SHADOW_LARGE_COLOUR);
super.draw(canvas);

View File

@@ -28,6 +28,7 @@ import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.PointF;
@@ -135,6 +136,9 @@ public class CellLayout extends ViewGroup {
private TimeInterpolator mEaseOutInterpolator;
private CellLayoutChildren mChildren;
private boolean mIsHotseat = false;
private final int mBubbleScalePercent;
public CellLayout(Context context) {
this(context, null);
}
@@ -180,6 +184,8 @@ public class CellLayout extends ViewGroup {
mNormalBackground.setFilterBitmap(true);
mActiveGlowBackground.setFilterBitmap(true);
mBubbleScalePercent = res.getInteger(R.integer.app_icon_hotseat_scale_percent);
// Initialize the data structures used for the drag visualization.
mCrosshairsDrawable = res.getDrawable(R.drawable.gardening_crosshairs);
@@ -492,6 +498,25 @@ public class CellLayout extends ViewGroup {
@Override
protected void dispatchDraw(Canvas canvas) {
// Debug drawing for hit space
if (false) {
final Rect frame = mRect;
for (int i = mChildren.getChildCount() - 1; i >= 0; i--) {
final View child = mChildren.getChildAt(i);
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
if ((child.getVisibility() == VISIBLE || child.getAnimation() != null) &&
lp.isLockedToGrid) {
child.getHitRect(frame);
frame.offset(mPaddingLeft, mPaddingTop);
Paint p = new Paint();
p.setColor(Color.GREEN);
canvas.drawRect(frame, p);
}
}
}
super.dispatchDraw(canvas);
if (mForegroundAlpha > 0) {
mOverScrollForegroundDrawable.setBounds(mForegroundRect);
@@ -554,10 +579,55 @@ public class CellLayout extends ViewGroup {
return mCountY;
}
public void setIsHotseat(boolean isHotseat) {
mIsHotseat = isHotseat;
}
public boolean addViewToCellLayout(
View child, int index, int childId, LayoutParams params, boolean markCells) {
return addViewToCellLayout(child, index, childId, params, markCells, false);
}
public boolean addViewToCellLayout(View child, int index, int childId, LayoutParams params,
boolean markCells, boolean allApps) {
final LayoutParams lp = params;
// Hotseat icons - scale down and remove text
// Don't scale the all apps button
// scale percent set to -1 means do not scale
// Only scale BubbleTextViews
if (child instanceof BubbleTextView) {
BubbleTextView bubbleChild = (BubbleTextView) child;
if (mIsHotseat && !allApps && mBubbleScalePercent >= 0) {
// If we haven't measured the child yet, do it now
// (this happens if we're being dropped from all-apps
if ((bubbleChild.getMeasuredWidth() | bubbleChild.getMeasuredHeight()) == 0) {
getChildrenLayout().measureChild(bubbleChild);
}
int measuredWidth = bubbleChild.getMeasuredWidth();
int measuredHeight = bubbleChild.getMeasuredHeight();
float bubbleScale = mBubbleScalePercent / 100f;
bubbleChild.setPivotX(0);
bubbleChild.setPivotY(0);
bubbleChild.setScaleX(bubbleScale);
bubbleChild.setScaleY(bubbleScale);
bubbleChild.setTranslationX(measuredWidth * (1 - bubbleScale) / 2);
bubbleChild.setTranslationY(measuredHeight * (1 - bubbleScale) / 2);
bubbleChild.setTextColor(android.R.color.transparent);
} else {
bubbleChild.setScaleX(1f);
bubbleChild.setScaleY(1f);
bubbleChild.setTranslationX(0f);
bubbleChild.setTranslationY(0f);
bubbleChild.setTextColor(
getResources().getColor(R.color.workspace_icon_text_color));
}
}
// Generate an id for each view, this assumes we have at most 256x256 cells
// per workspace screen
if (lp.cellX >= 0 && lp.cellX <= mCountX - 1 && lp.cellY >= 0 && lp.cellY <= mCountY - 1) {

View File

@@ -29,13 +29,13 @@ import com.android.launcher.R;
public class Hotseat extends FrameLayout {
private static final String TAG = "Hotseat";
private static final int sAllAppsButtonRank = 2; // In the middle of the dock
private Launcher mLauncher;
private CellLayout mContent;
private int mCellCountX;
private int mCellCountY;
private int mAllAppsButtonRank;
private boolean mIsLandscape;
public Hotseat(Context context) {
@@ -53,6 +53,7 @@ public class Hotseat extends FrameLayout {
R.styleable.Hotseat, defStyle, 0);
mCellCountX = a.getInt(R.styleable.Hotseat_cellCountX, -1);
mCellCountY = a.getInt(R.styleable.Hotseat_cellCountY, -1);
mAllAppsButtonRank = context.getResources().getInteger(R.integer.hotseat_all_apps_index);
mIsLandscape = context.getResources().getConfiguration().orientation ==
Configuration.ORIENTATION_LANDSCAPE;
}
@@ -77,8 +78,8 @@ public class Hotseat extends FrameLayout {
int getCellYFromOrder(int rank) {
return mIsLandscape ? (mContent.getCountY() - (rank + 1)) : 0;
}
public static boolean isAllAppsButtonRank(int rank) {
return rank == sAllAppsButtonRank;
public boolean isAllAppsButtonRank(int rank) {
return rank == mAllAppsButtonRank;
}
@Override
@@ -88,6 +89,7 @@ public class Hotseat extends FrameLayout {
if (mCellCountY < 0) mCellCountY = LauncherModel.getCellCountY();
mContent = (CellLayout) findViewById(R.id.layout);
mContent.setGridSize(mCellCountX, mCellCountY);
mContent.setIsHotseat(true);
resetLayout();
}
@@ -126,9 +128,9 @@ public class Hotseat extends FrameLayout {
// Note: We do this to ensure that the hotseat is always laid out in the orientation of
// the hotseat in order regardless of which orientation they were added
int x = getCellXFromOrder(sAllAppsButtonRank);
int y = getCellYFromOrder(sAllAppsButtonRank);
int x = getCellXFromOrder(mAllAppsButtonRank);
int y = getCellYFromOrder(mAllAppsButtonRank);
mContent.addViewToCellLayout(allAppsButton, -1, 0, new CellLayout.LayoutParams(x,y,1,1),
true);
true, true);
}
}

View File

@@ -2129,6 +2129,10 @@ public final class Launcher extends Activity
return (mState == State.APPS_CUSTOMIZE);
}
public boolean isAllAppsButtonRank(int rank) {
return mHotseat.isAllAppsButtonRank(rank);
}
// AllAppsView.Watcher
public void zoomed(float zoom) {
if (zoom == 1.0f) {

View File

@@ -26,6 +26,8 @@ import android.content.res.Configuration;
import android.database.ContentObserver;
import android.os.Handler;
import com.android.launcher.R;
import java.lang.ref.WeakReference;
public class LauncherApplication extends Application {
@@ -40,10 +42,7 @@ public class LauncherApplication extends Application {
super.onCreate();
// set sIsScreenXLarge and sScreenDensity *before* creating icon cache
final int screenSize = getResources().getConfiguration().screenLayout &
Configuration.SCREENLAYOUT_SIZE_MASK;
sIsScreenLarge = screenSize == Configuration.SCREENLAYOUT_SIZE_LARGE ||
screenSize == Configuration.SCREENLAYOUT_SIZE_XLARGE;
sIsScreenLarge = getResources().getBoolean(R.bool.is_large_screen);
sScreenDensity = getResources().getDisplayMetrics().density;
mIconCache = new IconCache(this);

View File

@@ -138,6 +138,7 @@ public class LauncherModel extends BroadcastReceiver {
public void bindAppsRemoved(ArrayList<ApplicationInfo> apps, boolean permanent);
public void bindPackagesUpdated();
public boolean isAllAppsVisible();
public boolean isAllAppsButtonRank(int rank);
public void bindSearchablesChanged();
}
@@ -920,7 +921,7 @@ public class LauncherModel extends BroadcastReceiver {
int containerIndex = item.screen;
if (item.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
// Return early if we detect that an item is under the hotseat button
if (Hotseat.isAllAppsButtonRank(item.screen)) {
if (mCallbacks == null || mCallbacks.get().isAllAppsButtonRank(item.screen)) {
return false;
}

View File

@@ -706,6 +706,8 @@ public class LauncherProvider extends ContentProvider {
ContentValues values = new ContentValues();
PackageManager packageManager = mContext.getPackageManager();
int allAppsButtonRank =
mContext.getResources().getInteger(R.integer.hotseat_all_apps_index);
int i = 0;
try {
XmlResourceParser parser = mContext.getResources().getXml(workspaceResourceId);
@@ -739,8 +741,8 @@ public class LauncherProvider extends ContentProvider {
// If we are adding to the hotseat, the screen is used as the position in the
// hotseat. This screen can't be at position 0 because AllApps is in the
// zeroth position.
if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT &&
Hotseat.isAllAppsButtonRank(Integer.valueOf(screen))) {
if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT
&& Integer.valueOf(screen) == allAppsButtonRank) {
throw new RuntimeException("Invalid screen position for hotseat item");
}

View File

@@ -113,7 +113,6 @@ final class Utilities {
}
int sourceWidth = icon.getIntrinsicWidth();
int sourceHeight = icon.getIntrinsicHeight();
if (sourceWidth > 0 && sourceHeight > 0) {
// There are intrinsic sizes.
if (width < sourceWidth || height < sourceHeight) {

View File

@@ -658,7 +658,7 @@ public class Workspace extends SmoothPagedView
return;
} else if (theta > START_DAMPING_TOUCH_SLOP_ANGLE) {
// Above START_DAMPING_TOUCH_SLOP_ANGLE and below MAX_SWIPE_ANGLE, we want to
// increase the touch slop to make it harder to begin scrolling the workspace. This
// increase the touch slop to make it harder to begin scrolling the workspace. This
// results in vertically scrolling widgets to more easily. The higher the angle, the
// more we increase touch slop.
theta -= START_DAMPING_TOUCH_SLOP_ANGLE;
@@ -1444,7 +1444,7 @@ public class Workspace extends SmoothPagedView
* This interpolator emulates the rate at which the perceived scale of an object changes
* as its distance from a camera increases. When this interpolator is applied to a scale
* animation on a view, it evokes the sense that the object is shrinking due to moving away
* from the camera.
* from the camera.
*/
static class ZInterpolator implements TimeInterpolator {
private float focalLength;
@@ -1621,7 +1621,7 @@ public class Workspace extends SmoothPagedView
setLayoutScale(1.0f);
}
final int duration = zoomIn ?
final int duration = zoomIn ?
getResources().getInteger(R.integer.config_workspaceUnshrinkTime) :
getResources().getInteger(R.integer.config_appsCustomizeWorkspaceShrinkTime);
for (int i = 0; i < getChildCount(); i++) {
@@ -2056,7 +2056,7 @@ public class Workspace extends SmoothPagedView
// is full
if (mTargetCell != null && mLauncher.isHotseatLayout(mDragTargetLayout)) {
Hotseat hotseat = mLauncher.getHotseat();
if (Hotseat.isAllAppsButtonRank(
if (hotseat.isAllAppsButtonRank(
hotseat.getOrderInHotseat(mTargetCell[0], mTargetCell[1]))) {
return false;
}
@@ -3043,6 +3043,7 @@ public class Workspace extends SmoothPagedView
CellLayout.LayoutParams lp = (CellLayout.LayoutParams) view.getLayoutParams();
cellLayout.getChildrenLayout().measureChild(view);
LauncherModel.addOrMoveItemInDatabase(mLauncher, info, container, screen,
lp.cellX, lp.cellY);