summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/CellLayout.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2014-03-05 18:07:04 -0800
committerAdam Cohen <adamcohen@google.com>2014-12-05 16:18:41 -0800
commit5940042d39b576553c2499bcf3d0641281e6ad52 (patch)
tree45eb331399dc9f0fd86f4a3dc58dada50fb9ec46 /src/com/android/launcher3/CellLayout.java
parente64b0dfcd0d4113e9259b6270cff734089f4cd3f (diff)
downloadandroid_packages_apps_Trebuchet-5940042d39b576553c2499bcf3d0641281e6ad52.tar.gz
android_packages_apps_Trebuchet-5940042d39b576553c2499bcf3d0641281e6ad52.tar.bz2
android_packages_apps_Trebuchet-5940042d39b576553c2499bcf3d0641281e6ad52.zip
Supporting custom widgets provided by launcher
-> This change provides integration for widgets provided by the launcher package which can run arbitrary code. Change-Id: I6052da5c4afed7ee72e3b44d045b9c46f2d84c42
Diffstat (limited to 'src/com/android/launcher3/CellLayout.java')
-rw-r--r--src/com/android/launcher3/CellLayout.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 0ff1ef4ad..7424d61c1 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -592,7 +592,7 @@ public class CellLayout extends ViewGroup {
}
public boolean addViewToCellLayout(View child, int index, int childId, LayoutParams params,
- boolean markCells) {
+ boolean markCells, boolean inLayout) {
final LayoutParams lp = params;
// Hotseat icons - remove text
@@ -613,8 +613,11 @@ public class CellLayout extends ViewGroup {
if (lp.cellVSpan < 0) lp.cellVSpan = mCountY;
child.setId(childId);
-
- mShortcutsAndWidgets.addView(child, index, lp);
+ if (inLayout) {
+ mShortcutsAndWidgets.addView(child, index, lp, true);
+ } else {
+ mShortcutsAndWidgets.addView(child, index, lp, false);
+ }
if (markCells) markCellsAsOccupiedForView(child);
@@ -623,6 +626,11 @@ public class CellLayout extends ViewGroup {
return false;
}
+ public boolean addViewToCellLayout(View child, int index, int childId, LayoutParams params,
+ boolean markCells) {
+ return addViewToCellLayout(child, index, childId, params, markCells, false);
+ }
+
@Override
public void removeAllViews() {
clearOccupiedCells();