mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 11:21:18 +08:00
新增自定义状态栏通知最大点数
This commit is contained in:
@@ -931,6 +931,19 @@ class SettingsActivity : MIUIActivity() {
|
||||
3
|
||||
)
|
||||
)
|
||||
add(
|
||||
TextV(
|
||||
resId = R.string.maximum_number_of_notification_dots
|
||||
)
|
||||
)
|
||||
add(
|
||||
SeekBarWithTextV(
|
||||
"maximum_number_of_notification_dots",
|
||||
0,
|
||||
4,
|
||||
3
|
||||
)
|
||||
)
|
||||
add(
|
||||
TextSummaryArrowV(
|
||||
TextSummaryV(
|
||||
|
||||
@@ -6,12 +6,13 @@ import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
object MaximumNumberOfNotificationIcons: HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
val size = XSPUtils.getInt("maximum_number_of_notification_icons",3)
|
||||
val icons = XSPUtils.getInt("maximum_number_of_notification_icons",3)
|
||||
val dots = XSPUtils.getInt("maximum_number_of_notification_dots",3)
|
||||
"com.android.systemui.statusbar.phone.NotificationIconContainer".replaceMethod(getDefaultClassLoader(), "miuiShowNotificationIcons", Boolean::class.java) {
|
||||
if (it.args[0] as Boolean) {
|
||||
it.thisObject.setIntField("MAX_DOTS", size)
|
||||
it.thisObject.setIntField("MAX_STATIC_ICONS", size)
|
||||
it.thisObject.setIntField("MAX_VISIBLE_ICONS_ON_LOCK", size)
|
||||
it.thisObject.setIntField("MAX_DOTS", dots)
|
||||
it.thisObject.setIntField("MAX_STATIC_ICONS", icons)
|
||||
it.thisObject.setIntField("MAX_VISIBLE_ICONS_ON_LOCK", icons)
|
||||
} else {
|
||||
it.thisObject.setIntField("MAX_DOTS", 0)
|
||||
it.thisObject.setIntField("MAX_STATIC_ICONS", 0)
|
||||
|
||||
@@ -199,4 +199,5 @@
|
||||
<string name="status_bar_layout_mode">Status bar layout mode</string>
|
||||
<string name="clock_center_and_icon_left">Clock Center and Icon Left</string>
|
||||
<string name="maximum_number_of_notification_icons">Maximum number of notification icons</string>
|
||||
<string name="maximum_number_of_notification_dots">Maximum number of notification dots</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user