summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2012-08-02 17:40:30 -0700
committerWinson Chung <winsonc@google.com>2012-08-08 14:02:22 -0700
commit0e721a4005b4d119cf641ca0dd0d8744672646f0 (patch)
tree78aca8d15bf6450d982cb3be1cfff471985938f5
parent1637d6d64ac85d75b69b90fd976ed449046ccdc6 (diff)
downloadpackages_apps_trebuchet-0e721a4005b4d119cf641ca0dd0d8744672646f0.zip
packages_apps_trebuchet-0e721a4005b4d119cf641ca0dd0d8744672646f0.tar.gz
packages_apps_trebuchet-0e721a4005b4d119cf641ca0dd0d8744672646f0.tar.bz2
Initial changes for new 10inch layout.
Change-Id: Ifaafca469df626a76ab5e16bd2f0d5afa1da172c
-rw-r--r--res/layout-port/search_bar.xml2
-rw-r--r--res/layout-sw720dp-land/application.xml20
-rw-r--r--res/layout-sw720dp-port/application.xml18
-rw-r--r--res/layout-sw720dp/hotseat.xml36
-rw-r--r--res/layout-sw720dp/launcher.xml67
-rw-r--r--res/layout-sw720dp/search_bar.xml79
-rw-r--r--res/values-land/styles.xml6
-rw-r--r--res/values-sw720dp-port/dimens.xml13
-rw-r--r--res/values-sw720dp/config.xml5
-rw-r--r--res/values-sw720dp/dimens.xml70
-rw-r--r--res/values-sw720dp/styles.xml15
-rw-r--r--res/values/config.xml3
-rw-r--r--res/values/styles.xml6
-rw-r--r--src/com/android/launcher2/Hotseat.java18
-rw-r--r--src/com/android/launcher2/Launcher.java21
15 files changed, 221 insertions, 158 deletions
diff --git a/res/layout-port/search_bar.xml b/res/layout-port/search_bar.xml
index 85da2f1..8f58fe6 100644
--- a/res/layout-port/search_bar.xml
+++ b/res/layout-port/search_bar.xml
@@ -47,7 +47,7 @@
<!-- Voice search icon -->
<com.android.launcher2.HolographicLinearLayout
- style="@style/SearchButton.Voice"
+ style="@style/SearchButton"
launcher:sourceImageViewId="@+id/voice_button"
android:id="@+id/voice_button_container"
android:layout_width="@dimen/search_bar_height"
diff --git a/res/layout-sw720dp-land/application.xml b/res/layout-sw720dp-land/application.xml
deleted file mode 100644
index 9393f7e..0000000
--- a/res/layout-sw720dp-land/application.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?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.android.launcher2.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-sw720dp-port/application.xml b/res/layout-sw720dp-port/application.xml
deleted file mode 100644
index af7a8a4..0000000
--- a/res/layout-sw720dp-port/application.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?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.android.launcher2.BubbleTextView xmlns:android="http://schemas.android.com/apk/res/android"
- style="@style/WorkspaceIcon.Portrait" />
diff --git a/res/layout-sw720dp/hotseat.xml b/res/layout-sw720dp/hotseat.xml
new file mode 100644
index 0000000..bcd5b9d
--- /dev/null
+++ b/res/layout-sw720dp/hotseat.xml
@@ -0,0 +1,36 @@
+<?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 65149f2..9ddb135 100644
--- a/res/layout-sw720dp/launcher.xml
+++ b/res/layout-sw720dp/launcher.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source Project
+<!-- Copyright (C) 2007 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.
@@ -16,22 +16,73 @@
<com.android.launcher2.DragLayer
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:id="@+id/drag_layer"
+ android:background="@drawable/workspace_bg"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:focusable="false">
+ android:layout_height="match_parent">
- <include layout="@layout/workspace"
+ <!-- Keep these behind the workspace so that they are not visible when
+ we go into AllApps -->
+ <include
+ android:id="@+id/dock_divider"
+ layout="@layout/workspace_divider"
+ android:layout_width="@dimen/workspace_divider_width"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/button_bar_height"
+ android:layout_gravity="bottom|center_horizontal" />
+ <include
+ android:id="@+id/paged_view_indicator"
+ 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: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 layout="@layout/qsb_bar"
- android:id="@+id/qsb_bar"
+ <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 layout="@layout/hotseat"
+ android:id="@+id/hotseat"
android:layout_width="match_parent"
+ android:layout_height="@dimen/button_bar_height_plus_padding"
+ android:layout_gravity="bottom" />
+
+ <include
+ android:id="@+id/qsb_bar"
+ layout="@layout/qsb_bar" />
+
+ <com.android.launcher2.DrawableStateProxyView
+ android:id="@+id/voice_button_proxy"
+ android:layout_width="80dp"
android:layout_height="@dimen/qsb_bar_height"
- android:layout_gravity="top" />
+ android:layout_marginRight="@dimen/qsb_voice_proxy_padding_right"
+ android:layout_gravity="top|right"
+ android:clickable="true"
+ android:onClick="onClickVoiceButton"
+ android:importantForAccessibility="no"
+ launcher:sourceViewId="@+id/voice_button" />
<include layout="@layout/apps_customize_pane"
android:id="@+id/apps_customize_pane"
diff --git a/res/layout-sw720dp/search_bar.xml b/res/layout-sw720dp/search_bar.xml
index 55ec959..8f58fe6 100644
--- a/res/layout-sw720dp/search_bar.xml
+++ b/res/layout-sw720dp/search_bar.xml
@@ -15,60 +15,57 @@
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
style="@style/SearchDropTargetBar"
android:layout_width="match_parent"
- android:layout_height="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.HolographicImageView
+ <com.android.launcher2.HolographicLinearLayout
style="@style/SearchButton"
- android:id="@+id/search_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ launcher:sourceImageViewId="@+id/search_button"
+ android:id="@+id/search_button_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_gravity="center_vertical"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
- android:src="@drawable/ic_home_search_normal_holo"
+ android:layout_toLeftOf="@+id/voice_button_container"
+ android:paddingLeft="8dp"
android:onClick="onClickSearchButton"
android:focusable="true"
android:clickable="true"
- android:contentDescription="@string/accessibility_search_button" />
-
- <ImageView
- style="@style/SearchButtonDivider"
- android:id="@+id/search_divider"
- android:layout_toRightOf="@+id/search_button"
- android:src="@drawable/divider_launcher_holo"
- android:onClick="onClickSearchButton"
- android:focusable="false"
- android:clickable="true" />
+ android:contentDescription="@string/accessibility_search_button">
+ <ImageView
+ android:id="@+id/search_button"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:src="@drawable/ic_home_search_normal_holo"
+ android:adjustViewBounds="true" />
+ </com.android.launcher2.HolographicLinearLayout>
<!-- Voice search icon -->
- <com.android.launcher2.HolographicImageView
- style="@style/SearchButton.Voice"
- android:id="@+id/voice_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toRightOf="@+id/search_divider"
- android:src="@drawable/ic_home_voice_search_holo"
- android:onClick="onClickVoiceButton"
- android:focusable="true"
- android:clickable="true"
- android:contentDescription="@string/accessibility_voice_search_button" />
-
- <!-- AppsCustomize icon -->
- <com.android.launcher2.HolographicImageView
- android:id="@+id/all_apps_button"
- android:onClick="onClickAllAppsButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ <com.android.launcher2.HolographicLinearLayout
+ style="@style/SearchButton"
+ launcher:sourceImageViewId="@+id/voice_button"
+ android:id="@+id/voice_button_container"
+ android:layout_width="@dimen/search_bar_height"
+ android:layout_height="match_parent"
+ android:layout_gravity="center_vertical"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
- android:paddingLeft="@dimen/toolbar_button_horizontal_padding"
- android:paddingRight="@dimen/toolbar_button_horizontal_padding"
- android:paddingTop="@dimen/all_apps_button_vertical_padding"
- android:paddingBottom="@dimen/all_apps_button_vertical_padding"
- android:src="@drawable/ic_home_all_apps_holo_dark"
-
+ android:paddingRight="8dp"
+ android:gravity="right"
+ android:onClick="onClickVoiceButton"
android:focusable="true"
android:clickable="true"
- android:contentDescription="@string/accessibility_all_apps_button" />
+ android:contentDescription="@string/accessibility_voice_search_button">
+ <ImageView
+ android:id="@+id/voice_button"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:src="@drawable/ic_home_voice_search_holo"
+ android:adjustViewBounds="true" />
+ </com.android.launcher2.HolographicLinearLayout>
</RelativeLayout>
diff --git a/res/values-land/styles.xml b/res/values-land/styles.xml
index df3356e..5b9de3e 100644
--- a/res/values-land/styles.xml
+++ b/res/values-land/styles.xml
@@ -29,6 +29,7 @@
<item name="android:orientation">vertical</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
+ <item name="android:layout_gravity">center_horizontal</item>
</style>
<style name="SearchButton">
<item name="android:layout_gravity">center_horizontal</item>
@@ -37,11 +38,6 @@
<item name="android:paddingLeft">@dimen/toolbar_button_horizontal_padding</item>
<item name="android:paddingRight">@dimen/toolbar_button_horizontal_padding</item>
</style>
- <style name="SearchButtonDivider">
- <item name="android:layout_width">match_parent</item>
- <item name="android:layout_height">wrap_content</item>
- <item name="android:layout_gravity">center_horizontal</item>
- </style>
<style name="DropTargetButtonContainer">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">0dp</item>
diff --git a/res/values-sw720dp-port/dimens.xml b/res/values-sw720dp-port/dimens.xml
index 9cf37ff..5528ae6 100644
--- a/res/values-sw720dp-port/dimens.xml
+++ b/res/values-sw720dp-port/dimens.xml
@@ -33,9 +33,22 @@
<dimen name="scroll_zone">40dp</dimen>
<dimen name="workspace_page_spacing">24dp</dimen>
+ <dimen name="qsb_bar_height">72dp</dimen>
+ <dimen name="qsb_bar_height_inset">72dp</dimen>
+ <dimen name="qsb_padding_left">112dp</dimen>
+ <dimen name="qsb_padding_right">112dp</dimen>
+ <!-- We offset the proxy to overlap with the voice icon -->
+ <dimen name="qsb_voice_proxy_padding_right">100dp</dimen>
+
<integer name="apps_customize_cling_focused_x">2</integer>
<integer name="apps_customize_cling_focused_y">2</integer>
+ <!-- Page width set to match a page of icons (96*k) -->
+ <dimen name="workspace_divider_width">768dp</dimen>
+
+<!-- Hotseat -->
+ <dimen name="hotseat_width_gap">16dp</dimen>
+
<!-- Cling -->
<!-- The offset for the text in the cling -->
<dimen name="cling_text_block_offset_x">80dp</dimen>
diff --git a/res/values-sw720dp/config.xml b/res/values-sw720dp/config.xml
index cdca805..1913d74 100644
--- a/res/values-sw720dp/config.xml
+++ b/res/values-sw720dp/config.xml
@@ -1,4 +1,6 @@
<resources>
+ <integer name="cell_count_x">8</integer>
+ <integer name="cell_count_y">5</integer>
<bool name="config_largeHeap">true</bool>
<bool name="is_large_screen">true</bool>
@@ -14,4 +16,7 @@
<!-- Camera distance for the overscroll effect -->
<integer name="config_cameraDistance">6500</integer>
+
+<!-- Hotseat -->
+ <bool name="hotseat_transpose_layout_with_orientation">false</bool>
</resources>
diff --git a/res/values-sw720dp/dimens.xml b/res/values-sw720dp/dimens.xml
index 4750ae2..9d73eca 100644
--- a/res/values-sw720dp/dimens.xml
+++ b/res/values-sw720dp/dimens.xml
@@ -17,19 +17,29 @@
<resources>
<dimen name="app_icon_size">72dp</dimen>
<dimen name="reveal_radius">72dp</dimen>
+
+<!-- Hotseat -->
+ <dimen name="button_bar_height">96dp</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">96dp</dimen>
+ <dimen name="hotseat_width_gap">48dp</dimen>
+
<!-- QSB -->
- <dimen name="toolbar_button_vertical_padding">12dip</dimen>
- <dimen name="toolbar_button_horizontal_padding">12dip</dimen>
+ <dimen name="toolbar_button_vertical_padding">8dip</dimen>
+ <dimen name="toolbar_button_horizontal_padding">8dip</dimen>
<!-- Workspace -->
- <dimen name="qsb_bar_height">56dp</dimen>
- <dimen name="qsb_bar_height_inset">37dp</dimen>
- <dimen name="qsb_padding_left">0dp</dimen>
- <dimen name="qsb_padding_right">0dp</dimen>
- <dimen name="search_bar_height">40dp</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="qsb_bar_height">60dp</dimen>
+ <dimen name="qsb_bar_height_inset">60dp</dimen>
+ <dimen name="qsb_padding_left">249dp</dimen>
+ <dimen name="qsb_padding_right">249dp</dimen>
+ <!-- We offset the proxy to overlap with the voice icon -->
+ <dimen name="qsb_voice_proxy_padding_right">230dp</dimen>
+ <!-- 44dp high for the optical bounds -->
+ <dimen name="search_bar_height">52dp</dimen>
<dimen name="folder_cell_width">96dp</dimen>
<dimen name="folder_cell_height">96dp</dimen>
@@ -52,32 +62,42 @@
<dimen name="dragViewOffsetY">0dp</dimen>
<!-- CellLayout padding land / port-->
- <dimen name="cell_layout_left_padding_port">15dp</dimen>
- <dimen name="cell_layout_left_padding_land">24dp</dimen>
- <dimen name="cell_layout_right_padding_port">15dp</dimen>
- <dimen name="cell_layout_right_padding_land">24dp</dimen>
- <dimen name="cell_layout_top_padding_port">25dp</dimen>
- <dimen name="cell_layout_top_padding_land">12dp</dimen>
- <dimen name="cell_layout_bottom_padding_port">25dp</dimen>
- <dimen name="cell_layout_bottom_padding_land">12dp</dimen>
+ <dimen name="cell_layout_left_padding_port">0dp</dimen>
+ <dimen name="cell_layout_left_padding_land">0dp</dimen>
+ <dimen name="cell_layout_right_padding_port">0dp</dimen>
+ <dimen name="cell_layout_right_padding_land">0dp</dimen>
+ <dimen name="cell_layout_top_padding_port">0dp</dimen>
+ <dimen name="cell_layout_top_padding_land">0dp</dimen>
+ <dimen name="cell_layout_bottom_padding_port">0dp</dimen>
+ <dimen name="cell_layout_bottom_padding_land">0dp</dimen>
<!-- Workspace padding -->
<dimen name="workspace_left_padding_port">0dp</dimen>
<dimen name="workspace_left_padding_land">0dp</dimen>
<dimen name="workspace_right_padding_port">0dp</dimen>
<dimen name="workspace_right_padding_land">0dp</dimen>
- <dimen name="workspace_top_padding_port">@dimen/workspace_content_large_only_top_margin</dimen>
- <dimen name="workspace_top_padding_land">@dimen/workspace_content_large_only_top_margin</dimen>
- <dimen name="workspace_bottom_padding_port">0dp</dimen>
- <dimen name="workspace_bottom_padding_land">0dp</dimen>
+
+ <dimen name="workspace_top_padding_port">@dimen/qsb_bar_height_inset</dimen>
+ <dimen name="workspace_top_padding_land">@dimen/qsb_bar_height_inset</dimen>
+ <!-- XXX: This should be @dimen/button_bar_height + bottom padding, but because we are not using
+ the hotseat with the smaller icons, this is slightly larger than final dimensions. -->
+ <dimen name="workspace_bottom_padding_port">110dp</dimen>
+ <dimen name="workspace_bottom_padding_land">100dp</dimen>
+
+ <!-- Page width set to match a page of icons (96*k + 46*(k-1) - 2*12[icon padding]) -->
+ <dimen name="workspace_divider_width">1066dp</dimen>
+ <dimen name="workspace_divider_padding_left">0dp</dimen>
+ <dimen name="workspace_divider_padding_right">0dp</dimen>
+ <dimen name="workspace_divider_padding_top">0dp</dimen>
+ <dimen name="workspace_divider_padding_bottom">0dp</dimen>
<!-- Workspace cell size -->
<dimen name="workspace_cell_width_land">96dp</dimen>
<dimen name="workspace_cell_width_port">96dp</dimen>
<dimen name="workspace_cell_height_land">96dp</dimen>
<dimen name="workspace_cell_height_port">96dp</dimen>
- <dimen name="workspace_width_gap_land">32dp</dimen>
+ <dimen name="workspace_width_gap_land">46dp</dimen>
<dimen name="workspace_width_gap_port">0dp</dimen>
- <dimen name="workspace_height_gap_land">2dp</dimen>
- <dimen name="workspace_height_gap_port">32dp</dimen>
+ <dimen name="workspace_height_gap_land">16dp</dimen>
+ <dimen name="workspace_height_gap_port">48dp</dimen>
</resources>
diff --git a/res/values-sw720dp/styles.xml b/res/values-sw720dp/styles.xml
index 87110da..d4b4344 100644
--- a/res/values-sw720dp/styles.xml
+++ b/res/values-sw720dp/styles.xml
@@ -75,6 +75,7 @@
<item name="android:paddingTop">@dimen/app_icon_padding_top</item>
<item name="android:paddingBottom">4dp</item>
<item name="android:textSize">13sp</item>
+ <item name="android:background">#FFFF0000</item>
</style>
<style name="WorkspaceIcon.Landscape.Folder">
<item name="android:drawablePadding">0dp</item>
@@ -123,27 +124,19 @@
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">@dimen/qsb_bar_height</item>
<item name="android:layout_gravity">top|center_horizontal</item>
+ <item name="android:paddingLeft">@dimen/qsb_padding_left</item>
+ <item name="android:paddingRight">@dimen/qsb_padding_right</item>
</style>
<style name="SearchDropTargetBar">
<item name="android:orientation">horizontal</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
+ <item name="android:layout_gravity">bottom|center_horizontal</item>
</style>
<style name="SearchButton">
<item name="android:layout_gravity">center_vertical</item>
<item name="android:paddingTop">@dimen/toolbar_button_vertical_padding</item>
<item name="android:paddingBottom">@dimen/toolbar_button_vertical_padding</item>
- <item name="android:paddingLeft">@dimen/toolbar_button_horizontal_padding</item>
- <item name="android:paddingRight">@dimen/toolbar_button_horizontal_padding</item>
- </style>
- <style name="SearchButton.Voice">
- <item name="android:paddingLeft">18dp</item>
- <item name="android:paddingRight">18dp</item>
- </style>
- <style name="SearchButtonDivider">
- <item name="android:layout_width">wrap_content</item>
- <item name="android:layout_height">match_parent</item>
- <item name="android:layout_gravity">center_vertical</item>
</style>
<style name="DropTargetButtonContainer">
<item name="android:layout_width">0dp</item>
diff --git a/res/values/config.xml b/res/values/config.xml
index 7f95931..381ef1b 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -77,6 +77,9 @@
<integer name="cell_count_x">4</integer>
<integer name="cell_count_y">4</integer>
+
+<!-- Hotseat -->
+ <bool name="hotseat_transpose_layout_with_orientation">true</bool>
<integer name="hotseat_cell_count">5</integer>
<integer name="hotseat_all_apps_index">2</integer>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index ee91d73..fed4194 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -123,17 +123,13 @@
<item name="android:orientation">horizontal</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
+ <item name="android:layout_gravity">bottom|center_horizontal</item>
</style>
<style name="SearchButton">
<item name="android:layout_gravity">center_vertical</item>
<item name="android:paddingTop">@dimen/toolbar_button_vertical_padding</item>
<item name="android:paddingBottom">@dimen/toolbar_button_vertical_padding</item>
</style>
- <style name="SearchButtonDivider">
- <item name="android:layout_width">wrap_content</item>
- <item name="android:layout_height">match_parent</item>
- <item name="android:layout_gravity">center_vertical</item>
- </style>
<style name="DropTargetButtonContainer">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">match_parent</item>
diff --git a/src/com/android/launcher2/Hotseat.java b/src/com/android/launcher2/Hotseat.java
index 15d606d..38feaa4 100644
--- a/src/com/android/launcher2/Hotseat.java
+++ b/src/com/android/launcher2/Hotseat.java
@@ -18,6 +18,7 @@ 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;
@@ -37,6 +38,8 @@ public class Hotseat extends FrameLayout {
private int mCellCountX;
private int mCellCountY;
private int mAllAppsButtonRank;
+
+ private boolean mTransposeLayoutWithOrientation;
private boolean mIsLandscape;
public Hotseat(Context context) {
@@ -52,9 +55,12 @@ public class Hotseat extends FrameLayout {
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 = context.getResources().getInteger(R.integer.hotseat_all_apps_index);
+ 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;
}
@@ -67,17 +73,21 @@ public class Hotseat extends FrameLayout {
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 mIsLandscape ? (mContent.getCountY() - y - 1) : x;
+ return hasVerticalHotseat() ? (mContent.getCountY() - y - 1) : x;
}
/* Get the orientation specific coordinates given an invariant order in the hotseat. */
int getCellXFromOrder(int rank) {
- return mIsLandscape ? 0 : rank;
+ return hasVerticalHotseat() ? 0 : rank;
}
int getCellYFromOrder(int rank) {
- return mIsLandscape ? (mContent.getCountY() - (rank + 1)) : 0;
+ return hasVerticalHotseat() ? (mContent.getCountY() - (rank + 1)) : 0;
}
public boolean isAllAppsButtonRank(int rank) {
return rank == mAllAppsButtonRank;
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 9999e0f..ad50bbf 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -952,20 +952,7 @@ public final class Launcher extends Activity
mAppsCustomizeContent = (AppsCustomizePagedView)
mAppsCustomizeTabHost.findViewById(R.id.apps_customize_pane_content);
mAppsCustomizeContent.setup(this, dragController);
-
- // Get the all apps button
- mAllAppsButton = findViewById(R.id.all_apps_button);
- if (mAllAppsButton != null) {
- mAllAppsButton.setOnTouchListener(new View.OnTouchListener() {
- @Override
- public boolean onTouch(View v, MotionEvent event) {
- if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) {
- onTouchDownAllAppsButton(v);
- }
- return false;
- }
- });
- }
+
// Setup the drag controller (drop targets have to be added in reverse order in priority)
dragController.setDragScoller(mWorkspace);
dragController.setScrollView(mDragLayer);
@@ -3020,7 +3007,6 @@ public final class Launcher extends Activity
private boolean updateGlobalSearchIcon() {
final View searchButtonContainer = findViewById(R.id.search_button_container);
final ImageView searchButton = (ImageView) findViewById(R.id.search_button);
- final View searchDivider = findViewById(R.id.search_divider);
final View voiceButtonContainer = findViewById(R.id.voice_button_container);
final View voiceButton = findViewById(R.id.voice_button);
final View voiceButtonProxy = findViewById(R.id.voice_button_proxy);
@@ -3039,14 +3025,12 @@ public final class Launcher extends Activity
TOOLBAR_ICON_METADATA_NAME);
}
- if (searchDivider != null) searchDivider.setVisibility(View.VISIBLE);
if (searchButtonContainer != null) searchButtonContainer.setVisibility(View.VISIBLE);
searchButton.setVisibility(View.VISIBLE);
invalidatePressedFocusedStates(searchButtonContainer, searchButton);
return true;
} else {
// We disable both search and voice search when there is no global search provider
- if (searchDivider != null) searchDivider.setVisibility(View.GONE);
if (searchButtonContainer != null) searchButtonContainer.setVisibility(View.GONE);
if (voiceButtonContainer != null) voiceButtonContainer.setVisibility(View.GONE);
searchButton.setVisibility(View.GONE);
@@ -3066,7 +3050,6 @@ public final class Launcher extends Activity
}
private boolean updateVoiceSearchIcon(boolean searchVisible) {
- final View searchDivider = findViewById(R.id.search_divider);
final View voiceButtonContainer = findViewById(R.id.voice_button_container);
final View voiceButton = findViewById(R.id.voice_button);
final View voiceButtonProxy = findViewById(R.id.voice_button_proxy);
@@ -3100,7 +3083,6 @@ public final class Launcher extends Activity
R.id.voice_button, activityName, R.drawable.ic_home_voice_search_holo,
TOOLBAR_ICON_METADATA_NAME);
}
- if (searchDivider != null) searchDivider.setVisibility(View.VISIBLE);
if (voiceButtonContainer != null) voiceButtonContainer.setVisibility(View.VISIBLE);
voiceButton.setVisibility(View.VISIBLE);
if (voiceButtonProxy != null) {
@@ -3109,7 +3091,6 @@ public final class Launcher extends Activity
invalidatePressedFocusedStates(voiceButtonContainer, voiceButton);
return true;
} else {
- if (searchDivider != null) searchDivider.setVisibility(View.GONE);
if (voiceButtonContainer != null) voiceButtonContainer.setVisibility(View.GONE);
voiceButton.setVisibility(View.GONE);
if (voiceButtonProxy != null) {