Merge "Moving item to its old position in folder if DnD is cancelled" into ub-launcher3-burnaby

This commit is contained in:
Sunny Goyal
2015-04-23 23:33:06 +00:00
committed by Android (Google) Code Review
2 changed files with 11 additions and 2 deletions
+10 -1
View File
@@ -745,9 +745,18 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
replaceFolderWithFinalItem();
}
} else {
rearrangeChildren();
// The drag failed, we need to return the item to the folder
ShortcutInfo info = (ShortcutInfo) d.dragInfo;
View icon = (mCurrentDragView != null && mCurrentDragView.getTag() == info)
? mCurrentDragView : mContent.createNewView(info);
ArrayList<View> views = getItemsInReadingOrder();
views.add(info.rank, icon);
mContent.arrangeChildren(views, views.size());
mItemsInvalidated = true;
mSuppressOnAdd = true;
mFolderIcon.onDrop(d);
mSuppressOnAdd = false;
}
if (target != this) {
@@ -363,7 +363,7 @@ public class FolderPagedView extends PagedView {
}
@SuppressLint("InflateParams")
private View createNewView(ShortcutInfo item) {
public View createNewView(ShortcutInfo item) {
final BubbleTextView textView = (BubbleTextView) mInflater.inflate(
R.layout.folder_application, null, false);
textView.applyFromShortcutInfo(item, mIconCache, false);