Android13--移除最近任务长按图标弹出菜单

最近在改Android13最近任务的一些功能,其中一个需求是把长按图标弹出菜单的功能屏蔽掉。

涉及到的类

quickstep\src\com\android\quickstep\views\TaskView.java

最近任务里面每一个任务对应的是一个TaskView

长按图标后,会调用showTaskMenu方法,弹出菜单,菜单类为TaskMenuView,如下:

java 复制代码
    private boolean showTaskMenu(IconView iconView) {
        if (!getRecentsView().canLaunchFullscreenTask()) {
            // Don't show menu when selecting second split screen app
            return true;
        }

        if (!mActivity.getDeviceProfile().isTablet
                && !getRecentsView().isClearAllHidden()) {
            getRecentsView().snapToPage(getRecentsView().indexOfChild(this));
            return false;
        } else {
            mActivity.getStatsLogManager().logger().withItemInfo(getItemInfo())
                    .log(LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS);
            return showTaskMenuWithContainer(iconView);
        }
    }

在平板上,会去调用showTaskMenuWithContainer方法,弹出菜单

如果想不显示这个菜单,直接不调用这个方法就行了,直接访问true

java 复制代码
    private boolean showTaskMenu(IconView iconView) {
        if (!getRecentsView().canLaunchFullscreenTask()) {
            // Don't show menu when selecting second split screen app
            return true;
        }

        if (!mActivity.getDeviceProfile().isTablet
                && !getRecentsView().isClearAllHidden()) {
            getRecentsView().snapToPage(getRecentsView().indexOfChild(this));
            return false;
        } else {
            mActivity.getStatsLogManager().logger().withItemInfo(getItemInfo())
                    .log(LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS);
            // return showTaskMenuWithContainer(iconView);
               return true;
        }
    }
相关推荐
毛豆的毛豆Y4 天前
AOSP Android14 Launcher3——RecentsView最近任务数据加载
aosp·launcher3·android14
毛豆的毛豆Y4 天前
AOSP Android14 Launcher3——点击桌面图标启动应用动画流程
aosp·launcher3·android14
毛豆的毛豆Y5 天前
AOSP Android14 Launcher3——远程窗口动画关键类SurfaceControl详解
aosp·launcher3·android14
毛豆的毛豆Y11 天前
AOSP Android14 Launcher3——底部任务栏Taskbar详解
aosp·launcher3·android14
a3158238063 个月前
Android设置个性化按钮按键的快捷启动应用
android·开发语言·framework·源码·android13
Sgq丶5 个月前
Android 13 aosp Launcher 隐藏“壁纸和样式“入口
android·aosp·launcher3
ItJavawfc6 个月前
Launcher3 去掉桌面搜索索框
launcher3·去掉搜索框·谷歌搜索框
Kwanvin8 个月前
Android13 Hotseat客制化--Hotseat修改布局、支持滑动、去掉开机弹动效果、禁止创建文件夹
android·java·launcher3·hotseat
Kwanvin8 个月前
仿华为车机UI--图标从Workspace拖动到Hotseat同时保留图标在原来位置
android·java·ui·华为·launcher3