当前位置: 首页>>代码示例>>Java>>正文


Java DropTarget.DragObject方法代码示例

本文整理汇总了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);
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:20,代码来源:UserEventDispatcher.java

示例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;
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:20,代码来源:Folder.java

示例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;
    }
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:34,代码来源:AllAppsContainerView.java

示例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();
    }
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:10,代码来源:DeepShortcutsContainer.java

示例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;
    }
}
 
开发者ID:talentlo,项目名称:Trebuchet,代码行数:34,代码来源:AllAppsContainerView.java

示例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();
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:7,代码来源:DeepShortcutsContainer.java

示例7: onDeferredEndFling

import com.android.launcher3.DropTarget; //导入方法依赖的package包/类
public void onDeferredEndFling(DropTarget.DragObject d) {
    d.dragSource.onFlingToDeleteCompleted();
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:4,代码来源:DragController.java

示例8: onDragStart

import com.android.launcher3.DropTarget; //导入方法依赖的package包/类
@Override
public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) { }
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:3,代码来源:WidgetHostViewLoader.java

示例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);
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:8,代码来源:DragController.java


注:本文中的com.android.launcher3.DropTarget.DragObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。