mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-06-12 05:07:46 +02:00
feat: half swipe notifier duration range
This commit is contained in:
@ -363,7 +363,17 @@
|
||||
},
|
||||
"half_swipe_notifier": {
|
||||
"name": "Half Swipe Notifier",
|
||||
"description": "Notifies you when someone half swipes into a conversation"
|
||||
"description": "Notifies you when someone half swipes into a conversation",
|
||||
"properties": {
|
||||
"min_duration": {
|
||||
"name": "Minimum Duration",
|
||||
"description": "The minimum duration of the half swipe (in seconds)"
|
||||
},
|
||||
"max_duration": {
|
||||
"name": "Maximum Duration",
|
||||
"description": "The maximum duration of the half swipe (in seconds)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"message_preview_length": {
|
||||
"name": "Message Preview Length",
|
||||
|
@ -2,9 +2,19 @@ package me.rhunk.snapenhance.common.config.impl
|
||||
|
||||
import me.rhunk.snapenhance.common.config.ConfigContainer
|
||||
import me.rhunk.snapenhance.common.config.FeatureNotice
|
||||
import me.rhunk.snapenhance.common.config.PropertyValue
|
||||
import me.rhunk.snapenhance.common.data.NotificationType
|
||||
|
||||
class MessagingTweaks : ConfigContainer() {
|
||||
inner class HalfSwipeNotifierConfig : ConfigContainer(hasGlobalState = true) {
|
||||
val minDuration: PropertyValue<Int> = integer("min_duration", defaultValue = 0) {
|
||||
inputCheck = { it.toIntOrNull()?.coerceAtLeast(0) != null && maxDuration.get() >= it.toInt() }
|
||||
}
|
||||
val maxDuration: PropertyValue<Int> = integer("max_duration", defaultValue = 20) {
|
||||
inputCheck = { it.toIntOrNull()?.coerceAtLeast(0) != null && minDuration.get() <= it.toInt() }
|
||||
}
|
||||
}
|
||||
|
||||
val bypassScreenshotDetection = boolean("bypass_screenshot_detection") { requireRestart() }
|
||||
val anonymousStoryViewing = boolean("anonymous_story_viewing")
|
||||
val preventStoryRewatchIndicator = boolean("prevent_story_rewatch_indicator") { requireRestart() }
|
||||
@ -13,7 +23,7 @@ class MessagingTweaks : ConfigContainer() {
|
||||
val hideTypingNotifications = boolean("hide_typing_notifications")
|
||||
val unlimitedSnapViewTime = boolean("unlimited_snap_view_time")
|
||||
val disableReplayInFF = boolean("disable_replay_in_ff")
|
||||
val halfSwipeNotifier = boolean("half_swipe_notifier") { requireRestart() }
|
||||
val halfSwipeNotifier = container("half_swipe_notifier", HalfSwipeNotifierConfig()) { requireRestart()}
|
||||
val messagePreviewLength = integer("message_preview_length", defaultValue = 20)
|
||||
val callStartConfirmation = boolean("call_start_confirmation") { requireRestart() }
|
||||
val autoSaveMessagesInConversations = multiple("auto_save_messages_in_conversations",
|
||||
|
Reference in New Issue
Block a user