需求:去掉launcher 中全部App界面上面搜索应用框
修改位置
packages\apps\Launcher3\src\com\android\launcher3\allapps\AllAppsContainerView.java
在 onFinishInflate() 中添加一行 mSearchContainer.setVisibility(View.GONE);
@Override
protected void onFinishInflate() {
super.onFinishInflate();
....
mSearchContainer = findViewById(R.id.search_container_all_apps);
mSearchUiManager = (SearchUiManager) mSearchContainer;
mSearchUiManager.initialize(mApps, mAppsRecyclerView);
Monkey.20211215 del search allapps
mSearchContainer.setVisibility(View.GONE);
......
}
packages\apps\Launcher3\src\com\android\launcher3\allapps\AllAppsTransitionController.java
注释setAlphas() 中的setter.setViewAlpha(),因为最终会调用到 AlphaUpdateListener 中的 updateVisibility() 将 setVisibility 改成 VISIBLE,导致上面添加的 GONE 不生效
private void setAlphas(LauncherState toState, PropertySetter setter) {
int visibleElements = toState.getVisibleElements(mLauncher);
boolean hasHeader = (visibleElements & ALL_APPS_HEADER) != 0;
boolean hasHeaderExtra = (visibleElements & ALL_APPS_HEADER_EXTRA) != 0;
boolean hasContent = (visibleElements & ALL_APPS_CONTENT) != 0;
// Monkey.20211215 del search allapps
// setter.setViewAlpha(mAppsView.getSearchView(), hasHeader ? 1 : 0, LINEAR);
setter.setViewAlpha(mAppsView.getContentView(), hasContent ? 1 : 0, LINEAR);
setter.setViewAlpha(mAppsView.getScrollBar(), hasContent ? 1 : 0, LINEAR);
mAppsView.getFloatingHeaderView().setContentVisibility(hasHeaderExtra, hasContent, setter);
setter.setInt(mScrimView, ScrimView.DRAG_HANDLE_ALPHA,
(visibleElements & VERTICAL_SWIPE_INDICATOR) != 0 ? 255 : 0, LINEAR);
}
|