zoukankan      html  css  js  c++  java
  • Android Launcher 怎样去掉主菜单,全部应用摆在桌面,相似小米桌面

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

    正文

     

    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.

  • 相关阅读:
    iOS开发多线程篇—GCD介绍
    IOS UI篇—UILabel的文字顶部对齐
    TableView编辑中实现多行删除的2中方法以及注意
    UITableView的新手——层次注意
    UITabBarItem编写的时候出现得图片显示异常,和有一些比较忽略的方法总结
    在ios开发中nil和NUll和Nilde区别————和如何判断连个对象的关系和UISlider不能拖动的问题
    iphone 手机屏幕和UIView和UIWindowde 的主要的区别
    iOS平常注意1
    ios优化复制大文件时,如何使内存运用最少且效率最高
    property在括号中应该怎样写
  • 原文地址:https://www.cnblogs.com/mfrbuaa/p/3768348.html
Copyright © 2011-2022 走看看