Search in sources :

Example 16 with ContainerType

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);
}
Also used : LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent)

Example 17 with ContainerType

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);
}
Also used : LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent)

Example 18 with ContainerType

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);
}
Also used : LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent)

Example 19 with ContainerType

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);
}
Also used : LoggerUtils.newCommandAction(com.android.launcher3.logging.LoggerUtils.newCommandAction) LoggerUtils.newTouchAction(com.android.launcher3.logging.LoggerUtils.newTouchAction) Action(com.android.launcher3.userevent.nano.LauncherLogProto.Action) LoggerUtils.newAction(com.android.launcher3.logging.LoggerUtils.newAction) 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)

Example 20 with ContainerType

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");
}
Also used : UserEventDispatcher(com.android.launcher3.logging.UserEventDispatcher) OmegaLauncher(com.saggitt.omega.OmegaLauncher) Target(com.android.launcher3.userevent.nano.LauncherLogProto.Target) LoggerUtils.newTarget(com.android.launcher3.logging.LoggerUtils.newTarget) LoggerUtils.newContainerTarget(com.android.launcher3.logging.LoggerUtils.newContainerTarget) LauncherAppWidgetHostView(com.android.launcher3.widget.LauncherAppWidgetHostView) AppWidgetHostView(android.appwidget.AppWidgetHostView) OptionsPopupView(com.android.launcher3.views.OptionsPopupView) View(android.view.View) PendingAppWidgetHostView(com.android.launcher3.widget.PendingAppWidgetHostView) AllAppsContainerView(com.android.launcher3.allapps.AllAppsContainerView) ScrimView(com.android.launcher3.views.ScrimView) DragView(com.android.launcher3.dragndrop.DragView)

Aggregations

LoggerUtils.newLauncherEvent (com.android.launcher3.logging.LoggerUtils.newLauncherEvent)8 LauncherEvent (com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent)8 BaseActivity (com.android.launcher3.BaseActivity)7 LauncherState (com.android.launcher3.LauncherState)7 Target (com.android.launcher3.userevent.nano.LauncherLogProto.Target)6 ActivityNotFoundException (android.content.ActivityNotFoundException)5 LoggerUtils.newContainerTarget (com.android.launcher3.logging.LoggerUtils.newContainerTarget)4 LoggerUtils.newTarget (com.android.launcher3.logging.LoggerUtils.newTarget)3 ButtonDropTarget (com.android.launcher3.ButtonDropTarget)2 DropTarget (com.android.launcher3.DropTarget)2 LoggerUtils.newAction (com.android.launcher3.logging.LoggerUtils.newAction)2 LoggerUtils.newCommandAction (com.android.launcher3.logging.LoggerUtils.newCommandAction)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.newTouchAction (com.android.launcher3.logging.LoggerUtils.newTouchAction)2 UserEventDispatcher (com.android.launcher3.logging.UserEventDispatcher)2 Action (com.android.launcher3.userevent.nano.LauncherLogProto.Action)2 AppWidgetHostView (android.appwidget.AppWidgetHostView)1 Intent (android.content.Intent)1