summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/dragndrop
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-03-30 23:37:42 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-30 23:37:42 +0000
commit917f4a44cb221ac51784e0bfde3a90e0e73bc46d (patch)
tree7f2c1560c26d19e129d3f1ea059fad7fbbfbc9ff /src/com/android/launcher3/dragndrop
parent52f0130a76addcfec25775004c24346dc69b30d3 (diff)
parent4a907d0f9d1c80661c086aa95a8509698f38b324 (diff)
downloadandroid_packages_apps_Trebuchet-917f4a44cb221ac51784e0bfde3a90e0e73bc46d.tar.gz
android_packages_apps_Trebuchet-917f4a44cb221ac51784e0bfde3a90e0e73bc46d.tar.bz2
android_packages_apps_Trebuchet-917f4a44cb221ac51784e0bfde3a90e0e73bc46d.zip
Merge "Delay the PinItemRequest#accept() call until the drop animation is finished." into ub-launcher3-dorval
am: 4a907d0f9d Change-Id: Icd6d070199cd685633ead1301bda9d3e4de698c9
Diffstat (limited to 'src/com/android/launcher3/dragndrop')
-rw-r--r--src/com/android/launcher3/dragndrop/PinShortcutRequestActivityInfo.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/launcher3/dragndrop/PinShortcutRequestActivityInfo.java b/src/com/android/launcher3/dragndrop/PinShortcutRequestActivityInfo.java
index 26460d776..bb5ac5b02 100644
--- a/src/com/android/launcher3/dragndrop/PinShortcutRequestActivityInfo.java
+++ b/src/com/android/launcher3/dragndrop/PinShortcutRequestActivityInfo.java
@@ -26,8 +26,10 @@ import android.graphics.drawable.Drawable;
import android.os.Build;
import com.android.launcher3.IconCache;
+import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherSettings;
+import com.android.launcher3.R;
import com.android.launcher3.compat.LauncherAppsCompat;
import com.android.launcher3.compat.PinItemRequestCompat;
import com.android.launcher3.compat.ShortcutConfigActivityInfo;
@@ -73,7 +75,13 @@ class PinShortcutRequestActivityInfo extends ShortcutConfigActivityInfo {
@Override
public com.android.launcher3.ShortcutInfo createShortcutInfo() {
- return LauncherAppsCompat.createShortcutInfoFromPinItemRequest(mContext, mRequest);
+ // Total duration for the drop animation to complete.
+ long duration = mContext.getResources().getInteger(R.integer.config_dropAnimMaxDuration) +
+ Launcher.EXIT_SPRINGLOADED_MODE_SHORT_TIMEOUT +
+ mContext.getResources().getInteger(R.integer.config_overlayTransitionTime) / 2;
+ // Delay the actual accept() call until the drop animation is complete.
+ return LauncherAppsCompat.createShortcutInfoFromPinItemRequest(
+ mContext, mRequest, duration);
}
@Override