diff options
author | Sandeep Siddhartha <sansid@google.com> | 2013-12-26 15:42:52 -0800 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2014-06-06 22:54:23 -0700 |
commit | 527793e2ac77098fe7e008c307548da28f978a7a (patch) | |
tree | 899d53af791fda31dac40dd99d2b5ffa1732d0d4 | |
parent | ca0fb5e98898646002581e3beb0ea75482927d49 (diff) | |
download | android_packages_apps_Trebuchet-527793e2ac77098fe7e008c307548da28f978a7a.tar.gz android_packages_apps_Trebuchet-527793e2ac77098fe7e008c307548da28f978a7a.tar.bz2 android_packages_apps_Trebuchet-527793e2ac77098fe7e008c307548da28f978a7a.zip |
Allow changing search bar hint in the cling on-the-fly
- This allows GEL to initially supply an empty string if hotword isn't
active, and later on update the cling if and when the hotword becomes
active.
- This isn't expensive as it'll only be called if Launcher first calls
getFirstRunClingSearchBarHint, i.e. once every fresh install/clear
data
Bug: 11116105
Change-Id: Ia963bb62d7b331afd0c34adfa6c4b6bdbac48349
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 07685b270..a2f7ba8df 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -4583,6 +4583,20 @@ public class Launcher extends Activity } } + /** + * Called when the SearchBar hint should be changed. + * + * @param hint the hint to be displayed in the search bar. + */ + protected void onSearchBarHintChanged(String hint) { + Cling cling = (Cling) findViewById(R.id.first_run_cling); + if (cling != null && cling.getVisibility() == View.VISIBLE && !hint.isEmpty()) { + TextView sbHint = (TextView) cling.findViewById(R.id.search_bar_hint); + sbHint.setText(hint); + sbHint.setVisibility(View.VISIBLE); + } + } + protected String getFirstRunClingSearchBarHint() { return ""; } |