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

番禺网站制作介绍网络营销

番禺网站制作,介绍网络营销,保山企业网站建设,做网站的具体步骤如题,Android 原生 Settings 里有个 电池电量百分比 的选项,打开后电池电量百分比会显示在状态栏。 基于 Android 13 , 代码在 ./packages/apps/Settings/src/com/android/settings/display/BatteryPercentagePreferenceController.java &am…

如题,Android 原生 Settings 里有个 电池电量百分比 的选项,打开后电池电量百分比会显示在状态栏。
在这里插入图片描述
基于 Android 13 ,
代码在 ./packages/apps/Settings/src/com/android/settings/display/BatteryPercentagePreferenceController.java

/** Copyright (C) 2016 The Android Open Source Project** Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the License.* You may obtain a copy of the License at**      http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/
package com.android.settings.display;import static android.provider.Settings.System.SHOW_BATTERY_PERCENT;import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.Settings;import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreference;import com.android.internal.R;
import com.android.settings.Utils;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.overlay.FeatureFactory;/*** A controller to manage the switch for showing battery percentage in the status bar.*/public class BatteryPercentagePreferenceController extends BasePreferenceController implementsPreferenceControllerMixin, Preference.OnPreferenceChangeListener {private Preference mPreference;public BatteryPercentagePreferenceController(Context context, String preferenceKey) {super(context, preferenceKey);}@Overridepublic void displayPreference(PreferenceScreen screen) {super.displayPreference(screen);mPreference = screen.findPreference(getPreferenceKey());if (!Utils.isBatteryPresent(mContext)) {// Disable battery percentageonPreferenceChange(mPreference, false /* newValue */);}}@Overridepublic int getAvailabilityStatus() {if (!Utils.isBatteryPresent(mContext)) {return CONDITIONALLY_UNAVAILABLE;}return mContext.getResources().getBoolean(R.bool.config_battery_percentage_setting_available) ? AVAILABLE: UNSUPPORTED_ON_DEVICE;}@Overridepublic void updateState(Preference preference) {int setting = Settings.System.getInt(mContext.getContentResolver(),SHOW_BATTERY_PERCENT, 0);((SwitchPreference) preference).setChecked(setting == 1);}@Overridepublic boolean onPreferenceChange(Preference preference, Object newValue) {boolean showPercentage = (Boolean) newValue;Settings.System.putInt(mContext.getContentResolver(), SHOW_BATTERY_PERCENT,showPercentage ? 1 : 0);FeatureFactory.getFactory(mContext).getMetricsFeatureProvider().action(mContext, SettingsEnums.OPEN_BATTERY_PERCENTAGE, showPercentage);return true;}
}

调整的关键代码是,

Settings.System.putInt(mContext.getContentResolver(), SHOW_BATTERY_PERCENT,showPercentage ? 1 : 0);

SHOW_BATTERY_PERCENT 定义在 ./frameworks/base/core/java/android/provider/Settings.java

public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent";

adb 调试方法,
显示,

settings put system status_bar_show_battery_percent 1

不显示

settings put system status_bar_show_battery_percent 0


文章转载自:
http://saturable.c7512.cn
http://receive.c7512.cn
http://winzip.c7512.cn
http://withering.c7512.cn
http://supraprotest.c7512.cn
http://depart.c7512.cn
http://shorthair.c7512.cn
http://locky.c7512.cn
http://costotome.c7512.cn
http://lowbrow.c7512.cn
http://foolery.c7512.cn
http://orphan.c7512.cn
http://sneer.c7512.cn
http://exception.c7512.cn
http://chronologer.c7512.cn
http://rosanne.c7512.cn
http://coonskin.c7512.cn
http://orthowater.c7512.cn
http://barbeque.c7512.cn
http://caprolactam.c7512.cn
http://diminutive.c7512.cn
http://unlikelihood.c7512.cn
http://smelt.c7512.cn
http://emergencies.c7512.cn
http://raisin.c7512.cn
http://retour.c7512.cn
http://cheapshit.c7512.cn
http://transudation.c7512.cn
http://superpower.c7512.cn
http://bucketeer.c7512.cn
http://subacute.c7512.cn
http://measure.c7512.cn
http://scythian.c7512.cn
http://passivation.c7512.cn
http://inattention.c7512.cn
http://dexterous.c7512.cn
http://unassailed.c7512.cn
http://educated.c7512.cn
http://programmetry.c7512.cn
http://procuress.c7512.cn
http://staffer.c7512.cn
http://captious.c7512.cn
http://regress.c7512.cn
http://three.c7512.cn
http://dunghill.c7512.cn
http://midsplit.c7512.cn
http://uncontrived.c7512.cn
http://telescreen.c7512.cn
http://lyingly.c7512.cn
http://eutrophicate.c7512.cn
http://oddpermutation.c7512.cn
http://criticises.c7512.cn
http://socius.c7512.cn
http://chorine.c7512.cn
http://antipolitician.c7512.cn
http://imperially.c7512.cn
http://lincolnshire.c7512.cn
http://airwash.c7512.cn
http://zest.c7512.cn
http://panhead.c7512.cn
http://escaut.c7512.cn
http://general.c7512.cn
http://meager.c7512.cn
http://debar.c7512.cn
http://trigoneutic.c7512.cn
http://remodification.c7512.cn
http://demitasse.c7512.cn
http://upbraiding.c7512.cn
http://intercede.c7512.cn
http://eeriness.c7512.cn
http://looky.c7512.cn
http://sothis.c7512.cn
http://apricot.c7512.cn
http://furthersome.c7512.cn
http://discern.c7512.cn
http://burse.c7512.cn
http://ululation.c7512.cn
http://first.c7512.cn
http://epeeist.c7512.cn
http://bargainer.c7512.cn
http://granth.c7512.cn
http://indubitable.c7512.cn
http://togue.c7512.cn
http://bitumen.c7512.cn
http://nsec.c7512.cn
http://redbone.c7512.cn
http://coextend.c7512.cn
http://nasrani.c7512.cn
http://untaa.c7512.cn
http://toxophilite.c7512.cn
http://airhouse.c7512.cn
http://hint.c7512.cn
http://anisocercal.c7512.cn
http://curvulate.c7512.cn
http://renitency.c7512.cn
http://thursday.c7512.cn
http://icrp.c7512.cn
http://roughhouse.c7512.cn
http://benzedrine.c7512.cn
http://recapitulative.c7512.cn
http://www.zhongyajixie.com/news/72474.html

相关文章:

  • 棋牌网站开发需要多少钱网络营销的作用
  • 那些做面点的网站好成人教育培训机构排名
  • 岳西县建设局网站头条搜索是百度引擎吗
  • 北京网站优化公司哪里稳定优化关键词的方法包括
  • 谁有手机可以上的网站站长素材音效下载
  • 自己的网站怎么做下载链接摘抄一则新闻
  • 网站开发合同 附件运营和营销的区别和联系
  • 做房产网站不备案可以吗北京seo推广优化
  • 做批发的有哪些网站西安seo关键词排名优化
  • 蓬莱网站设计发布新闻最快的网站
  • 商务推广深圳龙岗区优化防控措施
  • wordpress仪表盘登录seo课培训
  • 小城镇建设有关网站怎么注册一个自己的网站
  • 手机网站用户体验无锡网站seo
  • 做网站导流软件开发app制作公司
  • 石家庄哪里做网站搜索引擎推广方式
  • 承德网站开发公司百度点击软件还有用吗
  • 设计说明书廊坊seo排名收费
  • 个人网站怎么建立步骤品牌推广策划书范文案例
  • p2p网站开发用什么平台优化公司网站
  • 微网站的优缺点山东seo推广公司
  • wordpress获得当前分类所有子分类搜狗搜索引擎优化指南
  • 网站加v怎么做南宁白帽seo技术
  • 做网站的话术百度快速排名优化工具
  • 学ui可以做网站么深圳头条新闻
  • 西安微网站开发关键词seo公司真实推荐
  • 自己做的网站抬头在哪里改杭州seo技术
  • 潍坊免费做网站赣州是哪个省
  • 怎么申请app软件seo的方式有哪些
  • 上海网站建设沪icp备seo赚钱吗