The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Joe Onorato | a590252 | 2009-07-30 13:37:37 -0700 | [diff] [blame] | 17 | package com.android.launcher2; |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 18 | |
Adam Cohen | 2801caf | 2011-05-13 20:57:39 -0700 | [diff] [blame] | 19 | import android.animation.Animator; |
| 20 | import android.animation.AnimatorListenerAdapter; |
| 21 | import android.animation.ObjectAnimator; |
| 22 | import android.animation.PropertyValuesHolder; |
| 23 | import android.animation.ValueAnimator; |
| 24 | import android.animation.ValueAnimator.AnimatorUpdateListener; |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 25 | import android.content.Context; |
| 26 | import android.content.res.Resources; |
Adam Cohen | a9cf38f | 2011-05-02 15:36:58 -0700 | [diff] [blame] | 27 | import android.graphics.Canvas; |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 28 | import android.graphics.drawable.Drawable; |
| 29 | import android.util.AttributeSet; |
| 30 | import android.view.LayoutInflater; |
| 31 | import android.view.ViewGroup; |
Adam Cohen | a9cf38f | 2011-05-02 15:36:58 -0700 | [diff] [blame] | 32 | import android.widget.FrameLayout; |
| 33 | import android.widget.TextView; |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 34 | |
Romain Guy | edcce09 | 2010-03-04 13:03:17 -0800 | [diff] [blame] | 35 | import com.android.launcher.R; |
Adam Cohen | a9cf38f | 2011-05-02 15:36:58 -0700 | [diff] [blame] | 36 | import com.android.launcher2.FolderInfo.FolderListener; |
Romain Guy | edcce09 | 2010-03-04 13:03:17 -0800 | [diff] [blame] | 37 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 38 | /** |
| 39 | * An icon that can appear on in the workspace representing an {@link UserFolder}. |
| 40 | */ |
Adam Cohen | a9cf38f | 2011-05-02 15:36:58 -0700 | [diff] [blame] | 41 | public class FolderIcon extends FrameLayout implements DropTarget, FolderListener { |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 42 | private Launcher mLauncher; |
Adam Cohen | a9cf38f | 2011-05-02 15:36:58 -0700 | [diff] [blame] | 43 | Folder mFolder; |
| 44 | FolderInfo mInfo; |
| 45 | |
| 46 | private static final int NUM_ITEMS_IN_PREVIEW = 4; |
| 47 | private static final float ICON_ANGLE = 15f; |
Adam Cohen | 073a46f | 2011-05-17 16:28:09 -0700 | [diff] [blame^] | 48 | private static final int CONSUMPTION_ANIMATION_DURATION = 60; |
| 49 | private static final float INNER_RING_GROWTH_FACTOR = 0.1f; |
| 50 | private static final float OUTER_RING_BASELINE_SCALE = 0.7f; |
| 51 | private static final float OUTER_RING_GROWTH_FACTOR = 0.3f; |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 52 | |
Adam Cohen | 073a46f | 2011-05-17 16:28:09 -0700 | [diff] [blame^] | 53 | public static Drawable sFolderOuterRingDrawable = null; |
| 54 | |
| 55 | private int mOriginalWidth = -1; |
| 56 | private int mOriginalHeight = -1; |
| 57 | private int mOriginalX = -1; |
| 58 | private int mOriginalY = -1; |
| 59 | private boolean mIsAnimating = false; |
| 60 | |
| 61 | private int mFolderLocX; |
| 62 | private int mFolderLocY; |
| 63 | private float mOuterRingScale; |
Adam Cohen | 2801caf | 2011-05-13 20:57:39 -0700 | [diff] [blame] | 64 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 65 | public FolderIcon(Context context, AttributeSet attrs) { |
| 66 | super(context, attrs); |
| 67 | } |
| 68 | |
| 69 | public FolderIcon(Context context) { |
| 70 | super(context); |
| 71 | } |
| 72 | |
Michael Jurka | 0280c3b | 2010-09-17 15:00:07 -0700 | [diff] [blame] | 73 | public boolean isDropEnabled() { |
Winson Chung | 7a1d165 | 2011-03-18 15:56:01 -0700 | [diff] [blame] | 74 | final ViewGroup cellLayoutChildren = (ViewGroup) getParent(); |
| 75 | final ViewGroup cellLayout = (ViewGroup) cellLayoutChildren.getParent(); |
| 76 | final Workspace workspace = (Workspace) cellLayout.getParent(); |
| 77 | return !workspace.isSmall(); |
Michael Jurka | 0280c3b | 2010-09-17 15:00:07 -0700 | [diff] [blame] | 78 | } |
| 79 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 80 | static FolderIcon fromXml(int resId, Launcher launcher, ViewGroup group, |
Adam Cohen | df2cc41 | 2011-04-27 16:56:57 -0700 | [diff] [blame] | 81 | FolderInfo folderInfo, IconCache iconCache) { |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 82 | |
| 83 | FolderIcon icon = (FolderIcon) LayoutInflater.from(launcher).inflate(resId, group, false); |
| 84 | |
| 85 | final Resources resources = launcher.getResources(); |
Adam Cohen | 2801caf | 2011-05-13 20:57:39 -0700 | [diff] [blame] | 86 | Drawable d = iconCache.getFullResIcon(resources, R.drawable.portal_ring_inner_holo); |
Adam Cohen | a9cf38f | 2011-05-02 15:36:58 -0700 | [diff] [blame] | 87 | icon.setBackgroundDrawable(d); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 88 | icon.setTag(folderInfo); |
| 89 | icon.setOnClickListener(launcher); |
| 90 | icon.mInfo = folderInfo; |
| 91 | icon.mLauncher = launcher; |
Adam Cohen | a9cf38f | 2011-05-02 15:36:58 -0700 | [diff] [blame] | 92 | |
| 93 | Folder folder = Folder.fromXml(launcher); |
| 94 | folder.setDragController(launcher.getDragController()); |
| 95 | folder.setLauncher(launcher); |
Adam Cohen | 2801caf | 2011-05-13 20:57:39 -0700 | [diff] [blame] | 96 | folder.setFolderIcon(icon); |
Adam Cohen | a9cf38f | 2011-05-02 15:36:58 -0700 | [diff] [blame] | 97 | folder.bind(folderInfo); |
| 98 | icon.mFolder = folder; |
| 99 | |
| 100 | folderInfo.addListener(icon); |
Adam Cohen | 073a46f | 2011-05-17 16:28:09 -0700 | [diff] [blame^] | 101 | if (sFolderOuterRingDrawable == null) { |
| 102 | sFolderOuterRingDrawable = |
| 103 | launcher.getResources().getDrawable(R.drawable.portal_ring_outer_holo); |
| 104 | } |
Adam Cohen | a9cf38f | 2011-05-02 15:36:58 -0700 | [diff] [blame] | 105 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 106 | return icon; |
| 107 | } |
| 108 | |
Adam Cohen | 073a46f | 2011-05-17 16:28:09 -0700 | [diff] [blame^] | 109 | private boolean willAcceptItem(ItemInfo item) { |
| 110 | final int itemType = item.itemType; |
| 111 | return ((itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION || |
| 112 | itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) && |
| 113 | !mFolder.isFull() && item != mInfo); |
| 114 | } |
| 115 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 116 | public boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset, |
Joe Onorato | 00acb12 | 2009-08-04 16:04:30 -0400 | [diff] [blame] | 117 | DragView dragView, Object dragInfo) { |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 118 | final ItemInfo item = (ItemInfo) dragInfo; |
Adam Cohen | 073a46f | 2011-05-17 16:28:09 -0700 | [diff] [blame^] | 119 | return willAcceptItem(item); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 120 | } |
| 121 | |
Adam Cohen | df03538 | 2011-04-11 17:22:04 -0700 | [diff] [blame] | 122 | public void addItem(ShortcutInfo item) { |
| 123 | mInfo.add(item); |
Adam Cohen | a9cf38f | 2011-05-02 15:36:58 -0700 | [diff] [blame] | 124 | LauncherModel.addOrMoveItemInDatabase(mLauncher, item, mInfo.id, 0, item.cellX, item.cellY); |
Adam Cohen | df03538 | 2011-04-11 17:22:04 -0700 | [diff] [blame] | 125 | } |
| 126 | |
Joe Onorato | 00acb12 | 2009-08-04 16:04:30 -0400 | [diff] [blame] | 127 | public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset, |
| 128 | DragView dragView, Object dragInfo) { |
Joe Onorato | 0589f0f | 2010-02-08 13:44:00 -0800 | [diff] [blame] | 129 | ShortcutInfo item; |
| 130 | if (dragInfo instanceof ApplicationInfo) { |
| 131 | // Came from all apps -- make a copy |
| 132 | item = ((ApplicationInfo)dragInfo).makeShortcut(); |
| 133 | } else { |
| 134 | item = (ShortcutInfo)dragInfo; |
| 135 | } |
Michael Jurka | 66d7217 | 2011-04-12 16:29:25 -0700 | [diff] [blame] | 136 | item.cellX = -1; |
| 137 | item.cellY = -1; |
Adam Cohen | df03538 | 2011-04-11 17:22:04 -0700 | [diff] [blame] | 138 | addItem(item); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 139 | } |
| 140 | |
Adam Cohen | 2801caf | 2011-05-13 20:57:39 -0700 | [diff] [blame] | 141 | void saveState(CellLayout.LayoutParams lp) { |
| 142 | mOriginalWidth = lp.width; |
| 143 | mOriginalHeight = lp.height; |
| 144 | mOriginalX = lp.x; |
| 145 | mOriginalY = lp.y; |
| 146 | } |
| 147 | |
Adam Cohen | 073a46f | 2011-05-17 16:28:09 -0700 | [diff] [blame^] | 148 | private void animateToAcceptState() { |
Adam Cohen | 2801caf | 2011-05-13 20:57:39 -0700 | [diff] [blame] | 149 | CellLayout.LayoutParams lp = (CellLayout.LayoutParams) getLayoutParams(); |
Adam Cohen | 073a46f | 2011-05-17 16:28:09 -0700 | [diff] [blame^] | 150 | |
Adam Cohen | 2801caf | 2011-05-13 20:57:39 -0700 | [diff] [blame] | 151 | lp.isLockedToGrid = false; |
| 152 | saveState(lp); |
| 153 | |
Adam Cohen | 073a46f | 2011-05-17 16:28:09 -0700 | [diff] [blame^] | 154 | int newWidth = (int) ((1 + INNER_RING_GROWTH_FACTOR) * lp.width); |
| 155 | int newHeight = (int) ((1 + INNER_RING_GROWTH_FACTOR) * lp.width); |
| 156 | int newX = lp.x - (int) ((INNER_RING_GROWTH_FACTOR / 2) * lp.width); |
| 157 | int newY = lp.y - (int) ((INNER_RING_GROWTH_FACTOR / 2) * lp.height); |
| 158 | PropertyValuesHolder width = PropertyValuesHolder.ofInt("width", newWidth); |
| 159 | PropertyValuesHolder height = PropertyValuesHolder.ofInt("height",newHeight); |
| 160 | PropertyValuesHolder x = PropertyValuesHolder.ofInt("x", newX); |
| 161 | PropertyValuesHolder y = PropertyValuesHolder.ofInt("y", newY); |
| 162 | ObjectAnimator oa = ObjectAnimator.ofPropertyValuesHolder(lp, width, height, x, y); |
| 163 | oa.setDuration(CONSUMPTION_ANIMATION_DURATION); |
Adam Cohen | 2801caf | 2011-05-13 20:57:39 -0700 | [diff] [blame] | 164 | oa.addUpdateListener(new AnimatorUpdateListener() { |
| 165 | public void onAnimationUpdate(ValueAnimator animation) { |
Adam Cohen | 2801caf | 2011-05-13 20:57:39 -0700 | [diff] [blame] | 166 | requestLayout(); |
Adam Cohen | 073a46f | 2011-05-17 16:28:09 -0700 | [diff] [blame^] | 167 | invalidate(); |
Adam Cohen | 2801caf | 2011-05-13 20:57:39 -0700 | [diff] [blame] | 168 | } |
| 169 | }); |
Adam Cohen | 073a46f | 2011-05-17 16:28:09 -0700 | [diff] [blame^] | 170 | oa.addListener(new AnimatorListenerAdapter() { |
| 171 | @Override |
| 172 | public void onAnimationStart(Animator animation) { |
| 173 | mIsAnimating = true; |
| 174 | } |
| 175 | }); |
| 176 | ValueAnimator outerRingScale = ValueAnimator.ofFloat(0f, 1f); |
| 177 | outerRingScale.setDuration(CONSUMPTION_ANIMATION_DURATION); |
| 178 | outerRingScale.addUpdateListener(new AnimatorUpdateListener() { |
| 179 | public void onAnimationUpdate(ValueAnimator animation) { |
| 180 | final float percent = (Float) animation.getAnimatedValue(); |
| 181 | mOuterRingScale = OUTER_RING_BASELINE_SCALE + percent * OUTER_RING_GROWTH_FACTOR; |
| 182 | mLauncher.getWorkspace().invalidate(); |
| 183 | } |
| 184 | }); |
| 185 | |
| 186 | outerRingScale.start(); |
Adam Cohen | 2801caf | 2011-05-13 20:57:39 -0700 | [diff] [blame] | 187 | oa.start(); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 188 | } |
| 189 | |
Adam Cohen | 073a46f | 2011-05-17 16:28:09 -0700 | [diff] [blame^] | 190 | private void animateToNaturalState() { |
| 191 | final CellLayout.LayoutParams lp = (CellLayout.LayoutParams) getLayoutParams(); |
| 192 | lp.isLockedToGrid = false; |
| 193 | |
| 194 | PropertyValuesHolder width = PropertyValuesHolder.ofInt("width", mOriginalWidth); |
| 195 | PropertyValuesHolder height = PropertyValuesHolder.ofInt("height", mOriginalHeight); |
| 196 | PropertyValuesHolder x = PropertyValuesHolder.ofInt("x", mOriginalX); |
| 197 | PropertyValuesHolder y = PropertyValuesHolder.ofInt("y", mOriginalY); |
| 198 | ObjectAnimator oa = ObjectAnimator.ofPropertyValuesHolder(lp, width, height, x, y); |
| 199 | oa.addUpdateListener(new AnimatorUpdateListener() { |
| 200 | public void onAnimationUpdate(ValueAnimator animation) { |
| 201 | requestLayout(); |
| 202 | invalidate(); |
| 203 | } |
| 204 | }); |
| 205 | oa.addListener(new AnimatorListenerAdapter() { |
| 206 | @Override |
| 207 | public void onAnimationEnd(Animator animation) { |
| 208 | lp.isLockedToGrid = true; |
| 209 | mIsAnimating = false; |
| 210 | } |
| 211 | }); |
| 212 | |
| 213 | ValueAnimator outerRingScale = ValueAnimator.ofFloat(0f, 1f); |
| 214 | outerRingScale.setDuration(CONSUMPTION_ANIMATION_DURATION); |
| 215 | outerRingScale.addUpdateListener(new AnimatorUpdateListener() { |
| 216 | public void onAnimationUpdate(ValueAnimator animation) { |
| 217 | final float percent = (Float) animation.getAnimatedValue(); |
| 218 | mOuterRingScale = OUTER_RING_BASELINE_SCALE + OUTER_RING_GROWTH_FACTOR |
| 219 | - percent * OUTER_RING_GROWTH_FACTOR; |
| 220 | mLauncher.getWorkspace().invalidate(); |
| 221 | } |
| 222 | }); |
| 223 | |
| 224 | oa.setDuration(CONSUMPTION_ANIMATION_DURATION); |
| 225 | oa.start(); |
| 226 | } |
| 227 | |
| 228 | private void determineFolderLocationInWorkspace() { |
| 229 | int tvLocation[] = new int[2]; |
| 230 | int wsLocation[] = new int[2]; |
| 231 | getLocationOnScreen(tvLocation); |
| 232 | mLauncher.getWorkspace().getLocationOnScreen(wsLocation); |
| 233 | mFolderLocX = tvLocation[0] - wsLocation[0] + getMeasuredWidth() / 2; |
| 234 | mFolderLocY = tvLocation[1] - wsLocation[1] + getMeasuredHeight() / 2; |
| 235 | } |
| 236 | |
| 237 | public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset, |
| 238 | DragView dragView, Object dragInfo) { |
| 239 | if (!willAcceptItem((ItemInfo) dragInfo)) return; |
| 240 | determineFolderLocationInWorkspace(); |
| 241 | mLauncher.getWorkspace().showFolderAccept(this); |
| 242 | animateToAcceptState(); |
| 243 | } |
| 244 | |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 245 | public void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset, |
Joe Onorato | 00acb12 | 2009-08-04 16:04:30 -0400 | [diff] [blame] | 246 | DragView dragView, Object dragInfo) { |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 247 | } |
| 248 | |
| 249 | public void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset, |
Joe Onorato | 00acb12 | 2009-08-04 16:04:30 -0400 | [diff] [blame] | 250 | DragView dragView, Object dragInfo) { |
Adam Cohen | 073a46f | 2011-05-17 16:28:09 -0700 | [diff] [blame^] | 251 | if (!willAcceptItem((ItemInfo) dragInfo)) return; |
| 252 | mLauncher.getWorkspace().hideFolderAccept(this); |
| 253 | animateToNaturalState(); |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 254 | } |
Patrick Dubroy | 440c360 | 2010-07-13 17:50:32 -0700 | [diff] [blame] | 255 | |
| 256 | @Override |
| 257 | public DropTarget getDropTargetDelegate(DragSource source, int x, int y, int xOffset, int yOffset, |
| 258 | DragView dragView, Object dragInfo) { |
| 259 | return null; |
| 260 | } |
Adam Cohen | a9cf38f | 2011-05-02 15:36:58 -0700 | [diff] [blame] | 261 | |
Adam Cohen | 073a46f | 2011-05-17 16:28:09 -0700 | [diff] [blame^] | 262 | public void getFolderLocation(int[] loc) { |
| 263 | loc[0] = mFolderLocX; |
| 264 | loc[1] = mFolderLocY; |
| 265 | } |
| 266 | |
| 267 | public float getOuterRingScale() { |
| 268 | return mOuterRingScale; |
| 269 | } |
| 270 | |
Adam Cohen | a9cf38f | 2011-05-02 15:36:58 -0700 | [diff] [blame] | 271 | @Override |
| 272 | protected void onDraw(Canvas canvas) { |
| 273 | if (mFolder == null) return; |
| 274 | if (mFolder.getItemCount() == 0) return; |
| 275 | |
| 276 | canvas.save(); |
| 277 | TextView v = (TextView) mFolder.getItemAt(0); |
| 278 | Drawable d = v.getCompoundDrawables()[1]; |
| 279 | |
Adam Cohen | 073a46f | 2011-05-17 16:28:09 -0700 | [diff] [blame^] | 280 | CellLayout.LayoutParams lp = (CellLayout.LayoutParams) getLayoutParams(); |
| 281 | if (mOriginalWidth < 0 || mOriginalHeight < 0) { |
| 282 | mOriginalWidth = getMeasuredWidth(); |
| 283 | mOriginalHeight = getMeasuredHeight(); |
| 284 | } |
Adam Cohen | a9cf38f | 2011-05-02 15:36:58 -0700 | [diff] [blame] | 285 | |
Adam Cohen | 073a46f | 2011-05-17 16:28:09 -0700 | [diff] [blame^] | 286 | int xShift = (mOriginalWidth - d.getIntrinsicWidth()) / 2; |
| 287 | int yShift = (mOriginalHeight - d.getIntrinsicHeight()) / 2; |
| 288 | |
| 289 | if (mIsAnimating) { |
| 290 | xShift -= lp.x - mOriginalX; |
| 291 | yShift -= lp.y - mOriginalY; |
| 292 | } |
| 293 | |
| 294 | canvas.translate(xShift, yShift); |
Adam Cohen | a9cf38f | 2011-05-02 15:36:58 -0700 | [diff] [blame] | 295 | canvas.translate(d.getIntrinsicWidth() / 2, d.getIntrinsicHeight() / 2); |
| 296 | canvas.rotate(ICON_ANGLE); |
Adam Cohen | a9cf38f | 2011-05-02 15:36:58 -0700 | [diff] [blame] | 297 | canvas.translate(-d.getIntrinsicWidth() / 2, -d.getIntrinsicHeight() / 2); |
| 298 | |
| 299 | for (int i = Math.max(0, mFolder.getItemCount() - NUM_ITEMS_IN_PREVIEW); |
| 300 | i < mFolder.getItemCount(); i++) { |
| 301 | v = (TextView) mFolder.getItemAt(i); |
| 302 | d = v.getCompoundDrawables()[1]; |
| 303 | |
| 304 | if (d != null) { |
| 305 | d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight()); |
| 306 | d.draw(canvas); |
| 307 | } |
| 308 | |
| 309 | canvas.translate(d.getIntrinsicWidth() / 2, d.getIntrinsicHeight() / 2); |
| 310 | canvas.rotate(-ICON_ANGLE); |
| 311 | canvas.translate(-d.getIntrinsicWidth() / 2, -d.getIntrinsicHeight() / 2); |
| 312 | } |
| 313 | |
| 314 | canvas.restore(); |
| 315 | } |
| 316 | |
| 317 | public void onAdd(ShortcutInfo item) { |
| 318 | invalidate(); |
| 319 | requestLayout(); |
| 320 | } |
| 321 | |
| 322 | public void onRemove(ShortcutInfo item) { |
| 323 | invalidate(); |
| 324 | requestLayout(); |
| 325 | } |
The Android Open Source Project | 31dd503 | 2009-03-03 19:32:27 -0800 | [diff] [blame] | 326 | } |