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");
}
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);
}
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);
}
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);
}
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);
}
Aggregations