当前位置: 首页 > news >正文

移动wordpress 到根目录温州关键词优化排名

移动wordpress 到根目录,温州关键词优化排名,wordpress小说文章发布插件,网站外包的恶意刷流量文章目录 需求实现需求说明 参考资料修改文件实现思路首页显示的搜索框去除应用列表中的搜索框去除解决方案代码跟踪代码扩展 需求 Launcher3 去掉搜桌面索框 实现需求说明 每个平台平台源码有区别#xff0c;比如#xff1a;MTK、高通、展讯、RK、谷歌…单个平台下 不同A… 文章目录 需求实现需求说明 参考资料修改文件实现思路首页显示的搜索框去除应用列表中的搜索框去除解决方案代码跟踪代码扩展 需求 Launcher3 去掉搜桌面索框 实现需求说明 每个平台平台源码有区别比如MTK、高通、展讯、RK、谷歌…单个平台下 不同Android版本对应的模块源码也不一样 当前针对的是MTK Android12 来实现去掉搜索框功能其它平台可借鉴部分实现思路。网上部分资料也因为不同平台不同版本可能只能解决部分问题。实际还是需要自己针对性看源码分析源码实现。 搜索框 有两部分 主界面和所有应用的谷歌搜索框 参考资料 为了方便了解Launcher3建议还是熟悉下相关Launcher3 知识点 菜鸟成长之路-源码分析专栏 Android Launcher3 简介 Launcher3 高端定制 Launcher3 开发 Launcher3 Android Code Search在线源码查看 Launcher3 xref 在线源码查看 Launcher3 RK 源码查看 Launcher3 解析 Launcher3 AndroidP AS版本 谷歌Launcher3 Android13源码修改 Launcher3 和 Launcher3QuickStep 区别 Android14 不分Launcher3修改 Launcher3 LoaderTask 的数据加载 Android14 浅析Launcher Android O Launcher3-Workspace加载 修改文件 packages/apps/Launcher3/res/layout/search_container_workspace.xml packages/apps/Launcher3/src/com/android/launcher3/Workspace.java packages/apps/Launcher3/res/layout/secondary_launcher.xml实现思路 首页显示的搜索框去除 去除首页的搜索框思路方法基本一致search_container_workspace.xml 修改屏蔽Fragment 配置 com.android.launcher3.qsb.QsbContainerViewxmlns:androidhttp://schemas.android.com/apk/res/androidandroid:orientationverticalandroid:layout_widthmatch_parentandroid:layout_height0dpandroid:idid/search_container_workspaceandroid:padding0dp !-- 注释这一段fragmentandroid:namecom.android.launcher3.qsb.QsbContainerView$QsbFragmentandroid:layout_widthmatch_parentandroid:tagqsb_viewandroid:layout_heightmatch_parent/-- /com.android.launcher3.qsb.QsbContainerViewWorkspace.java 文件修改 bindAndInitFirstWorkspaceScreen 方法中屏蔽// Add the first pageCellLayout firstPage insertNewWorkspaceScreen(Workspace.FIRST_SCREEN_ID, getChildCount());// Always add a QSB on the first screen.if (mQsb 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.mQsb LayoutInflater.from(getContext()).inflate(R.layout.search_container_workspace, firstPage, false);}int cellVSpan FeatureFlags.EXPANDED_SMARTSPACE.get()? EXPANDED_SMARTSPACE_HEIGHT : DEFAULT_SMARTSPACE_HEIGHT;CellLayout.LayoutParams lp new CellLayout.LayoutParams(0, twoQsb?1:0, firstPage.getCountX(),cellVSpan);lp.canReorder false;if (!firstPage.addViewToCellLayout(mQsb, 0, R.id.search_container_workspace, lp, true)) {Log.e(TAG, Failed to add to item at (0, 0) to CellLayout);mQsb null;} 应用列表中的搜索框去除 实际这个需求实现 在不同的平台和版本区别很大借鉴解决思路。 解决方案 解决方案找到对应表的布局将布局中的View com.android.launcher3.allapps.search.AppsSearchContainerLayout 设置为GONE 状态 代码跟踪 首先看Launcher 目录有一个allapps 自己猜是所有app 的意思吧 看着像的就去看一下源码 ![(https://i-blog.csdnimg.cn/direct/6e65499862dc4d60a68dc2f1d2878f46.png) 在AllAppsContainerView.java 文件中有这样一段代码初始化View 这个search 相关的 search_container_all_apps看着像mSearchContainer findViewById(R.id.search_container_all_apps);mSearchUiManager (SearchUiManager) mSearchContainer;mSearchUiManager.initializeSearch(this);mSearchContainer.setVisibility(View.GONE);那就找 search_container_all_apps grep -rn search_container_all_apps 一次 fise4ubuntu-PowerEdge-R730:~/Android/mt6769-alps-release-s0.mp1.rc/alps-release-s0.mp1.rc$ grep -rn search_container_all_apps packages/apps/Launcher3/res/values/config.xml:108: item typeid namesearch_container_all_apps / packages/apps/Launcher3/res/layout/all_apps_tabs.xml:23: android:layout_belowid/search_container_all_apps packages/apps/Launcher3/res/layout/secondary_launcher.xml:65: android:layout_belowid/search_container_all_apps packages/apps/Launcher3/res/layout/secondary_launcher.xml:102: android:idid/search_container_all_apps packages/apps/Launcher3/res/layout/all_apps_content_layout.xml:21: android:layout_belowid/search_container_all_apps packages/apps/Launcher3/res/layout/all_apps_rv_layout.xml:22: android:layout_belowid/search_container_all_apps packages/apps/Launcher3/res/layout/all_apps_fast_scroller.xml:24: android:layout_belowid/search_container_all_apps packages/apps/Launcher3/res/layout/all_apps_fast_scroller.xml:33: android:layout_belowid/search_container_all_apps packages/apps/Launcher3/res/layout/search_container_all_apps.xml:18: android:idid/search_container_all_apps packages/apps/Launcher3/res/layout/all_apps.xml:36: android:layout_belowid/search_container_all_apps packages/apps/Launcher3/res/layout/all_apps.xml:48: layoutlayout/search_container_all_apps/ packages/apps/Launcher3/src/com/android/launcher3/allapps/AllAppsContainerView.java:378: mSearchContainer findViewById(R.id.search_container_all_apps); packages/apps/Launcher3/src/com/android/launcher3/allapps/AllAppsContainerView.java:382: Log.d(TAG, findViewById search_container_all_apps GONE); packages/apps/Launcher3/tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java:51: allAppsContainer, search_container_all_apps); packages/apps/Launcher3/tests/tapl/com/android/launcher3/tapl/AllApps.java:203: return mLauncher.waitForObjectInContainer(allAppsContainer, search_container_all_apps); 整理出有用的信息如下 packages/apps/Launcher3/res/values/config.xml:108: item typeid namesearch_container_all_apps / packages/apps/Launcher3/res/layout/secondary_launcher.xml:102: android:idid/search_container_all_apps packages/apps/Launcher3/res/layout/search_container_all_apps.xml:18: android:idid/search_container_all_apps packages/apps/Launcher3/res/layout/all_apps.xml:48: layoutlayout/search_container_all_apps/ 再次搜索对应的文件 secondary_launcher.xml 找到 SecondaryDisplayLauncher.java 对应search_container_all_apps.xml - 无all_apps.xml - 无 我们看看secondary_launcher.xml 发现有一个搜索的View, AppsSearchContainerLayout 设置为GONE 状态就是 search_container_all_apps 对应的View ?xml version1.0 encodingutf-8? com.android.launcher3.secondarydisplay.SecondaryDragLayerxmlns:androidhttp://schemas.android.com/apk/res/androidandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentandroid:idid/drag_layerandroid:paddingdimen/dynamic_grid_edge_marginGridViewandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentandroid:layout_marginBottom100dpandroid:themestyle/HomeScreenElementThemeandroid:layout_gravitycenter_horizontal|topandroid:layout_margindimen/dynamic_grid_edge_marginandroid:idid/workspace_grid /ImageButtonandroid:idid/all_apps_buttonandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_gravitybottom|endandroid:layout_margin40dpandroid:padding16dpandroid:srcdrawable/ic_appsandroid:backgrounddrawable/bg_all_apps_buttonandroid:contentDescriptionstring/all_apps_button_labelandroid:onClickonAppsButtonClicked /com.android.launcher3.allapps.AllAppsContainerViewandroid:idid/apps_viewandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentandroid:clipChildrentrueandroid:clipToPaddingfalseandroid:focusablefalseandroid:saveEnabledfalseandroid:layout_gravitybottom|endandroid:backgrounddrawable/round_rect_primaryandroid:elevation2dpandroid:visibilityinvisible includelayoutlayout/all_apps_rv_layoutandroid:visibilitygone /com.android.launcher3.allapps.FloatingHeaderViewandroid:idid/all_apps_headerandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:layout_belowid/search_container_all_appsandroid:clipToPaddingfalseandroid:paddingTopdimen/all_apps_header_top_paddingandroid:orientationvertical com.android.launcher3.workprofile.PersonalWorkSlidingTabStripandroid:idid/tabsandroid:layout_widthmatch_parentandroid:layout_heightdimen/all_apps_header_pill_heightandroid:orientationhorizontalstylestyle/TextHeadlineButtonandroid:idid/tab_personalandroid:layout_width0dpandroid:layout_heightmatch_parentandroid:layout_weight1android:background?android:attr/selectableItemBackgroundandroid:textstring/all_apps_personal_tabandroid:textAllCapstrueandroid:textColorcolor/all_apps_tab_textandroid:textSize14sp /Buttonandroid:idid/tab_workandroid:layout_width0dpandroid:layout_heightmatch_parentandroid:layout_weight1android:background?android:attr/selectableItemBackgroundandroid:textstring/all_apps_work_tabandroid:textAllCapstrueandroid:textColorcolor/all_apps_tab_textandroid:textSize14sp //com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip/com.android.launcher3.allapps.FloatingHeaderViewcom.android.launcher3.allapps.search.AppsSearchContainerLayoutandroid:idid/search_container_all_appsandroid:layout_widthmatch_parentandroid:layout_heightdimen/all_apps_search_bar_field_heightandroid:layout_centerHorizontaltrueandroid:layout_gravitytop|center_horizontalandroid:backgrounddrawable/bg_all_apps_searchboxandroid:elevation1dpandroid:focusableInTouchModetrueandroid:gravitycenterandroid:hintstring/all_apps_search_bar_hintandroid:imeOptionsactionSearch|flagNoExtractUiandroid:inputTypetext|textNoSuggestions|textCapWordsandroid:maxLines1android:padding8dpandroid:saveEnabledfalseandroid:scrollHorizontallytrueandroid:singleLinetrueandroid:textColor?android:attr/textColorSecondaryandroid:textColorHintdrawable/all_apps_search_hintandroid:textSize16spandroid:visibilitygone/include layoutlayout/all_apps_fast_scroller //com.android.launcher3.allapps.AllAppsContainerView /com.android.launcher3.secondarydisplay.SecondaryDragLayer代码扩展 上面的更改已经实现了需求我们接着看 secondary_launcher.xml 对应的Java 文件 AllAppsContainerView.java onFinishInflate() 方法Overrideprotected void onFinishInflate() {super.onFinishInflate();Log.d(TAG,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);//下面代码自己添加的mSearchContainer.setVisibility(View.GONE);Log.d(TAG, findViewById search_container_all_apps GONE);} 实际验证在不修改布局情况下这里设置GONE 没有用 跟踪mSearchContainer 对外提供的方法public View getSearchView() {return mSearchContainer;}搜索 getSearchView() 方法fise4ubuntu-PowerEdge-R730:~/Android/mt6769-alps-release-s0.mp1.rc/alps-release-s0.mp1.rc/packages/apps/Launcher3$ grep -rn getSearchView src/com/android/launcher3/allapps/AllAppsContainerView.java:586: public View getSearchView() { src/com/android/launcher3/allapps/AllAppsContainerView.java:806: (int) (getSearchView().getAlpha() * 255)); src/com/android/launcher3/allapps/AllAppsContainerView.java:809: getSearchView().setBackgroundColor(viewBG); src/com/android/launcher3/allapps/AllAppsContainerView.java:816: getSearchView().setVisibility(View.GONE);这些都是 AllAppsContainerView.java 里面获取View 回头看 secondary_launcher.xml 对应的类是SecondaryDisplayLauncher.java 找到 SecondaryDisplayLauncher.java showAppDrawer 方法,在这个方法里去通过getSearchView 获取到搜索框然后对搜索框设置GONE 不显示也可以的。/*** Show/hide app drawer card with animation.*/public void showAppDrawer(boolean show) {Log.d(TAG, showAppDrawer show);if (show mAppDrawerShown) {return;}float openR (float) Math.hypot(mAppsView.getWidth(), mAppsView.getHeight());float closeR Themes.getDialogCornerRadius(this);float startR mAppsButton.getWidth() / 2f;float[] buttonPos new float[] { startR, startR};mDragLayer.getDescendantCoordRelativeToSelf(mAppsButton, buttonPos);mDragLayer.mapCoordInSelfToDescendant(mAppsView, buttonPos);final Animator animator ViewAnimationUtils.createCircularReveal(mAppsView,(int) buttonPos[0], (int) buttonPos[1],show ? closeR : openR, show ? openR : closeR);if (show) {mAppDrawerShown true;mAppsView.setVisibility(View.VISIBLE);mAppsButton.setVisibility(View.INVISIBLE);} else {mAppDrawerShown false;animator.addListener(new AnimatorListenerAdapter() {Overridepublic void onAnimationEnd(Animator animation) {mAppsView.setVisibility(View.INVISIBLE);mAppsButton.setVisibility(View.VISIBLE);mAppsView.getSearchUiManager().resetSearch();}});}Log.d(TAG, showAppDrawer set searchView Gone);//设置为 GONE mAppsView.getSearchView().setVisibility(View.GONE);animator.start();} showAppDrawer 方法只是在特定的情况下执行所以在这个方法里面执行设置GONE逻辑并不是完全之策最简单直接就是更改布局GONE 状态了。
http://www.zqtcl.cn/news/366824/

