diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2015-04-08 19:01:34 -0700 |
---|---|---|
committer | Hyunyoung Song <hyunyoungs@google.com> | 2015-04-08 19:01:34 -0700 |
commit | 3f471440a8b6b71d4c15501a96befd3b715c9e8f (patch) | |
tree | d5da39d089eed5096a4b10204153d5d6bb798624 /src/com/android/launcher3/DeleteDropTarget.java | |
parent | 85e3d4cc5ea4e554639868069f4fd409731f7bbb (diff) | |
download | android_packages_apps_Trebuchet-3f471440a8b6b71d4c15501a96befd3b715c9e8f.tar.gz android_packages_apps_Trebuchet-3f471440a8b6b71d4c15501a96befd3b715c9e8f.tar.bz2 android_packages_apps_Trebuchet-3f471440a8b6b71d4c15501a96befd3b715c9e8f.zip |
WidgetTray revamp work
- RecyclerView is rendering
- Animation is connected
- Drag and drop is now handled
- UI tweaking: background, margins, more to come.
- Flicker and preview not loading issue:
fixed height for the horizontal scroll view.
- Shortcuts are added
- Widget Preview loading should support shortPress for drop
- UI tweaks left: overlay of arrow when there are more items to scroll
- icons are added in the section header
- Sorting of widget sections and widget horizontal list
- Adding all the padding constants to dimen.xml file
- RecyclerView should only support one view type
For items to be addressed in follow up patches OR CLs,
TODO is added to the comment.
b/19897708
Change-Id: Ibfc4da1696a23d20bada93db46e126706eb13cdc
Diffstat (limited to 'src/com/android/launcher3/DeleteDropTarget.java')
-rw-r--r-- | src/com/android/launcher3/DeleteDropTarget.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/com/android/launcher3/DeleteDropTarget.java b/src/com/android/launcher3/DeleteDropTarget.java index 1f0dad221..62aa285ab 100644 --- a/src/com/android/launcher3/DeleteDropTarget.java +++ b/src/com/android/launcher3/DeleteDropTarget.java @@ -42,6 +42,7 @@ import android.view.animation.LinearInterpolator; import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.util.Thunk; +import com.android.launcher3.widget.WidgetsContainerView; public class DeleteDropTarget extends ButtonDropTarget { private static int DELETE_ANIMATION_DURATION = 285; @@ -100,8 +101,9 @@ public class DeleteDropTarget extends ButtonDropTarget { private boolean isAllAppsApplication(DragSource source, Object info) { return source.supportsAppInfoDropTarget() && (info instanceof AppInfo); } - private boolean isAllAppsWidget(DragSource source, Object info) { - if (source instanceof AppsCustomizePagedView) { + + private boolean isWidget(DragSource source, Object info) { + if (source instanceof WidgetsContainerView) { if (info instanceof PendingAddItemInfo) { PendingAddItemInfo addInfo = (PendingAddItemInfo) info; switch (addInfo.itemType) { @@ -173,7 +175,7 @@ public class DeleteDropTarget extends ButtonDropTarget { // If we are dragging an application from AppsCustomize, only show the control if we can // delete the app (it was downloaded), and rename the string to "uninstall" in such a case. // Hide the delete target if it is a widget from AppsCustomize. - if (!willAcceptDrop(info) || isAllAppsWidget(source, info)) { + if (!willAcceptDrop(info) || isWidget(source, info)) { isVisible = false; } if (useUninstallLabel) { @@ -489,13 +491,14 @@ public class DeleteDropTarget extends ButtonDropTarget { } public void onFlingToDelete(final DragObject d, int x, int y, PointF vel) { - final boolean isAllApps = d.dragSource instanceof AppsCustomizePagedView; + final boolean isWidgets = d.dragSource instanceof WidgetsContainerView; + final boolean isAllapps = d.dragSource instanceof AppsContainerView; // Don't highlight the icon as it's animating d.dragView.setColor(0); d.dragView.updateInitialScaleToCurrentScale(); // Don't highlight the target if we are flinging from AllApps - if (isAllApps) { + if (isWidgets || isAllapps) { resetHoverColor(); } @@ -545,7 +548,7 @@ public class DeleteDropTarget extends ButtonDropTarget { public void run() { // If we are dragging from AllApps, then we allow AppsCustomizePagedView to clean up // itself, otherwise, complete the drop to initiate the deletion process - if (!isAllApps) { + if (!isWidgets || !isAllapps) { mLauncher.exitSpringLoadedDragMode(); completeDrop(d); } |