Skip to content

Commit

Permalink
feat: systemui - cc - HideEditButton
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevtinge committed Jun 16, 2024
1 parent 609665e commit 91b0f27
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.sevtinge.hyperceiler.module.hook.systemui.plugin;

import static de.robv.android.xposed.XC_MethodReplacement.returnConstant;

import de.robv.android.xposed.XposedHelpers;

public class HideEditButton {
public static void initHideEditButton(ClassLoader classLoader) {
XposedHelpers.findAndHookMethod("miui.systemui.controlcenter.panel.main.qs.EditButtonController", classLoader, "available", boolean.class, returnConstant(false));
XposedHelpers.findAndHookMethod("miui.systemui.controlcenter.panel.main.qs.EditButtonController", classLoader, "available", boolean.class, "miui.systemui.controlcenter.panel.main.MainPanelModeController$MainPanelMode", returnConstant(false));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ protected void after(MethodHookParam param) {

public void setClassLoader(ClassLoader classLoader) {
// CCGrid.loadCCGrid(classLoader);
if (mPrefsMap.getBoolean("system_ui_control_center_hide_edit_botton"))
HideEditButton.initHideEditButton(classLoader);
if (mPrefsMap.getBoolean("system_ui_plugin_enable_volume_blur"))
EnableVolumeBlur.initEnableVolumeBlur(classLoader);
if (mPrefsMap.getStringAsInt("system_ui_control_center_mi_smart_hub_entry", 0) != 0)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@
<string name="system_ui_control_center_show_weather">显示天气</string>
<string name="system_ui_control_center_show_weather_city">显示地区</string>
<string name="system_ui_control_center_disable_device_managed">隐藏网络监控提示</string>
<string name="system_ui_control_center_hide_edit_botton">隐藏编辑按钮</string>
<string name="system_ui_control_center_unimportant_notification">禁止折叠为历史通知</string>
<string name="system_ui_control_center_mute_visible_notice">亮屏时静音</string>
<string name="system_ui_control_center_expand_notification">展开通知</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@
<string name="system_ui_control_center_show_weather">Show weather</string>
<string name="system_ui_control_center_show_weather_city">Show city</string>
<string name="system_ui_control_center_disable_device_managed">Hide network monitoring prompts</string>
<string name="system_ui_control_center_hide_edit_botton">Hide edit button</string>
<string name="system_ui_control_center_mute_visible_notice">Mute when screen is on</string>
<string name="system_ui_control_center_unimportant_notification">Collapse into history notifications is prohibited</string>
<string name="system_ui_control_center_expand_notification">Expand Notifications</string>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/xml/system_ui_control_center.xml
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,11 @@

<PreferenceCategory android:title="@string/system_ui_controlcenter_new_title">

<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_system_ui_control_center_hide_edit_botton"
android:title="@string/system_ui_control_center_hide_edit_botton" />

<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_system_ui_control_center_disable_device_managed"
Expand Down

0 comments on commit 91b0f27

Please sign in to comment.