diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI.java b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI.java index 3ba04955e6..f21627cf92 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI.java @@ -53,6 +53,7 @@ import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.GmsTile; import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.HideDelimiter; import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.MediaControlPanelBackgroundMix; +import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.MediaControlPanelTimeViewTextSize; import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.MediaControlSeekbarCustom; import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.MoreCardTiles; import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.MuteVisibleNotifications; @@ -136,6 +137,7 @@ public class SystemUI extends BaseModule { public void handleLoadPackage() { // PluginHelper initHook(new PluginHelper()); + initHook(new MediaControlPanelTimeViewTextSize(), mPrefsMap.getInt("system_ui_control_center_media_control_time_view_text_size", 13) == 13); // 充电动画 initHook(new ChargeAnimationStyle(), mPrefsMap.getStringAsInt("system_ui_charge_animation_style", 0) > 0); // initHook(DisableChargeAnimation.INSTANCE); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/MediaControlPanelTimeViewTextSize.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/MediaControlPanelTimeViewTextSize.kt new file mode 100644 index 0000000000..07ef980e5e --- /dev/null +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/MediaControlPanelTimeViewTextSize.kt @@ -0,0 +1,40 @@ +package com.sevtinge.hyperceiler.module.hook.systemui.controlcenter + +import android.util.* +import android.widget.* +import com.github.kyuubiran.ezxhelper.* +import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createAfterHook +import com.github.kyuubiran.ezxhelper.ObjectHelper.Companion.objectHelper +import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder +import com.sevtinge.hyperceiler.module.base.* + +class MediaControlPanelTimeViewTextSize : BaseHook() { + + private val textSize by lazy { + mPrefsMap.getInt("system_ui_control_center_media_control_time_view_text_size", 13).toFloat() + } + + //from https://github.com/YuKongA/MediaControl-BlurBg + override fun init() { + EzXHelper.initHandleLoadPackage(lpparam) + EzXHelper.setLogTag(TAG) + EzXHelper.setToastTag(TAG) + + val miuiMediaControlPanel = + ClassUtils.loadClassOrNull("com.android.systemui.statusbar.notification.mediacontrol.MiuiMediaControlPanel") + + miuiMediaControlPanel?.methodFinder()?.filterByName("bindPlayer")?.first() + ?.createAfterHook { + val mMediaViewHolder = + it.thisObject.objectHelper().getObjectOrNullUntilSuperclass("mMediaViewHolder") + ?: return@createAfterHook + val elapsedTimeView = + mMediaViewHolder.objectHelper().getObjectOrNullAs("elapsedTimeView") + val totalTimeView = + mMediaViewHolder.objectHelper().getObjectOrNullAs("totalTimeView") + + elapsedTimeView?.setTextSize(TypedValue.COMPLEX_UNIT_DIP, textSize) + totalTimeView?.setTextSize(TypedValue.COMPLEX_UNIT_DIP, textSize) + } + } +} \ No newline at end of file diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index d91a67c680..29108d3bcc 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -813,6 +813,7 @@ 波浪 圆滑 粗细 + 时间预览文本大小 优化音乐面板背景混色效果 移除卡片混色背景 背景模糊半径 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8a8fcbcb72..9c80341292 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -796,6 +796,7 @@ Wavy Sleek Thickness + Time view text size Remove mixed color background from card Background blur radius Opacity of the background overlay layer diff --git a/app/src/main/res/xml/system_ui_control_center.xml b/app/src/main/res/xml/system_ui_control_center.xml index 28ec5f1bea..0cb8799a12 100644 --- a/app/src/main/res/xml/system_ui_control_center.xml +++ b/app/src/main/res/xml/system_ui_control_center.xml @@ -180,6 +180,17 @@ app:showSeekBarValue="true" app:stepValue="1" /> + +