Android 11.0 在闹钟APK,移除时钟音量按钮
Posted 王睿丶
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Android 11.0 在闹钟APK,移除时钟音量按钮相关的知识,希望对你有一定的参考价值。
相关文件
packages/apps/DeskClock/res/values/strings.xml
packages/apps/DeskClock/res/xml/settings.xml
packages/apps/DeskClock/src/com/android/deskclock/settings/SettingsActivity.java
移除字样
packages/apps/DeskClock/res/values/strings.xml
++ <!-- <!– Title of the setting to change hardware button behavior. This string-->
++ <!-- should be changed for each piece of hardware. [CHAR LIMIT=20] –>-->
++ <!-- <string name="volume_button_setting_title">Volume buttons</string>-->
++ <!-- <!– Entries listed in the setting for the side-button action. –>-->
++ <!-- <string-array name="volume_button_setting_entries">-->
++ <!-- <item>Snooze</item>-->
++ <!-- <item>Dismiss</item>-->
++ <!-- <item>Control volume</item>-->
++ <!-- </string-array>-->
移除布局
packages/apps/DeskClock/res/xml/settings.xml
++ <!-- <com.android.deskclock.settings.SimpleMenuPreference-->
++ <!-- android:defaultValue="0"-->
++ <!-- android:dialogTitle="@string/volume_button_setting_title"-->
++ <!-- android:entries="@array/volume_button_setting_entries"-->
++ <!-- android:entryValues="@array/volume_button_setting_values"-->
++ <!-- android:key="volume_button_setting"-->
++ <!-- android:title="@string/volume_button_setting_title" />-->
移除选项
packages/apps/DeskClock/src/com/android/deskclock/settings/SettingsActivity.java
private void refresh()
final SimpleMenuPreference clockStylePref = (SimpleMenuPreference)
findPreference(KEY_CLOCK_STYLE);
clockStylePref.setSummary(clockStylePref.getEntry());
clockStylePref.setOnPreferenceChangeListener(this);
++ // final SimpleMenuPreference volumeButtonsPref = (SimpleMenuPreference)
++ // findPreference(KEY_VOLUME_BUTTONS);
++ // volumeButtonsPref.setSummary(volumeButtonsPref.getEntry());
++ // volumeButtonsPref.setOnPreferenceChangeListener(this);
final Preference clockSecondsPref = findPreference(KEY_CLOCK_DISPLAY_SECONDS);
clockSecondsPref.setOnPreferenceChangeListener(this);
@Override
public void onCreatePreferences(Bundle bundle, String rootKey)
getPreferenceManager().setStorageDeviceProtected();
addPreferencesFromResource(R.xml.settings);
final Preference timerVibrate = findPreference(KEY_TIMER_VIBRATE);
final boolean hasVibrator = ((Vibrator) timerVibrate.getContext()
.getSystemService(VIBRATOR_SERVICE)).hasVibrator();
timerVibrate.setVisible(hasVibrator);
++ //timerVibrate.setVisible(false);
loadTimeZoneList();
以上是关于Android 11.0 在闹钟APK,移除时钟音量按钮的主要内容,如果未能解决你的问题,请参考以下文章