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

++ <!--    &lt;!&ndash; Title of the setting to change hardware button behavior. This string-->
++ <!--         should be changed for each piece of hardware. [CHAR LIMIT=20] &ndash;&gt;-->
++ <!--    <string name="volume_button_setting_title">Volume buttons</string>-->

++ <!--    &lt;!&ndash; Entries listed in the setting for the side-button action. &ndash;&gt;-->
++ <!--    <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,移除时钟音量按钮的主要内容,如果未能解决你的问题,请参考以下文章

Android 11.0 在闹钟APK,长按进入夜间模式,松开退出夜间模式

Android 11.0 删除振动功能

制造商时钟/闹钟包和类名列表,请添加[关闭]

Android实战第一篇——时钟+闹钟+计时器+秒表

小米8青春版充电提示音怎么设置

Android 11.0 删除系统APK