From e857ff50ec6806204888bdb1bedc006df88581af Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Tue, 9 Nov 2010 12:21:34 -0800 Subject: [PATCH] Don't allow d&d move from boxes that don't support it Bug: 3177021 Change-Id: Ib5cfcef05794d6f83884d97f2096f3d4f6b3295c --- .../android/email/activity/MessageListFragment.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/com/android/email/activity/MessageListFragment.java b/src/com/android/email/activity/MessageListFragment.java index 309ba2f8e..2c82f01b8 100644 --- a/src/com/android/email/activity/MessageListFragment.java +++ b/src/com/android/email/activity/MessageListFragment.java @@ -471,8 +471,8 @@ public class MessageListFragment extends ListFragment @Override public void onProvideThumbnailMetrics(Point thumbnailSize, Point thumbnailTouchPoint) { - thumbnailSize.set(mWidth, (int) mHeight); - thumbnailTouchPoint.set((int) 20, (int) mHeight / 2); + thumbnailSize.set(mWidth, mHeight); + thumbnailTouchPoint.set(20, mHeight / 2); } @Override @@ -496,6 +496,13 @@ public class MessageListFragment extends ListFragment public boolean onItemLongClick(AdapterView parent, View view, int position, long id) { if (view != mListFooterView) { + // We can't move from combined accounts view + // We also need to check the actual mailbox to see if we can move items from it + if (mAccount == null || mMailbox == null) { + return false; + } else if (mMailboxId > 0 && !Mailbox.canMoveFrom(mActivity, mMailboxId)) { + return false; + } MessageListItem listItem = (MessageListItem)view; if (!mListAdapter.isSelected(listItem)) { toggleSelection(listItem);