use of com.android.launcher3.keyboard.KeyboardDragAndDropView in project android_packages_apps_Launcher3 by crdroidandroid.
the class LauncherAccessibilityDelegate method beginAccessibleDrag.
private boolean beginAccessibleDrag(View item, ItemInfo info, boolean fromKeyboard) {
if (!itemSupportsAccessibleDrag(info)) {
return false;
}
mDragInfo = new DragInfo();
mDragInfo.info = info;
mDragInfo.item = item;
mDragInfo.dragType = DragType.ICON;
if (info instanceof FolderInfo) {
mDragInfo.dragType = DragType.FOLDER;
} else if (info instanceof LauncherAppWidgetInfo) {
mDragInfo.dragType = DragType.WIDGET;
}
Rect pos = new Rect();
mLauncher.getDragLayer().getDescendantRectRelativeToSelf(item, pos);
mLauncher.getDragController().addDragListener(this);
DragOptions options = new DragOptions();
options.isAccessibleDrag = true;
options.isKeyboardDrag = fromKeyboard;
options.simulatedDndStartPoint = new Point(pos.centerX(), pos.centerY());
if (fromKeyboard) {
KeyboardDragAndDropView popup = (KeyboardDragAndDropView) mLauncher.getLayoutInflater().inflate(R.layout.keyboard_drag_and_drop, mLauncher.getDragLayer(), false);
popup.showForIcon(item, info, options);
} else {
ItemLongClickListener.beginDrag(item, mLauncher, info, options);
}
return true;
}
Aggregations