diff options
author | Winson Chung <winsonc@google.com> | 2013-09-24 20:58:24 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-24 20:58:24 +0000 |
commit | 2b5e56c23bc8123064eb24b4060daba0fc948300 (patch) | |
tree | 6968df42de9aef7bf481d8d30a9741bdda47598b /src/com/android/launcher3/Launcher.java | |
parent | 21f9f2a74795d88140794f3f64a26aed71ea1418 (diff) | |
parent | e6eabffd39c85b4cdb022c5e803ed561d87bd88b (diff) | |
download | android_packages_apps_Trebuchet-2b5e56c23bc8123064eb24b4060daba0fc948300.tar.gz android_packages_apps_Trebuchet-2b5e56c23bc8123064eb24b4060daba0fc948300.tar.bz2 android_packages_apps_Trebuchet-2b5e56c23bc8123064eb24b4060daba0fc948300.zip |
Merge "Launcher changes to support custom cling hints." into jb-ub-now-indigo-rose
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 695dfd20e..8959e7e09 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -274,6 +274,7 @@ public class Launcher extends Activity private boolean mVisible = false; private boolean mAttached = false; private static final boolean DISABLE_CLINGS = true; + private static final boolean DISABLE_CUSTOM_CLINGS = true; private static LocaleConfiguration sLocaleConfiguration = null; @@ -4126,16 +4127,33 @@ public class Launcher extends Activity // If we're not using the default workspace layout, replace workspace cling // with a custom workspace cling (usually specified in an overlay) // For now, only do this on tablets - if (mSharedPrefs.getInt(LauncherProvider.DEFAULT_WORKSPACE_RESOURCE_ID, 0) != 0 && - getResources().getBoolean(R.bool.config_useCustomClings)) { - // Use a custom cling - View cling = findViewById(R.id.workspace_cling); - ViewGroup clingParent = (ViewGroup) cling.getParent(); - int clingIndex = clingParent.indexOfChild(cling); - clingParent.removeViewAt(clingIndex); - View customCling = mInflater.inflate(R.layout.custom_workspace_cling, clingParent, false); - clingParent.addView(customCling, clingIndex); - customCling.setId(R.id.workspace_cling); + if (!DISABLE_CUSTOM_CLINGS) { + if (mSharedPrefs.getInt(LauncherProvider.DEFAULT_WORKSPACE_RESOURCE_ID, 0) != 0 && + getResources().getBoolean(R.bool.config_useCustomClings)) { + // Use a custom cling + View cling = findViewById(R.id.workspace_cling); + ViewGroup clingParent = (ViewGroup) cling.getParent(); + int clingIndex = clingParent.indexOfChild(cling); + clingParent.removeViewAt(clingIndex); + View customCling = mInflater.inflate(R.layout.custom_workspace_cling, clingParent, false); + clingParent.addView(customCling, clingIndex); + customCling.setId(R.id.workspace_cling); + } + } + Cling cling = (Cling) findViewById(R.id.first_run_cling); + if (cling != null) { + String sbHintStr = getFirstRunClingSearchBarHint(); + String ccHintStr = getFirstRunCustomContentHint(); + if (!sbHintStr.isEmpty()) { + TextView sbHint = (TextView) cling.findViewById(R.id.search_bar_hint); + sbHint.setText(sbHintStr); + sbHint.setVisibility(View.VISIBLE); + } + if (!ccHintStr.isEmpty()) { + TextView ccHint = (TextView) cling.findViewById(R.id.custom_content_hint); + ccHint.setText(ccHintStr); + ccHint.setVisibility(View.VISIBLE); + } } initCling(R.id.first_run_cling, null, false, true); } else { @@ -4143,6 +4161,13 @@ public class Launcher extends Activity } } + protected String getFirstRunClingSearchBarHint() { + return ""; + } + protected String getFirstRunCustomContentHint() { + return ""; + } + public void showFirstRunWorkspaceCling() { // Enable the clings only if they have not been dismissed before if (isClingsEnabled() && |