diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index 7d1586bee..88b38be1a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -22336,7 +22336,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not icons.add(R.drawable.msg_reset); } if (allowRepeat && NaConfig.INSTANCE.getShowGreatOrPoor().Bool()) { - items.add(LocaleController.getString("Great", R.string.Great)); + items.add(NaConfig.INSTANCE.getCustomGreat().String()); options.add(nkbtn_greatOrPoor); icons.add(R.drawable.msg_prpr); } @@ -30328,7 +30328,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } } } - + private void repeatMessage(boolean isLongClick, boolean isRepeatasCopy) { if (checkSlowMode(chatActivityEnterView.getSendButton())) { return; @@ -30352,7 +30352,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not return; } } - + AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); builder.setTitle(LocaleController.getString("Repeat", R.string.Repeat)); builder.setMessage(LocaleController.getString("repeatConfirmText", R.string.repeatConfirmText)); @@ -30366,7 +30366,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); showDialog(builder.create()); } - + private void doRepeatMessage(boolean isLongClick, ArrayList messages, boolean isRepeatAsCopy) { if (selectedObject != null && selectedObject.messageOwner != null && (isLongClick || isThreadChat() || getMessagesController().isChatNoForwards(currentChat))) { // If selected message contains `replyTo`: @@ -30394,14 +30394,14 @@ selectedObjectGroup) != null) { } return; } - + if (isRepeatAsCopy) { forwardMessages(messages, true, false, true, 0); } else { forwardMessages(messages, false, false, true, 0); } } - + public void invertReplyMessage(boolean isLongClick) { if (checkSlowMode(chatActivityEnterView.getSendButton())) { return; @@ -30444,15 +30444,16 @@ selectedObjectGroup) != null) { } } } - + public void sendGreatOrGreat(boolean isLongClick) { if (checkSlowMode(chatActivityEnterView.getSendButton())) { return; } - getSendMessagesHelper().sendMessage(isLongClick ? "破烂" : "好耶", dialog_id, selectedObject, threadMessageObject - , null, false, null, null, null, true, 0, null); + getSendMessagesHelper().sendMessage(isLongClick ? NaConfig.INSTANCE.getCustomPoor().String() : NaConfig.INSTANCE.getCustomGreat().String(), + dialog_id, selectedObject, threadMessageObject, null, false, + null, null, null, true, 0, null); } - + public void setScrollToMessage() { AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); builder.setTitle(LocaleController.getString("InputMessageId", R.string.InputMessageId)); @@ -30475,7 +30476,7 @@ selectedObjectGroup) != null) { editText.setPadding(0, 0, 0, 0); editText.setInputType(InputType.TYPE_CLASS_NUMBER); builder.setView(editText); - + builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialogInterface, i) -> { try { 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 47f348283..a65a54f1b 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoChatSettingsActivity.java +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoChatSettingsActivity.java @@ -83,6 +83,8 @@ public class NekoChatSettingsActivity extends BaseFragment implements Notificati private final AbstractConfigCell hideSendAsChannelRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.hideSendAsChannel)); private final AbstractConfigCell showSpoilersDirectlyRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.showSpoilersDirectly)); private final AbstractConfigCell messageMenuRow = cellGroup.appendCell(new ConfigCellSelectBox(LocaleController.getString("MessageMenu"), null, null, this::showMessageMenuAlert)); + private final AbstractConfigCell customGreatRow = cellGroup.appendCell(new ConfigCellTextInput(null, NaConfig.INSTANCE.getCustomGreat(), LocaleController.getString(R.string.CustomGreatHint), null,(input) -> input.isEmpty() ? (String) NaConfig.INSTANCE.getCustomGreat().defaultValue : input)); + private final AbstractConfigCell CustomPoorRow = cellGroup.appendCell(new ConfigCellTextInput(null, NaConfig.INSTANCE.getCustomPoor(), LocaleController.getString(R.string.CustomPoorHint), null,(input) -> input.isEmpty() ? (String) NaConfig.INSTANCE.getCustomPoor().defaultValue : input)); private final AbstractConfigCell showServicesTime = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getShowServicesTime())); private final AbstractConfigCell combineMessageRow = cellGroup.appendCell(new ConfigCellSelectBox(null, NaConfig.INSTANCE.getCombineMessage(), new String[]{ LocaleController.getString("combineMessageEnabledWithReply", R.string.CombineMessageEnabledWithReply), @@ -419,7 +421,7 @@ public class NekoChatSettingsActivity extends BaseFragment implements Notificati break; } case 5 + 2: { - textCell.setTextAndCheck(LocaleController.getString("Great", R.string.Great), NaConfig.INSTANCE.getShowGreatOrPoor().Bool(), false); + textCell.setTextAndCheck(NaConfig.INSTANCE.getCustomGreat().String(), NaConfig.INSTANCE.getShowGreatOrPoor().Bool(), false); break; } case 3 + 3 + 2: { diff --git a/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt b/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt index 0d69b60e3..1adfd412c 100644 --- a/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt +++ b/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt @@ -153,121 +153,169 @@ object NaConfig { ConfigItem.configTypeBool, true ) - val customTitle = addConfig( - "CustomTitle", - ConfigItem.configTypeString, - LocaleController.getString("NekoX", R.string.NekoX) - ) - val useSystemUnlock = addConfig( - "UseSystemUnlock", - ConfigItem.configTypeBool, - true - ) - val codeSyntaxHighlight = addConfig( - "CodeSyntaxHighlight", - ConfigItem.configTypeBool, - true - ) - val dateOfForwardedMsg = addConfig( - "DateOfForwardedMsg", - ConfigItem.configTypeBool, - false - ) - val showMessageID = addConfig( - "ShowMessageID", - ConfigItem.configTypeBool, - false - ) - val showRPCError = addConfig( - "ShowRPCError", - ConfigItem.configTypeBool, - false - ) - val showPremiumStarInChat = addConfig( - "ShowPremiumStarInChat", - ConfigItem.configTypeBool, - false - ) - val showPremiumAvatarAnimation = addConfig( - "ShowPremiumAvatarAnimation", - ConfigItem.configTypeBool, - true - ) - val alwaysSaveChatOffset = addConfig( - "AlwaysSaveChatOffset", - ConfigItem.configTypeBool, - true - ) - val autoReplaceRepeat = addConfig( - "AutoReplaceRepeat", - ConfigItem.configTypeBool, - true - ) - val autoInsertGIFCaption = addConfig( - "AutoInsertGIFCaption", - ConfigItem.configTypeBool, - true - ) - val defaultMonoLanguage = addConfig( - "DefaultMonoLanguage", - ConfigItem.configTypeString, - "" - ) - val disableGlobalSearch = addConfig( - "DisableGlobalSearch", - ConfigItem.configTypeBool, - false - ) - val hideOriginAfterTranslation: ConfigItem = addConfig( - "HideOriginAfterTranslation", - ConfigItem.configTypeBool, - false - ) - val zalgoFilter = addConfig( - "ZalgoFilter", - ConfigItem.configTypeBool, - false - ) - val customChannelLabel = addConfig( - "CustomChannelLabel", - ConfigItem.configTypeString, - LocaleController.getString("channelLabel", R.string.channelLabel) - ) - val alwaysShowDownloadIcon = addConfig( - "AlwaysShowDownloadIcon", - ConfigItem.configTypeBool, - false - ) - val showPhotoOpenInExternalApp = addConfig( - "ShowPhotoOpenInExternalApp", - ConfigItem.configTypeBool, - false - ) - val quickToggleAnonymous = addConfig( - "QuickToggleAnonymous", - ConfigItem.configTypeBool, - false - ) - val onlyShowBuiltInEmoji = addConfig( - "OnlyShowBuiltInEmoji", - ConfigItem.configTypeBool, - false - ) - val realHideTimeForSticker = addConfig( - "RealHideTimeForSticker", - ConfigItem.configTypeBool, - false - ) - val ignoreFolderCount = addConfig( - "IgnoreFolderCount", - ConfigItem.configTypeBool, - false - ) - val customArtworkApi = addConfig( - "CustomArtworkApi", - ConfigItem.configTypeString, - "" - ) + val customTitle = + addConfig( + "CustomTitle", + ConfigItem.configTypeString, + LocaleController.getString( + "NekoX", + R.string.NekoX + ) + ) + val useSystemUnlock = + addConfig( + "UseSystemUnlock", + ConfigItem.configTypeBool, + true + ) + val codeSyntaxHighlight = + addConfig( + "CodeSyntaxHighlight", + ConfigItem.configTypeBool, + true + ) + val dateOfForwardedMsg = + addConfig( + "DateOfForwardedMsg", + ConfigItem.configTypeBool, + false + ) + val showMessageID = + addConfig( + "ShowMessageID", + ConfigItem.configTypeBool, + false + ) + val showRPCError = + addConfig( + "ShowRPCError", + ConfigItem.configTypeBool, + false + ) + val showPremiumStarInChat = + addConfig( + "ShowPremiumStarInChat", + ConfigItem.configTypeBool, + false + ) + val showPremiumAvatarAnimation = + addConfig( + "ShowPremiumAvatarAnimation", + ConfigItem.configTypeBool, + true + ) + val alwaysSaveChatOffset = + addConfig( + "AlwaysSaveChatOffset", + ConfigItem.configTypeBool, + true + ) + val autoReplaceRepeat = + addConfig( + "AutoReplaceRepeat", + ConfigItem.configTypeBool, + true + ) + val autoInsertGIFCaption = + addConfig( + "AutoInsertGIFCaption", + ConfigItem.configTypeBool, + true + ) + val defaultMonoLanguage = + addConfig( + "DefaultMonoLanguage", + ConfigItem.configTypeString, + "" + ) + val disableGlobalSearch = + addConfig( + "DisableGlobalSearch", + ConfigItem.configTypeBool, + false + ) + val hideOriginAfterTranslation: ConfigItem = + addConfig( + "HideOriginAfterTranslation", + ConfigItem.configTypeBool, + false + ) + val zalgoFilter = + addConfig( + "ZalgoFilter", + ConfigItem.configTypeBool, + false + ) + val customChannelLabel = + addConfig( + "CustomChannelLabel", + ConfigItem.configTypeString, + LocaleController.getString( + "channelLabel", + R.string.channelLabel + ) + ) + val alwaysShowDownloadIcon = + addConfig( + "AlwaysShowDownloadIcon", + ConfigItem.configTypeBool, + false + ) + val showPhotoOpenInExternalApp = + addConfig( + "ShowPhotoOpenInExternalApp", + ConfigItem.configTypeBool, + false + ) + val quickToggleAnonymous = + addConfig( + "QuickToggleAnonymous", + ConfigItem.configTypeBool, + false + ) + val onlyShowBuiltInEmoji = + addConfig( + "OnlyShowBuiltInEmoji", + ConfigItem.configTypeBool, + false + ) + val realHideTimeForSticker = + addConfig( + "RealHideTimeForSticker", + ConfigItem.configTypeBool, + false + ) + val ignoreFolderCount = + addConfig( + "IgnoreFolderCount", + ConfigItem.configTypeBool, + false + ) + val customArtworkApi = + addConfig( + "CustomArtworkApi", + ConfigItem.configTypeString, + "" + ) + val customGreat = + addConfig( + "CustomGreat", + ConfigItem.configTypeString, + LocaleController.getString( + "Great", + R.string.Great + ) + ) + val CustomPoor = + addConfig( + "CustomPoor", + ConfigItem.configTypeString, + LocaleController.getString( + "Pool", + R.string.Poor + ) + + ) private fun addConfig( k: String, 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 cfec6b408..8dcec603f 100644 --- a/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml +++ b/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml @@ -61,4 +61,8 @@ 禁用 Markdown 禁用小游戏 自定义音乐封面 API + 自定义快捷回复词 + 默认好耶 + 自定义长按快捷回复词 + 默认破烂 diff --git a/TMessagesProj/src/main/res/values/strings_na.xml b/TMessagesProj/src/main/res/values/strings_na.xml index d605d411b..210a6edfe 100644 --- a/TMessagesProj/src/main/res/values/strings_na.xml +++ b/TMessagesProj/src/main/res/values/strings_na.xml @@ -62,4 +62,8 @@ Save without markdown Send as emoji Custom Artwork Api + Custom reply word + Default great + Custom long click reply word + Default pool