Skip to content

Commit

Permalink
feat: hide mute all in filter
Browse files Browse the repository at this point in the history
Signed-off-by: Next Alone <[email protected]>
  • Loading branch information
NextAlone committed Sep 23, 2023
1 parent 87002b6 commit 519e26e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3373,7 +3373,7 @@ public boolean didSelectTab(FilterTabsView.TabView tabView, boolean selected) {
.add(R.drawable.msg_edit, defaultTab ? LocaleController.getString("FilterEditAll", R.string.FilterEditAll) : LocaleController.getString("FilterEdit", R.string.FilterEdit), () -> {
presentFragment(defaultTab ? new FiltersSetupActivity() : new FilterCreateActivity(dialogFilter));
})
.addIf(dialogFilter != null && !dialogs.isEmpty(), muteAll ? R.drawable.msg_mute : R.drawable.msg_unmute, muteAll ? LocaleController.getString("FilterMuteAll", R.string.FilterMuteAll) : LocaleController.getString("FilterUnmuteAll", R.string.FilterUnmuteAll), () -> {
.addIf(!Config.hideFilterMuteAll && dialogFilter != null && !dialogs.isEmpty(), muteAll ? R.drawable.msg_mute : R.drawable.msg_unmute, muteAll ? LocaleController.getString("FilterMuteAll", R.string.FilterMuteAll) : LocaleController.getString("FilterUnmuteAll", R.string.FilterUnmuteAll), () -> {
int count = 0;
for (int i = 0; i < dialogs.size(); ++i) {
TLRPC.Dialog dialog = dialogs.get(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public class GeneralSettingActivity extends BaseActivity {
private int ignorMutedCountRow;
private int disableSharePhoneWithContactByDefault;
private int ignoreFolderUnreadCountRow;
private int hideFilterMuteAllRow;

private int devicesRow;
private int useSystemEmojiRow;
Expand Down Expand Up @@ -380,6 +381,11 @@ else if (position == showBotAPIRow) {
if (view instanceof TextCheckCell) {
((TextCheckCell) view).setChecked(Config.hideStories);
}
} else if (position == hideFilterMuteAllRow) {
Config.toggleHideFilterMuteAll();
if (view instanceof TextCheckCell) {
((TextCheckCell) view).setChecked(Config.hideFilterMuteAll);
}
}

}
Expand Down Expand Up @@ -446,6 +452,7 @@ protected void updateRows() {
disableSharePhoneWithContactByDefault = addRow("disableSharePhoneWithContactByDefault");
tabsTitleTypeRow = addRow("tabsTitleType");
ignoreFolderUnreadCountRow = addRow("ignoreFolderUnreadCount");
hideFilterMuteAllRow = addRow("hideFilterMuteAll");
general2Row = addRow();

devicesRow = addRow();
Expand Down Expand Up @@ -642,6 +649,8 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position, boole
textCell.setTextAndCheck(LocaleController.getString("HideStories", R.string.HideStories), Config.hideStories, true);
} else if (position == ignoreFolderUnreadCountRow) {
textCell.setTextAndCheck(LocaleController.getString("ignoreFolderUnreadCount", R.string.ignoreFolderUnreadCount), Config.ignoreFolderUnreadCount, true);
} else if (position == hideFilterMuteAllRow) {
textCell.setTextAndCheck(LocaleController.getString("hideFilterMuteAll", R.string.hideFilterMuteAll), Config.hideFilterMuteAll, true);
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ object Defines {
@BooleanConfig const val deleteMessageForBoth = "deleteMessageForBoth"
@StringConfig("") const val textStyleSettings = "textStyleSettings"
@BooleanConfig const val hideSendAsButton = "hideSendAsButton"
@BooleanConfig const val hideFilterMuteAll = "hideFilterMuteAll"

// Drawer List
@BooleanConfig(true) const val showNewGroup = "showNewGroup"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,5 @@
<string name="drawerList">側邊欄列表</string>
<string name="TextStyleSettings">文本样式</string>
<string name="hideSendAsButton">隐藏发送者按钮</string>
<string name="hideFilterMuteAll">隱藏文件夾中的\"全部取消靜音\"</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-zh/strings_nullgram.xml
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,5 @@
<string name="drawerList">侧边栏列表</string>
<string name="TextStyleSettings">文本样式</string>
<string name="hideSendAsButton">隐藏发送者按钮</string>
<string name="hideFilterMuteAll">隐藏文件夹中的\"全部取消静音\"</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values/strings_nullgram.xml
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,5 @@
<string name="drawerList">Drawer list</string>
<string name="TextStyleSettings">Text style</string>
<string name="hideSendAsButton">Hide send as button</string>
<string name="hideFilterMuteAll">Hide filter mute all</string>
</resources>

0 comments on commit 519e26e

Please sign in to comment.