Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Daniel Sandler | 325dc23 | 2013-06-05 22:57:57 -0400 | [diff] [blame] | 17 | package com.android.launcher3; |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 18 | |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 19 | import android.animation.TimeInterpolator; |
| 20 | import android.animation.ValueAnimator; |
| 21 | import android.animation.ValueAnimator.AnimatorUpdateListener; |
Sunny Goyal | 71b5c0b | 2015-01-08 16:59:04 -0800 | [diff] [blame^] | 22 | import android.annotation.TargetApi; |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 23 | import android.content.ComponentName; |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 24 | import android.content.Context; |
Winson Chung | a62e9fd | 2011-07-11 15:20:48 -0700 | [diff] [blame] | 25 | import android.content.res.ColorStateList; |
Winson Chung | 201bc82 | 2011-06-20 15:41:53 -0700 | [diff] [blame] | 26 | import android.content.res.Configuration; |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 27 | import android.content.res.Resources; |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 28 | import android.graphics.PointF; |
Adam Cohen | d4d7aa5 | 2011-07-19 21:47:37 -0700 | [diff] [blame] | 29 | import android.graphics.Rect; |
Winson Chung | 967289b | 2011-06-30 18:09:30 -0700 | [diff] [blame] | 30 | import android.graphics.drawable.TransitionDrawable; |
Michael Jurka | 4346746 | 2013-11-14 12:03:58 +0100 | [diff] [blame] | 31 | import android.os.AsyncTask; |
Jason Monk | 6a2c778 | 2014-09-02 13:13:24 -0400 | [diff] [blame] | 32 | import android.os.Build; |
| 33 | import android.os.Bundle; |
Jason Monk | 950a467 | 2014-07-15 09:22:36 -0400 | [diff] [blame] | 34 | import android.os.UserManager; |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 35 | import android.util.AttributeSet; |
| 36 | import android.view.View; |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 37 | import android.view.ViewConfiguration; |
Winson Chung | a6427b1 | 2011-07-27 10:53:39 -0700 | [diff] [blame] | 38 | import android.view.ViewGroup; |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 39 | import android.view.animation.AnimationUtils; |
Adam Cohen | d4d7aa5 | 2011-07-19 21:47:37 -0700 | [diff] [blame] | 40 | import android.view.animation.DecelerateInterpolator; |
Winson Chung | 61967cb | 2012-02-28 18:11:33 -0800 | [diff] [blame] | 41 | import android.view.animation.LinearInterpolator; |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 42 | |
Kenny Guy | ed13187 | 2014-04-30 03:02:21 +0100 | [diff] [blame] | 43 | import com.android.launcher3.compat.UserHandleCompat; |
| 44 | |
Winson Chung | 61fa419 | 2011-06-12 15:15:29 -0700 | [diff] [blame] | 45 | public class DeleteDropTarget extends ButtonDropTarget { |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 46 | private static int DELETE_ANIMATION_DURATION = 285; |
Winson Chung | 6e1bdaf | 2012-05-29 17:03:45 -0700 | [diff] [blame] | 47 | private static int FLING_DELETE_ANIMATION_DURATION = 350; |
| 48 | private static float FLING_TO_DELETE_FRICTION = 0.035f; |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 49 | private static int MODE_FLING_DELETE_TO_TRASH = 0; |
| 50 | private static int MODE_FLING_DELETE_ALONG_VECTOR = 1; |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 51 | |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 52 | private final int mFlingDeleteMode = MODE_FLING_DELETE_ALONG_VECTOR; |
| 53 | |
Winson Chung | a62e9fd | 2011-07-11 15:20:48 -0700 | [diff] [blame] | 54 | private ColorStateList mOriginalTextColor; |
Adam Cohen | ebea84d | 2011-11-09 17:20:41 -0800 | [diff] [blame] | 55 | private TransitionDrawable mUninstallDrawable; |
| 56 | private TransitionDrawable mRemoveDrawable; |
| 57 | private TransitionDrawable mCurrentDrawable; |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 58 | |
Michael Jurka | 24715c7 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 59 | private boolean mWaitingForUninstall = false; |
| 60 | |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 61 | public DeleteDropTarget(Context context, AttributeSet attrs) { |
| 62 | this(context, attrs, 0); |
| 63 | } |
| 64 | |
| 65 | public DeleteDropTarget(Context context, AttributeSet attrs, int defStyle) { |
| 66 | super(context, attrs, defStyle); |
| 67 | } |
| 68 | |
| 69 | @Override |
| 70 | protected void onFinishInflate() { |
| 71 | super.onFinishInflate(); |
| 72 | |
| 73 | // Get the drawable |
Winson Chung | a6427b1 | 2011-07-27 10:53:39 -0700 | [diff] [blame] | 74 | mOriginalTextColor = getTextColors(); |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 75 | |
| 76 | // Get the hover color |
| 77 | Resources r = getResources(); |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 78 | mHoverColor = r.getColor(R.color.delete_target_hover_tint); |
Adam Cohen | ebea84d | 2011-11-09 17:20:41 -0800 | [diff] [blame] | 79 | mUninstallDrawable = (TransitionDrawable) |
| 80 | r.getDrawable(R.drawable.uninstall_target_selector); |
| 81 | mRemoveDrawable = (TransitionDrawable) r.getDrawable(R.drawable.remove_target_selector); |
| 82 | |
| 83 | mRemoveDrawable.setCrossFadeEnabled(true); |
| 84 | mUninstallDrawable.setCrossFadeEnabled(true); |
| 85 | |
| 86 | // The current drawable is set to either the remove drawable or the uninstall drawable |
| 87 | // and is initially set to the remove drawable, as set in the layout xml. |
Winson Chung | 947245b | 2012-05-15 16:34:19 -0700 | [diff] [blame] | 88 | mCurrentDrawable = (TransitionDrawable) getCurrentDrawable(); |
Winson Chung | 201bc82 | 2011-06-20 15:41:53 -0700 | [diff] [blame] | 89 | |
| 90 | // Remove the text in the Phone UI in landscape |
| 91 | int orientation = getResources().getConfiguration().orientation; |
| 92 | if (orientation == Configuration.ORIENTATION_LANDSCAPE) { |
Daniel Sandler | e4f9891 | 2013-06-25 15:13:26 -0400 | [diff] [blame] | 93 | if (!LauncherAppState.getInstance().isScreenLarge()) { |
Winson Chung | a6427b1 | 2011-07-27 10:53:39 -0700 | [diff] [blame] | 94 | setText(""); |
Winson Chung | 201bc82 | 2011-06-20 15:41:53 -0700 | [diff] [blame] | 95 | } |
| 96 | } |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 97 | } |
| 98 | |
| 99 | private boolean isAllAppsApplication(DragSource source, Object info) { |
Mathew Inwood | 1eeb3fc | 2013-11-25 17:01:34 +0000 | [diff] [blame] | 100 | return source.supportsAppInfoDropTarget() && (info instanceof AppInfo); |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 101 | } |
| 102 | private boolean isAllAppsWidget(DragSource source, Object info) { |
Winson Chung | 11a4937 | 2012-04-27 15:12:38 -0700 | [diff] [blame] | 103 | if (source instanceof AppsCustomizePagedView) { |
| 104 | if (info instanceof PendingAddItemInfo) { |
| 105 | PendingAddItemInfo addInfo = (PendingAddItemInfo) info; |
| 106 | switch (addInfo.itemType) { |
| 107 | case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT: |
| 108 | case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET: |
Adam Cohen | 5940042 | 2014-03-05 18:07:04 -0800 | [diff] [blame] | 109 | case LauncherSettings.Favorites.ITEM_TYPE_CUSTOM_APPWIDGET: |
Winson Chung | 11a4937 | 2012-04-27 15:12:38 -0700 | [diff] [blame] | 110 | return true; |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | return false; |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 115 | } |
Michael Jurka | 0b4870d | 2011-07-10 13:39:08 -0700 | [diff] [blame] | 116 | private boolean isDragSourceWorkspaceOrFolder(DragObject d) { |
| 117 | return (d.dragSource instanceof Workspace) || (d.dragSource instanceof Folder); |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 118 | } |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 119 | |
Winson Chung | a48487a | 2012-03-20 16:19:37 -0700 | [diff] [blame] | 120 | private void setHoverColor() { |
Adam Cohen | fe9da81 | 2014-08-04 17:08:01 -0700 | [diff] [blame] | 121 | if (mCurrentDrawable != null) { |
| 122 | mCurrentDrawable.startTransition(mTransitionDuration); |
| 123 | } |
Winson Chung | a48487a | 2012-03-20 16:19:37 -0700 | [diff] [blame] | 124 | setTextColor(mHoverColor); |
| 125 | } |
| 126 | private void resetHoverColor() { |
Adam Cohen | fe9da81 | 2014-08-04 17:08:01 -0700 | [diff] [blame] | 127 | if (mCurrentDrawable != null) { |
| 128 | mCurrentDrawable.resetTransition(); |
| 129 | } |
Winson Chung | a48487a | 2012-03-20 16:19:37 -0700 | [diff] [blame] | 130 | setTextColor(mOriginalTextColor); |
| 131 | } |
| 132 | |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 133 | @Override |
| 134 | public boolean acceptDrop(DragObject d) { |
Adam Cohen | 7c4c510 | 2013-06-14 17:42:35 -0700 | [diff] [blame] | 135 | return willAcceptDrop(d.dragInfo); |
| 136 | } |
| 137 | |
| 138 | public static boolean willAcceptDrop(Object info) { |
| 139 | if (info instanceof ItemInfo) { |
| 140 | ItemInfo item = (ItemInfo) info; |
| 141 | if (item.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET || |
Adam Cohen | 5940042 | 2014-03-05 18:07:04 -0800 | [diff] [blame] | 142 | item.itemType == LauncherSettings.Favorites.ITEM_TYPE_CUSTOM_APPWIDGET || |
Adam Cohen | 7c4c510 | 2013-06-14 17:42:35 -0700 | [diff] [blame] | 143 | item.itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) { |
| 144 | return true; |
| 145 | } |
Michael Jurka | ed3d4df | 2013-09-12 18:09:24 +0200 | [diff] [blame] | 146 | |
Nilesh Agrawal | 16f3ea8 | 2014-01-09 17:14:01 -0800 | [diff] [blame] | 147 | if (!LauncherAppState.isDisableAllApps() && |
Michael Jurka | 5e7af5d | 2013-09-14 18:35:38 +0200 | [diff] [blame] | 148 | item.itemType == LauncherSettings.Favorites.ITEM_TYPE_FOLDER) { |
Michael Jurka | ed3d4df | 2013-09-12 18:09:24 +0200 | [diff] [blame] | 149 | return true; |
| 150 | } |
| 151 | |
Nilesh Agrawal | 16f3ea8 | 2014-01-09 17:14:01 -0800 | [diff] [blame] | 152 | if (!LauncherAppState.isDisableAllApps() && |
Michael Jurka | 5e7af5d | 2013-09-14 18:35:38 +0200 | [diff] [blame] | 153 | item.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION && |
| 154 | item instanceof AppInfo) { |
| 155 | AppInfo appInfo = (AppInfo) info; |
| 156 | return (appInfo.flags & AppInfo.DOWNLOADED_FLAG) != 0; |
| 157 | } |
| 158 | |
Michael Jurka | 9bd4d28 | 2013-09-05 19:21:31 +0200 | [diff] [blame] | 159 | if (item.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION && |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 160 | item instanceof ShortcutInfo) { |
Nilesh Agrawal | 16f3ea8 | 2014-01-09 17:14:01 -0800 | [diff] [blame] | 161 | if (LauncherAppState.isDisableAllApps()) { |
Michael Jurka | 9bd4d28 | 2013-09-05 19:21:31 +0200 | [diff] [blame] | 162 | ShortcutInfo shortcutInfo = (ShortcutInfo) info; |
| 163 | return (shortcutInfo.flags & AppInfo.DOWNLOADED_FLAG) != 0; |
| 164 | } else { |
| 165 | return true; |
| 166 | } |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 167 | } |
Adam Cohen | 947dc54 | 2013-06-06 22:43:33 -0700 | [diff] [blame] | 168 | } |
Adam Cohen | 7c4c510 | 2013-06-14 17:42:35 -0700 | [diff] [blame] | 169 | return false; |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 170 | } |
| 171 | |
Sunny Goyal | 71b5c0b | 2015-01-08 16:59:04 -0800 | [diff] [blame^] | 172 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2) |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 173 | @Override |
| 174 | public void onDragStart(DragSource source, Object info, int dragAction) { |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 175 | boolean isVisible = true; |
Nilesh Agrawal | 16f3ea8 | 2014-01-09 17:14:01 -0800 | [diff] [blame] | 176 | boolean useUninstallLabel = !LauncherAppState.isDisableAllApps() && |
Michael Jurka | addcba6 | 2013-10-09 19:04:13 -0700 | [diff] [blame] | 177 | isAllAppsApplication(source, info); |
Mathew Inwood | 1eeb3fc | 2013-11-25 17:01:34 +0000 | [diff] [blame] | 178 | boolean useDeleteLabel = !useUninstallLabel && source.supportsDeleteDropTarget(); |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 179 | |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 180 | // If we are dragging an application from AppsCustomize, only show the control if we can |
Winson Chung | e01af63 | 2013-09-26 10:43:20 -0700 | [diff] [blame] | 181 | // delete the app (it was downloaded), and rename the string to "uninstall" in such a case. |
| 182 | // Hide the delete target if it is a widget from AppsCustomize. |
| 183 | if (!willAcceptDrop(info) || isAllAppsWidget(source, info)) { |
Adam Cohen | 947dc54 | 2013-06-06 22:43:33 -0700 | [diff] [blame] | 184 | isVisible = false; |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 185 | } |
Jason Monk | 950a467 | 2014-07-15 09:22:36 -0400 | [diff] [blame] | 186 | if (useUninstallLabel) { |
Jason Monk | 6a2c778 | 2014-09-02 13:13:24 -0400 | [diff] [blame] | 187 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { |
| 188 | UserManager userManager = (UserManager) |
| 189 | getContext().getSystemService(Context.USER_SERVICE); |
| 190 | Bundle restrictions = userManager.getUserRestrictions(); |
| 191 | if (restrictions.getBoolean(UserManager.DISALLOW_APPS_CONTROL, false) |
| 192 | || restrictions.getBoolean(UserManager.DISALLOW_UNINSTALL_APPS, false)) { |
| 193 | isVisible = false; |
| 194 | } |
Jason Monk | 950a467 | 2014-07-15 09:22:36 -0400 | [diff] [blame] | 195 | } |
| 196 | } |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 197 | |
Michael Jurka | addcba6 | 2013-10-09 19:04:13 -0700 | [diff] [blame] | 198 | if (useUninstallLabel) { |
Fabrice Di Meglio | d6a33c6 | 2013-02-06 15:40:46 -0800 | [diff] [blame] | 199 | setCompoundDrawablesRelativeWithIntrinsicBounds(mUninstallDrawable, null, null, null); |
Mathew Inwood | 1eeb3fc | 2013-11-25 17:01:34 +0000 | [diff] [blame] | 200 | } else if (useDeleteLabel) { |
Fabrice Di Meglio | d6a33c6 | 2013-02-06 15:40:46 -0800 | [diff] [blame] | 201 | setCompoundDrawablesRelativeWithIntrinsicBounds(mRemoveDrawable, null, null, null); |
Mathew Inwood | 1eeb3fc | 2013-11-25 17:01:34 +0000 | [diff] [blame] | 202 | } else { |
| 203 | isVisible = false; |
Adam Cohen | ebea84d | 2011-11-09 17:20:41 -0800 | [diff] [blame] | 204 | } |
Winson Chung | 947245b | 2012-05-15 16:34:19 -0700 | [diff] [blame] | 205 | mCurrentDrawable = (TransitionDrawable) getCurrentDrawable(); |
Adam Cohen | ebea84d | 2011-11-09 17:20:41 -0800 | [diff] [blame] | 206 | |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 207 | mActive = isVisible; |
Winson Chung | a48487a | 2012-03-20 16:19:37 -0700 | [diff] [blame] | 208 | resetHoverColor(); |
Winson Chung | a6427b1 | 2011-07-27 10:53:39 -0700 | [diff] [blame] | 209 | ((ViewGroup) getParent()).setVisibility(isVisible ? View.VISIBLE : View.GONE); |
Mathew Inwood | 1eeb3fc | 2013-11-25 17:01:34 +0000 | [diff] [blame] | 210 | if (isVisible && getText().length() > 0) { |
Michael Jurka | addcba6 | 2013-10-09 19:04:13 -0700 | [diff] [blame] | 211 | setText(useUninstallLabel ? R.string.delete_target_uninstall_label |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 212 | : R.string.delete_target_label); |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | @Override |
| 217 | public void onDragEnd() { |
| 218 | super.onDragEnd(); |
| 219 | mActive = false; |
| 220 | } |
| 221 | |
| 222 | public void onDragEnter(DragObject d) { |
| 223 | super.onDragEnter(d); |
| 224 | |
Winson Chung | a48487a | 2012-03-20 16:19:37 -0700 | [diff] [blame] | 225 | setHoverColor(); |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 226 | } |
| 227 | |
| 228 | public void onDragExit(DragObject d) { |
| 229 | super.onDragExit(d); |
| 230 | |
Winson Chung | aaa530a | 2011-07-11 21:06:30 -0700 | [diff] [blame] | 231 | if (!d.dragComplete) { |
Winson Chung | a48487a | 2012-03-20 16:19:37 -0700 | [diff] [blame] | 232 | resetHoverColor(); |
Winson Chung | 61967cb | 2012-02-28 18:11:33 -0800 | [diff] [blame] | 233 | } else { |
| 234 | // Restore the hover color if we are deleting |
| 235 | d.dragView.setColor(mHoverColor); |
Winson Chung | aaa530a | 2011-07-11 21:06:30 -0700 | [diff] [blame] | 236 | } |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 237 | } |
| 238 | |
Adam Cohen | ed66b2b | 2012-01-23 17:28:51 -0800 | [diff] [blame] | 239 | private void animateToTrashAndCompleteDrop(final DragObject d) { |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 240 | final DragLayer dragLayer = mLauncher.getDragLayer(); |
| 241 | final Rect from = new Rect(); |
Adam Cohen | ed66b2b | 2012-01-23 17:28:51 -0800 | [diff] [blame] | 242 | dragLayer.getViewRectRelativeToSelf(d.dragView, from); |
Adam Cohen | fe9da81 | 2014-08-04 17:08:01 -0700 | [diff] [blame] | 243 | |
| 244 | int width = mCurrentDrawable == null ? 0 : mCurrentDrawable.getIntrinsicWidth(); |
| 245 | int height = mCurrentDrawable == null ? 0 : mCurrentDrawable.getIntrinsicHeight(); |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 246 | final Rect to = getIconRect(d.dragView.getMeasuredWidth(), d.dragView.getMeasuredHeight(), |
Adam Cohen | fe9da81 | 2014-08-04 17:08:01 -0700 | [diff] [blame] | 247 | width, height); |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 248 | final float scale = (float) to.width() / from.width(); |
Adam Cohen | ed66b2b | 2012-01-23 17:28:51 -0800 | [diff] [blame] | 249 | |
Adam Cohen | d4d7aa5 | 2011-07-19 21:47:37 -0700 | [diff] [blame] | 250 | mSearchDropTargetBar.deferOnDragEnd(); |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 251 | deferCompleteDropIfUninstalling(d); |
| 252 | |
Adam Cohen | d4d7aa5 | 2011-07-19 21:47:37 -0700 | [diff] [blame] | 253 | Runnable onAnimationEndRunnable = new Runnable() { |
| 254 | @Override |
| 255 | public void run() { |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 256 | completeDrop(d); |
Adam Cohen | d4d7aa5 | 2011-07-19 21:47:37 -0700 | [diff] [blame] | 257 | mSearchDropTargetBar.onDragEnd(); |
Sunny Goyal | 8498eb4 | 2014-10-16 12:08:41 -0700 | [diff] [blame] | 258 | mLauncher.exitSpringLoadedDragModeDelayed(true, 0, null); |
Adam Cohen | d4d7aa5 | 2011-07-19 21:47:37 -0700 | [diff] [blame] | 259 | } |
| 260 | }; |
Winson Chung | 61967cb | 2012-02-28 18:11:33 -0800 | [diff] [blame] | 261 | dragLayer.animateView(d.dragView, from, to, scale, 1f, 1f, 0.1f, 0.1f, |
Adam Cohen | d4d7aa5 | 2011-07-19 21:47:37 -0700 | [diff] [blame] | 262 | DELETE_ANIMATION_DURATION, new DecelerateInterpolator(2), |
Winson Chung | 61967cb | 2012-02-28 18:11:33 -0800 | [diff] [blame] | 263 | new LinearInterpolator(), onAnimationEndRunnable, |
Adam Cohen | ed66b2b | 2012-01-23 17:28:51 -0800 | [diff] [blame] | 264 | DragLayer.ANIMATION_END_DISAPPEAR, null); |
Adam Cohen | d4d7aa5 | 2011-07-19 21:47:37 -0700 | [diff] [blame] | 265 | } |
| 266 | |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 267 | private void deferCompleteDropIfUninstalling(DragObject d) { |
| 268 | mWaitingForUninstall = false; |
Michael Jurka | 5e7af5d | 2013-09-14 18:35:38 +0200 | [diff] [blame] | 269 | if (isUninstallFromWorkspace(d)) { |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 270 | if (d.dragSource instanceof Folder) { |
| 271 | ((Folder) d.dragSource).deferCompleteDropAfterUninstallActivity(); |
| 272 | } else if (d.dragSource instanceof Workspace) { |
| 273 | ((Workspace) d.dragSource).deferCompleteDropAfterUninstallActivity(); |
| 274 | } |
| 275 | mWaitingForUninstall = true; |
| 276 | } |
| 277 | } |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 278 | |
Michael Jurka | 5e7af5d | 2013-09-14 18:35:38 +0200 | [diff] [blame] | 279 | private boolean isUninstallFromWorkspace(DragObject d) { |
Sunny Goyal | 71b5c0b | 2015-01-08 16:59:04 -0800 | [diff] [blame^] | 280 | if (LauncherAppState.isDisableAllApps() && isDragSourceWorkspaceOrFolder(d) |
| 281 | && (d.dragInfo instanceof ShortcutInfo)) { |
Michael Jurka | 5e7af5d | 2013-09-14 18:35:38 +0200 | [diff] [blame] | 282 | ShortcutInfo shortcut = (ShortcutInfo) d.dragInfo; |
Nilesh Agrawal | dff0bfe | 2013-12-17 15:20:50 -0800 | [diff] [blame] | 283 | // Only allow manifest shortcuts to initiate an un-install. |
| 284 | return !InstallShortcutReceiver.isValidShortcutLaunchIntent(shortcut.intent); |
Michael Jurka | 5e7af5d | 2013-09-14 18:35:38 +0200 | [diff] [blame] | 285 | } |
| 286 | return false; |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 287 | } |
| 288 | |
Michael Jurka | f300758 | 2013-08-21 14:33:57 +0200 | [diff] [blame] | 289 | private void completeDrop(DragObject d) { |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 290 | ItemInfo item = (ItemInfo) d.dragInfo; |
| 291 | boolean wasWaitingForUninstall = mWaitingForUninstall; |
| 292 | mWaitingForUninstall = false; |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 293 | if (isAllAppsApplication(d.dragSource, item)) { |
Sunny Goyal | 71b5c0b | 2015-01-08 16:59:04 -0800 | [diff] [blame^] | 294 | uninstallApp(mLauncher, (AppInfo) item); |
Michael Jurka | 5e7af5d | 2013-09-14 18:35:38 +0200 | [diff] [blame] | 295 | } else if (isUninstallFromWorkspace(d)) { |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 296 | ShortcutInfo shortcut = (ShortcutInfo) item; |
Kenny Guy | d31df54 | 2014-06-30 15:12:11 +0100 | [diff] [blame] | 297 | if (shortcut.intent != null && shortcut.intent.getComponent() != null) { |
Michael Jurka | f300758 | 2013-08-21 14:33:57 +0200 | [diff] [blame] | 298 | final ComponentName componentName = shortcut.intent.getComponent(); |
| 299 | final DragSource dragSource = d.dragSource; |
Kenny Guy | d31df54 | 2014-06-30 15:12:11 +0100 | [diff] [blame] | 300 | final UserHandleCompat user = shortcut.user; |
| 301 | mWaitingForUninstall = mLauncher.startApplicationUninstallActivity( |
| 302 | componentName, shortcut.flags, user); |
Michael Jurka | f300758 | 2013-08-21 14:33:57 +0200 | [diff] [blame] | 303 | if (mWaitingForUninstall) { |
| 304 | final Runnable checkIfUninstallWasSuccess = new Runnable() { |
| 305 | @Override |
| 306 | public void run() { |
| 307 | mWaitingForUninstall = false; |
| 308 | String packageName = componentName.getPackageName(); |
Kenny Guy | ed13187 | 2014-04-30 03:02:21 +0100 | [diff] [blame] | 309 | boolean uninstallSuccessful = !AllAppsList.packageHasActivities( |
Kenny Guy | d31df54 | 2014-06-30 15:12:11 +0100 | [diff] [blame] | 310 | getContext(), packageName, user); |
Michael Jurka | f300758 | 2013-08-21 14:33:57 +0200 | [diff] [blame] | 311 | if (dragSource instanceof Folder) { |
| 312 | ((Folder) dragSource). |
| 313 | onUninstallActivityReturned(uninstallSuccessful); |
| 314 | } else if (dragSource instanceof Workspace) { |
| 315 | ((Workspace) dragSource). |
| 316 | onUninstallActivityReturned(uninstallSuccessful); |
| 317 | } |
| 318 | } |
| 319 | }; |
| 320 | mLauncher.addOnResumeCallback(checkIfUninstallWasSuccess); |
| 321 | } |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 322 | } |
Sunny Goyal | 71b5c0b | 2015-01-08 16:59:04 -0800 | [diff] [blame^] | 323 | } else if (isDragSourceWorkspaceOrFolder(d)) { |
| 324 | removeWorkspaceOrFolderItem(mLauncher, item, null); |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 325 | } |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 326 | if (wasWaitingForUninstall && !mWaitingForUninstall) { |
| 327 | if (d.dragSource instanceof Folder) { |
| 328 | ((Folder) d.dragSource).onUninstallActivityReturned(false); |
| 329 | } else if (d.dragSource instanceof Workspace) { |
| 330 | ((Workspace) d.dragSource).onUninstallActivityReturned(false); |
| 331 | } |
| 332 | } |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 333 | } |
Adam Cohen | d4d7aa5 | 2011-07-19 21:47:37 -0700 | [diff] [blame] | 334 | |
Sunny Goyal | 71b5c0b | 2015-01-08 16:59:04 -0800 | [diff] [blame^] | 335 | public static void uninstallApp(Launcher launcher, AppInfo info) { |
| 336 | launcher.startApplicationUninstallActivity(info.componentName, info.flags, info.user); |
| 337 | } |
| 338 | |
| 339 | /** |
| 340 | * Removes the item from the workspace. If the view is not null, it also removes the view. |
| 341 | * @return true if the item was removed. |
| 342 | */ |
| 343 | public static boolean removeWorkspaceOrFolderItem(Launcher launcher, ItemInfo item, View view) { |
| 344 | if (item instanceof ShortcutInfo) { |
| 345 | LauncherModel.deleteItemFromDatabase(launcher, item); |
| 346 | } else if (item instanceof FolderInfo) { |
| 347 | FolderInfo folder = (FolderInfo) item; |
| 348 | launcher.removeFolder(folder); |
| 349 | LauncherModel.deleteFolderContentsFromDatabase(launcher, folder); |
| 350 | } else if (item instanceof LauncherAppWidgetInfo) { |
| 351 | final LauncherAppWidgetInfo widget = (LauncherAppWidgetInfo) item; |
| 352 | |
| 353 | // Remove the widget from the workspace |
| 354 | launcher.removeAppWidget(widget); |
| 355 | LauncherModel.deleteItemFromDatabase(launcher, widget); |
| 356 | |
| 357 | final LauncherAppWidgetHost appWidgetHost = launcher.getAppWidgetHost(); |
| 358 | |
| 359 | if (appWidgetHost != null && !widget.isCustomWidget() |
| 360 | && widget.isWidgetIdValid()) { |
| 361 | // Deleting an app widget ID is a void call but writes to disk before returning |
| 362 | // to the caller... |
| 363 | new AsyncTask<Void, Void, Void>() { |
| 364 | public Void doInBackground(Void ... args) { |
| 365 | appWidgetHost.deleteAppWidgetId(widget.appWidgetId); |
| 366 | return null; |
| 367 | } |
| 368 | }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null); |
| 369 | } |
| 370 | } else { |
| 371 | return false; |
| 372 | } |
| 373 | |
| 374 | if (view != null) { |
| 375 | launcher.getWorkspace().removeWorkspaceItem(view); |
| 376 | launcher.getWorkspace().stripEmptyScreens(); |
| 377 | } |
| 378 | return true; |
| 379 | } |
| 380 | |
Adam Cohen | d4d7aa5 | 2011-07-19 21:47:37 -0700 | [diff] [blame] | 381 | public void onDrop(DragObject d) { |
| 382 | animateToTrashAndCompleteDrop(d); |
| 383 | } |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 384 | |
| 385 | /** |
| 386 | * Creates an animation from the current drag view to the delete trash icon. |
| 387 | */ |
| 388 | private AnimatorUpdateListener createFlingToTrashAnimatorListener(final DragLayer dragLayer, |
| 389 | DragObject d, PointF vel, ViewConfiguration config) { |
Adam Cohen | fe9da81 | 2014-08-04 17:08:01 -0700 | [diff] [blame] | 390 | |
| 391 | int width = mCurrentDrawable == null ? 0 : mCurrentDrawable.getIntrinsicWidth(); |
| 392 | int height = mCurrentDrawable == null ? 0 : mCurrentDrawable.getIntrinsicHeight(); |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 393 | final Rect to = getIconRect(d.dragView.getMeasuredWidth(), d.dragView.getMeasuredHeight(), |
Adam Cohen | fe9da81 | 2014-08-04 17:08:01 -0700 | [diff] [blame] | 394 | width, height); |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 395 | final Rect from = new Rect(); |
| 396 | dragLayer.getViewRectRelativeToSelf(d.dragView, from); |
| 397 | |
| 398 | // Calculate how far along the velocity vector we should put the intermediate point on |
| 399 | // the bezier curve |
| 400 | float velocity = Math.abs(vel.length()); |
| 401 | float vp = Math.min(1f, velocity / (config.getScaledMaximumFlingVelocity() / 2f)); |
| 402 | int offsetY = (int) (-from.top * vp); |
| 403 | int offsetX = (int) (offsetY / (vel.y / vel.x)); |
| 404 | final float y2 = from.top + offsetY; // intermediate t/l |
| 405 | final float x2 = from.left + offsetX; |
| 406 | final float x1 = from.left; // drag view t/l |
| 407 | final float y1 = from.top; |
| 408 | final float x3 = to.left; // delete target t/l |
| 409 | final float y3 = to.top; |
| 410 | |
| 411 | final TimeInterpolator scaleAlphaInterpolator = new TimeInterpolator() { |
| 412 | @Override |
| 413 | public float getInterpolation(float t) { |
| 414 | return t * t * t * t * t * t * t * t; |
| 415 | } |
| 416 | }; |
| 417 | return new AnimatorUpdateListener() { |
| 418 | @Override |
| 419 | public void onAnimationUpdate(ValueAnimator animation) { |
| 420 | final DragView dragView = (DragView) dragLayer.getAnimatedView(); |
| 421 | float t = ((Float) animation.getAnimatedValue()).floatValue(); |
| 422 | float tp = scaleAlphaInterpolator.getInterpolation(t); |
| 423 | float initialScale = dragView.getInitialScale(); |
| 424 | float finalAlpha = 0.5f; |
| 425 | float scale = dragView.getScaleX(); |
| 426 | float x1o = ((1f - scale) * dragView.getMeasuredWidth()) / 2f; |
| 427 | float y1o = ((1f - scale) * dragView.getMeasuredHeight()) / 2f; |
| 428 | float x = (1f - t) * (1f - t) * (x1 - x1o) + 2 * (1f - t) * t * (x2 - x1o) + |
| 429 | (t * t) * x3; |
| 430 | float y = (1f - t) * (1f - t) * (y1 - y1o) + 2 * (1f - t) * t * (y2 - x1o) + |
| 431 | (t * t) * y3; |
| 432 | |
| 433 | dragView.setTranslationX(x); |
| 434 | dragView.setTranslationY(y); |
| 435 | dragView.setScaleX(initialScale * (1f - tp)); |
| 436 | dragView.setScaleY(initialScale * (1f - tp)); |
| 437 | dragView.setAlpha(finalAlpha + (1f - finalAlpha) * (1f - tp)); |
| 438 | } |
| 439 | }; |
| 440 | } |
| 441 | |
| 442 | /** |
| 443 | * Creates an animation from the current drag view along its current velocity vector. |
| 444 | * For this animation, the alpha runs for a fixed duration and we update the position |
| 445 | * progressively. |
| 446 | */ |
| 447 | private static class FlingAlongVectorAnimatorUpdateListener implements AnimatorUpdateListener { |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 448 | private DragLayer mDragLayer; |
| 449 | private PointF mVelocity; |
| 450 | private Rect mFrom; |
| 451 | private long mPrevTime; |
| 452 | private boolean mHasOffsetForScale; |
Winson Chung | 6e1bdaf | 2012-05-29 17:03:45 -0700 | [diff] [blame] | 453 | private float mFriction; |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 454 | |
Winson Chung | 9658b1e | 2012-04-09 18:30:07 -0700 | [diff] [blame] | 455 | private final TimeInterpolator mAlphaInterpolator = new DecelerateInterpolator(0.75f); |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 456 | |
| 457 | public FlingAlongVectorAnimatorUpdateListener(DragLayer dragLayer, PointF vel, Rect from, |
Winson Chung | 6e1bdaf | 2012-05-29 17:03:45 -0700 | [diff] [blame] | 458 | long startTime, float friction) { |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 459 | mDragLayer = dragLayer; |
| 460 | mVelocity = vel; |
| 461 | mFrom = from; |
| 462 | mPrevTime = startTime; |
Winson Chung | 6e1bdaf | 2012-05-29 17:03:45 -0700 | [diff] [blame] | 463 | mFriction = 1f - (dragLayer.getResources().getDisplayMetrics().density * friction); |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 464 | } |
| 465 | |
| 466 | @Override |
| 467 | public void onAnimationUpdate(ValueAnimator animation) { |
| 468 | final DragView dragView = (DragView) mDragLayer.getAnimatedView(); |
| 469 | float t = ((Float) animation.getAnimatedValue()).floatValue(); |
| 470 | long curTime = AnimationUtils.currentAnimationTimeMillis(); |
| 471 | |
| 472 | if (!mHasOffsetForScale) { |
| 473 | mHasOffsetForScale = true; |
| 474 | float scale = dragView.getScaleX(); |
| 475 | float xOffset = ((scale - 1f) * dragView.getMeasuredWidth()) / 2f; |
| 476 | float yOffset = ((scale - 1f) * dragView.getMeasuredHeight()) / 2f; |
| 477 | |
| 478 | mFrom.left += xOffset; |
| 479 | mFrom.top += yOffset; |
| 480 | } |
| 481 | |
| 482 | mFrom.left += (mVelocity.x * (curTime - mPrevTime) / 1000f); |
| 483 | mFrom.top += (mVelocity.y * (curTime - mPrevTime) / 1000f); |
| 484 | |
| 485 | dragView.setTranslationX(mFrom.left); |
| 486 | dragView.setTranslationY(mFrom.top); |
| 487 | dragView.setAlpha(1f - mAlphaInterpolator.getInterpolation(t)); |
| 488 | |
Winson Chung | 6e1bdaf | 2012-05-29 17:03:45 -0700 | [diff] [blame] | 489 | mVelocity.x *= mFriction; |
| 490 | mVelocity.y *= mFriction; |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 491 | mPrevTime = curTime; |
| 492 | } |
| 493 | }; |
| 494 | private AnimatorUpdateListener createFlingAlongVectorAnimatorListener(final DragLayer dragLayer, |
| 495 | DragObject d, PointF vel, final long startTime, final int duration, |
| 496 | ViewConfiguration config) { |
| 497 | final Rect from = new Rect(); |
| 498 | dragLayer.getViewRectRelativeToSelf(d.dragView, from); |
| 499 | |
Winson Chung | 6e1bdaf | 2012-05-29 17:03:45 -0700 | [diff] [blame] | 500 | return new FlingAlongVectorAnimatorUpdateListener(dragLayer, vel, from, startTime, |
| 501 | FLING_TO_DELETE_FRICTION); |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 502 | } |
| 503 | |
| 504 | public void onFlingToDelete(final DragObject d, int x, int y, PointF vel) { |
Winson Chung | a48487a | 2012-03-20 16:19:37 -0700 | [diff] [blame] | 505 | final boolean isAllApps = d.dragSource instanceof AppsCustomizePagedView; |
| 506 | |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 507 | // Don't highlight the icon as it's animating |
| 508 | d.dragView.setColor(0); |
| 509 | d.dragView.updateInitialScaleToCurrentScale(); |
Winson Chung | a48487a | 2012-03-20 16:19:37 -0700 | [diff] [blame] | 510 | // Don't highlight the target if we are flinging from AllApps |
| 511 | if (isAllApps) { |
| 512 | resetHoverColor(); |
| 513 | } |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 514 | |
| 515 | if (mFlingDeleteMode == MODE_FLING_DELETE_TO_TRASH) { |
| 516 | // Defer animating out the drop target if we are animating to it |
| 517 | mSearchDropTargetBar.deferOnDragEnd(); |
| 518 | mSearchDropTargetBar.finishAnimations(); |
| 519 | } |
| 520 | |
| 521 | final ViewConfiguration config = ViewConfiguration.get(mLauncher); |
| 522 | final DragLayer dragLayer = mLauncher.getDragLayer(); |
Winson Chung | 6e1bdaf | 2012-05-29 17:03:45 -0700 | [diff] [blame] | 523 | final int duration = FLING_DELETE_ANIMATION_DURATION; |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 524 | final long startTime = AnimationUtils.currentAnimationTimeMillis(); |
| 525 | |
| 526 | // NOTE: Because it takes time for the first frame of animation to actually be |
| 527 | // called and we expect the animation to be a continuation of the fling, we have |
| 528 | // to account for the time that has elapsed since the fling finished. And since |
| 529 | // we don't have a startDelay, we will always get call to update when we call |
| 530 | // start() (which we want to ignore). |
| 531 | final TimeInterpolator tInterpolator = new TimeInterpolator() { |
| 532 | private int mCount = -1; |
| 533 | private float mOffset = 0f; |
| 534 | |
| 535 | @Override |
| 536 | public float getInterpolation(float t) { |
| 537 | if (mCount < 0) { |
| 538 | mCount++; |
| 539 | } else if (mCount == 0) { |
| 540 | mOffset = Math.min(0.5f, (float) (AnimationUtils.currentAnimationTimeMillis() - |
| 541 | startTime) / duration); |
| 542 | mCount++; |
| 543 | } |
| 544 | return Math.min(1f, mOffset + t); |
| 545 | } |
| 546 | }; |
| 547 | AnimatorUpdateListener updateCb = null; |
| 548 | if (mFlingDeleteMode == MODE_FLING_DELETE_TO_TRASH) { |
| 549 | updateCb = createFlingToTrashAnimatorListener(dragLayer, d, vel, config); |
| 550 | } else if (mFlingDeleteMode == MODE_FLING_DELETE_ALONG_VECTOR) { |
| 551 | updateCb = createFlingAlongVectorAnimatorListener(dragLayer, d, vel, startTime, |
| 552 | duration, config); |
| 553 | } |
Michael Jurka | 1e2f465 | 2013-07-08 18:03:46 -0700 | [diff] [blame] | 554 | deferCompleteDropIfUninstalling(d); |
| 555 | |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 556 | Runnable onAnimationEndRunnable = new Runnable() { |
| 557 | @Override |
| 558 | public void run() { |
Winson Chung | a48487a | 2012-03-20 16:19:37 -0700 | [diff] [blame] | 559 | // If we are dragging from AllApps, then we allow AppsCustomizePagedView to clean up |
| 560 | // itself, otherwise, complete the drop to initiate the deletion process |
| 561 | if (!isAllApps) { |
| 562 | mLauncher.exitSpringLoadedDragMode(); |
| 563 | completeDrop(d); |
| 564 | } |
| 565 | mLauncher.getDragController().onDeferredEndFling(d); |
Winson Chung | 043f2af | 2012-03-01 16:09:54 -0800 | [diff] [blame] | 566 | } |
| 567 | }; |
| 568 | dragLayer.animateView(d.dragView, updateCb, duration, tInterpolator, onAnimationEndRunnable, |
| 569 | DragLayer.ANIMATION_END_DISAPPEAR, null); |
| 570 | } |
Winson Chung | 4c98d92 | 2011-05-31 16:50:48 -0700 | [diff] [blame] | 571 | } |