去掉待机界面搜索框和主界面搜索框!!去掉主菜单白色图标

 第一个搜索框修改:

vendor/mediatek/proprietary/packages/apps/Launcher3/src/com/android/launcher3/config$

FeatureFlags.java

找到这行:

public static final boolean QSB_ON_FIRST_SCREEN = BuildConfig.QSB_ON_FIRST_SCREEN;

可以修改为:public static final boolean QSB_ON_FIRST_SCREEN = true;

也可以到vendor/mediatek/proprietary/packages/apps/Launcher3/src_build_config/com/android/launcher3$BuildConfig.java类里面修改:

public static final boolean QSB_ON_FIRST_SCREEN = false;

第二个搜索框修改:

路径还是launcher下:

vendor/mediatek/proprietary/packages/apps/Launcher3/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java 类 或者【AllAppsContainerView】类

在 onFinishInflate 方法里面添加即可!!

其一:

@Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        mSearchContainer = findViewById(R.id.search_container_all_apps);
        mSearchUiManager = (SearchUiManager) mSearchContainer;
        mSearchUiManager.initializeSearch(this);
        //*/remove main menu search box
        mSearchContainer.setVisibility(View.GONE);
        //*/
    }

其二:

@Override
    protected void onFinishInflate() {
        super.onFinishInflate();

        // This is a focus listener that proxies focus from a view into the list view.  This is to
        // work around the search box from getting first focus and showing the cursor.
        setOnFocusChangeListener((v, hasFocus) -> {
            if (hasFocus && getActiveRecyclerView() != null) {
                getActiveRecyclerView().requestFocus();
            }
        });

        mHeader = findViewById(R.id.all_apps_header);
        rebindAdapters(mUsingTabs, true /* force */);

        mSearchContainer = findViewById(R.id.search_container_all_apps);
        mSearchUiManager = (SearchUiManager) mSearchContainer;
        mSearchUiManager.initializeSearch(this);
        //*remove main menu search box
        mSearchContainer.setVisibility(View.GONE);
        //*/
    }

如何去掉安卓原生的主菜单白色白框图标:

frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons$BaseIconFactory.java


    private Drawable normalizeAndWrapToAdaptiveIcon(@NonNull Drawable icon,
            boolean shrinkNonAdaptiveIcons, RectF outIconBounds, float[] outScale) {
        if (icon == null) {
            return null;
        }
        float scale = 1f;

        /*if (shrinkNonAdaptiveIcons && ATLEAST_OREO) {
            if (mWrapperIcon == null) {
                mWrapperIcon = mContext.getDrawable(R.drawable.adaptive_icon_drawable_wrapper)
                        .mutate();
            }
            AdaptiveIconDrawable dr = (AdaptiveIconDrawable) mWrapperIcon;
            dr.setBounds(0, 0, 1, 1);
            boolean[] outShape = new boolean[1];
            scale = getNormalizer().getScale(icon, outIconBounds, dr.getIconMask(), outShape);
            if (!(icon instanceof AdaptiveIconDrawable) && !outShape[0]) {
                FixedScaleDrawable fsd = ((FixedScaleDrawable) dr.getForeground());
                fsd.setDrawable(icon);
                fsd.setScale(scale);
                icon = dr;
                scale = getNormalizer().getScale(icon, outIconBounds, null, null);

                ((ColorDrawable) dr.getBackground()).setColor(mWrapperBackgroundColor);
            }
        } else {
            scale = getNormalizer().getScale(icon, outIconBounds, null, null);
        }*/
        /*/
        AdaptiveIconDrawable dr = (AdaptiveIconDrawable) mWrapperIcon;
            dr.setBounds(0, 0, 1, 1);
            boolean[] outShape = new boolean[1];
         scale = getNormalizer().getScale(icon, outIconBounds, dr.getIconMask(), outShape);
        //*/
        scale = getNormalizer().getScale(icon, outIconBounds, null, null);
        //*/

        outScale[0] = scale;
        return icon;
    }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值