Fix two pieces of folder jank
-> Folder icon gets clipped when animating from dock
as well as a couple other cases (issue 5849615)
-> Blip when creating folder (issue 6623095)
Change-Id: I638c9a7876de2f87eb8e96a9eb192fa4a127fb4a
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
index db65a31..1163f9e 100644
--- a/src/com/android/launcher2/Folder.java
+++ b/src/com/android/launcher2/Folder.java
@@ -100,6 +100,8 @@
private boolean mSuppressFolderDeletion = false;
private boolean mItemAddedBackToSelfViaIcon = false;
FolderEditText mFolderName;
+ private float mFolderIconPivotX;
+ private float mFolderIconPivotY;
private boolean mIsEditingName = false;
private InputMethodManager mInputMethodManager;
@@ -839,20 +841,24 @@
int folderPivotY = height / 2 + (centeredTop - top);
setPivotX(folderPivotX);
setPivotY(folderPivotY);
- int folderIconPivotX = (int) (mFolderIcon.getMeasuredWidth() *
+ mFolderIconPivotX = (int) (mFolderIcon.getMeasuredWidth() *
(1.0f * folderPivotX / width));
- int folderIconPivotY = (int) (mFolderIcon.getMeasuredHeight() *
+ mFolderIconPivotY = (int) (mFolderIcon.getMeasuredHeight() *
(1.0f * folderPivotY / height));
- mFolderIcon.setPivotX(folderIconPivotX);
- mFolderIcon.setPivotY(folderIconPivotY);
-
lp.width = width;
lp.height = height;
lp.x = left;
lp.y = top;
}
+ float getPivotXForIconAnimation() {
+ return mFolderIconPivotX;
+ }
+ float getPivotYForIconAnimation() {
+ return mFolderIconPivotY;
+ }
+
private void setupContentForNumItems(int count) {
setupContentDimensions(count);