summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/widget/WidgetHostViewLoader.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-01-25 11:30:06 -0800
committerSunny Goyal <sunnygoyal@google.com>2017-01-27 09:35:18 -0800
commit8a0dc38aebdc7624db3de2cdfecb9d11e2baee04 (patch)
treef14bd7258440f41d094bc8e789d14ad9073abf6f /src/com/android/launcher3/widget/WidgetHostViewLoader.java
parentcd64d62a7e840ed730bb15545125e980a8465960 (diff)
downloadandroid_packages_apps_Trebuchet-8a0dc38aebdc7624db3de2cdfecb9d11e2baee04.tar.gz
android_packages_apps_Trebuchet-8a0dc38aebdc7624db3de2cdfecb9d11e2baee04.tar.bz2
android_packages_apps_Trebuchet-8a0dc38aebdc7624db3de2cdfecb9d11e2baee04.zip
Improving widget handling for pinItemRequest
> Preloading widget view while dragging for smoother transition > Skipping config activity and sending confirmation to the caller when widget is dropped Bug: 33584624 Change-Id: Ib23e5964298296d12d9c93f38aefdf924a07368e
Diffstat (limited to 'src/com/android/launcher3/widget/WidgetHostViewLoader.java')
-rw-r--r--src/com/android/launcher3/widget/WidgetHostViewLoader.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher3/widget/WidgetHostViewLoader.java b/src/com/android/launcher3/widget/WidgetHostViewLoader.java
index 56112b21e..5eeea44b8 100644
--- a/src/com/android/launcher3/widget/WidgetHostViewLoader.java
+++ b/src/com/android/launcher3/widget/WidgetHostViewLoader.java
@@ -46,7 +46,9 @@ public class WidgetHostViewLoader implements DragController.DragListener {
}
@Override
- public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) { }
+ public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) {
+ preloadWidget();
+ }
@Override
public void onDragEnd() {
@@ -80,7 +82,7 @@ public class WidgetHostViewLoader implements DragController.DragListener {
/**
* Start preloading the widget.
*/
- public boolean preloadWidget() {
+ private boolean preloadWidget() {
final LauncherAppWidgetProviderInfo pInfo = mInfo.info;
if (pInfo.isCustomWidget) {
@@ -89,7 +91,7 @@ public class WidgetHostViewLoader implements DragController.DragListener {
final Bundle options = getDefaultOptionsForWidget(mLauncher, mInfo);
// If there is a configuration activity, do not follow thru bound and inflate.
- if (pInfo.configure != null) {
+ if (mInfo.getHandler().needsConfigure()) {
mInfo.bindOptions = options;
return false;
}