Search in sources :

Example 46 with Target

use of com.android.launcher3.userevent.nano.LauncherLogProto.Target in project android_packages_apps_Trebuchet by LineageOS.

the class UserEventDispatcher method logDeepShortcutsOpen.

public void logDeepShortcutsOpen(View icon) {
    ItemInfo info = (ItemInfo) icon.getTag();
    Target child = newItemTarget(info, mInstantAppResolver);
    ArrayList<Target> targets = makeTargetsList(child);
    fillLogContainer(icon, child, targets);
    dispatchUserEvent(newLauncherEvent(newTouchAction(Action.Touch.TAP), targets), null);
    resetElapsedContainerMillis("deep shortcut open");
}
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) ItemInfo(com.android.launcher3.model.data.ItemInfo)

Example 47 with Target

use of com.android.launcher3.userevent.nano.LauncherLogProto.Target in project android_packages_apps_Trebuchet by LineageOS.

the class UserEventDispatcher method logActionTapOutside.

public void logActionTapOutside(Target target) {
    LauncherEvent event = newLauncherEvent(newTouchAction(Action.Type.TOUCH), target);
    event.action.isOutside = true;
    dispatchUserEvent(event, null);
}
Also used : LauncherEvent(com.android.launcher3.userevent.nano.LauncherLogProto.LauncherEvent) LoggerUtils.newLauncherEvent(com.android.launcher3.logging.LoggerUtils.newLauncherEvent)

Example 48 with Target

use of com.android.launcher3.userevent.nano.LauncherLogProto.Target in project android_packages_apps_Trebuchet by LineageOS.

the class LoggerUtils method newItemTarget.

public static Target newItemTarget(ItemInfo info, InstantAppResolver instantAppResolver) {
    Target t = newTarget(Target.Type.ITEM);
    switch(info.itemType) {
        case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
            t.itemType = (instantAppResolver != null && info instanceof AppInfo && instantAppResolver.isInstantApp(((AppInfo) info))) ? ItemType.WEB_APP : ItemType.APP_ICON;
            t.predictedRank = DEFAULT_PREDICTED_RANK;
            break;
        case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
            t.itemType = ItemType.SHORTCUT;
            t.predictedRank = DEFAULT_PREDICTED_RANK;
            break;
        case LauncherSettings.Favorites.ITEM_TYPE_FOLDER:
            t.itemType = ItemType.FOLDER_ICON;
            break;
        case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
            t.itemType = ItemType.WIDGET;
            break;
        case LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT:
            t.itemType = ItemType.DEEPSHORTCUT;
            t.predictedRank = DEFAULT_PREDICTED_RANK;
            break;
    }
    return t;
}
Also used : Target(com.android.launcher3.userevent.nano.LauncherLogProto.Target) ButtonDropTarget(com.android.launcher3.ButtonDropTarget) AppInfo(com.android.launcher3.model.data.AppInfo)

Example 49 with Target

use of com.android.launcher3.userevent.nano.LauncherLogProto.Target in project android_packages_apps_Trebuchet by LineageOS.

the class UserEventDispatcher method logActionOnItem.

/**
 * Creates new {@link LauncherEvent} of ITEM target type with input arguments and dispatches it.
 *
 * @param touchAction ENUM value of {@link LauncherLogProto.Action.Touch} Action
 * @param dir         ENUM value of {@link LauncherLogProto.Action.Direction} Action
 * @param itemType    ENUM value of {@link LauncherLogProto.ItemType}
 * @param gridX       Nullable X coordinate of item's position on the workspace grid
 * @param gridY       Nullable Y coordinate of item's position on the workspace grid
 */
public void logActionOnItem(int touchAction, int dir, int itemType, @Nullable Integer gridX, @Nullable Integer gridY) {
    Target itemTarget = newTarget(Target.Type.ITEM);
    itemTarget.itemType = itemType;
    ofNullable(gridX).ifPresent(value -> itemTarget.gridX = value);
    ofNullable(gridY).ifPresent(value -> itemTarget.gridY = value);
    LauncherEvent event = newLauncherEvent(newTouchAction(touchAction), itemTarget);
    event.action.dir = dir;
    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)

Example 50 with Target

use of com.android.launcher3.userevent.nano.LauncherLogProto.Target in project android_packages_apps_Trebuchet by LineageOS.

the class UserEventDispatcher method logNotificationLaunch.

public void logNotificationLaunch(View v, PendingIntent intent) {
    LauncherEvent event = newLauncherEvent(newTouchAction(Action.Touch.TAP), newItemTarget(v, mInstantAppResolver), newTarget(Target.Type.CONTAINER));
    Target itemTarget = newItemTarget(v, mInstantAppResolver);
    ArrayList<Target> targets = makeTargetsList(itemTarget);
    if (fillLogContainer(v, itemTarget, targets)) {
        itemTarget.packageNameHash = (mUuidStr + intent.getCreatorPackage()).hashCode();
    }
    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)

Aggregations

View (android.view.View)85 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)59 Point (android.graphics.Point)42 Rect (android.graphics.Rect)41 AppWidgetHostView (android.appwidget.AppWidgetHostView)40 AbstractFloatingView (com.android.launcher3.AbstractFloatingView)38 ItemInfo (com.android.launcher3.model.data.ItemInfo)37 Animator (android.animation.Animator)35 ValueAnimator (android.animation.ValueAnimator)35 Target (com.android.launcher3.userevent.nano.LauncherLogProto.Target)35 BubbleTextView (com.android.launcher3.BubbleTextView)34 DropTarget (com.android.launcher3.DropTarget)32 DragView (com.android.launcher3.dragndrop.DragView)30 LauncherAppWidgetHostView (com.android.launcher3.widget.LauncherAppWidgetHostView)30 AnimatorSet (android.animation.AnimatorSet)29 RemoteAnimationTargetCompat (com.android.systemui.shared.system.RemoteAnimationTargetCompat)29 ComponentName (android.content.ComponentName)28 ObjectAnimator (android.animation.ObjectAnimator)27 DraggableView (com.android.launcher3.dragndrop.DraggableView)26 AppInfo (com.android.launcher3.model.data.AppInfo)26