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
This commit is contained in:
Sunny Goyal
2017-01-25 11:30:06 -08:00
parent cd64d62a7e
commit 8a0dc38aeb
7 changed files with 114 additions and 20 deletions

View File

@@ -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;
}