Merge "Moving item to its old position in folder if DnD is cancelled" into ub-launcher3-burnaby
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user