Search in sources :

Example 16 with LauncherEvent

use of com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent in project Neo-Launcher by NeoApplications.

the class UserEventDispatcher method logStateChangeAction.

/**
 * Used primarily for swipe up and down when state changes when swipe up happens from the
 * navbar bezel, the {@param srcChildContainerType} is NAVBAR and
 * {@param srcParentContainerType} is either one of the two
 * (1) WORKSPACE: if the launcher is the foreground activity
 * (2) APP: if another app was the foreground activity
 */
public void logStateChangeAction(int action, int dir, int downX, int downY, int srcChildTargetType, int srcParentContainerType, int dstContainerType, int pageIndex) {
    LauncherEvent event;
    if (srcChildTargetType == LauncherLogProto.ItemType.TASK) {
        event = newLauncherEvent(newTouchAction(action), newItemTarget(srcChildTargetType), newContainerTarget(srcParentContainerType));
    } else {
        event = newLauncherEvent(newTouchAction(action), newContainerTarget(srcChildTargetType), newContainerTarget(srcParentContainerType));
    }
    event.destTarget = new Target[1];
    event.destTarget[0] = newContainerTarget(dstContainerType);
    event.action.dir = dir;
    event.action.isStateChange = true;
    event.srcTarget[0].pageIndex = pageIndex;
    event.srcTarget[0].spanX = downX;
    event.srcTarget[0].spanY = downY;
    dispatchUserEvent(event, null);
    resetElapsedContainerMillis("state changed");
}
Also used : LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent)

Example 17 with LauncherEvent

use of com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent in project Neo-Launcher by NeoApplications.

the class UserEventDispatcher method logActionOnControl.

public void logActionOnControl(int action, int controlType, @Nullable View controlInContainer, int parentContainerType) {
    final LauncherEvent event = (controlInContainer == null && parentContainerType < 0) ? newLauncherEvent(newTouchAction(action), newTarget(Target.Type.CONTROL)) : newLauncherEvent(newTouchAction(action), newTarget(Target.Type.CONTROL), newTarget(Target.Type.CONTAINER));
    event.srcTarget[0].controlType = controlType;
    if (controlInContainer != null) {
        fillInLogContainerData(event, controlInContainer);
    }
    if (parentContainerType >= 0) {
        event.srcTarget[1].containerType = parentContainerType;
    }
    if (action == Action.Touch.DRAGDROP) {
        event.actionDurationMillis = SystemClock.uptimeMillis() - mActionDurationMillis;
    }
    dispatchUserEvent(event, null);
}
Also used : LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent)

Example 18 with LauncherEvent

use of com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent in project Neo-Launcher by NeoApplications.

the class UserEventDispatcher method logDragNDrop.

public void logDragNDrop(DropTarget.DragObject dragObj, View dropTargetAsView) {
    LauncherEvent event = newLauncherEvent(newTouchAction(Action.Touch.DRAGDROP), newItemTarget(dragObj.originalDragInfo, mInstantAppResolver), newTarget(Target.Type.CONTAINER));
    event.destTarget = new Target[] { newItemTarget(dragObj.originalDragInfo, mInstantAppResolver), newDropTarget(dropTargetAsView) };
    dragObj.dragSource.fillInLogContainerData(null, dragObj.originalDragInfo, event.srcTarget[0], event.srcTarget[1]);
    if (dropTargetAsView instanceof LogContainerProvider) {
        ((LogContainerProvider) dropTargetAsView).fillInLogContainerData(null, dragObj.dragInfo, event.destTarget[0], event.destTarget[1]);
    }
    event.actionDurationMillis = SystemClock.uptimeMillis() - mActionDurationMillis;
    dispatchUserEvent(event, null);
}
Also used : LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent) LogContainerProvider(com.android.launcher3.logging.StatsLogUtils.LogContainerProvider)

Example 19 with LauncherEvent

use of com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent in project Neo-Launcher by NeoApplications.

the class UserEventDispatcher method logActionCommand.

public void logActionCommand(int command, Target srcTarget, Target dstTarget) {
    LauncherEvent event = newLauncherEvent(newCommandAction(command), srcTarget);
    if (command == Action.Command.STOP) {
        if (mAppOrTaskLaunch || !mSessionStarted) {
            mSessionStarted = false;
            return;
        }
    }
    if (dstTarget != null) {
        event.destTarget = new Target[1];
        event.destTarget[0] = dstTarget;
        event.action.isStateChange = true;
    }
    dispatchUserEvent(event, null);
}
Also used : LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent)

Example 20 with LauncherEvent

use of com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent in project Neo-Launcher by NeoApplications.

the class UserEventDispatcher method logActionOnContainer.

public void logActionOnContainer(int action, int dir, int containerType, int pageIndex) {
    LauncherEvent event = newLauncherEvent(newTouchAction(action), newContainerTarget(containerType));
    event.action.dir = dir;
    event.srcTarget[0].pageIndex = pageIndex;
    dispatchUserEvent(event, null);
}
Also used : LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent)

Aggregations

LauncherEvent (com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent)32 LoggerUtils.newLauncherEvent (com.android.launcher3.logging.LoggerUtils.newLauncherEvent)29 DropTarget (com.android.launcher3.DropTarget)9 LoggerUtils.newContainerTarget (com.android.launcher3.logging.LoggerUtils.newContainerTarget)9 LoggerUtils.newControlTarget (com.android.launcher3.logging.LoggerUtils.newControlTarget)9 LoggerUtils.newDropTarget (com.android.launcher3.logging.LoggerUtils.newDropTarget)9 LoggerUtils.newItemTarget (com.android.launcher3.logging.LoggerUtils.newItemTarget)9 LoggerUtils.newTarget (com.android.launcher3.logging.LoggerUtils.newTarget)9 Target (com.android.launcher3.userevent.nano.LauncherLogProto.Target)9 LoggerUtils.newAction (com.android.launcher3.logging.LoggerUtils.newAction)4 LoggerUtils.newCommandAction (com.android.launcher3.logging.LoggerUtils.newCommandAction)4 LoggerUtils.newTouchAction (com.android.launcher3.logging.LoggerUtils.newTouchAction)4 Action (com.android.launcher3.userevent.nano.LauncherLogProto.Action)4 LogContainerProvider (com.android.launcher3.logging.StatsLogUtils.LogContainerProvider)3 ItemInfo (com.android.launcher3.ItemInfo)1 LauncherLogProto (com.android.launcher3.userevent.LauncherLogProto)1 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1