Skip to content

Commit

Permalink
feat: Disable Preview Video Sound Shortcut
Browse files Browse the repository at this point in the history
Thanks to @NullgramClient

Co-authored-by: James Clef <[email protected]>
Co-authored-by: Henry-ZHR <[email protected]>
  • Loading branch information
3 people committed Apr 17, 2024
1 parent 65517f7 commit bcbc8d8
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -27464,6 +27464,10 @@ public boolean onPreDraw() {
}

public boolean maybePlayVisibleVideo() {
if (NaConfig.INSTANCE.getDisablePreviewVideoSoundShortcut().Bool()) {
return false;
}

if (chatListView == null) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,12 @@ object NaConfig {
ConfigItem.configTypeBool,
false
)
val disablePreviewVideoSoundShortcut =
addConfig(
"DisablePreviewVideoSoundShortcut",
ConfigItem.configTypeBool,
false
)

private fun addConfig(
k: String,
Expand Down
2 changes: 2 additions & 0 deletions TMessagesProj/src/main/res/values-es-rES/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,6 @@
<string name="StickersChooseShortNameForStickerPack">Elige un nombre corto para tu paquete.</string>
<string name="StickersCopyStickerSet">Copiar Set de Sticker</string>
<string name="DisableChannelMuteButton">Deshabilitar botón de silenciar canal</string>
<string name="DisablePreviewVideoSoundShortcut">Desactivar acceso directo al sonido de un video</string>
<string name="DisablePreviewVideoSoundShortcutNotice">Desactivar las teclas de volumen para reproducir el sonido de la vista previa del video</string>
</resources>
2 changes: 2 additions & 0 deletions TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,6 @@
<string name="StickersChooseShortNameForStickerPack">为您的包选择一个简短的名称。</string>
<string name="StickersCopyStickerSet">复制整个贴纸包</string>
<string name="DisableChannelMuteButton">禁用频道聊天页面的静音按钮</string>
<string name="DisablePreviewVideoSoundShortcut">禁用预览视频音量快捷键</string>
<string name="DisablePreviewVideoSoundShortcutNotice">禁用音量键快捷开启预览视频的声音</string>
</resources>
2 changes: 2 additions & 0 deletions TMessagesProj/src/main/res/values/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,6 @@
<string name="StickersChooseShortNameForStickerPack">Choose a short name for your pack.</string>
<string name="StickersCopyStickerSet">Copy Sticker Set</string>
<string name="DisableChannelMuteButton">Disable channel mute button</string>
<string name="DisablePreviewVideoSoundShortcut">Disable preview video sound shortcut</string>
<string name="DisablePreviewVideoSoundShortcutNotice">Disable volume keys to enable preview video sound</string>
</resources>

0 comments on commit bcbc8d8

Please sign in to comment.