blob: cbb46e2fddc436e41e8f551b233d99478052fdb0 [file] [log] [blame]
Winson Chung321e9ee2010-08-09 13:37:56 -07001/*
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
17package com.android.launcher2;
18
Patrick Dubroy9f7aec82010-09-06 11:03:37 -070019import com.android.launcher.R;
Winson Chung321e9ee2010-08-09 13:37:56 -070020
21import android.content.ComponentName;
22import android.content.Context;
23import android.content.res.TypedArray;
Winson Chung321e9ee2010-08-09 13:37:56 -070024import android.util.AttributeSet;
Winson Chung5f2aa4e2010-08-20 14:49:25 -070025import android.view.ActionMode;
Winson Chung321e9ee2010-08-09 13:37:56 -070026import android.view.LayoutInflater;
Winson Chung5f2aa4e2010-08-20 14:49:25 -070027import android.view.Menu;
28import android.view.MenuItem;
Winson Chung321e9ee2010-08-09 13:37:56 -070029import android.view.View;
Patrick Dubroydea9e932010-09-22 15:04:29 -070030import android.view.ViewGroup;
Winson Chung321e9ee2010-08-09 13:37:56 -070031import android.view.animation.AnimationUtils;
Winson Chung5f2aa4e2010-08-20 14:49:25 -070032import android.widget.Checkable;
Winson Chung321e9ee2010-08-09 13:37:56 -070033import android.widget.TextView;
34
Patrick Dubroy9f7aec82010-09-06 11:03:37 -070035import java.util.ArrayList;
36import java.util.Collections;
Winson Chung321e9ee2010-08-09 13:37:56 -070037
38/**
39 * An implementation of PagedView that populates the pages of the workspace
40 * with all of the user's applications.
41 */
42public class AllAppsPagedView extends PagedView
Winson Chung5f2aa4e2010-08-20 14:49:25 -070043 implements AllAppsView, View.OnClickListener, View.OnLongClickListener, DragSource,
44 DropTarget, ActionMode.Callback {
Winson Chung321e9ee2010-08-09 13:37:56 -070045
46 private static final String TAG = "AllAppsPagedView";
47 private static final boolean DEBUG = false;
48
Patrick Dubroy9f7aec82010-09-06 11:03:37 -070049 private static final int MENU_DELETE_APP = 1;
50 private static final int MENU_APP_INFO = 2;
51
Winson Chung321e9ee2010-08-09 13:37:56 -070052 private Launcher mLauncher;
53 private DragController mDragController;
54
55 // preserve compatibility with 3D all apps:
56 // 0.0 -> hidden
57 // 1.0 -> shown and opaque
58 // intermediate values -> partially shown & partially opaque
59 private float mZoom;
60
61 // set of all applications
62 private ArrayList<ApplicationInfo> mApps;
63 private ArrayList<ApplicationInfo> mFilteredApps;
64
65 // the types of applications to filter
66 static final int ALL_APPS_FLAG = -1;
67 private int mAppFilter = ALL_APPS_FLAG;
68
Winson Chung321e9ee2010-08-09 13:37:56 -070069 private final LayoutInflater mInflater;
70
Patrick Dubroydea9e932010-09-22 15:04:29 -070071 private ViewGroup mOrigInfoButtonParent;
72 private LayoutParams mOrigInfoButtonLayoutParams;
73
74 private ViewGroup mOrigDeleteZoneParent;
75 private LayoutParams mOrigDeleteZoneLayoutParams;
76
Winson Chung321e9ee2010-08-09 13:37:56 -070077 public AllAppsPagedView(Context context) {
78 this(context, null);
79 }
80
81 public AllAppsPagedView(Context context, AttributeSet attrs) {
82 this(context, attrs, 0);
83 }
84
85 public AllAppsPagedView(Context context, AttributeSet attrs, int defStyle) {
86 super(context, attrs, defStyle);
87 TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PagedView, defStyle, 0);
88 mCellCountX = a.getInt(R.styleable.PagedView_cellCountX, 6);
89 mCellCountY = a.getInt(R.styleable.PagedView_cellCountY, 4);
90 mInflater = LayoutInflater.from(context);
91 a.recycle();
92 setSoundEffectsEnabled(false);
93 }
94
95 @Override
96 public void setLauncher(Launcher launcher) {
97 mLauncher = launcher;
Patrick Dubroy2b9ff372010-09-07 17:49:27 -070098 mLauncher.setAllAppsPagedView(this);
Winson Chung321e9ee2010-08-09 13:37:56 -070099 }
100
101 @Override
102 public void setDragController(DragController dragger) {
103 mDragController = dragger;
104 }
105
106 public void setAppFilter(int filterType) {
107 mAppFilter = filterType;
Winson Chung80baf5a2010-08-09 16:03:15 -0700108 if (mApps != null) {
109 mFilteredApps = rebuildFilteredApps(mApps);
Winson Chung86f77532010-08-24 11:08:22 -0700110 setCurrentPage(0);
Winson Chung80baf5a2010-08-09 16:03:15 -0700111 invalidatePageData();
112 }
Winson Chung321e9ee2010-08-09 13:37:56 -0700113 }
114
115 @Override
116 public void zoom(float zoom, boolean animate) {
117 mZoom = zoom;
118 cancelLongPress();
119
120 if (isVisible()) {
121 getParent().bringChildToFront(this);
122 setVisibility(View.VISIBLE);
123 if (animate) {
124 startAnimation(AnimationUtils.loadAnimation(getContext(),
125 R.anim.all_apps_2d_fade_in));
126 } else {
127 onAnimationEnd();
128 }
129 } else {
130 if (animate) {
131 startAnimation(AnimationUtils.loadAnimation(getContext(),
132 R.anim.all_apps_2d_fade_out));
133 } else {
134 onAnimationEnd();
135 }
136 }
137 }
138
139 protected void onAnimationEnd() {
140 if (!isVisible()) {
141 setVisibility(View.GONE);
142 mZoom = 0.0f;
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700143
144 endChoiceMode();
Winson Chung321e9ee2010-08-09 13:37:56 -0700145 } else {
146 mZoom = 1.0f;
147 }
148
149 if (mLauncher != null)
150 mLauncher.zoomed(mZoom);
151 }
152
153 private int getChildIndexForGrandChild(View v) {
154 final int childCount = getChildCount();
155 for (int i = 0; i < childCount; ++i) {
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700156 final PagedViewCellLayout layout = (PagedViewCellLayout) getChildAt(i);
Winson Chung321e9ee2010-08-09 13:37:56 -0700157 if (layout.indexOfChild(v) > -1) {
158 return i;
159 }
160 }
161 return -1;
162 }
163
164 @Override
165 public void onClick(View v) {
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700166 // if we are already in a choice mode, then just change the selection
167 if (v instanceof Checkable) {
168 if (!isChoiceMode(CHOICE_MODE_NONE)) {
Patrick Dubroy9f7aec82010-09-06 11:03:37 -0700169 Checkable c = (Checkable) v;
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700170 if (isChoiceMode(CHOICE_MODE_SINGLE)) {
Patrick Dubroy9f7aec82010-09-06 11:03:37 -0700171 // Uncheck all the other grandchildren, and toggle the clicked one
172 boolean wasChecked = c.isChecked();
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700173 resetCheckedGrandchildren();
Patrick Dubroy9f7aec82010-09-06 11:03:37 -0700174 c.setChecked(!wasChecked);
175 } else {
176 c.toggle();
177 }
178 if (getCheckedGrandchildren().size() == 0) {
179 endChoiceMode();
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700180 }
181
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700182 return;
183 }
184 }
185
186 // otherwise continue and launch the application
Winson Chung321e9ee2010-08-09 13:37:56 -0700187 int childIndex = getChildIndexForGrandChild(v);
Winson Chung86f77532010-08-24 11:08:22 -0700188 if (childIndex == getCurrentPage()) {
Winson Chung321e9ee2010-08-09 13:37:56 -0700189 final ApplicationInfo app = (ApplicationInfo) v.getTag();
190
Winson Chung80baf5a2010-08-09 16:03:15 -0700191 // animate some feedback to the click
192 animateClickFeedback(v, new Runnable() {
Winson Chung321e9ee2010-08-09 13:37:56 -0700193 @Override
Winson Chung80baf5a2010-08-09 16:03:15 -0700194 public void run() {
Winson Chung321e9ee2010-08-09 13:37:56 -0700195 mLauncher.startActivitySafely(app.intent, app);
196 }
Winson Chung321e9ee2010-08-09 13:37:56 -0700197 });
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700198
199 endChoiceMode();
Winson Chung321e9ee2010-08-09 13:37:56 -0700200 }
201 }
202
203 @Override
204 public boolean onLongClick(View v) {
205 if (!v.isInTouchMode()) {
206 return false;
207 }
208
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700209 if (v instanceof Checkable) {
210 // In preparation for drag, we always reset the checked grand children regardless of
211 // what choice mode we are in
212 resetCheckedGrandchildren();
213
214 // Toggle the selection on the dragged app
215 Checkable c = (Checkable) v;
216 c.toggle();
217 }
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700218
Patrick Dubroy430c53b2010-09-08 16:01:19 -0700219 // Start choice mode AFTER the item is selected
220 if (isChoiceMode(CHOICE_MODE_NONE)) {
221 startChoiceMode(CHOICE_MODE_SINGLE, this);
222 }
223
Winson Chung321e9ee2010-08-09 13:37:56 -0700224 ApplicationInfo app = (ApplicationInfo) v.getTag();
225 app = new ApplicationInfo(app);
226
Michael Jurka3e7c7632010-10-02 16:01:03 -0700227 mLauncher.getWorkspace().onDragStartedWithItemSpans(1, 1);
Winson Chung321e9ee2010-08-09 13:37:56 -0700228 mDragController.startDrag(v, this, app, DragController.DRAG_ACTION_COPY);
Winson Chung321e9ee2010-08-09 13:37:56 -0700229 return true;
230 }
231
232 @Override
233 public void onDropCompleted(View target, boolean success) {
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700234 // close the choice action mode if we have a proper drop
235 if (target != this) {
236 endChoiceMode();
237 }
Michael Jurka3e7c7632010-10-02 16:01:03 -0700238 mLauncher.getWorkspace().onDragStopped();
Winson Chung321e9ee2010-08-09 13:37:56 -0700239 }
240
241 @Override
242 public boolean isVisible() {
243 return mZoom > 0.001f;
244 }
245
246 @Override
247 public boolean isAnimating() {
248 return (getAnimation() != null);
249 }
250
251 private ArrayList<ApplicationInfo> rebuildFilteredApps(ArrayList<ApplicationInfo> apps) {
252 ArrayList<ApplicationInfo> filteredApps = new ArrayList<ApplicationInfo>();
253 if (mAppFilter == ALL_APPS_FLAG) {
254 return apps;
255 } else {
256 final int length = apps.size();
257 for (int i = 0; i < length; ++i) {
258 ApplicationInfo info = apps.get(i);
259 if ((info.flags & mAppFilter) > 0) {
260 filteredApps.add(info);
261 }
262 }
263 }
264 return filteredApps;
265 }
266
267 @Override
268 public void setApps(ArrayList<ApplicationInfo> list) {
269 mApps = list;
Winson Chung80baf5a2010-08-09 16:03:15 -0700270 Collections.sort(mApps, LauncherModel.APP_NAME_COMPARATOR);
Winson Chung321e9ee2010-08-09 13:37:56 -0700271 mFilteredApps = rebuildFilteredApps(mApps);
Winson Chung241c3b42010-08-25 16:53:03 -0700272 mPageViewIconCache.clear();
Winson Chung321e9ee2010-08-09 13:37:56 -0700273 invalidatePageData();
274 }
275
Winson Chung80baf5a2010-08-09 16:03:15 -0700276 private void addAppsWithoutInvalidate(ArrayList<ApplicationInfo> list) {
277 // we add it in place, in alphabetical order
278 final int count = list.size();
279 for (int i = 0; i < count; ++i) {
280 final ApplicationInfo info = list.get(i);
281 final int index = Collections.binarySearch(mApps, info, LauncherModel.APP_NAME_COMPARATOR);
282 if (index < 0) {
283 mApps.add(-(index + 1), info);
284 }
285 }
286 mFilteredApps = rebuildFilteredApps(mApps);
287 }
Winson Chung321e9ee2010-08-09 13:37:56 -0700288 @Override
289 public void addApps(ArrayList<ApplicationInfo> list) {
Winson Chung80baf5a2010-08-09 16:03:15 -0700290 addAppsWithoutInvalidate(list);
Winson Chung321e9ee2010-08-09 13:37:56 -0700291 invalidatePageData();
292 }
293
Winson Chung80baf5a2010-08-09 16:03:15 -0700294 private void removeAppsWithoutInvalidate(ArrayList<ApplicationInfo> list) {
Winson Chung321e9ee2010-08-09 13:37:56 -0700295 // loop through all the apps and remove apps that have the same component
296 final int length = list.size();
297 for (int i = 0; i < length; ++i) {
Winson Chung241c3b42010-08-25 16:53:03 -0700298 final ApplicationInfo info = list.get(i);
299 int removeIndex = findAppByComponent(mApps, info);
Winson Chung321e9ee2010-08-09 13:37:56 -0700300 if (removeIndex > -1) {
301 mApps.remove(removeIndex);
Winson Chung241c3b42010-08-25 16:53:03 -0700302 mPageViewIconCache.removeOutline(info);
Winson Chung321e9ee2010-08-09 13:37:56 -0700303 }
304 }
Winson Chung80baf5a2010-08-09 16:03:15 -0700305 mFilteredApps = rebuildFilteredApps(mApps);
306 }
307 @Override
308 public void removeApps(ArrayList<ApplicationInfo> list) {
309 removeAppsWithoutInvalidate(list);
Winson Chung321e9ee2010-08-09 13:37:56 -0700310 invalidatePageData();
311 }
312
313 @Override
314 public void updateApps(ArrayList<ApplicationInfo> list) {
Winson Chung80baf5a2010-08-09 16:03:15 -0700315 removeAppsWithoutInvalidate(list);
316 addAppsWithoutInvalidate(list);
317 invalidatePageData();
Winson Chung321e9ee2010-08-09 13:37:56 -0700318 }
319
320 private int findAppByComponent(ArrayList<ApplicationInfo> list, ApplicationInfo item) {
321 ComponentName removeComponent = item.intent.getComponent();
322 final int length = list.size();
323 for (int i = 0; i < length; ++i) {
324 ApplicationInfo info = list.get(i);
325 if (info.intent.getComponent().equals(removeComponent)) {
326 return i;
327 }
328 }
329 return -1;
330 }
331
332 @Override
333 public void dumpState() {
334 ApplicationInfo.dumpApplicationInfoList(TAG, "mApps", mApps);
335 }
336
337 @Override
338 public void surrender() {
339 // do nothing?
340 }
341
342 @Override
343 public void syncPages() {
344 // ensure that we have the right number of pages
345 int numPages = (int) Math.ceil((float) mFilteredApps.size() / (mCellCountX * mCellCountY));
346 int curNumPages = getChildCount();
347 // remove any extra pages after the "last" page
348 int extraPageDiff = curNumPages - numPages;
349 for (int i = 0; i < extraPageDiff; ++i) {
350 removeViewAt(numPages);
351 }
352 // add any necessary pages
353 for (int i = curNumPages; i < numPages; ++i) {
354 PagedViewCellLayout layout = new PagedViewCellLayout(getContext());
355 layout.setCellCount(mCellCountX, mCellCountY);
Winson Chung5ffd8ea2010-09-23 18:40:29 -0700356 layout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop,
357 mPageLayoutPaddingRight, mPageLayoutPaddingBottom);
Winson Chung321e9ee2010-08-09 13:37:56 -0700358 addView(layout);
359 }
360
361 // bound the current page
Winson Chung86f77532010-08-24 11:08:22 -0700362 setCurrentPage(Math.max(0, Math.min(numPages - 1, getCurrentPage())));
Winson Chung321e9ee2010-08-09 13:37:56 -0700363 }
364
365 @Override
366 public void syncPageItems(int page) {
367 // ensure that we have the right number of items on the pages
Winson Chung80baf5a2010-08-09 16:03:15 -0700368 final int cellsPerPage = mCellCountX * mCellCountY;
369 final int startIndex = page * cellsPerPage;
370 final int endIndex = Math.min(startIndex + cellsPerPage, mFilteredApps.size());
Winson Chung321e9ee2010-08-09 13:37:56 -0700371 PagedViewCellLayout layout = (PagedViewCellLayout) getChildAt(page);
Winson Chung80baf5a2010-08-09 16:03:15 -0700372
373 final int curNumPageItems = layout.getChildCount();
374 final int numPageItems = endIndex - startIndex;
375
376 // remove any extra items
377 int extraPageItemsDiff = curNumPageItems - numPageItems;
378 for (int i = 0; i < extraPageItemsDiff; ++i) {
379 layout.removeViewAt(numPageItems);
380 }
381 // add any necessary items
382 for (int i = curNumPageItems; i < numPageItems; ++i) {
Winson Chung321e9ee2010-08-09 13:37:56 -0700383 TextView text = (TextView) mInflater.inflate(R.layout.all_apps_paged_view_application, layout, false);
Winson Chung80baf5a2010-08-09 16:03:15 -0700384 text.setOnClickListener(this);
385 text.setOnLongClickListener(this);
386
387 layout.addViewToCellLayout(text, -1, i,
388 new PagedViewCellLayout.LayoutParams(0, 0, 1, 1));
389 }
390
391 // actually reapply to the existing text views
392 for (int i = startIndex; i < endIndex; ++i) {
Winson Chung241c3b42010-08-25 16:53:03 -0700393 final int index = i - startIndex;
394 final ApplicationInfo info = mFilteredApps.get(i);
395 PagedViewIcon icon = (PagedViewIcon) layout.getChildAt(index);
396 icon.applyFromApplicationInfo(info, mPageViewIconCache);
Winson Chung321e9ee2010-08-09 13:37:56 -0700397
Winson Chung80baf5a2010-08-09 16:03:15 -0700398 PagedViewCellLayout.LayoutParams params =
Winson Chung241c3b42010-08-25 16:53:03 -0700399 (PagedViewCellLayout.LayoutParams) icon.getLayoutParams();
Winson Chung80baf5a2010-08-09 16:03:15 -0700400 params.cellX = index % mCellCountX;
401 params.cellY = index / mCellCountX;
Winson Chung321e9ee2010-08-09 13:37:56 -0700402 }
403 }
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700404
405 @Override
406 public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
Michael Jurka3125d9d2010-09-27 11:30:20 -0700407 mode.setTitle(R.string.cab_app_selection_text);
Patrick Dubroy430c53b2010-09-08 16:01:19 -0700408
Patrick Dubroydea9e932010-09-22 15:04:29 -0700409 // Until the workspace has a selection mode and the CAB supports drag-and-drop, we
410 // take a hybrid approach: grab the views from the workspace and stuff them into the CAB.
411 // When the action mode is done, restore the views to their original place in the toolbar.
412
413 ApplicationInfoDropTarget infoButton =
414 (ApplicationInfoDropTarget) mLauncher.findViewById(R.id.info_button);
415 mOrigInfoButtonParent = (ViewGroup) infoButton.getParent();
416 mOrigInfoButtonLayoutParams = infoButton.getLayoutParams();
417 mOrigInfoButtonParent.removeView(infoButton);
418 infoButton.setManageVisibility(false);
419 infoButton.setVisibility(View.VISIBLE);
420
421 DeleteZone deleteZone = (DeleteZone) mLauncher.findViewById(R.id.delete_zone);
422 mOrigDeleteZoneParent = (ViewGroup) deleteZone.getParent();
423 mOrigDeleteZoneLayoutParams = deleteZone.getLayoutParams();
424 mOrigDeleteZoneParent.removeView(deleteZone);
425 deleteZone.setManageVisibility(false);
426 deleteZone.setVisibility(View.VISIBLE);
427
428 menu.add(0, MENU_APP_INFO, 0, R.string.cab_menu_app_info).setActionView(infoButton);
429 menu.add(0, MENU_DELETE_APP, 0, R.string.cab_menu_delete_app).setActionView(deleteZone);
430
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700431 return true;
432 }
433
434 @Override
435 public boolean onCreateActionMode(ActionMode mode, Menu menu) {
Patrick Dubroy9f7aec82010-09-06 11:03:37 -0700436 mDragController.addDropTarget(this);
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700437 return true;
438 }
439
440 @Override
441 public void onDestroyActionMode(ActionMode mode) {
Patrick Dubroydea9e932010-09-22 15:04:29 -0700442 // Re-parent the drop targets into the toolbar, and restore their layout params
443 ApplicationInfoDropTarget infoButton =
444 (ApplicationInfoDropTarget) mLauncher.findViewById(R.id.info_button);
445 ((ViewGroup) infoButton.getParent()).removeView(infoButton);
446 mOrigInfoButtonParent.addView(infoButton, mOrigInfoButtonLayoutParams);
447 infoButton.setVisibility(View.GONE);
448 infoButton.setManageVisibility(true);
449
450 DeleteZone deleteZone = (DeleteZone) mLauncher.findViewById(R.id.delete_zone);
451 ((ViewGroup) deleteZone.getParent()).removeView(deleteZone);
452 mOrigDeleteZoneParent.addView(deleteZone, mOrigDeleteZoneLayoutParams);
453 deleteZone.setVisibility(View.GONE);
454 deleteZone.setManageVisibility(true);
455
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700456 mDragController.removeDropTarget(this);
457 endChoiceMode();
458 }
459
460 @Override
461 public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
Patrick Dubroy9f7aec82010-09-06 11:03:37 -0700462 final int id = item.getItemId();
463
464 // Assumes that we are in CHOICE_MODE_SINGLE
Patrick Dubroy430c53b2010-09-08 16:01:19 -0700465 final ApplicationInfo appInfo = (ApplicationInfo) getChosenItem();
Patrick Dubroy9f7aec82010-09-06 11:03:37 -0700466
467 if (id == MENU_APP_INFO) {
468 mLauncher.startApplicationDetailsActivity(appInfo.componentName);
469 } else if (id == MENU_DELETE_APP) {
Patrick Dubroy5539af72010-09-07 15:22:01 -0700470 mLauncher.startApplicationUninstallActivity(appInfo);
Patrick Dubroy9f7aec82010-09-06 11:03:37 -0700471 }
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700472 return false;
473 }
474
475 /*
476 * We don't actually use AllAppsPagedView as a drop target... it's only used to intercept a drop
477 * to the workspace.
478 */
479 @Override
480 public boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset,
481 DragView dragView, Object dragInfo) {
482 return false;
483 }
484 @Override
Winson Chung5f2aa4e2010-08-20 14:49:25 -0700485 public DropTarget getDropTargetDelegate(DragSource source, int x, int y, int xOffset,
486 int yOffset, DragView dragView, Object dragInfo) {
487 return null;
488 }
489 @Override
490 public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset,
491 DragView dragView, Object dragInfo) {}
492 @Override
493 public void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset,
494 DragView dragView, Object dragInfo) {}
495 @Override
496 public void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset,
497 DragView dragView, Object dragInfo) {}
498 @Override
499 public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset,
500 DragView dragView, Object dragInfo) {}
Michael Jurka0280c3b2010-09-17 15:00:07 -0700501
502 public boolean isDropEnabled() {
503 return true;
504 }
Winson Chung321e9ee2010-08-09 13:37:56 -0700505}