summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Launcher.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-10-05 15:02:00 +0200
committerMichael Jurka <mikejurka@google.com>2012-10-05 15:36:20 +0200
commit68255cbabe1cb7fbfc0706a8a2e1b1927eae1b55 (patch)
treeeb82329d4a79d9fcd62827e25964e49a5be7fad8 /src/com/android/launcher2/Launcher.java
parent28b3e10fdea4d719b46d2e0da9a916bacc238fd1 (diff)
downloadandroid_packages_apps_Trebuchet-68255cbabe1cb7fbfc0706a8a2e1b1927eae1b55.tar.gz
android_packages_apps_Trebuchet-68255cbabe1cb7fbfc0706a8a2e1b1927eae1b55.tar.bz2
android_packages_apps_Trebuchet-68255cbabe1cb7fbfc0706a8a2e1b1927eae1b55.zip
Add support for custom manta cling
- Load a custom cling if custom workspace layout is specified - Also persist any custom workspace layout Bug: 6992663
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r--src/com/android/launcher2/Launcher.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 3fdf5c3ce..fedf32460 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -3733,6 +3733,18 @@ public final class Launcher extends Activity
if (isClingsEnabled() &&
!mSharedPrefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, false) &&
!skipCustomClingIfNoAccounts() ) {
+ // If we're not using the default workspace layout, replace workspace cling
+ // with a custom workspace cling (usually specified in an overlay)
+ if (mSharedPrefs.getInt(LauncherProvider.DEFAULT_WORKSPACE_RESOURCE_ID, 0) != 0) {
+ // 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);
+ }
initCling(R.id.workspace_cling, null, false, 0);
} else {
removeCling(R.id.workspace_cling);