Don't allow d&d move from boxes that don't support it

Bug: 3177021
Change-Id: Ib5cfcef05794d6f83884d97f2096f3d4f6b3295c
This commit is contained in:
Marc Blank 2010-11-09 12:21:34 -08:00
parent dc8f1afeb6
commit e857ff50ec

View File

@ -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);