Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 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 | |
| 17 | package com.android.launcher2; |
| 18 | |
| 19 | import java.util.ArrayList; |
| 20 | import java.util.Collections; |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 21 | |
| 22 | import android.content.ComponentName; |
| 23 | import android.content.Context; |
| 24 | import android.content.res.TypedArray; |
Winson Chung | 5f2aa4e | 2010-08-20 14:49:25 -0700 | [diff] [blame^] | 25 | import android.graphics.Rect; |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 26 | import android.util.AttributeSet; |
Winson Chung | 5f2aa4e | 2010-08-20 14:49:25 -0700 | [diff] [blame^] | 27 | import android.view.ActionMode; |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 28 | import android.view.LayoutInflater; |
Winson Chung | 5f2aa4e | 2010-08-20 14:49:25 -0700 | [diff] [blame^] | 29 | import android.view.Menu; |
| 30 | import android.view.MenuItem; |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 31 | import android.view.View; |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 32 | import android.view.animation.AnimationUtils; |
Winson Chung | 5f2aa4e | 2010-08-20 14:49:25 -0700 | [diff] [blame^] | 33 | import android.widget.Checkable; |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 34 | import android.widget.TextView; |
| 35 | |
| 36 | import com.android.launcher.R; |
| 37 | |
| 38 | /** |
| 39 | * An implementation of PagedView that populates the pages of the workspace |
| 40 | * with all of the user's applications. |
| 41 | */ |
| 42 | public class AllAppsPagedView extends PagedView |
Winson Chung | 5f2aa4e | 2010-08-20 14:49:25 -0700 | [diff] [blame^] | 43 | implements AllAppsView, View.OnClickListener, View.OnLongClickListener, DragSource, |
| 44 | DropTarget, ActionMode.Callback { |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 45 | |
| 46 | private static final String TAG = "AllAppsPagedView"; |
| 47 | private static final boolean DEBUG = false; |
| 48 | |
| 49 | private Launcher mLauncher; |
| 50 | private DragController mDragController; |
| 51 | |
| 52 | // preserve compatibility with 3D all apps: |
| 53 | // 0.0 -> hidden |
| 54 | // 1.0 -> shown and opaque |
| 55 | // intermediate values -> partially shown & partially opaque |
| 56 | private float mZoom; |
| 57 | |
| 58 | // set of all applications |
| 59 | private ArrayList<ApplicationInfo> mApps; |
| 60 | private ArrayList<ApplicationInfo> mFilteredApps; |
| 61 | |
| 62 | // the types of applications to filter |
| 63 | static final int ALL_APPS_FLAG = -1; |
| 64 | private int mAppFilter = ALL_APPS_FLAG; |
| 65 | |
| 66 | private int mCellCountX; |
| 67 | private int mCellCountY; |
| 68 | |
| 69 | private final LayoutInflater mInflater; |
| 70 | |
| 71 | public AllAppsPagedView(Context context) { |
| 72 | this(context, null); |
| 73 | } |
| 74 | |
| 75 | public AllAppsPagedView(Context context, AttributeSet attrs) { |
| 76 | this(context, attrs, 0); |
| 77 | } |
| 78 | |
| 79 | public AllAppsPagedView(Context context, AttributeSet attrs, int defStyle) { |
| 80 | super(context, attrs, defStyle); |
| 81 | TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PagedView, defStyle, 0); |
| 82 | mCellCountX = a.getInt(R.styleable.PagedView_cellCountX, 6); |
| 83 | mCellCountY = a.getInt(R.styleable.PagedView_cellCountY, 4); |
| 84 | mInflater = LayoutInflater.from(context); |
| 85 | a.recycle(); |
| 86 | setSoundEffectsEnabled(false); |
| 87 | } |
| 88 | |
| 89 | @Override |
| 90 | public void setLauncher(Launcher launcher) { |
| 91 | mLauncher = launcher; |
| 92 | } |
| 93 | |
| 94 | @Override |
| 95 | public void setDragController(DragController dragger) { |
| 96 | mDragController = dragger; |
| 97 | } |
| 98 | |
| 99 | public void setAppFilter(int filterType) { |
| 100 | mAppFilter = filterType; |
Winson Chung | 80baf5a | 2010-08-09 16:03:15 -0700 | [diff] [blame] | 101 | if (mApps != null) { |
| 102 | mFilteredApps = rebuildFilteredApps(mApps); |
Winson Chung | 86f7753 | 2010-08-24 11:08:22 -0700 | [diff] [blame] | 103 | setCurrentPage(0); |
Winson Chung | 80baf5a | 2010-08-09 16:03:15 -0700 | [diff] [blame] | 104 | invalidatePageData(); |
| 105 | } |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | @Override |
| 109 | public void zoom(float zoom, boolean animate) { |
| 110 | mZoom = zoom; |
| 111 | cancelLongPress(); |
| 112 | |
| 113 | if (isVisible()) { |
| 114 | getParent().bringChildToFront(this); |
| 115 | setVisibility(View.VISIBLE); |
| 116 | if (animate) { |
| 117 | startAnimation(AnimationUtils.loadAnimation(getContext(), |
| 118 | R.anim.all_apps_2d_fade_in)); |
| 119 | } else { |
| 120 | onAnimationEnd(); |
| 121 | } |
| 122 | } else { |
| 123 | if (animate) { |
| 124 | startAnimation(AnimationUtils.loadAnimation(getContext(), |
| 125 | R.anim.all_apps_2d_fade_out)); |
| 126 | } else { |
| 127 | onAnimationEnd(); |
| 128 | } |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | protected void onAnimationEnd() { |
| 133 | if (!isVisible()) { |
| 134 | setVisibility(View.GONE); |
| 135 | mZoom = 0.0f; |
Winson Chung | 5f2aa4e | 2010-08-20 14:49:25 -0700 | [diff] [blame^] | 136 | |
| 137 | endChoiceMode(); |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 138 | } else { |
| 139 | mZoom = 1.0f; |
| 140 | } |
| 141 | |
| 142 | if (mLauncher != null) |
| 143 | mLauncher.zoomed(mZoom); |
| 144 | } |
| 145 | |
| 146 | private int getChildIndexForGrandChild(View v) { |
| 147 | final int childCount = getChildCount(); |
| 148 | for (int i = 0; i < childCount; ++i) { |
Winson Chung | 5f2aa4e | 2010-08-20 14:49:25 -0700 | [diff] [blame^] | 149 | final PagedViewCellLayout layout = (PagedViewCellLayout) getChildAt(i); |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 150 | if (layout.indexOfChild(v) > -1) { |
| 151 | return i; |
| 152 | } |
| 153 | } |
| 154 | return -1; |
| 155 | } |
| 156 | |
| 157 | @Override |
| 158 | public void onClick(View v) { |
Winson Chung | 5f2aa4e | 2010-08-20 14:49:25 -0700 | [diff] [blame^] | 159 | // if we are already in a choice mode, then just change the selection |
| 160 | if (v instanceof Checkable) { |
| 161 | if (!isChoiceMode(CHOICE_MODE_NONE)) { |
| 162 | if (isChoiceMode(CHOICE_MODE_SINGLE)) { |
| 163 | // reset all the previously checked items if in single selection mode |
| 164 | resetCheckedGrandchildren(); |
| 165 | } |
| 166 | |
| 167 | // then toggle this one |
| 168 | Checkable c = (Checkable) v; |
| 169 | c.toggle(); |
| 170 | return; |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | // otherwise continue and launch the application |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 175 | int childIndex = getChildIndexForGrandChild(v); |
Winson Chung | 86f7753 | 2010-08-24 11:08:22 -0700 | [diff] [blame] | 176 | if (childIndex == getCurrentPage()) { |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 177 | final ApplicationInfo app = (ApplicationInfo) v.getTag(); |
| 178 | |
Winson Chung | 80baf5a | 2010-08-09 16:03:15 -0700 | [diff] [blame] | 179 | // animate some feedback to the click |
| 180 | animateClickFeedback(v, new Runnable() { |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 181 | @Override |
Winson Chung | 80baf5a | 2010-08-09 16:03:15 -0700 | [diff] [blame] | 182 | public void run() { |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 183 | mLauncher.startActivitySafely(app.intent, app); |
| 184 | } |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 185 | }); |
Winson Chung | 5f2aa4e | 2010-08-20 14:49:25 -0700 | [diff] [blame^] | 186 | |
| 187 | endChoiceMode(); |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 188 | } |
| 189 | } |
| 190 | |
| 191 | @Override |
| 192 | public boolean onLongClick(View v) { |
| 193 | if (!v.isInTouchMode()) { |
| 194 | return false; |
| 195 | } |
| 196 | |
Winson Chung | 5f2aa4e | 2010-08-20 14:49:25 -0700 | [diff] [blame^] | 197 | /* Uncomment this to enable selection mode with the action bar |
| 198 | |
| 199 | // start the choice mode, and select the item that was long-pressed |
| 200 | if (isChoiceMode(CHOICE_MODE_NONE)) { |
| 201 | startChoiceMode(CHOICE_MODE_SINGLE, this); |
| 202 | } |
| 203 | |
| 204 | if (v instanceof Checkable) { |
| 205 | // In preparation for drag, we always reset the checked grand children regardless of |
| 206 | // what choice mode we are in |
| 207 | resetCheckedGrandchildren(); |
| 208 | |
| 209 | // Toggle the selection on the dragged app |
| 210 | Checkable c = (Checkable) v; |
| 211 | c.toggle(); |
| 212 | } |
| 213 | */ |
| 214 | |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 215 | ApplicationInfo app = (ApplicationInfo) v.getTag(); |
| 216 | app = new ApplicationInfo(app); |
| 217 | |
| 218 | mDragController.startDrag(v, this, app, DragController.DRAG_ACTION_COPY); |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 219 | return true; |
| 220 | } |
| 221 | |
| 222 | @Override |
| 223 | public void onDropCompleted(View target, boolean success) { |
Winson Chung | 5f2aa4e | 2010-08-20 14:49:25 -0700 | [diff] [blame^] | 224 | // close the choice action mode if we have a proper drop |
| 225 | if (target != this) { |
| 226 | endChoiceMode(); |
| 227 | } |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 228 | } |
| 229 | |
| 230 | @Override |
| 231 | public boolean isVisible() { |
| 232 | return mZoom > 0.001f; |
| 233 | } |
| 234 | |
| 235 | @Override |
| 236 | public boolean isAnimating() { |
| 237 | return (getAnimation() != null); |
| 238 | } |
| 239 | |
| 240 | private ArrayList<ApplicationInfo> rebuildFilteredApps(ArrayList<ApplicationInfo> apps) { |
| 241 | ArrayList<ApplicationInfo> filteredApps = new ArrayList<ApplicationInfo>(); |
| 242 | if (mAppFilter == ALL_APPS_FLAG) { |
| 243 | return apps; |
| 244 | } else { |
| 245 | final int length = apps.size(); |
| 246 | for (int i = 0; i < length; ++i) { |
| 247 | ApplicationInfo info = apps.get(i); |
| 248 | if ((info.flags & mAppFilter) > 0) { |
| 249 | filteredApps.add(info); |
| 250 | } |
| 251 | } |
| 252 | } |
| 253 | return filteredApps; |
| 254 | } |
| 255 | |
| 256 | @Override |
| 257 | public void setApps(ArrayList<ApplicationInfo> list) { |
| 258 | mApps = list; |
Winson Chung | 80baf5a | 2010-08-09 16:03:15 -0700 | [diff] [blame] | 259 | Collections.sort(mApps, LauncherModel.APP_NAME_COMPARATOR); |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 260 | mFilteredApps = rebuildFilteredApps(mApps); |
Winson Chung | 241c3b4 | 2010-08-25 16:53:03 -0700 | [diff] [blame] | 261 | mPageViewIconCache.clear(); |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 262 | invalidatePageData(); |
| 263 | } |
| 264 | |
Winson Chung | 80baf5a | 2010-08-09 16:03:15 -0700 | [diff] [blame] | 265 | private void addAppsWithoutInvalidate(ArrayList<ApplicationInfo> list) { |
| 266 | // we add it in place, in alphabetical order |
| 267 | final int count = list.size(); |
| 268 | for (int i = 0; i < count; ++i) { |
| 269 | final ApplicationInfo info = list.get(i); |
| 270 | final int index = Collections.binarySearch(mApps, info, LauncherModel.APP_NAME_COMPARATOR); |
| 271 | if (index < 0) { |
| 272 | mApps.add(-(index + 1), info); |
| 273 | } |
| 274 | } |
| 275 | mFilteredApps = rebuildFilteredApps(mApps); |
| 276 | } |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 277 | @Override |
| 278 | public void addApps(ArrayList<ApplicationInfo> list) { |
Winson Chung | 80baf5a | 2010-08-09 16:03:15 -0700 | [diff] [blame] | 279 | addAppsWithoutInvalidate(list); |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 280 | invalidatePageData(); |
| 281 | } |
| 282 | |
Winson Chung | 80baf5a | 2010-08-09 16:03:15 -0700 | [diff] [blame] | 283 | private void removeAppsWithoutInvalidate(ArrayList<ApplicationInfo> list) { |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 284 | // loop through all the apps and remove apps that have the same component |
| 285 | final int length = list.size(); |
| 286 | for (int i = 0; i < length; ++i) { |
Winson Chung | 241c3b4 | 2010-08-25 16:53:03 -0700 | [diff] [blame] | 287 | final ApplicationInfo info = list.get(i); |
| 288 | int removeIndex = findAppByComponent(mApps, info); |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 289 | if (removeIndex > -1) { |
| 290 | mApps.remove(removeIndex); |
Winson Chung | 241c3b4 | 2010-08-25 16:53:03 -0700 | [diff] [blame] | 291 | mPageViewIconCache.removeOutline(info); |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 292 | } |
| 293 | } |
Winson Chung | 80baf5a | 2010-08-09 16:03:15 -0700 | [diff] [blame] | 294 | mFilteredApps = rebuildFilteredApps(mApps); |
| 295 | } |
| 296 | @Override |
| 297 | public void removeApps(ArrayList<ApplicationInfo> list) { |
| 298 | removeAppsWithoutInvalidate(list); |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 299 | invalidatePageData(); |
| 300 | } |
| 301 | |
| 302 | @Override |
| 303 | public void updateApps(ArrayList<ApplicationInfo> list) { |
Winson Chung | 80baf5a | 2010-08-09 16:03:15 -0700 | [diff] [blame] | 304 | removeAppsWithoutInvalidate(list); |
| 305 | addAppsWithoutInvalidate(list); |
| 306 | invalidatePageData(); |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 307 | } |
| 308 | |
| 309 | private int findAppByComponent(ArrayList<ApplicationInfo> list, ApplicationInfo item) { |
| 310 | ComponentName removeComponent = item.intent.getComponent(); |
| 311 | final int length = list.size(); |
| 312 | for (int i = 0; i < length; ++i) { |
| 313 | ApplicationInfo info = list.get(i); |
| 314 | if (info.intent.getComponent().equals(removeComponent)) { |
| 315 | return i; |
| 316 | } |
| 317 | } |
| 318 | return -1; |
| 319 | } |
| 320 | |
| 321 | @Override |
| 322 | public void dumpState() { |
| 323 | ApplicationInfo.dumpApplicationInfoList(TAG, "mApps", mApps); |
| 324 | } |
| 325 | |
| 326 | @Override |
| 327 | public void surrender() { |
| 328 | // do nothing? |
| 329 | } |
| 330 | |
| 331 | @Override |
| 332 | public void syncPages() { |
| 333 | // ensure that we have the right number of pages |
| 334 | int numPages = (int) Math.ceil((float) mFilteredApps.size() / (mCellCountX * mCellCountY)); |
| 335 | int curNumPages = getChildCount(); |
| 336 | // remove any extra pages after the "last" page |
| 337 | int extraPageDiff = curNumPages - numPages; |
| 338 | for (int i = 0; i < extraPageDiff; ++i) { |
| 339 | removeViewAt(numPages); |
| 340 | } |
| 341 | // add any necessary pages |
| 342 | for (int i = curNumPages; i < numPages; ++i) { |
| 343 | PagedViewCellLayout layout = new PagedViewCellLayout(getContext()); |
| 344 | layout.setCellCount(mCellCountX, mCellCountY); |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 345 | addView(layout); |
| 346 | } |
| 347 | |
| 348 | // bound the current page |
Winson Chung | 86f7753 | 2010-08-24 11:08:22 -0700 | [diff] [blame] | 349 | setCurrentPage(Math.max(0, Math.min(numPages - 1, getCurrentPage()))); |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 350 | } |
| 351 | |
| 352 | @Override |
| 353 | public void syncPageItems(int page) { |
| 354 | // ensure that we have the right number of items on the pages |
Winson Chung | 80baf5a | 2010-08-09 16:03:15 -0700 | [diff] [blame] | 355 | final int cellsPerPage = mCellCountX * mCellCountY; |
| 356 | final int startIndex = page * cellsPerPage; |
| 357 | final int endIndex = Math.min(startIndex + cellsPerPage, mFilteredApps.size()); |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 358 | PagedViewCellLayout layout = (PagedViewCellLayout) getChildAt(page); |
Winson Chung | 80baf5a | 2010-08-09 16:03:15 -0700 | [diff] [blame] | 359 | |
| 360 | final int curNumPageItems = layout.getChildCount(); |
| 361 | final int numPageItems = endIndex - startIndex; |
| 362 | |
| 363 | // remove any extra items |
| 364 | int extraPageItemsDiff = curNumPageItems - numPageItems; |
| 365 | for (int i = 0; i < extraPageItemsDiff; ++i) { |
| 366 | layout.removeViewAt(numPageItems); |
| 367 | } |
| 368 | // add any necessary items |
| 369 | for (int i = curNumPageItems; i < numPageItems; ++i) { |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 370 | TextView text = (TextView) mInflater.inflate(R.layout.all_apps_paged_view_application, layout, false); |
Winson Chung | 80baf5a | 2010-08-09 16:03:15 -0700 | [diff] [blame] | 371 | text.setOnClickListener(this); |
| 372 | text.setOnLongClickListener(this); |
| 373 | |
| 374 | layout.addViewToCellLayout(text, -1, i, |
| 375 | new PagedViewCellLayout.LayoutParams(0, 0, 1, 1)); |
| 376 | } |
| 377 | |
| 378 | // actually reapply to the existing text views |
| 379 | for (int i = startIndex; i < endIndex; ++i) { |
Winson Chung | 241c3b4 | 2010-08-25 16:53:03 -0700 | [diff] [blame] | 380 | final int index = i - startIndex; |
| 381 | final ApplicationInfo info = mFilteredApps.get(i); |
| 382 | PagedViewIcon icon = (PagedViewIcon) layout.getChildAt(index); |
| 383 | icon.applyFromApplicationInfo(info, mPageViewIconCache); |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 384 | |
Winson Chung | 80baf5a | 2010-08-09 16:03:15 -0700 | [diff] [blame] | 385 | PagedViewCellLayout.LayoutParams params = |
Winson Chung | 241c3b4 | 2010-08-25 16:53:03 -0700 | [diff] [blame] | 386 | (PagedViewCellLayout.LayoutParams) icon.getLayoutParams(); |
Winson Chung | 80baf5a | 2010-08-09 16:03:15 -0700 | [diff] [blame] | 387 | params.cellX = index % mCellCountX; |
| 388 | params.cellY = index / mCellCountX; |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 389 | } |
| 390 | } |
Winson Chung | 5f2aa4e | 2010-08-20 14:49:25 -0700 | [diff] [blame^] | 391 | |
| 392 | @Override |
| 393 | public boolean onPrepareActionMode(ActionMode mode, Menu menu) { |
| 394 | mDragController.addDropTarget(this); |
| 395 | |
| 396 | // REST TO BE IMPLEMENTED BY PAT |
| 397 | mode.setTitle("Customization title goes here"); |
| 398 | return true; |
| 399 | } |
| 400 | |
| 401 | @Override |
| 402 | public boolean onCreateActionMode(ActionMode mode, Menu menu) { |
| 403 | return true; |
| 404 | } |
| 405 | |
| 406 | @Override |
| 407 | public void onDestroyActionMode(ActionMode mode) { |
| 408 | mDragController.removeDropTarget(this); |
| 409 | endChoiceMode(); |
| 410 | } |
| 411 | |
| 412 | @Override |
| 413 | public boolean onActionItemClicked(ActionMode mode, MenuItem item) { |
| 414 | // TO BE IMPLEMENTED BY PAT |
| 415 | // get the checked grandchild, and handle the action here |
| 416 | return false; |
| 417 | } |
| 418 | |
| 419 | /* |
| 420 | * We don't actually use AllAppsPagedView as a drop target... it's only used to intercept a drop |
| 421 | * to the workspace. |
| 422 | */ |
| 423 | @Override |
| 424 | public boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset, |
| 425 | DragView dragView, Object dragInfo) { |
| 426 | return false; |
| 427 | } |
| 428 | @Override |
| 429 | public Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset, |
| 430 | DragView dragView, Object dragInfo, Rect recycle) { |
| 431 | return null; |
| 432 | } |
| 433 | @Override |
| 434 | public DropTarget getDropTargetDelegate(DragSource source, int x, int y, int xOffset, |
| 435 | int yOffset, DragView dragView, Object dragInfo) { |
| 436 | return null; |
| 437 | } |
| 438 | @Override |
| 439 | public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset, |
| 440 | DragView dragView, Object dragInfo) {} |
| 441 | @Override |
| 442 | public void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset, |
| 443 | DragView dragView, Object dragInfo) {} |
| 444 | @Override |
| 445 | public void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset, |
| 446 | DragView dragView, Object dragInfo) {} |
| 447 | @Override |
| 448 | public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset, |
| 449 | DragView dragView, Object dragInfo) {} |
Winson Chung | 321e9ee | 2010-08-09 13:37:56 -0700 | [diff] [blame] | 450 | } |