commit 2d49a2a8ddad6e0c444ee3d1c4c51d4fdebe7429
parent f995cc1ed5a71f0b70fb5356c882376f915b85a2
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date: Thu, 22 Jun 2023 13:12:50 +0200
feat: story viewer override
- vertical story viewer
- discover playback seekbar
Diffstat:
3 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/app/src/main/assets/lang/en_US.json b/app/src/main/assets/lang/en_US.json
@@ -70,7 +70,8 @@
"enable_friend_feed_menu_bar": "Enable New Friend Feed Menu Bar",
"friend_feed_menu_buttons": "Friend Feed Menu Buttons",
"friend_feed_menu_buttons_position": "Friend Feed Buttons Position Index",
- "unlimited_conversation_pinning": "Unlimited Conversation Pinning"
+ "unlimited_conversation_pinning": "Unlimited Conversation Pinning",
+ "story_viewer_override": "Story Viewer Override"
},
"option": {
@@ -130,6 +131,11 @@
"EVERY_LAUNCH": "Every Launch",
"DAILY": "Daily",
"WEEKLY": "Weekly"
+ },
+ "story_viewer_override": {
+ "OFF": "Off",
+ "DISCOVER_PLAYBACK_SEEKBAR": "Enable Discover Playback Seekbar",
+ "VERTICAL_STORY_VIEWER": "Enable Vertical Story Viewer"
}
}
},
diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/config/ConfigProperty.kt b/app/src/main/kotlin/me/rhunk/snapenhance/config/ConfigProperty.kt
@@ -196,6 +196,13 @@ enum class ConfigProperty(
)
)
),
+ STORY_VIEWER_OVERRIDE("story_viewer_override",
+ ConfigCategory.UI_TWEAKS,
+ ConfigStateSelection(
+ listOf("OFF", "DISCOVER_PLAYBACK_SEEKBAR", "VERTICAL_STORY_VIEWER"),
+ "OFF"
+ )
+ ),
STREAK_EXPIRATION_INFO(
"streak_expiration_info",
ConfigCategory.UI_TWEAKS,
diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/features/impl/ConfigEnumKeys.kt b/app/src/main/kotlin/me/rhunk/snapenhance/features/impl/ConfigEnumKeys.kt
@@ -84,6 +84,19 @@ class ConfigEnumKeys : Feature("Config enum keys", loadParams = FeatureLoadParam
}
}
+ context.config.state(ConfigProperty.STORY_VIEWER_OVERRIDE).let { state ->
+ if (state == "OFF") return@let
+
+ hookAllEnums(context.mappings.getMappedClass("enums", "DISCOVER_FEED")) {
+ if (key == "DF_ENABLE_SHOWS_PAGE_CONTROLS" && state == "DISCOVER_PLAYBACK_SEEKBAR") {
+ set(true)
+ }
+ if (key == "DF_VOPERA_FOR_STORIES" && state == "VERTICAL_STORY_VIEWER") {
+ set(true)
+ }
+ }
+ }
+
ConfigProperty.ENABLE_APP_APPEARANCE.valueContainer.addPropertyChangeListener {
context.softRestartApp(true)
}