相关文章:

  • 网站增加栏目费用在网站开发中如何设置登录
  • 怎样用php做网站百度推广联系人
  • 怎么建立手机网站如何申请公司域名
  • 营销型网站怎么收费邓州企业网站
  • 北京建设官方网站邢台网站维护
  • 新余网站制作网站开发工资咋样
  • 襄阳网站建设外包自己做一个网站
  • 网站域名的后缀wordpress文章归类
  • 查询企业信息的官方网站大连建设网站公司
  • 网站建设 全包专业建设规划方案模板
  • 做网站好还是做微信小程序好浙江建设工程造价信息网站
  • 网站开发怎么报价推广普通话手抄报模板可打印
  • 好的平面网站模板企业网站建设浩森宇特
  • 做网站通过什么赚钱吗公司建设网站的费用
  • 如何做建筑一体化的网站视频网站开发应用到哪些技术
  • 巴中微信网站建设竞价托管一般多少钱
  • 彩票网站开发 违法股票网站排名哪个好
  • 宝格丽网站建设哈尔滨网站建设王道下拉強
  • 烟台网站建设的公司世界500强企业排名2021
  • 网络营销做得比较成功的案例吴中seo网站优化软件
  • 怎么设立网站美区下载的app怎么更新
  • 建立网站ppt做酒店网站所用到的算法
  • 上海网站建设的价格低太仓做网站的公司
  • 怎样登录建设互联网站怎么做中英文网站
  • 云网站7china中小企业网站建设好么
  • 美丽南方官网网站建设国际新闻最新消息今天摘抄
  • 牛商网营销型网站多少钱江门营销型网站建设多少钱
  • 小榄公司网站建设网站交互做的比较好的
  • 深圳定制网站建设怎么改版网站
  • 免费学软件的自学网站江阴建设局网站