博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android Launcher 怎样去掉主菜单,全部应用摆在桌面,相似小米桌面
阅读量:7099 次
发布时间:2019-06-28

本文共 1688 字,大约阅读时间需要 5 分钟。

前言

         欢迎大家我分享和推荐好用的代码段~~
声明
         欢迎转载,但请保留文章原始出处:
         CSDN:
         雨季o莫忧离:

正文

 

Launcher3/src/com/android/launcher3/
1. AppsCustomizePagedView.java
   public static boolean DISABLE_ALL_APPS = true; //mtk modify
2. AppsCustomizePagedView.java
 
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int width = MeasureSpec.getSize(widthMeasureSpec);
        int height = MeasureSpec.getSize(heightMeasureSpec);
        LauncherLog.d(TAG, "onMeasure mIsInEditMode = " + mIsInEditMode + widthMeasureSpec + "  " + heightMeasureSpec
                + "  " + width + "  " + height);
        if (!isDataReady()) {
            LauncherLog.d(TAG, "onMeasure DISABLE_ALL_APPS is " + DISABLE_ALL_APPS
                    + " !mApps.isEmpty() is " + !mApps.isEmpty()
                    + " !mWidgets.isEmpty()" + !mWidgets.isEmpty());
            if ((DISABLE_ALL_APPS || (!mApps.isEmpty() && mAppsHasSet)) && !mWidgets.isEmpty()) { //mtk modify
                setDataIsReady();
                setMeasuredDimension(width, height);
                onDataReady(width, height);
            }
        }
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }
3.Launcher.java
    private void showAppsCustomizeHelper(final boolean animated, final boolean springLoaded,
                                         final AppsCustomizePagedView.ContentType contentType) {
    ......
        // Shrink workspaces away if going to AppsCustomize from workspace
        Animator workspaceAnim =
                mWorkspace.getChangeStateAnimation(Workspace.State.SMALL, animated);
        //if (!AppsCustomizePagedView.DISABLE_ALL_APPS) { //mtk modify
            // Set the content type for the all apps space
            mAppsCustomizeTabHost.setContentTypeImmediate(contentType);
        //} //mtk modify
    ......
    }
4. default_workspace.xml文件(这个文件非常多路径有,请确保改动到正确的文件,比如)mediatek/operator/有)
这个文件会配置hotseat的图标,默认不会配置screen为2的位置,这是原来的allapp button,做了此客制化后就须要配置screen2,而不能配置screen 4,因此,请相应改动原来4个hotseat图标的screen id,从0到3.

你可能感兴趣的文章
亚马逊是如何进行软件开发的
查看>>
More than React(五)异步编程真的好吗?
查看>>
座谈会:Apache基金会那些事儿
查看>>
2017敏捷沙滩大会:完美软件,测量持续交付,以及探索未来
查看>>
某些编程语言更容易出错?研究人员提出质疑
查看>>
如何使用CloudFormation构建 VPC?
查看>>
从 SPA 到 PWA:Web App的下一站在哪?
查看>>
微软发布用于Serverless架构的Azure API Management
查看>>
又拍云黄慧攀QCon 2016技术分享:直播平台架构与实施
查看>>
用户故事 | 刷算法面试题的4种思考方式
查看>>
Scott Guthrie访谈:定制仪表板与Azure Monitor
查看>>
姜宁谈红帽绩效考核:不关心员工具体做什么
查看>>
Prometheus正式从CNCF毕业
查看>>
周末的时间,我们在GitHub用什么语言编程?
查看>>
使用gRPC构建真实世界的微服务
查看>>
.NET Core 2.1预览版首次引入Global Tools
查看>>
NUnit 3引入扩展能力与并行执行特性
查看>>
2018年最好的45个Vue开源项目汇总
查看>>
OpenShift 3.11推出Kubernetes Federation V2预览版
查看>>
阿里宣布开源Flutter应用框架Fish Redux!
查看>>