mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
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:
@@ -150,16 +150,7 @@ public class WidgetsContainerView extends BaseContainerView
|
||||
// Return if global dragging is not enabled
|
||||
if (!mLauncher.isDraggingEnabled()) return false;
|
||||
|
||||
boolean status = beginDragging(v);
|
||||
if (status && v.getTag() instanceof PendingAddWidgetInfo) {
|
||||
WidgetHostViewLoader hostLoader = new WidgetHostViewLoader(mLauncher, v);
|
||||
boolean preloadStatus = hostLoader.preloadWidget();
|
||||
if (LOGD) {
|
||||
Log.d(TAG, String.format("preloading widget [status=%s]", preloadStatus));
|
||||
}
|
||||
mLauncher.getDragController().addDragListener(hostLoader);
|
||||
}
|
||||
return status;
|
||||
return beginDragging(v);
|
||||
}
|
||||
|
||||
private boolean beginDragging(View v) {
|
||||
@@ -222,6 +213,8 @@ public class WidgetsContainerView extends BaseContainerView
|
||||
bounds.right -= padding;
|
||||
}
|
||||
scale = bounds.width() / (float) preview.getWidth();
|
||||
|
||||
mLauncher.getDragController().addDragListener(new WidgetHostViewLoader(mLauncher, v));
|
||||
} else {
|
||||
PendingAddShortcutInfo createShortcutInfo = (PendingAddShortcutInfo) v.getTag();
|
||||
Drawable icon = createShortcutInfo.activityInfo.getFullResIcon(mIconCache);
|
||||
|
||||
Reference in New Issue
Block a user