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

 第一个搜索框修改:

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);
        //*/tyd,lxd,20230613,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);
        //*/tyd,lxd,20230613,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;
    }

你可能感兴趣的:(开发语言,android,android,studio)