Skip to content

Commit

Permalink
feat: show small gif
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Feb 11, 2024
1 parent c99bf67 commit 1a45e06
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7920,6 +7920,11 @@ private void setMessageContent(MessageObject messageObject, MessageObject.Groupe
if (w == 0 || h == 0) {
w = h = AndroidUtilities.dp(150);
}

if (NaConfig.INSTANCE.getShowSmallGIF().Bool() && messageObject.type == MessageObject.TYPE_GIF) {
w = h = AndroidUtilities.dp(120);
}

if (messageObject.type == MessageObject.TYPE_VIDEO) {
if (w < infoWidth + AndroidUtilities.dp(16 + 24)) {
w = infoWidth + AndroidUtilities.dp(16 + 24);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public class NekoChatSettingsActivity extends BaseNekoXSettingsActivity implemen
private final AbstractConfigCell useChatAttachMediaMenuRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.useChatAttachMediaMenu, LocaleController.getString("UseChatAttachEnterMenuNotice")));
private final AbstractConfigCell disableLinkPreviewByDefaultRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableLinkPreviewByDefault, LocaleController.getString("DisableLinkPreviewByDefaultNotice")));
private final AbstractConfigCell takeGIFasVideoRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.takeGIFasVideo));
private final AbstractConfigCell showSmallGifRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getShowSmallGIF()));
private final AbstractConfigCell showSeconds = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.showSeconds));
private final AbstractConfigCell showBottomActionsWhenSelectingRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.showBottomActionsWhenSelecting));
private final AbstractConfigCell labelChannelUserRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.labelChannelUser));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,12 @@ object NaConfig {
ConfigItem.configTypeBool,
false
)
val showSmallGIF =
addConfig(
"ShowSmallGIF",
ConfigItem.configTypeBool,
false
)

private fun addConfig(
k: String,
Expand Down
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,5 @@
<string name="DisableMarkdown">禁用 Markdown</string>
<string name="SendWithMarkdown">启用 Markdown</string>
<string name="DisableClickProfileGalleryView">禁用点按切换头像</string>
<string name="ShowSmallGIF">GIF 显示得更小</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,5 @@
<string name="DisableMarkdown">Disable Markdown</string>
<string name="SendWithMarkdown">Send with markdown</string>
<string name="DisableClickProfileGalleryView">Disable flip avatars by tapping</string>
<string name="ShowSmallGIF">Show Small Gif</string>
</resources>

0 comments on commit 1a45e06

Please sign in to comment.