Skip to content

Commit

Permalink
opt: systemui-ctrlCenter-ProgressBar(custom) ProgressBar Color
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevtinge committed Mar 26, 2024
1 parent 7cb1b17 commit d01af8c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import android.graphics.drawable.*
import android.hardware.*
import android.media.*
import android.os.*
import android.util.*
import android.view.*
import android.widget.*
import androidx.annotation.*
Expand All @@ -34,6 +35,7 @@ import com.github.kyuubiran.ezxhelper.ClassUtils.loadClassOrNull
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createAfterHook
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createBeforeHook
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook
import com.github.kyuubiran.ezxhelper.Log
import com.github.kyuubiran.ezxhelper.ObjectHelper.Companion.objectHelper
import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder
import com.sevtinge.hyperceiler.module.base.*
Expand Down Expand Up @@ -160,8 +162,8 @@ class MediaControlPanelBackgroundMix : BaseHook() {
action2?.setColorFilter(Color.BLACK)
action3?.setColorFilter(Color.BLACK)
action4?.setColorFilter(Color.BLACK)
seekBar?.progressDrawable?.colorFilter = colorFilter(Color.BLACK)
seekBar?.thumb?.colorFilter = colorFilter(if (mPrefsMap.getStringAsInt("system_ui_control_center_media_control_progress_mode", 0) == 2) Color.TRANSPARENT else Color.BLACK)
seekBar?.progressDrawable?.colorFilter = colorFilter(Color.argb(165, 0, 0, 0))
seekBar?.thumb?.colorFilter = colorFilter(if (mPrefsMap.getStringAsInt("system_ui_control_center_media_control_progress_mode", 0) == 2) Color.TRANSPARENT else Color.argb(165, 0, 0, 0))
elapsedTimeView?.setTextColor(grey)
totalTimeView?.setTextColor(grey)
} else {
Expand All @@ -173,8 +175,8 @@ class MediaControlPanelBackgroundMix : BaseHook() {
action2?.setColorFilter(Color.WHITE)
action3?.setColorFilter(Color.WHITE)
action4?.setColorFilter(Color.WHITE)
seekBar?.progressDrawable?.colorFilter = colorFilter(Color.WHITE)
seekBar?.thumb?.colorFilter = colorFilter((if (mPrefsMap.getStringAsInt("system_ui_control_center_media_control_progress_mode", 0) == 2) Color.TRANSPARENT else Color.WHITE))
seekBar?.progressDrawable?.colorFilter = colorFilter(Color.argb(165, 255, 255, 255))
seekBar?.thumb?.colorFilter = colorFilter((if (mPrefsMap.getStringAsInt("system_ui_control_center_media_control_progress_mode", 0) == 2) Color.TRANSPARENT else Color.argb(165, 255, 255, 255)))
elapsedTimeView?.setTextColor(grey)
totalTimeView?.setTextColor(grey)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class MediaControlSeekbarCustom : BaseHook() {
private val progressThickness by lazy {
mPrefsMap.getInt("system_ui_control_center_media_control_progress_thickness", 80)
}

//from https://github.com/YuKongA/MediaControl-BlurBg
override fun init() {
EzXHelper.initHandleLoadPackage(lpparam)
EzXHelper.setLogTag(TAG)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ja-rJP/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@
<string name="system_ui_control_center_blur_background_alpha">背景ぼかしの値</string>
<string name="system_ui_control_center_default_background_alpha">デフォルトの背景値</string>
<string name="system_ui_control_center_media_control_panel_background_mix">メディアコントロールパネルの色混合効果を最適化</string>
<string name="system_ui_control_center_media_control_progress_">プログレスバー</string>
<string name="system_ui_control_center_media_control_progress">プログレスバー</string>
<string name="system_ui_control_center_media_control_progress_wavy">波状</string>
<string name="system_ui_control_center_media_control_progress_sleek">スリーク</string>
<string name="system_ui_control_center_media_control_progress_thickness">太さ</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@
<string name="system_ui_control_center_blur_background_alpha">Valor do blur de fundo</string>
<string name="system_ui_control_center_default_background_alpha">Valor padrão de fundo</string>
<string name="system_ui_control_center_media_control_panel_background_mix">Otimizar efeito de mistura de cores do painel de controle de mídia</string>
<string name="system_ui_control_center_media_control_progress_">Barra de progresso</string>
<string name="system_ui_control_center_media_control_progress">Barra de progresso</string>
<string name="system_ui_control_center_media_control_progress_wavy">Ondulado</string>
<string name="system_ui_control_center_media_control_progress_sleek">Suave</string>
<string name="system_ui_control_center_media_control_progress_thickness">Rígido</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@
<string name="system_ui_control_center_corner_radius_desc">默认主题无需调节</string>
<string name="system_ui_control_center_blur_background_alpha">通知背景透明度</string>
<string name="system_ui_control_center_default_background_alpha">下拉通知背景透明度</string>
<string name="system_ui_control_center_media_control_progress_">媒体进度条样式</string>
<string name="system_ui_control_center_media_control_progress">媒体进度条样式</string>
<string name="system_ui_control_center_media_control_progress_wavy">波浪</string>
<string name="system_ui_control_center_media_control_progress_sleek">圆滑</string>
<string name="system_ui_control_center_media_control_progress_thickness">粗细</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@
<string name="system_ui_control_center_blur_background_alpha">Blur Background value</string>
<string name="system_ui_control_center_default_background_alpha">Default Background value</string>
<string name="system_ui_control_center_media_control_panel_background_mix">Optimize the color mixing effect of the media control panel</string>
<string name="system_ui_control_center_media_control_progress_">Progress Bar</string>
<string name="system_ui_control_center_media_control_progress">Progress Bar</string>
<string name="system_ui_control_center_media_control_progress_wavy">Wavy</string>
<string name="system_ui_control_center_media_control_progress_sleek">Sleek</string>
<string name="system_ui_control_center_media_control_progress_thickness">Thickness</string>
Expand Down
34 changes: 17 additions & 17 deletions app/src/main/res/xml/system_ui_control_center.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,23 +127,6 @@

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

<DropDownPreference
android:defaultValue="0"
android:key="prefs_key_system_ui_control_center_media_control_progress_mode"
android:title="@string/system_ui_control_center_media_control_progress_"
app:entries="@array/system_ui_control_center_media_control_progress_mode"
app:entryValues="@array/system_ui_control_center_media_control_progress_mode_value" />

<SeekBarPreferenceEx
android:key="prefs_key_system_ui_control_center_media_control_progress_thickness"
android:title="@string/system_ui_control_center_media_control_progress_thickness"
app:format="%d dp"
app:maxValue="260"
app:minValue="20"
android:defaultValue="80"
app:showSeekBarValue="true"
app:stepValue="1" />

<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_system_ui_control_center_media_control_panel_background_mix"
Expand Down Expand Up @@ -180,6 +163,23 @@
app:showSeekBarValue="true"
app:stepValue="1" />

<DropDownPreference
android:defaultValue="0"
android:key="prefs_key_system_ui_control_center_media_control_progress_mode"
android:title="@string/system_ui_control_center_media_control_progress"
app:entries="@array/system_ui_control_center_media_control_progress_mode"
app:entryValues="@array/system_ui_control_center_media_control_progress_mode_value" />

<SeekBarPreferenceEx
android:key="prefs_key_system_ui_control_center_media_control_progress_thickness"
android:title="@string/system_ui_control_center_media_control_progress_thickness"
app:format="%d dp"
app:maxValue="260"
app:minValue="20"
android:defaultValue="80"
app:showSeekBarValue="true"
app:stepValue="1" />

</PreferenceCategory>

<PreferenceCategory android:title="@string/system_ui_controlcenter_card_title">
Expand Down

0 comments on commit d01af8c

Please sign in to comment.