use of com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType 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.ContainerType 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);
}
use of com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType in project Neo-Launcher by NeoApplications.
the class UserEventDispatcher method logActionBounceTip.
public void logActionBounceTip(int containerType) {
LauncherEvent event = newLauncherEvent(newAction(Action.Type.TIP), newContainerTarget(containerType));
event.srcTarget[0].tipType = LauncherLogProto.TipType.BOUNCE;
dispatchUserEvent(event, null);
}
use of com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType in project Neo-Launcher by NeoApplications.
the class UserEventDispatcher method logActionBack.
public void logActionBack(boolean completed, int downX, int downY, boolean isButton, boolean gestureSwipeLeft, int containerType) {
int actionTouch = isButton ? Action.Touch.TAP : Action.Touch.SWIPE;
Action action = newCommandAction(actionTouch);
action.command = Action.Command.BACK;
action.dir = isButton ? Action.Direction.NONE : gestureSwipeLeft ? Action.Direction.LEFT : Action.Direction.RIGHT;
Target target = newControlTarget(isButton ? LauncherLogProto.ControlType.BACK_BUTTON : LauncherLogProto.ControlType.BACK_GESTURE);
target.spanX = downX;
target.spanY = downY;
target.cardinality = completed ? 1 : 0;
LauncherEvent event = newLauncherEvent(action, target, newContainerTarget(containerType));
dispatchUserEvent(event, null);
}
use of com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType in project Neo-Launcher by NeoApplications.
the class Launcher method onNewIntent.
@Override
protected void onNewIntent(Intent intent) {
TraceHelper.beginSection("NEW_INTENT");
super.onNewIntent(intent);
boolean alreadyOnHome = hasWindowFocus() && ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
// Check this condition before handling isActionMain, as this will get reset.
boolean shouldMoveToDefaultScreen = alreadyOnHome && isInState(NORMAL) && AbstractFloatingView.getTopOpenView(this) == null;
boolean isActionMain = Intent.ACTION_MAIN.equals(intent.getAction());
boolean internalStateHandled = InternalStateHandler.handleNewIntent(this, intent, isStarted());
boolean handled = false;
if (isActionMain) {
if (!internalStateHandled) {
// In all these cases, only animate if we're already on home
AbstractFloatingView.closeAllOpenViews(this, isStarted());
if (!isInState(NORMAL)) {
// Only change state, if not already the same. This prevents cancelling any
// animations running as part of resume
mStateManager.goToState(NORMAL);
}
// Reset the apps view
if (!alreadyOnHome) {
mAppsView.reset(isStarted());
handled = true;
}
if (shouldMoveToDefaultScreen && !mWorkspace.isHandlingTouch()) {
mWorkspace.post(mWorkspace::moveToDefaultScreen);
handled = true;
}
if (!handled && this instanceof OmegaLauncher) {
((OmegaLauncher) this).getGestureController().onPressHome();
}
}
// Handle HOME_INTENT
UserEventDispatcher ued = getUserEventDispatcher();
Target target = newContainerTarget(mStateManager.getState().containerType);
target.pageIndex = mWorkspace.getCurrentPage();
ued.logActionCommand(Action.Command.HOME_INTENT, target, newContainerTarget(ContainerType.WORKSPACE));
final View v = getWindow().peekDecorView();
if (v != null && v.getWindowToken() != null) {
UiThreadHelper.hideKeyboardAsync(this, v.getWindowToken());
}
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onHomeIntent(internalStateHandled);
}
}
TraceHelper.endSection("NEW_INTENT");
}
Aggregations