diff options
author | Jorim Jaggi <jjaggi@google.com> | 2014-01-16 15:30:42 -0800 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2014-06-06 22:54:28 -0700 |
commit | 0f89422e2821c407ea9feacbe078236391df581f (patch) | |
tree | 71fd6d17d6ad30431ca0abffdb2cafc4830077e0 /src/com/android/launcher3/DragLayer.java | |
parent | ae89bc568bf51719fbb41087352b45344a1ad5fa (diff) | |
download | android_packages_apps_Trebuchet-0f89422e2821c407ea9feacbe078236391df581f.tar.gz android_packages_apps_Trebuchet-0f89422e2821c407ea9feacbe078236391df581f.tar.bz2 android_packages_apps_Trebuchet-0f89422e2821c407ea9feacbe078236391df581f.zip |
Implement spring-loading of folders when dragging over.
Bug: 8912132
Change-Id: Id81889a133e56461df2e20599c4b40020818ba18
Diffstat (limited to 'src/com/android/launcher3/DragLayer.java')
-rw-r--r-- | src/com/android/launcher3/DragLayer.java | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/src/com/android/launcher3/DragLayer.java b/src/com/android/launcher3/DragLayer.java index ba193f96b..b832494a2 100644 --- a/src/com/android/launcher3/DragLayer.java +++ b/src/com/android/launcher3/DragLayer.java @@ -65,8 +65,6 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang private boolean mHoverPointClosesFolder = false; private Rect mHitRect = new Rect(); - private int mWorkspaceIndex = -1; - private int mQsbIndex = -1; public static final int ANIMATION_END_DISAPPEAR = 0; public static final int ANIMATION_END_FADE_OUT = 1; public static final int ANIMATION_END_REMAIN_VISIBLE = 2; @@ -75,6 +73,8 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang private final Rect mInsets = new Rect(); + private int mDragViewIndex; + /** * Used to create a new DragLayer from XML. * @@ -774,31 +774,26 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang } private void updateChildIndices() { - if (mLauncher != null) { - mWorkspaceIndex = indexOfChild(mLauncher.getWorkspace()); - mQsbIndex = indexOfChild(mLauncher.getSearchBar()); + mDragViewIndex = -1; + int childCount = getChildCount(); + for (int i = 0; i < childCount; i++) { + if (getChildAt(i) instanceof DragView) { + mDragViewIndex = i; + } } } @Override protected int getChildDrawingOrder(int childCount, int i) { - // TODO: We have turned off this custom drawing order because it now effects touch - // dispatch order. We need to sort that issue out and then decide how to go about this. - if (true || LauncherAppState.isScreenLandscape(getContext()) || - mWorkspaceIndex == -1 || mQsbIndex == -1 || - mLauncher.getWorkspace().isDrawingBackgroundGradient()) { + if (mDragViewIndex == -1) { return i; - } - - // This ensures that the workspace is drawn above the hotseat and qsb, - // except when the workspace is drawing a background gradient, in which - // case we want the workspace to stay behind these elements. - if (i == mQsbIndex) { - return mWorkspaceIndex; - } else if (i == mWorkspaceIndex) { - return mQsbIndex; - } else { + } else if (i == mDragViewIndex) { + return getChildCount()-1; + } else if (i < mDragViewIndex) { return i; + } else { + // i > mDragViewIndex + return i-1; } } |