summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-05-25 17:41:01 -0700
committerWinson Chung <winsonc@google.com>2011-05-26 11:07:58 -0700
commit1cad91e625386885a4b5f82a7fa3f05c5e575750 (patch)
tree448ead2da744cd0869eb5478d91f4fa59469d578 /src/com/android
parented4c1f1eaddd23ea3a19750533e84d7411334534 (diff)
downloadandroid_packages_apps_Trebuchet-1cad91e625386885a4b5f82a7fa3f05c5e575750.tar.gz
android_packages_apps_Trebuchet-1cad91e625386885a4b5f82a7fa3f05c5e575750.tar.bz2
android_packages_apps_Trebuchet-1cad91e625386885a4b5f82a7fa3f05c5e575750.zip
Adding QSB
- Also changing AppsCustomize bg to black. Change-Id: Iadd1a34dda56b02191e00502714296a1a3c8ee88
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher2/Launcher.java64
1 files changed, 37 insertions, 27 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 2a16e9978..631042e02 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -3157,22 +3157,34 @@ public final class Launcher extends Activity
}
private void updateGlobalSearchIcon() {
- if (LauncherApplication.isScreenLarge()) {
- final View searchButton = findViewById(R.id.search_button);
- final View searchDivider = findViewById(R.id.search_divider);
+ final ImageView searchButton = (ImageView) findViewById(R.id.search_button);
+ final View searchDivider = findViewById(R.id.search_divider);
- final SearchManager searchManager =
- (SearchManager) getSystemService(Context.SEARCH_SERVICE);
- ComponentName activityName = searchManager.getGlobalSearchActivity();
- if (activityName != null) {
+ final SearchManager searchManager =
+ (SearchManager) getSystemService(Context.SEARCH_SERVICE);
+ ComponentName activityName = searchManager.getGlobalSearchActivity();
+ if (activityName != null) {
+ // In landscape mode on the Phone UI, we only have enough space to show the magnifying
+ // glass icon
+ boolean iconLoaded = false;
+ if (!LauncherApplication.isScreenLarge()) {
+ // TODO-APPS_CUSTOMIZE: Remove when the QSB fixes itself?
+ int orientation = getResources().getConfiguration().orientation;
+ if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
+ searchButton.setImageResource(R.drawable.ic_generic_search);
+ iconLoaded = true;
+ sGlobalSearchIcon = null;
+ }
+ }
+ if (!iconLoaded) {
sGlobalSearchIcon = updateButtonWithIconFromExternalActivity(
R.id.search_button, activityName, R.drawable.ic_generic_search);
- searchButton.setVisibility(View.VISIBLE);
- searchDivider.setVisibility(View.VISIBLE);
- } else {
- searchButton.setVisibility(View.GONE);
- searchDivider.setVisibility(View.GONE);
}
+ searchButton.setVisibility(View.VISIBLE);
+ searchDivider.setVisibility(View.VISIBLE);
+ } else {
+ searchButton.setVisibility(View.GONE);
+ searchDivider.setVisibility(View.GONE);
}
}
@@ -3181,21 +3193,19 @@ public final class Launcher extends Activity
}
private void updateVoiceSearchIcon() {
- if (LauncherApplication.isScreenLarge()) {
- final View searchDivider = findViewById(R.id.search_divider);
- final View voiceButton = findViewById(R.id.voice_button);
-
- Intent intent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
- ComponentName activityName = intent.resolveActivity(getPackageManager());
- if (activityName != null) {
- sVoiceSearchIcon = updateButtonWithIconFromExternalActivity(
- R.id.voice_button, activityName, R.drawable.ic_voice_search);
- searchDivider.setVisibility(View.VISIBLE);
- voiceButton.setVisibility(View.VISIBLE);
- } else {
- searchDivider.setVisibility(View.GONE);
- voiceButton.setVisibility(View.GONE);
- }
+ final View searchDivider = findViewById(R.id.search_divider);
+ final View voiceButton = findViewById(R.id.voice_button);
+
+ Intent intent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
+ ComponentName activityName = intent.resolveActivity(getPackageManager());
+ if (activityName != null) {
+ sVoiceSearchIcon = updateButtonWithIconFromExternalActivity(
+ R.id.voice_button, activityName, R.drawable.ic_voice_search);
+ searchDivider.setVisibility(View.VISIBLE);
+ voiceButton.setVisibility(View.VISIBLE);
+ } else {
+ searchDivider.setVisibility(View.GONE);
+ voiceButton.setVisibility(View.GONE);
}
}