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