diff options
author | Winson Chung <winsonc@google.com> | 2013-10-01 01:13:22 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-10-01 01:13:23 +0000 |
commit | f099eb0bf4c0fdee5c4708d48ce0134fbf0d1249 (patch) | |
tree | f09362ea7a3268a310b99c42ffb9eda46ae18b28 /src/com/android/launcher3/Launcher.java | |
parent | 61f560d92ab4b11a61beeb8df97b9952027e08e4 (diff) | |
parent | 5841efa6121fb40dd7c1a6a432a899b894fa5c6d (diff) | |
download | android_packages_apps_Trebuchet-f099eb0bf4c0fdee5c4708d48ce0134fbf0d1249.tar.gz android_packages_apps_Trebuchet-f099eb0bf4c0fdee5c4708d48ce0134fbf0d1249.tar.bz2 android_packages_apps_Trebuchet-f099eb0bf4c0fdee5c4708d48ce0134fbf0d1249.zip |
Merge "Using state to update voice button proxy visibility instead of view flags. (Bug 10915381)" into jb-ub-now-indigo-rose
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 62e05e8d8..7ae429dae 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -900,6 +900,9 @@ public class Launcher extends Activity // Process any items that were added while Launcher was away. InstallShortcutReceiver.disableAndFlushInstallQueue(this); + // Update the voice search button proxy + updateVoiceButtonProxyVisible(false); + // Again, as with the above scenario, it's possible that one or more of the global icons // were updated in the wrong orientation. updateGlobalIcons(); @@ -3338,7 +3341,7 @@ public class Launcher extends Activity if (voiceButtonContainer != null) voiceButtonContainer.setVisibility(View.GONE); if (searchButton != null) searchButton.setVisibility(View.GONE); if (voiceButton != null) voiceButton.setVisibility(View.GONE); - setVoiceButtonProxyVisible(false); + updateVoiceButtonProxyVisible(false); return false; } } @@ -3385,13 +3388,13 @@ public class Launcher extends Activity } if (voiceButtonContainer != null) voiceButtonContainer.setVisibility(View.VISIBLE); voiceButton.setVisibility(View.VISIBLE); - setVoiceButtonProxyVisible(true); + updateVoiceButtonProxyVisible(false); invalidatePressedFocusedStates(voiceButtonContainer, voiceButton); return true; } else { if (voiceButtonContainer != null) voiceButtonContainer.setVisibility(View.GONE); if (voiceButton != null) voiceButton.setVisibility(View.GONE); - setVoiceButtonProxyVisible(false); + updateVoiceButtonProxyVisible(false); return false; } } @@ -3403,12 +3406,23 @@ public class Launcher extends Activity invalidatePressedFocusedStates(voiceButtonContainer, voiceButton); } - public void setVoiceButtonProxyVisible(boolean visible) { + public void updateVoiceButtonProxyVisible(boolean forceDisableVoiceButtonProxy) { final View voiceButtonProxy = findViewById(R.id.voice_button_proxy); if (voiceButtonProxy != null) { + boolean visible = !forceDisableVoiceButtonProxy && + mWorkspace.shouldVoiceButtonProxyBeVisible(); voiceButtonProxy.setVisibility(visible ? View.VISIBLE : View.GONE); + voiceButtonProxy.bringToFront(); } } + + /** + * This is an overrid eot disable the voice button proxy. If disabled is true, then the voice button proxy + * will be hidden regardless of what shouldVoiceButtonProxyBeVisible() returns. + */ + public void disableVoiceButtonProxy(boolean disabled) { + updateVoiceButtonProxyVisible(disabled); + } /** * Sets the app market icon */ |