diff options
author | cretin45 <cretin45@gmail.com> | 2016-02-01 13:30:13 -0800 |
---|---|---|
committer | Tom Powell <zifnab@zifnab06.net> | 2017-03-26 16:14:45 -0700 |
commit | f6f7c1779f8865534d249e1f722ec4a531a58748 (patch) | |
tree | 553a2ab7ae6fcec6b9d4d7030e4ab946e04add8f /src/com | |
parent | fbb223365d6cc0a6283abd549f9baa3931e55778 (diff) | |
download | android_packages_apps_Trebuchet-f6f7c1779f8865534d249e1f722ec4a531a58748.tar.gz android_packages_apps_Trebuchet-f6f7c1779f8865534d249e1f722ec4a531a58748.tar.bz2 android_packages_apps_Trebuchet-f6f7c1779f8865534d249e1f722ec4a531a58748.zip |
Trebuchet: Close folder layout when adding shortcut
Issue-id: CYNGNOS-1801
Change-Id: I6ee9324f650b5896c5097983b32c0e0963c28b42
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher3/Folder.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java index ccb12b62a..e8e8f2d16 100644 --- a/src/com/android/launcher3/Folder.java +++ b/src/com/android/launcher3/Folder.java @@ -34,6 +34,7 @@ import android.graphics.Rect; import android.graphics.drawable.BitmapDrawable; import android.os.Build; import android.os.Bundle; +import android.os.Handler; import android.os.PowerManager; import android.provider.Settings; import android.text.InputType; @@ -185,6 +186,8 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList private boolean mHiddenFolder = false; + private Handler mHandler; + @Thunk int mScrollHintDir = DragController.SCROLL_NONE; @Thunk int mCurrentScrollDir = DragController.SCROLL_NONE; @@ -197,6 +200,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList public Folder(Context context, AttributeSet attrs) { super(context, attrs); setAlwaysDrawnWithCacheEnabled(false); + mHandler = new Handler(); mInputMethodManager = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); @@ -1452,7 +1456,6 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList if (d.dragSource != this) { updateItemLocationsInDatabaseBatch(); } - mIsExternalDrag = false; } else { currentDragView = mCurrentDragView; mContent.addViewForRank(currentDragView, si, mEmptyCellRank); @@ -1488,6 +1491,17 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList // The animation has already been shown while opening the folder. mInfo.setOption(FolderInfo.FLAG_MULTI_PAGE_ANIMATION, true, mLauncher); } + + if (mIsExternalDrag) { + // Delay the close animation to reduce jank + mHandler.postDelayed(new Runnable() { + @Override + public void run() { + mLauncher.closeFolder(Folder.this); + } + }, 100); + mIsExternalDrag = false; + } } // This is used so the item doesn't immediately appear in the folder when added. In one case |