Merge "Ensure that we update the preview layout rule when not animating." into ub-launcher3-calgary
This commit is contained in:
@@ -2584,6 +2584,7 @@ public class Workspace extends PagedView
|
||||
fi.performCreateAnimation(destInfo, v, sourceInfo, dragView, folderLocation, scale,
|
||||
postAnimationRunnable);
|
||||
} else {
|
||||
fi.prepareCreate(v);
|
||||
fi.addItem(destInfo);
|
||||
fi.addItem(sourceInfo);
|
||||
}
|
||||
|
||||
@@ -262,14 +262,19 @@ public class FolderIcon extends FrameLayout implements FolderListener {
|
||||
}
|
||||
};
|
||||
|
||||
public Drawable prepareCreate(final View destView) {
|
||||
Drawable animateDrawable = getTopDrawable((TextView) destView);
|
||||
computePreviewDrawingParams(animateDrawable.getIntrinsicWidth(),
|
||||
destView.getMeasuredWidth());
|
||||
return animateDrawable;
|
||||
}
|
||||
|
||||
public void performCreateAnimation(final ShortcutInfo destInfo, final View destView,
|
||||
final ShortcutInfo srcInfo, final DragView srcView, Rect dstRect,
|
||||
float scaleRelativeToDragLayer, Runnable postAnimationRunnable) {
|
||||
|
||||
// These correspond two the drawable and view that the icon was dropped _onto_
|
||||
Drawable animateDrawable = getTopDrawable((TextView) destView);
|
||||
computePreviewDrawingParams(animateDrawable.getIntrinsicWidth(),
|
||||
destView.getMeasuredWidth());
|
||||
Drawable animateDrawable = prepareCreate(destView);
|
||||
|
||||
mReferenceDrawable = animateDrawable;
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ public class FolderPagedView extends PagedView {
|
||||
*/
|
||||
public int allocateRankForNewItem(ShortcutInfo info) {
|
||||
int rank = getItemCount();
|
||||
ArrayList<View> views = new ArrayList<View>(mFolder.getItemsInReadingOrder());
|
||||
ArrayList<View> views = new ArrayList<>(mFolder.getItemsInReadingOrder());
|
||||
views.add(rank, null);
|
||||
arrangeChildren(views, views.size(), false);
|
||||
setCurrentPage(rank / mMaxItemsPerPage);
|
||||
|
||||
Reference in New Issue
Block a user