use of com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch.TAP in project android_packages_apps_Trebuchet by LineageOS.
the class DeleteDropTarget method completeDrop.
@Override
public void completeDrop(DragObject d) {
ItemInfo item = d.dragInfo;
if (canRemove(item)) {
int itemPage = mLauncher.getWorkspace().getCurrentPage();
onAccessibilityDrop(null, item);
ModelWriter modelWriter = mLauncher.getModelWriter();
Runnable onUndoClicked = () -> {
mLauncher.setPageToBindSynchronously(itemPage);
modelWriter.abortDelete();
mLauncher.getUserEventDispatcher().logActionOnControl(TAP, UNDO);
};
Snackbar.show(mLauncher, R.string.item_removed, R.string.undo, modelWriter::commitDelete, onUndoClicked);
}
}
use of com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch.TAP in project android_packages_apps_Trebuchet by LineageOS.
the class PopupContainerWithArrow method onControllerInterceptTouchEvent.
@Override
public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
BaseDragLayer dl = getPopupContainer();
if (!dl.isEventOverView(this, ev)) {
mLauncher.getUserEventDispatcher().logActionTapOutside(newContainerTarget(ContainerType.DEEPSHORTCUTS));
close(true);
// the app with one tap if they don't find a shortcut they want.
return mOriginalIcon == null || !dl.isEventOverView(mOriginalIcon, ev);
}
}
return false;
}
use of com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch.TAP in project Neo-Launcher by NeoApplications.
the class SmartspaceCard method click.
void click(View view) {
if (this.dI.cG == null) {
Log.e("SmartspaceCard", "no tap action available: " + this);
return;
}
Intent intent = new Intent(this.getIntent());
Launcher launcher = Launcher.getLauncher(view.getContext());
switch(this.dI.cG.cY) {
default:
{
Log.w("SmartspaceCard", "unrecognized tap action: " + this);
break;
}
case 1:
{
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setSourceBounds(launcher.getViewBounds(view));
intent.setPackage(FeedBridge.Companion.getInstance(mContext).resolveSmartspace());
view.getContext().sendBroadcast(intent);
break;
}
case 2:
{
launcher.startActivitySafely(view, intent, null, null);
break;
}
}
}
use of com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch.TAP in project Neo-Launcher by NeoApplications.
the class PopupContainerWithArrow method onControllerInterceptTouchEvent.
@Override
public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
BaseDragLayer dl = getPopupContainer();
if (!dl.isEventOverView(this, ev)) {
mLauncher.getUserEventDispatcher().logActionTapOutside(LoggerUtils.newContainerTarget(ContainerType.DEEPSHORTCUTS));
close(true);
// the app with one tap if they don't find a shortcut they want.
return mOriginalIcon == null || !dl.isEventOverView(mOriginalIcon, ev);
}
}
return false;
}
use of com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch.TAP in project Neo-Launcher by NeoApplications.
the class DeleteDropTarget method completeDrop.
@Override
public void completeDrop(DragObject d) {
ItemInfo item = d.dragInfo;
if (canRemove(item)) {
int itemPage = mLauncher.getWorkspace().getCurrentPage();
onAccessibilityDrop(null, item);
ModelWriter modelWriter = mLauncher.getModelWriter();
Runnable onUndoClicked = () -> {
modelWriter.abortDelete(itemPage);
mLauncher.getUserEventDispatcher().logActionOnControl(TAP, UNDO);
};
Snackbar.show(mLauncher, R.string.item_removed, R.string.undo, modelWriter::commitDelete, onUndoClicked);
}
}
Aggregations