diff options
author | Michael Jurka <mikejurka@google.com> | 2011-01-25 22:56:42 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-25 22:56:42 -0800 |
commit | a5fa4b492f87540bce227a311733789930ebcf5f (patch) | |
tree | bf388db31210dc64edc1dfed0b6b2e3a9e668010 | |
parent | 878aaca1fee925805e4fc210317540bb5ef933ae (diff) | |
parent | 789744f8962642b04c4b37791154fc990a05746c (diff) | |
download | packages_apps_trebuchet-a5fa4b492f87540bce227a311733789930ebcf5f.zip packages_apps_trebuchet-a5fa4b492f87540bce227a311733789930ebcf5f.tar.gz packages_apps_trebuchet-a5fa4b492f87540bce227a311733789930ebcf5f.tar.bz2 |
Merge "Updating layout of search buttons" into honeycomb
-rw-r--r-- | res/drawable-xlarge-hdpi/search_button_normal.png | bin | 1126 -> 0 bytes | |||
-rw-r--r-- | res/drawable-xlarge-hdpi/search_button_pressed.png | bin | 4507 -> 0 bytes | |||
-rw-r--r-- | res/drawable-xlarge-hdpi/textfield_home_end.9.png | bin | 2936 -> 0 bytes | |||
-rw-r--r-- | res/drawable-xlarge-hdpi/textfield_home_start.9.png | bin | 1207 -> 0 bytes | |||
-rw-r--r-- | res/drawable-xlarge-mdpi/ic_generic_search.png | bin | 0 -> 2445 bytes | |||
-rw-r--r-- | res/drawable-xlarge-mdpi/search_button_normal.png | bin | 1067 -> 0 bytes | |||
-rw-r--r-- | res/drawable-xlarge-mdpi/search_button_pressed.png | bin | 3706 -> 0 bytes | |||
-rw-r--r-- | res/drawable-xlarge-mdpi/textfield_home_end.9.png | bin | 2935 -> 0 bytes | |||
-rw-r--r-- | res/drawable-xlarge-mdpi/textfield_home_start.9.png | bin | 3008 -> 0 bytes | |||
-rw-r--r-- | res/drawable-xlarge/search_button_generic.xml | 20 | ||||
-rw-r--r-- | res/layout-xlarge-land/launcher.xml | 91 | ||||
-rw-r--r-- | res/layout-xlarge-port/launcher.xml | 91 | ||||
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 12 |
13 files changed, 98 insertions, 116 deletions
diff --git a/res/drawable-xlarge-hdpi/search_button_normal.png b/res/drawable-xlarge-hdpi/search_button_normal.png Binary files differdeleted file mode 100644 index b1df556..0000000 --- a/res/drawable-xlarge-hdpi/search_button_normal.png +++ /dev/null diff --git a/res/drawable-xlarge-hdpi/search_button_pressed.png b/res/drawable-xlarge-hdpi/search_button_pressed.png Binary files differdeleted file mode 100644 index 1013383..0000000 --- a/res/drawable-xlarge-hdpi/search_button_pressed.png +++ /dev/null diff --git a/res/drawable-xlarge-hdpi/textfield_home_end.9.png b/res/drawable-xlarge-hdpi/textfield_home_end.9.png Binary files differdeleted file mode 100644 index 4e79920..0000000 --- a/res/drawable-xlarge-hdpi/textfield_home_end.9.png +++ /dev/null diff --git a/res/drawable-xlarge-hdpi/textfield_home_start.9.png b/res/drawable-xlarge-hdpi/textfield_home_start.9.png Binary files differdeleted file mode 100644 index a338c69..0000000 --- a/res/drawable-xlarge-hdpi/textfield_home_start.9.png +++ /dev/null diff --git a/res/drawable-xlarge-mdpi/ic_generic_search.png b/res/drawable-xlarge-mdpi/ic_generic_search.png Binary files differnew file mode 100644 index 0000000..d92071b --- /dev/null +++ b/res/drawable-xlarge-mdpi/ic_generic_search.png diff --git a/res/drawable-xlarge-mdpi/search_button_normal.png b/res/drawable-xlarge-mdpi/search_button_normal.png Binary files differdeleted file mode 100644 index b172074..0000000 --- a/res/drawable-xlarge-mdpi/search_button_normal.png +++ /dev/null diff --git a/res/drawable-xlarge-mdpi/search_button_pressed.png b/res/drawable-xlarge-mdpi/search_button_pressed.png Binary files differdeleted file mode 100644 index c2926c8..0000000 --- a/res/drawable-xlarge-mdpi/search_button_pressed.png +++ /dev/null diff --git a/res/drawable-xlarge-mdpi/textfield_home_end.9.png b/res/drawable-xlarge-mdpi/textfield_home_end.9.png Binary files differdeleted file mode 100644 index 753514f..0000000 --- a/res/drawable-xlarge-mdpi/textfield_home_end.9.png +++ /dev/null diff --git a/res/drawable-xlarge-mdpi/textfield_home_start.9.png b/res/drawable-xlarge-mdpi/textfield_home_start.9.png Binary files differdeleted file mode 100644 index 11ee7ca..0000000 --- a/res/drawable-xlarge-mdpi/textfield_home_start.9.png +++ /dev/null diff --git a/res/drawable-xlarge/search_button_generic.xml b/res/drawable-xlarge/search_button_generic.xml deleted file mode 100644 index 8f18e67..0000000 --- a/res/drawable-xlarge/search_button_generic.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2010 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" android:drawable="@drawable/search_button_pressed" /> - <item android:drawable="@drawable/search_button_normal" /> -</selector> diff --git a/res/layout-xlarge-land/launcher.xml b/res/layout-xlarge-land/launcher.xml index 93d19dc..c76516e 100644 --- a/res/layout-xlarge-land/launcher.xml +++ b/res/layout-xlarge-land/launcher.xml @@ -54,54 +54,51 @@ android:layout_height="?android:attr/actionBarSize" android:layout_gravity="top"> - <LinearLayout android:id="@+id/search_button_cluster" + <!-- Global search icon --> + <ImageView + android:id="@+id/search_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_alignParentLeft="true" + android:paddingLeft="@dimen/toolbar_button_horizontal_padding" + android:paddingRight="@dimen/toolbar_button_horizontal_padding" + android:paddingTop="@dimen/toolbar_button_vertical_padding" + android:paddingBottom="@dimen/toolbar_button_vertical_padding" + android:src="@drawable/ic_generic_search" + android:background="@drawable/button_bg" + android:onClick="onClickSearchButton" + android:focusable="true" + android:clickable="true" /> + + <ImageView + android:id="@+id/search_divider" + android:src="@drawable/divider_launcher_holo" android:layout_width="wrap_content" - android:layout_height="48dp" - android:gravity="bottom" - > - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:layout_marginLeft="16dp" - android:background="@drawable/textfield_home_start" - android:orientation="horizontal"> - <!-- Global search icon --> - <ImageView - android:id="@+id/search_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="bottom" - android:paddingLeft="8dp" - android:paddingRight="32dp" - android:paddingTop="12dp" - android:src="@drawable/search_button_generic" - android:background="@drawable/button_bg" - android:onClick="onClickSearchButton" - android:focusable="true" - android:clickable="true"/> - </LinearLayout> - - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:background="@drawable/textfield_home_end" - android:orientation="horizontal"> - <!-- Voice search icon --> - <ImageView - android:id="@+id/voice_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="bottom" - android:paddingLeft="24dp" - android:paddingRight="24dp" - android:paddingTop="12dp" - android:src="@drawable/ic_voice_search" - android:background="@drawable/button_bg" - android:onClick="onClickVoiceButton" - android:focusable="true" - android:clickable="true"/> - </LinearLayout> - </LinearLayout> + android:layout_height="@dimen/toolbar_divider_height" + android:layout_toRightOf="@id/search_button" + android:paddingTop="@dimen/toolbar_button_vertical_padding" + android:paddingBottom="@dimen/toolbar_button_vertical_padding" + + android:onClick="onClickAllAppsButton" + android:focusable="true" + android:clickable="true" /> + + <!-- Voice search icon --> + <ImageView + android:id="@+id/voice_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_toRightOf="@id/search_divider" + android:paddingLeft="@dimen/toolbar_button_horizontal_padding" + android:paddingRight="@dimen/toolbar_button_horizontal_padding" + android:paddingTop="@dimen/toolbar_button_vertical_padding" + android:paddingBottom="@dimen/toolbar_button_vertical_padding" + android:src="@drawable/ic_voice_search" + android:background="@drawable/button_bg" + android:onClick="onClickVoiceButton" + android:focusable="true" + android:clickable="true"/> <ImageView android:id="@+id/configure_button" diff --git a/res/layout-xlarge-port/launcher.xml b/res/layout-xlarge-port/launcher.xml index 6ad5d9c..3b499d9 100644 --- a/res/layout-xlarge-port/launcher.xml +++ b/res/layout-xlarge-port/launcher.xml @@ -54,54 +54,51 @@ android:layout_height="?android:attr/actionBarSize" android:layout_gravity="top"> - <LinearLayout android:id="@+id/search_button_cluster" + <!-- Global search icon --> + <ImageView + android:id="@+id/search_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_alignParentLeft="true" + android:paddingLeft="@dimen/toolbar_button_horizontal_padding" + android:paddingRight="@dimen/toolbar_button_horizontal_padding" + android:paddingTop="@dimen/toolbar_button_vertical_padding" + android:paddingBottom="@dimen/toolbar_button_vertical_padding" + android:src="@drawable/ic_generic_search" + android:background="@drawable/button_bg" + android:onClick="onClickSearchButton" + android:focusable="true" + android:clickable="true" /> + + <ImageView + android:id="@+id/search_divider" + android:src="@drawable/divider_launcher_holo" + android:layout_width="wrap_content" + android:layout_height="@dimen/toolbar_divider_height" + android:layout_toRightOf="@id/search_button" + android:paddingTop="@dimen/toolbar_button_vertical_padding" + android:paddingBottom="@dimen/toolbar_button_vertical_padding" + + android:onClick="onClickAllAppsButton" + android:focusable="true" + android:clickable="true" /> + + <!-- Voice search icon --> + <ImageView + android:id="@+id/voice_button" android:layout_width="wrap_content" - android:layout_height="48dp" - android:gravity="bottom" - > - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:layout_marginLeft="16dp" - android:background="@drawable/textfield_home_start" - android:orientation="horizontal"> - <!-- Global search icon --> - <ImageView - android:id="@+id/search_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="bottom" - android:paddingLeft="8dp" - android:paddingRight="32dp" - android:paddingTop="12dp" - android:src="@drawable/search_button_generic" - android:background="@drawable/button_bg" - android:onClick="onClickSearchButton" - android:focusable="true" - android:clickable="true"/> - </LinearLayout> - - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:background="@drawable/textfield_home_end" - android:orientation="horizontal"> - <!-- Voice search icon --> - <ImageView - android:id="@+id/voice_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="bottom" - android:paddingLeft="24dp" - android:paddingRight="24dp" - android:paddingTop="12dp" - android:src="@drawable/ic_voice_search" - android:background="@drawable/button_bg" - android:onClick="onClickVoiceButton" - android:focusable="true" - android:clickable="true"/> - </LinearLayout> - </LinearLayout> + android:layout_height="wrap_content" + android:layout_toRightOf="@id/search_divider" + android:paddingLeft="@dimen/toolbar_button_horizontal_padding" + android:paddingRight="@dimen/toolbar_button_horizontal_padding" + android:paddingTop="@dimen/toolbar_button_vertical_padding" + android:paddingBottom="@dimen/toolbar_button_vertical_padding" + android:src="@drawable/ic_voice_search" + android:background="@drawable/button_bg" + android:onClick="onClickVoiceButton" + android:focusable="true" + android:clickable="true"/> <ImageView android:id="@+id/configure_button" diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 1a7067e..966f2e7 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -2598,7 +2598,9 @@ public final class Launcher extends Activity * @param hideSeq AnimatorSet in which to put "hide" animations, or null. */ private void hideAndShowToolbarButtons(State newState, AnimatorSet showSeq, AnimatorSet hideSeq) { - final View searchButton = findViewById(R.id.search_button_cluster); + final View searchButton = findViewById(R.id.search_button); + final View searchDivider = findViewById(R.id.search_divider); + final View voiceSearchButton = findViewById(R.id.voice_button); final View allAppsButton = findViewById(R.id.all_apps_button); final View divider = findViewById(R.id.divider); final View configureButton = findViewById(R.id.configure_button); @@ -2606,6 +2608,8 @@ public final class Launcher extends Activity switch (newState) { case WORKSPACE: hideOrShowToolbarButton(true, searchButton, showSeq); + hideOrShowToolbarButton(true, searchDivider, showSeq); + hideOrShowToolbarButton(true, voiceSearchButton, showSeq); hideOrShowToolbarButton(true, allAppsButton, showSeq); hideOrShowToolbarButton(true, divider, showSeq); hideOrShowToolbarButton(true, configureButton, showSeq); @@ -2615,7 +2619,9 @@ public final class Launcher extends Activity break; case ALL_APPS: hideOrShowToolbarButton(false, configureButton, hideSeq); + hideOrShowToolbarButton(false, searchDivider, hideSeq); hideOrShowToolbarButton(false, searchButton, hideSeq); + hideOrShowToolbarButton(false, voiceSearchButton, hideSeq); hideOrShowToolbarButton(false, divider, hideSeq); hideOrShowToolbarButton(false, allAppsButton, hideSeq); mDeleteZone.setDragAndDropEnabled(false); @@ -2623,7 +2629,9 @@ public final class Launcher extends Activity break; case CUSTOMIZE: hideOrShowToolbarButton(false, allAppsButton, hideSeq); + hideOrShowToolbarButton(false, searchDivider, hideSeq); hideOrShowToolbarButton(false, searchButton, hideSeq); + hideOrShowToolbarButton(false, voiceSearchButton, hideSeq); hideOrShowToolbarButton(false, divider, hideSeq); hideOrShowToolbarButton(false, configureButton, hideSeq); mDeleteZone.setDragAndDropEnabled(false); @@ -3106,7 +3114,7 @@ public final class Launcher extends Activity ComponentName activityName = searchManager.getGlobalSearchActivity(); if (activityName != null) { sGlobalSearchIcon = updateButtonWithIconFromExternalActivity( - R.id.search_button, activityName, R.drawable.search_button_generic); + R.id.search_button, activityName, R.drawable.ic_generic_search); } else { findViewById(R.id.search_button).setVisibility(View.GONE); } |