Skip to content

Commit

Permalink
Add AOD darkness slider
Browse files Browse the repository at this point in the history
  • Loading branch information
PL7963 committed Aug 27, 2024
1 parent 0e08a28 commit 092d36c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ object LinkageAnimCustomer : YukiBaseHooker() {
val off =
MiWallpaperHook.mainPrefs.getInt("screen_off_color_fade_anim_val", 450)
val chenAnimLinkage = MiWallpaperHook.mainPrefs.getBoolean("lineage_aod_chen_wallpaper_anim", false)
val wallpaperBlackAlpha = MiWallpaperHook.mainPrefs.getInt("wallpaper_black_alpha", 80)
.toFloat() / 100

initAnim()
Log.d("Art_Chen", "ClockBaseAnimation-LinkageAnim: start! toAod $toAod hasNotification $hasNotification")
Expand All @@ -108,7 +110,7 @@ object LinkageAnimCustomer : YukiBaseHooker() {

val stateStyle = XposedHelpers.callStaticMethod("miuix.animation.Folme".toClass(), "useValue", arrayOf("WallpaperParam"))
XposedHelpers.callMethod(toAodAnimConfig, "setEase", mWallpaperHideEase)
XposedHelpers.callMethod(stateStyle, "to", arrayOf("wallpaperBlack", if (chenAnimLinkage) 0.8f else 1f, toAodAnimConfig))
XposedHelpers.callMethod(stateStyle, "to", arrayOf("wallpaperBlack", if (chenAnimLinkage) wallpaperBlackAlpha else 1f, toAodAnimConfig))
} else {
XposedHelpers.callMethod(showEase, "setDuration", on.toLong())
val stateStyle = XposedHelpers.callStaticMethod("miuix.animation.Folme".toClass(), "useValue", arrayOf("WallpaperParam"))
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 @@ -135,4 +135,5 @@
<string name="lineage_aod_wallpaper_anim_title">联动息屏和琛的壁纸动画</string>
<string name="lineage_aod_wallpaper_anim_summary">警告:长亮AOD时有烧屏风险</string>
<string name="enable_home_text_shadow_title">启用桌面文字阴影效果</string>
<string name="wallpaper_black_alpha_title">壁纸压暗程度</string>">
</resources>
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 @@ -137,4 +137,5 @@
<string name="lineage_aod_wallpaper_anim_title">Lineage Aod and Chen Wallpaper Anim</string>
<string name="lineage_aod_wallpaper_anim_summary">WARNING: May cause screen burn if AOD Always mode</string>
<string name="enable_home_text_shadow_title">Enable Home Text Shadow</string>
<string name="wallpaper_black_alpha_title">Wallpaper Darkness</string>">
</resources>
8 changes: 8 additions & 0 deletions app/src/main/res/xml/chen_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@
app:title="@string/lineage_aod_wallpaper_anim_title"
app:summary="@string/lineage_aod_wallpaper_anim_summary"/>

<SeekBarPreference
android:max="100"
app:key="wallpaper_black_alpha"
app:dependency="lineage_aod_chen_wallpaper_anim"
app:defaultValue="80"
app:min="0"
app:updatesContinuously="true"
app:title="@string/wallpaper_black_alpha_title" />

<rikka.material.preference.MaterialSwitchPreference
app:key="disable_wallpaper_auto_darken"
Expand Down

0 comments on commit 092d36c

Please sign in to comment.