am a5fa4b49: Merge "Updating layout of search buttons" into honeycomb
* commit 'a5fa4b492f87540bce227a311733789930ebcf5f': Updating layout of search buttons
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
@@ -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>
|
||||
@@ -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>
|
||||
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"
|
||||
|
||||
<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: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"
|
||||
|
||||
@@ -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>
|
||||
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"
|
||||
|
||||
<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: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"
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||