diff options
author | Winson Chung <winsonc@google.com> | 2011-07-13 17:25:49 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-07-20 14:12:20 -0700 |
commit | 3d503fbd9468fb2b9fa645f4f7b91e11229edbfa (patch) | |
tree | 38d8bb61f62a47a731b97520a274e07cefbec20c /res | |
parent | ec8a2eee50290e7d9c95936041b937b6e94bb152 (diff) | |
download | android_packages_apps_Trebuchet-3d503fbd9468fb2b9fa645f4f7b91e11229edbfa.tar.gz android_packages_apps_Trebuchet-3d503fbd9468fb2b9fa645f4f7b91e11229edbfa.tar.bz2 android_packages_apps_Trebuchet-3d503fbd9468fb2b9fa645f4f7b91e11229edbfa.zip |
Initial changes to add configurable hotseat.
Change-Id: I4c2ed4a1c122c057662fabc70bfef7c5c088460b
Diffstat (limited to 'res')
22 files changed, 139 insertions, 77 deletions
diff --git a/res/drawable-hdpi/apps_hotseat_button.png b/res/drawable-hdpi/apps_hotseat_button.png Binary files differnew file mode 100644 index 000000000..c459ba823 --- /dev/null +++ b/res/drawable-hdpi/apps_hotseat_button.png diff --git a/res/drawable-hdpi/hotseat_bg_panel.9.png b/res/drawable-hdpi/hotseat_bg_panel.9.png Binary files differnew file mode 100644 index 000000000..ae718d471 --- /dev/null +++ b/res/drawable-hdpi/hotseat_bg_panel.9.png diff --git a/res/drawable-hdpi/hotseat_scrubber_holo.9.png b/res/drawable-hdpi/hotseat_scrubber_holo.9.png Binary files differindex 3400050ca..3a026f8be 100644 --- a/res/drawable-hdpi/hotseat_scrubber_holo.9.png +++ b/res/drawable-hdpi/hotseat_scrubber_holo.9.png diff --git a/res/drawable-hdpi/hotseat_track_holo.9.png b/res/drawable-hdpi/hotseat_track_holo.9.png Binary files differindex a058a3a37..f49344fe8 100644 --- a/res/drawable-hdpi/hotseat_track_holo.9.png +++ b/res/drawable-hdpi/hotseat_track_holo.9.png diff --git a/res/drawable-land-hdpi/hotseat_bg_panel.9.png b/res/drawable-land-hdpi/hotseat_bg_panel.9.png Binary files differnew file mode 100644 index 000000000..6a25f46e8 --- /dev/null +++ b/res/drawable-land-hdpi/hotseat_bg_panel.9.png diff --git a/res/drawable-land-mdpi/hotseat_bg_panel.9.png b/res/drawable-land-mdpi/hotseat_bg_panel.9.png Binary files differnew file mode 100644 index 000000000..dbe73d4b1 --- /dev/null +++ b/res/drawable-land-mdpi/hotseat_bg_panel.9.png diff --git a/res/drawable-mdpi/apps_hotseat_button.png b/res/drawable-mdpi/apps_hotseat_button.png Binary files differnew file mode 100644 index 000000000..f9006a477 --- /dev/null +++ b/res/drawable-mdpi/apps_hotseat_button.png diff --git a/res/drawable-mdpi/hotseat_bg_panel.9.png b/res/drawable-mdpi/hotseat_bg_panel.9.png Binary files differnew file mode 100644 index 000000000..1074d614b --- /dev/null +++ b/res/drawable-mdpi/hotseat_bg_panel.9.png diff --git a/res/drawable-mdpi/hotseat_scrubber_holo.9.png b/res/drawable-mdpi/hotseat_scrubber_holo.9.png Binary files differindex 69f74f731..de66649e7 100644 --- a/res/drawable-mdpi/hotseat_scrubber_holo.9.png +++ b/res/drawable-mdpi/hotseat_scrubber_holo.9.png diff --git a/res/drawable-mdpi/hotseat_track_holo.9.png b/res/drawable-mdpi/hotseat_track_holo.9.png Binary files differindex a058a3a37..3dcab6716 100644 --- a/res/drawable-mdpi/hotseat_track_holo.9.png +++ b/res/drawable-mdpi/hotseat_track_holo.9.png diff --git a/res/layout-land/hotseat.xml b/res/layout-land/hotseat.xml new file mode 100644 index 000000000..79661a728 --- /dev/null +++ b/res/layout-land/hotseat.xml @@ -0,0 +1,33 @@ +<?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" + android:background="@drawable/hotseat_bg_panel" + launcher:cellCountX="1" + launcher:cellCountY="-1"> + <com.android.launcher2.CellLayout + android:id="@+id/layout" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingTop="@dimen/workspace_top_padding" + android:paddingBottom="@dimen/workspace_bottom_padding" + launcher:cellWidth="@dimen/workspace_cell_width" + launcher:cellHeight="@dimen/workspace_cell_height" + launcher:widthGap="-1dp" + launcher:heightGap="-1dp" + launcher:maxGap="@dimen/workspace_max_gap" /> +</com.android.launcher2.Hotseat>
\ No newline at end of file diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml index 428a0a73a..4d40adadc 100644 --- a/res/layout-land/launcher.xml +++ b/res/layout-land/launcher.xml @@ -40,8 +40,8 @@ android:id="@+id/workspace" android:layout_width="match_parent" android:layout_height="match_parent" - android:scrollbars="horizontal" - android:fadeScrollbars="true" + android:paddingLeft="@dimen/qsb_bar_height" + android:paddingRight="@dimen/button_bar_height" launcher:defaultScreen="2" launcher:cellCountX="4" launcher:cellCountY="4" @@ -66,31 +66,11 @@ android:layout_height="match_parent" android:visibility="invisible" /> - <RelativeLayout - android:id="@+id/all_apps_button_cluster" - android:layout_height="fill_parent" - android:layout_width="@dimen/button_bar_height_portrait" - android:layout_gravity="right|center_vertical" - android:layout_marginBottom="@dimen/half_status_bar_height"> - <ImageView - android:id="@+id/hotseat_left" - style="@style/HotseatButton.Left" - android:layout_below="@id/all_apps_button" - android:src="@drawable/hotseat_phone" - android:onClick="launchHotSeat" /> - <com.android.launcher2.HandleView - style="@style/HotseatButton" - android:id="@+id/all_apps_button" - android:layout_centerVertical="true" - android:layout_alignParentRight="true" - android:src="@drawable/all_apps_button" - launcher:direction="vertical" /> - <ImageView - android:id="@+id/hotseat_right" - style="@style/HotseatButton.Right" - android:layout_above="@id/all_apps_button" - android:src="@drawable/hotseat_browser" - android:onClick="launchHotSeat" /> + <include layout="@layout/hotseat" + android:id="@+id/hotseat" + android:layout_width="@dimen/button_bar_height" + android:layout_height="match_parent" + android:layout_gravity="right" /> + - </RelativeLayout> </com.android.launcher2.DragLayer> diff --git a/res/layout-land/search_bar.xml b/res/layout-land/search_bar.xml index e3f67a1f2..0dbfd7b35 100644 --- a/res/layout-land/search_bar.xml +++ b/res/layout-land/search_bar.xml @@ -26,6 +26,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:src="@drawable/ic_search_normal_holo" + android:adjustViewBounds="true" android:background="@drawable/button_bg" android:onClick="onClickSearchButton" android:focusable="true" @@ -47,9 +48,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:src="@drawable/ic_voice_search_holo" + android:adjustViewBounds="true" android:background="@drawable/button_bg" android:onClick="onClickVoiceButton" android:focusable="true" android:clickable="true" android:contentDescription="@string/accessibility_voice_search_button" /> -</LinearLayout>
\ No newline at end of file +</LinearLayout> diff --git a/res/layout-port/hotseat.xml b/res/layout-port/hotseat.xml new file mode 100644 index 000000000..88dd73867 --- /dev/null +++ b/res/layout-port/hotseat.xml @@ -0,0 +1,33 @@ +<?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" + android:background="@drawable/hotseat_bg_panel" + launcher:cellCountX="-1" + launcher:cellCountY="1"> + <com.android.launcher2.CellLayout + android:id="@+id/layout" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingLeft="@dimen/workspace_left_padding" + android:paddingRight="@dimen/workspace_right_padding" + launcher:cellWidth="@dimen/workspace_cell_width" + launcher:cellHeight="@dimen/workspace_cell_height" + launcher:widthGap="-1dp" + launcher:heightGap="-1dp" + launcher:maxGap="@dimen/workspace_max_gap" /> +</com.android.launcher2.Hotseat>
\ No newline at end of file diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml index d9750dbd2..fc39034f5 100644 --- a/res/layout-port/launcher.xml +++ b/res/layout-port/launcher.xml @@ -68,31 +68,12 @@ android:layout_height="match_parent" android:visibility="invisible" /> - <RelativeLayout - android:id="@+id/all_apps_button_cluster" - android:layout_width="fill_parent" + <include layout="@layout/hotseat" + android:id="@+id/hotseat" + android:layout_width="match_parent" android:layout_height="@dimen/button_bar_height" - android:layout_gravity="bottom|center_horizontal" - android:paddingTop="2dip"> - <ImageView - android:id="@+id/hotseat_left" - style="@style/HotseatButton.Left" - android:layout_toLeftOf="@id/all_apps_button" - android:src="@drawable/hotseat_phone" - android:onClick="launchHotSeat" /> - <com.android.launcher2.HandleView - style="@style/HotseatButton" - android:id="@+id/all_apps_button" - android:layout_centerHorizontal="true" - android:layout_alignParentBottom="true" - android:src="@drawable/all_apps_button" - launcher:direction="horizontal" /> - <ImageView - android:id="@+id/hotseat_right" - style="@style/HotseatButton.Right" - android:layout_toRightOf="@id/all_apps_button" - android:src="@drawable/hotseat_browser" - android:onClick="launchHotSeat" /> - </RelativeLayout> + android:layout_gravity="bottom" /> + + </com.android.launcher2.DragLayer> diff --git a/res/layout-port/search_bar.xml b/res/layout-port/search_bar.xml index f9a202ae0..0de290a04 100644 --- a/res/layout-port/search_bar.xml +++ b/res/layout-port/search_bar.xml @@ -36,7 +36,8 @@ android:id="@+id/search_button" android:layout_width="wrap_content" android:layout_height="match_parent" - android:src="@drawable/ic_search_normal_holo" /> + android:src="@drawable/ic_search_normal_holo" + android:adjustViewBounds="true" /> </LinearLayout> <!-- Voice search icon --> @@ -48,6 +49,7 @@ android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:src="@drawable/ic_voice_search_holo" + android:adjustViewBounds="true" android:background="@drawable/button_bg" android:onClick="onClickVoiceButton" android:focusable="true" diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml index 305e730a1..d4843933f 100644 --- a/res/values-land/dimens.xml +++ b/res/values-land/dimens.xml @@ -17,7 +17,7 @@ <resources> <!-- QSB --> <dimen name="toolbar_button_vertical_padding">12dip</dimen> - <dimen name="toolbar_button_horizontal_padding">12dip</dimen> + <dimen name="toolbar_button_horizontal_padding">10dip</dimen> <!-- Workspace --> <dimen name="workspace_left_padding">@dimen/qsb_bar_height</dimen> @@ -28,10 +28,6 @@ <dimen name="scroll_track_padding_left">@dimen/qsb_bar_height</dimen> <dimen name="scroll_track_padding_right">@dimen/button_bar_height</dimen> - <dimen name="folder_cell_width">100dip</dimen> - <dimen name="folder_cell_height">74dip</dimen> - <dimen name="button_bar_height">62dip</dimen> - <!-- AppsCustomize --> <dimen name="apps_customize_cell_width">80dp</dimen> <!-- The width can be 76dp because we don't have B padding --> diff --git a/res/values-port/dimens.xml b/res/values-port/dimens.xml index c5fdd68e0..998bdc2c2 100644 --- a/res/values-port/dimens.xml +++ b/res/values-port/dimens.xml @@ -18,16 +18,10 @@ <!-- Workspace --> <dimen name="workspace_left_padding">0dp</dimen> <dimen name="workspace_right_padding">0dp</dimen> - <!-- NOTE: This padding is the @dimen/qsb_bar_height + some padding --> - <dimen name="workspace_top_padding">60dp</dimen> - <!-- NOTE: This padding is the @dimen/button_bar_height + some padding - for signposting --> - <dimen name="workspace_bottom_padding">64dp</dimen> + <dimen name="workspace_top_padding">@dimen/qsb_bar_height</dimen> + <dimen name="workspace_bottom_padding">@dimen/button_bar_height</dimen> <dimen name="workspace_page_spacing">8dp</dimen> - <dimen name="folder_cell_width">74dip</dimen> - <dimen name="folder_cell_height">86dip</dimen> - <integer name="apps_customize_cellCountX">4</integer> <integer name="apps_customize_cellCountY">5</integer> <dimen name="apps_customize_pageLayoutWidthGap">-1dp</dimen> diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 55518dfae..e093e36f8 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -38,6 +38,15 @@ <attr name="cellCountY" format="integer" /> </declare-styleable> + <!-- 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" /> + </declare-styleable> + <!-- CellLayout specific attributes. These attributes are used to customize a CellLayout view in XML files. --> <declare-styleable name="CellLayout"> @@ -125,6 +134,7 @@ <declare-styleable name="Favorite"> <attr name="className" format="string" /> <attr name="packageName" format="string" /> + <attr name="container" format="string" /> <attr name="screen" format="string" /> <attr name="x" format="string" /> <attr name="y" format="string" /> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 083a88741..bcef13daa 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -16,7 +16,7 @@ <resources> <!-- Workspace --> - <dimen name="qsb_bar_height">56dp</dimen> + <dimen name="qsb_bar_height">48dp</dimen> <dimen name="workspace_cell_width">80dp</dimen> <dimen name="workspace_cell_height">80dp</dimen> <dimen name="workspace_width_gap">-1dp</dimen> @@ -42,14 +42,14 @@ <dimen name="title_texture_width">120px</dimen> <!-- height of the bottom row of controls --> - <dimen name="button_bar_height">56dip</dimen> + <dimen name="button_bar_height">80dip</dimen> <!-- Drag padding to add to the drop targets --> <dimen name="drop_target_drag_padding">20dp</dimen> <!-- so we have access to this dimension in landscape mode even though button_bar_height changes --> - <dimen name="button_bar_height_portrait">56dip</dimen> + <dimen name="button_bar_height_portrait">80dip</dimen> <!-- extra horizontal spacing between mini screen thumbnails ie. in all apps and in customization mode --> diff --git a/res/values/strings.xml b/res/values/strings.xml index dcbc6d926..cae613ca0 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -120,6 +120,8 @@ <string name="add_photo_frame">Picture frame</string> <!-- Error message when user has filled a home screen, possibly not used --> <string name="out_of_space">No more room on this Home screen.</string> + <!-- Error message when user tries to drop an invalid item on the hotseat --> + <string name="invalid_hotseat_item">This widget is too large for the hotseat.</string> <!-- Message displayed when a shortcut is created by an external application --> <string name="shortcut_installed">Shortcut \"<xliff:g id="name" example="Browser">%s</xliff:g>\" created.</string> <!-- Message displayed when a shortcut is uninstalled by an external application --> diff --git a/res/xml/default_workspace.xml b/res/xml/default_workspace.xml index 722731cc2..9189c76e4 100644 --- a/res/xml/default_workspace.xml +++ b/res/xml/default_workspace.xml @@ -15,13 +15,19 @@ --> <favorites xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"> - <!-- Far-left screen [0] --> + <!-- Far-left screen [0] --> - <!-- Left screen [1] --> - - <!-- Middle screen [2] --> + <!-- Left screen [1] --> - <!-- Right screen [3] --> + <!-- Middle screen [2] --> + <favorite + launcher:packageName="com.google.android.camera" + launcher:className="com.android.camera.Camera" + launcher:screen="2" + launcher:x="0" + launcher:y="3" /> + + <!-- Right screen [3] --> <appwidget launcher:packageName="com.android.music" launcher:className="com.android.music.MediaAppWidgetProvider" @@ -31,6 +37,29 @@ launcher:spanX="4" launcher:spanY="1" /> - <!-- Far-right screen [4] --> + <!-- 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="1" + launcher:x="0" + launcher:y="0" /> + <favorite + launcher:packageName="com.android.contacts" + launcher:className="com.android.contacts.activities.PeopleActivity" + launcher:container="-101" + launcher:screen="2" + launcher:x="0" + launcher:y="0" /> + <favorite + launcher:packageName="com.android.browser" + launcher:className="com.android.browser.BrowserActivity" + launcher:container="-101" + launcher:screen="3" + launcher:x="0" + launcher:y="0" /> </favorites> |