Search in sources :

Example 6 with LogContainerProvider

use of com.android.launcher3.logging.StatsLogUtils.LogContainerProvider in project android_packages_apps_Trebuchet by LineageOS.

the class UserEventDispatcher method logDragNDrop.

public void logDragNDrop(DropTarget.DragObject dragObj, View dropTargetAsView) {
    Target srcChild = newItemTarget(dragObj.originalDragInfo, mInstantAppResolver);
    ArrayList<Target> srcTargets = makeTargetsList(srcChild);
    Target destChild = newItemTarget(dragObj.originalDragInfo, mInstantAppResolver);
    ArrayList<Target> destTargets = makeTargetsList(destChild);
    dragObj.dragSource.fillInLogContainerData(dragObj.originalDragInfo, srcChild, srcTargets);
    if (dropTargetAsView instanceof LogContainerProvider) {
        ((LogContainerProvider) dropTargetAsView).fillInLogContainerData(dragObj.dragInfo, destChild, destTargets);
    } else {
        destTargets.add(newDropTarget(dropTargetAsView));
    }
    LauncherEvent event = newLauncherEvent(newTouchAction(Action.Touch.DRAGDROP), srcTargets);
    Target[] destTargetsArray = new Target[destTargets.size()];
    destTargets.toArray(destTargetsArray);
    event.destTarget = destTargetsArray;
    event.actionDurationMillis = SystemClock.uptimeMillis() - mActionDurationMillis;
    dispatchUserEvent(event, null);
}
Also used : LoggerUtils.newTarget(com.android.launcher3.logging.LoggerUtils.newTarget) Target(com.android.launcher3.userevent.nano.LauncherLogProto.Target) LoggerUtils.newControlTarget(com.android.launcher3.logging.LoggerUtils.newControlTarget) LoggerUtils.newItemTarget(com.android.launcher3.logging.LoggerUtils.newItemTarget) DropTarget(com.android.launcher3.DropTarget) LoggerUtils.newContainerTarget(com.android.launcher3.logging.LoggerUtils.newContainerTarget) LoggerUtils.newDropTarget(com.android.launcher3.logging.LoggerUtils.newDropTarget) LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent) LogContainerProvider(com.android.launcher3.logging.StatsLogUtils.LogContainerProvider)

Aggregations

LogContainerProvider (com.android.launcher3.logging.StatsLogUtils.LogContainerProvider)5 ItemInfo (com.android.launcher3.ItemInfo)3 LoggerUtils.newLauncherEvent (com.android.launcher3.logging.LoggerUtils.newLauncherEvent)3 LauncherEvent (com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent)3 DropTarget (com.android.launcher3.DropTarget)2 LoggerUtils.newContainerTarget (com.android.launcher3.logging.LoggerUtils.newContainerTarget)2 LoggerUtils.newControlTarget (com.android.launcher3.logging.LoggerUtils.newControlTarget)2 LoggerUtils.newDropTarget (com.android.launcher3.logging.LoggerUtils.newDropTarget)2 LoggerUtils.newItemTarget (com.android.launcher3.logging.LoggerUtils.newItemTarget)2 LoggerUtils.newTarget (com.android.launcher3.logging.LoggerUtils.newTarget)2 Target (com.android.launcher3.userevent.nano.LauncherLogProto.Target)2 View (android.view.View)1 ItemInfo (com.android.launcher3.model.data.ItemInfo)1 ComponentKey (com.android.launcher3.util.ComponentKey)1