栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

十、AOSP-app图标去白边+去Google搜索栏

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

十、AOSP-app图标去白边+去Google搜索栏

一、app图标去白边

源码路径:packagesappsLauncher3srccomandroidlauncher3graphicsLauncherIcons.java源码

if (!FeatureFlags.LAUNCHER3_DISABLE_ICON_NORMALIZATION) {
    normalizer = IconNormalizer.getInstance(context);
    if (Utilities.ATLEAST_OREO && iconAppTargetSdk >= Build.VERSION_CODES.O) {
        boolean[] outShape = new boolean[1];
        AdaptiveIconDrawable dr = (AdaptiveIconDrawable)
                context.getDrawable(R.drawable.adaptive_icon_drawable_wrapper).mutate();
        dr.setBounds(0, 0, 1, 1);
        scale = normalizer.getScale(icon, null, dr.getIconMask(), outShape);
        if (FeatureFlags.LEGACY_ICON_TREATMENT &&
                !outShape[0]){
            Drawable wrappedIcon = wrapToAdaptiveIconDrawable(context, icon, scale);
            if (wrappedIcon != icon) {
                icon = wrappedIcon;
                scale = normalizer.getScale(icon, null, null, null);
            }
        }
    } else {
        scale = normalizer.getScale(icon, null, null, null);
    }
}

修改

if (!FeatureFlags.LAUNCHER3_DISABLE_ICON_NORMALIZATION) {
    normalizer = IconNormalizer.getInstance(context);
    //zjp delete
    
    scale = normalizer.getScale(icon, null, null, null);//zjp add
}
二、去Google搜索栏 1、删除xml配置

源码路径:/packages/apps/Launcher3/res/layout/search_container_workspace.xml

源码



    

修改



2、删除资源加载代码

源码位置: /packages/apps/Launcher3/src/com/android/launcher3/Workspace.java源码

// Always add a QSB on the first screen.
if (qsb == null) {
    // In transposed layout, we add the QSB in the Grid. As workspace does not touch the
    // edges, we do not need a full width QSB.
    qsb = LayoutInflater.from(getContext())
            .inflate(R.layout.search_container_workspace,firstPage, false);
}
CellLayout.LayoutParams lp = new CellLayout.LayoutParams(0, 0, firstPage.getCountX(), 1);
lp.canReorder = false;
if (!firstPage.addViewToCellLayout(qsb, 0, R.id.search_container_workspace, lp, true)) {
    Log.e(TAG, "Failed to add to item at (0, 0) to CellLayout");
}

修改

// Always add a QSB on the first screen.
if (qsb == null) {
    // In transposed layout, we add the QSB in the Grid. As workspace does not touch the
    // edges, we do not need a full width QSB.
    qsb = LayoutInflater.from(getContext())
            .inflate(R.layout.search_container_workspace,firstPage, false);
}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/716623.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号