本文整理汇总了Java中com.android.launcher3.DropTarget.DragObject方法的典型用法代码示例。如果您正苦于以下问题:Java DropTarget.DragObject方法的具体用法?Java DropTarget.DragObject怎么用?Java DropTarget.DragObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.launcher3.DropTarget
的用法示例。
在下文中一共展示了DropTarget.DragObject方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: logDragNDrop
import com.android.launcher3.DropTarget; //导入方法依赖的package包/类
public void logDragNDrop(DropTarget.DragObject dragObj, View dropTargetAsView) {
LauncherEvent event = LoggerUtils.initLauncherEvent(Action.TOUCH,
dragObj.dragView,
dragObj.originalDragInfo,
Target.CONTAINER,
dropTargetAsView);
event.action.touch = Action.DRAGDROP;
dragObj.dragSource.fillInLaunchSourceData(null, dragObj.originalDragInfo,
event.srcTarget[0], event.srcTarget[1]);
if (dropTargetAsView instanceof LaunchSourceProvider) {
((LaunchSourceProvider) dropTargetAsView).fillInLaunchSourceData(null,
dragObj.dragInfo, event.destTarget[0], event.destTarget[1]);
}
event.actionDurationMillis = SystemClock.uptimeMillis() - mActionDurationMillis;
dispatchUserEvent(event, null);
}
示例2: onDragStart
import com.android.launcher3.DropTarget; //导入方法依赖的package包/类
@Override
public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) {
if (dragObject.dragSource != this) {
return;
}
mContent.removeItem(mCurrentDragView);
if (dragObject.dragInfo instanceof ShortcutInfo) {
mItemsInvalidated = true;
// We do not want to get events for the item being removed, as they will get handled
// when the drop completes
try (SuppressInfoChanges s = new SuppressInfoChanges()) {
mInfo.remove((ShortcutInfo) dragObject.dragInfo, true);
}
}
mDragInProgress = true;
mItemAddedBackToSelfViaIcon = false;
}
示例3: onDropCompleted
import com.android.launcher3.DropTarget; //导入方法依赖的package包/类
@Override
public void onDropCompleted(View target, DropTarget.DragObject d, boolean isFlingToDelete,
boolean success) {
if (isFlingToDelete || !success || (target != mLauncher.getWorkspace() &&
!(target instanceof DeleteDropTarget) && !(target instanceof Folder))) {
// Exit spring loaded mode if we have not successfully dropped or have not handled the
// drop in Workspace
mLauncher.exitSpringLoadedDragModeDelayed(true,
Launcher.EXIT_SPRINGLOADED_MODE_SHORT_TIMEOUT, null);
}
mLauncher.unlockScreenOrientation(false);
// Display an error message if the drag failed due to there not being enough space on the
// target layout we were dropping on.
if (!success) {
boolean showOutOfSpaceMessage = false;
if (target instanceof Workspace && !mLauncher.getDragController().isDeferringDrag()) {
int currentScreen = mLauncher.getCurrentWorkspaceScreen();
Workspace workspace = (Workspace) target;
CellLayout layout = (CellLayout) workspace.getChildAt(currentScreen);
ItemInfo itemInfo = d.dragInfo;
if (layout != null) {
showOutOfSpaceMessage =
!layout.findCellForSpan(null, itemInfo.spanX, itemInfo.spanY);
}
}
if (showOutOfSpaceMessage) {
mLauncher.showOutOfSpaceMessage(false);
}
d.deferDragViewCleanupPostAnimation = false;
}
}
示例4: onDropCompleted
import com.android.launcher3.DropTarget; //导入方法依赖的package包/类
@Override
public void onDropCompleted(View target, DropTarget.DragObject d, boolean isFlingToDelete,
boolean success) {
if (!success) {
d.dragView.remove();
mLauncher.showWorkspace(true);
mLauncher.getDropTargetBar().onDragEnd();
}
}
示例5: onDropCompleted
import com.android.launcher3.DropTarget; //导入方法依赖的package包/类
@Override
public void onDropCompleted(View target, DropTarget.DragObject d, boolean isFlingToDelete,
boolean success) {
if (isFlingToDelete || !success || (target != mLauncher.getWorkspace() &&
!(target instanceof DeleteDropTarget) && !(target instanceof Folder))) {
// Exit spring loaded mode if we have not successfully dropped or have not handled the
// drop in Workspace
mLauncher.exitSpringLoadedDragModeDelayed(true,
Launcher.EXIT_SPRINGLOADED_MODE_SHORT_TIMEOUT, null);
}
mLauncher.unlockScreenOrientation(false);
// Display an error message if the drag failed due to there not being enough space on the
// target layout we were dropping on.
if (!success) {
boolean showOutOfSpaceMessage = false;
if (target instanceof Workspace) {
int currentScreen = mLauncher.getCurrentWorkspaceScreen();
Workspace workspace = (Workspace) target;
CellLayout layout = (CellLayout) workspace.getChildAt(currentScreen);
ItemInfo itemInfo = (ItemInfo) d.dragInfo;
if (layout != null) {
showOutOfSpaceMessage =
!layout.findCellForSpan(null, itemInfo.spanX, itemInfo.spanY);
}
}
if (showOutOfSpaceMessage) {
mLauncher.showOutOfSpaceMessage(false);
}
d.deferDragViewCleanupPostAnimation = false;
}
}
示例6: onDragStart
import com.android.launcher3.DropTarget; //导入方法依赖的package包/类
@Override
public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) {
// Either the original icon or one of the shortcuts was dragged.
// Hide the container, but don't remove it yet because that interferes with touch events.
animateClose();
}
示例7: onDeferredEndFling
import com.android.launcher3.DropTarget; //导入方法依赖的package包/类
public void onDeferredEndFling(DropTarget.DragObject d) {
d.dragSource.onFlingToDeleteCompleted();
}
示例8: onDragStart
import com.android.launcher3.DropTarget; //导入方法依赖的package包/类
@Override
public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) { }
示例9: onDragStart
import com.android.launcher3.DropTarget; //导入方法依赖的package包/类
/**
* A drag has begun
*
* @param dragObject The object being dragged
* @param options Options used to start the drag
*/
void onDragStart(DropTarget.DragObject dragObject, DragOptions options);