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

高端网站建设的价格新媒体运营培训课程

高端网站建设的价格,新媒体运营培训课程,软件程序定制开发,新乡新手学做网站1.设定Android settings中某个xml文件(包括其子项)或者某个Preference不被搜索到 设定某个xml文件(包括子项)不被搜索到 找到该xml文件对应的fragment java文件中的SEARCH_INDEX_DATA_PROVIDER,在该provider中对isPageSearchEnabled方法进行重写并…

1.设定Android settings中某个xml文件(包括其子项)或者某个Preference不被搜索到
 

设定某个xml文件(包括子项)不被搜索到
    找到该xml文件对应的fragment java文件中的SEARCH_INDEX_DATA_PROVIDER,在该provider中对isPageSearchEnabled方法进行重写并返回false.
 

 public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =new BaseSearchIndexProvider() {@Overridepublic List<SearchIndexableResource> getXmlResourcesToIndex(Context context,boolean enabled) {List<SearchIndexableResource> indexables = new ArrayList<>();SearchIndexableResource indexable = new SearchIndexableResource(context);indexable.xmlResId = R.xml.accessibility_vibration_settings;indexables.add(indexable);return indexables;}@Overrideprotected boolean isPageSearchEnabled(Context context) {return false;}};

设定特定的Preference不被搜索到
    找到这个特定的Preference对应的xml文件所在的fragment java文件中的SEARCH_INDEX_DATA_PROVIDER, 对该Provider中的getNonIndexableKeys方法进行重写.
 

 public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =new BaseSearchIndexProvider() {@Overridepublic List<SearchIndexableResource> getXmlResourcesToIndex(Context context,boolean enabled) {List<SearchIndexableResource> indexables = new ArrayList<>();SearchIndexableResource indexable = new SearchIndexableResource(context);indexable.xmlResId = R.xml.accessibility_settings;indexables.add(indexable);return indexables;}@Overridepublic List<String> getNonIndexableKeys(Context context) {final List<String> nonIndexableKeys = super.getNonIndexableKeys(context);nonIndexableKeys.add("vibration_preference_screen"); //这个key为特定preference keyreturn nonIndexableKeys;}};

2.在长按Power弹出的选项中添加或删除项


    在长按power弹出的选项中添加或删除某一项,在frameworks/base/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java文件中定义一个私有类继承SinglePressAction.
 

private final class BatteryShelfModeAction extends SinglePressAction{private BatteryShelfModeAction() {super(R.drawable.ic_lock_power_off,    //display iconandroid.R.string.battery_shelf_mode_title_in_power_menu);  //display icon label}@Overridepublic boolean showDuringKeyguard() {return true;}@Overridepublic boolean showBeforeProvisioning() {return true;}@Overridepublic void onPress() {// enter battery shelf modeIntent batteryShelfDialogIntent = new Intent();batteryShelfDialogIntent.setComponent(new ComponentName("com.wistron.touchfwupdate", "com.wistron.battery.BatteryShelfMode"));batteryShelfDialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);mContext.startActivity(batteryShelfDialogIntent);}}

GlobalActionsDialog.java文件中的createDialog 方法中找到globalActionsList
 

 mItems = new ArrayList<Action>();String[] defaultActions = mContext.getResources().getStringArray(R.array.config_globalActionsList);ArraySet<String> addedKeys = new ArraySet<String>();mHasLogoutButton = false;mHasLockdownButton = false;for (int i = 0; i < defaultActions.length; i++) {

frameworks/base/core/res/res/values/config.xml中的config_globalActionsList

添加key
 

<string-array translatable="false" name="config_globalActionsList"><item>power</item><item>restart</item><item>lockdown</item><item>logout</item><item>bugreport</item><item>screenshot</item><item>shelf_mode</item><item>emergency</item></string-array>

在 GlobalActionsDialog.java文件中的createDialog 方法中添加
 

for (int i = 0; i < defaultActions.length; i++) {String actionKey = defaultActions[i];if (addedKeys.contains(actionKey)) {// If we already have added this, don't add it again.continue;}if (GLOBAL_ACTION_KEY_POWER.equals(actionKey)) {mItems.add(new PowerAction());} else if (GLOBAL_ACTION_KEY_AIRPLANE.equals(actionKey)) {mItems.add(mAirplaneModeOn);} else if (GLOBAL_ACTION_KEY_BUGREPORT.equals(actionKey)) {if (Settings.Global.getInt(mContext.getContentResolver(),Settings.Global.BUGREPORT_IN_POWER_MENU, 0) != 0 && isCurrentUserOwner()) {mItems.add(new BugReportAction());}} else if (GLOBAL_ACTION_KEY_SILENT.equals(actionKey)) {if (mShowSilentToggle) {mItems.add(mSilentModeAction);}} else if (GLOBAL_ACTION_KEY_USERS.equals(actionKey)) {if (SystemProperties.getBoolean("fw.power_user_switcher", false)) {addUsersToMenu(mItems);}} else if (GLOBAL_ACTION_KEY_SETTINGS.equals(actionKey)) {mItems.add(getSettingsAction());} else if (GLOBAL_ACTION_KEY_LOCKDOWN.equals(actionKey)) {if (Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.LOCKDOWN_IN_POWER_MENU, 0, getCurrentUser().id) != 0&& shouldDisplayLockdown()) {mItems.add(getLockdownAction());mHasLockdownButton = true;}} else if (GLOBAL_ACTION_KEY_VOICEASSIST.equals(actionKey)) {mItems.add(getVoiceAssistAction());} else if (GLOBAL_ACTION_KEY_ASSIST.equals(actionKey)) {mItems.add(getAssistAction());} else if (GLOBAL_ACTION_KEY_RESTART.equals(actionKey)) {mItems.add(new RestartAction());} else if (GLOBAL_ACTION_KEY_SCREENSHOT.equals(actionKey)) {mItems.add(new ScreenshotAction());} else if (GLOBAL_ACTION_KEY_LOGOUT.equals(actionKey)) {if (mDevicePolicyManager.isLogoutEnabled()&& getCurrentUser().id != UserHandle.USER_SYSTEM) {mItems.add(new LogoutAction());mHasLogoutButton = true;}} else if (GLOBAL_ACTION_KEY_EMERGENCY.equals(actionKey)) {if (!mEmergencyAffordanceManager.needsEmergencyAffordance()) {mItems.add(new EmergencyDialerAction());}} else if (GLOBAL_ACTION_KEY_BATTERY_SHELF_MODE.equals(actionKey)) {
//                if (!SystemProperties.get("ro.boot.hwid", "0").equals("0"))mItems.add(new BatteryShelfModeAction());}else {Log.e(TAG, "Invalid global action key " + actionKey);}// Add here so we don't add more than one.addedKeys.add(actionKey);}

http://www.hrbkazy.com/news/36756.html

相关文章:

  • 网站开发需要大学吗如何自己搭建网站
  • 盐城做网站的公司百度推广登录网站
  • 网站怎么做多级菜单2024年2月新冠疫情又开始了吗
  • 装修公司做网站推广能接到活吗就在刚刚武汉宣布最新消息
  • 网站建设专员工作总结营销策略有哪些方面
  • 武汉哪家做网站百度竞价点击工具
  • 万脑网站建设优化培训课程
  • 网站建设主要流程图seo优化教学视频
  • 动易网站系统怎么样公司员工培训方案
  • 怎样做网站管理搜索引擎营销优化
  • 用腾讯云服务器做网站快速学电脑培训班
  • 怎么查网站权重搜索大全引擎
  • wordpress网页教程百度云百度seo效果怎么样
  • 大学生创业服务网站建设方案友情链接获取的途径有哪些
  • 做兼职网站的项目初衷seo营销策略
  • vb可以做网站吗网络推广有几种方法
  • 企业网站建设知乎网店运营具体做什么
  • 在哪个网站做推广好经典营销案例分析
  • wordpress 优秀主题seo诊断分析
  • 网站建设的增值税税率佛山网站建设
  • 网站所属权在线域名查询网站
  • 自己做鲜花网站怎么样最新天气预报最新消息
  • 广告行业包括网站建设吗关键词排名优化怎么做
  • dedecms医院网站网页搜索关键词
  • 网站出售商品建设2023年火爆的新闻
  • 长春网站制作长春万网变现流量推广app
  • 免费推广的方式有哪些快速优化seo软件
  • 佛山全市住宅限购seo怎么弄
  • phpcms 网站栏目百度一下你就知道下
  • 禅城网站建设公司百度关键词seo外包