From bcbc8d8a2eb8b6e7a10638393bbf2aa1289f33ea Mon Sep 17 00:00:00 2001 From: xtaodada Date: Wed, 17 Apr 2024 21:55:20 +0800 Subject: [PATCH] feat: Disable Preview Video Sound Shortcut Thanks to @NullgramClient Co-authored-by: James Clef Co-authored-by: Henry-ZHR --- .../src/main/java/org/telegram/ui/ChatActivity.java | 4 ++++ .../nekogram/settings/NekoChatSettingsActivity.java | 1 + .../src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt | 6 ++++++ TMessagesProj/src/main/res/values-es-rES/strings_na.xml | 2 ++ TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml | 2 ++ TMessagesProj/src/main/res/values/strings_na.xml | 2 ++ 6 files changed, 17 insertions(+) diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index f1841f4155..00e95798fe 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -27464,6 +27464,10 @@ public boolean onPreDraw() { } public boolean maybePlayVisibleVideo() { + if (NaConfig.INSTANCE.getDisablePreviewVideoSoundShortcut().Bool()) { + return false; + } + if (chatListView == null) { return false; } diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoChatSettingsActivity.java b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoChatSettingsActivity.java index 2fc0139848..1595f68709 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoChatSettingsActivity.java +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoChatSettingsActivity.java @@ -156,6 +156,7 @@ public class NekoChatSettingsActivity extends BaseNekoXSettingsActivity implemen private final AbstractConfigCell disableMarkdownRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getDisableMarkdown())); private final AbstractConfigCell disableClickCommandToSendRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getDisableClickCommandToSend(), LocaleController.getString(R.string.DisableClickCommandToSendHint))); private final AbstractConfigCell showQuickReplyInBotCommandsRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getShowQuickReplyInBotCommands())); + private final AbstractConfigCell disablePreviewVideoSoundShortcutRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getDisablePreviewVideoSoundShortcut(), LocaleController.getString(R.string.DisablePreviewVideoSoundShortcutNotice))); private final AbstractConfigCell dividerInteractions = cellGroup.appendCell(new ConfigCellDivider()); // Sticker diff --git a/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt b/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt index 690410877d..73dc2f6277 100644 --- a/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt +++ b/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt @@ -578,6 +578,12 @@ object NaConfig { ConfigItem.configTypeBool, false ) + val disablePreviewVideoSoundShortcut = + addConfig( + "DisablePreviewVideoSoundShortcut", + ConfigItem.configTypeBool, + false + ) private fun addConfig( k: String, diff --git a/TMessagesProj/src/main/res/values-es-rES/strings_na.xml b/TMessagesProj/src/main/res/values-es-rES/strings_na.xml index b179ae9a38..8e6d9bd83e 100644 --- a/TMessagesProj/src/main/res/values-es-rES/strings_na.xml +++ b/TMessagesProj/src/main/res/values-es-rES/strings_na.xml @@ -136,4 +136,6 @@ Elige un nombre corto para tu paquete. Copiar Set de Sticker Deshabilitar botón de silenciar canal + Desactivar acceso directo al sonido de un video + Desactivar las teclas de volumen para reproducir el sonido de la vista previa del video diff --git a/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml b/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml index 0453b4b5fd..4f02c5da4a 100644 --- a/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml +++ b/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml @@ -136,4 +136,6 @@ 为您的包选择一个简短的名称。 复制整个贴纸包 禁用频道聊天页面的静音按钮 + 禁用预览视频音量快捷键 + 禁用音量键快捷开启预览视频的声音 diff --git a/TMessagesProj/src/main/res/values/strings_na.xml b/TMessagesProj/src/main/res/values/strings_na.xml index c2b2d47db9..102c398717 100644 --- a/TMessagesProj/src/main/res/values/strings_na.xml +++ b/TMessagesProj/src/main/res/values/strings_na.xml @@ -136,4 +136,6 @@ Choose a short name for your pack. Copy Sticker Set Disable channel mute button + Disable preview video sound shortcut + Disable volume keys to enable preview video sound