Search in sources :

Example 56 with Target

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

the class StatsLogCompatManager method fillInLauncherExtensionWithPageId.

public static boolean fillInLauncherExtensionWithPageId(LauncherExtension ext, int pageId) {
    if (DEBUG) {
        Log.d(TAG, "fillInLauncherExtensionWithPageId, pageId = " + pageId);
    }
    Target target = new Target();
    target.pageIndex = pageId;
    ext.srcTarget[0] = new LauncherTarget();
    copy(target, ext.srcTarget[0]);
    return true;
}
Also used : Target(com.android.launcher3.userevent.nano.LauncherLogProto.Target) LauncherTarget(android.stats.launcher.nano.LauncherTarget) LauncherTarget(android.stats.launcher.nano.LauncherTarget)

Example 57 with Target

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

the class StatsLogCompatManager method fillInLauncherExtension.

public static boolean fillInLauncherExtension(View v, LauncherExtension extension) {
    if (DEBUG) {
        Log.d(TAG, "fillInLauncherExtension");
    }
    StatsLogUtils.LogContainerProvider provider = StatsLogUtils.getLaunchProviderRecursive(v);
    if (v == null || !(v.getTag() instanceof ItemInfo) || provider == null) {
        if (DEBUG) {
            Log.d(TAG, "View or provider is null, or view doesn't have an ItemInfo tag.");
        }
        return false;
    }
    ItemInfo itemInfo = (ItemInfo) v.getTag();
    Target child = new Target();
    Target parent = new Target();
    provider.fillInLogContainerData(v, itemInfo, child, parent);
    extension.srcTarget[0] = new LauncherTarget();
    extension.srcTarget[1] = new LauncherTarget();
    copy(child, extension.srcTarget[0]);
    copy(parent, extension.srcTarget[1]);
    return true;
}
Also used : Target(com.android.launcher3.userevent.nano.LauncherLogProto.Target) LauncherTarget(android.stats.launcher.nano.LauncherTarget) ItemInfo(com.android.launcher3.ItemInfo) LauncherTarget(android.stats.launcher.nano.LauncherTarget) StatsLogUtils(com.android.launcher3.logging.StatsLogUtils)

Example 58 with Target

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

the class DeleteDropTarget method getDropTargetForLogging.

@Override
public Target getDropTargetForLogging() {
    Target t = LoggerUtils.newTarget(Target.Type.CONTROL);
    t.controlType = mControlType;
    return t;
}
Also used : Target(com.android.launcher3.userevent.nano.LauncherLogProto.Target)

Example 59 with Target

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

the class Workspace method createUserFolderIfNecessary.

boolean createUserFolderIfNecessary(View newView, int container, CellLayout target, int[] targetCell, float distance, boolean external, DragView dragView) {
    if (distance > mMaxDistanceForFolderCreation)
        return false;
    View v = target.getChildAt(targetCell[0], targetCell[1]);
    boolean hasntMoved = false;
    if (mDragInfo != null) {
        CellLayout cellParent = getParentCellLayoutForView(mDragInfo.cell);
        hasntMoved = (mDragInfo.cellX == targetCell[0] && mDragInfo.cellY == targetCell[1]) && (cellParent == target);
    }
    if (v == null || hasntMoved || !mCreateUserFolderOnDrop)
        return false;
    mCreateUserFolderOnDrop = false;
    final int screenId = getIdForScreen(target);
    boolean aboveShortcut = (v.getTag() instanceof WorkspaceItemInfo);
    boolean willBecomeShortcut = (newView.getTag() instanceof WorkspaceItemInfo);
    if (aboveShortcut && willBecomeShortcut) {
        WorkspaceItemInfo sourceInfo = (WorkspaceItemInfo) newView.getTag();
        WorkspaceItemInfo destInfo = (WorkspaceItemInfo) v.getTag();
        // if the drag started here, we need to remove it from the workspace
        if (!external) {
            getParentCellLayoutForView(mDragInfo.cell).removeView(mDragInfo.cell);
        }
        Rect folderLocation = new Rect();
        float scale = mLauncher.getDragLayer().getDescendantRectRelativeToSelf(v, folderLocation);
        target.removeView(v);
        FolderIcon fi = mLauncher.addFolder(target, container, screenId, targetCell[0], targetCell[1]);
        destInfo.cellX = -1;
        destInfo.cellY = -1;
        sourceInfo.cellX = -1;
        sourceInfo.cellY = -1;
        // If the dragView is null, we can't animate
        boolean animate = dragView != null;
        if (animate) {
            // In order to keep everything continuous, we hand off the currently rendered
            // folder background to the newly created icon. This preserves animation state.
            fi.setFolderBackground(mFolderCreateBg);
            mFolderCreateBg = new PreviewBackground();
            fi.performCreateAnimation(destInfo, v, sourceInfo, dragView, folderLocation, scale);
        } else {
            fi.prepareCreateAnimation(v);
            fi.addItem(destInfo);
            fi.addItem(sourceInfo);
        }
        return true;
    }
    return false;
}
Also used : Rect(android.graphics.Rect) PreviewBackground(com.android.launcher3.folder.PreviewBackground) FolderIcon(com.android.launcher3.folder.FolderIcon) View(android.view.View) PendingAppWidgetHostView(com.android.launcher3.widget.PendingAppWidgetHostView) LauncherAppWidgetHostView(com.android.launcher3.widget.LauncherAppWidgetHostView) AppWidgetHostView(android.appwidget.AppWidgetHostView) DragView(com.android.launcher3.dragndrop.DragView) OmegaBackgroundView(com.saggitt.omega.views.OmegaBackgroundView) SuppressLint(android.annotation.SuppressLint) Point(android.graphics.Point)

Example 60 with Target

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

the class SecondaryDropTarget method getDropTargetForLogging.

@Override
public Target getDropTargetForLogging() {
    Target t = LoggerUtils.newTarget(Target.Type.CONTROL);
    t.controlType = mCurrentAccessibilityAction == UNINSTALL ? ControlType.UNINSTALL_TARGET : ControlType.SETTINGS_BUTTON;
    return t;
}
Also used : Target(com.android.launcher3.userevent.nano.LauncherLogProto.Target)

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