feat: folder support add all forums

This commit is contained in:
xtaodada 2022-12-29 22:33:52 +08:00
parent 99956e9b0c
commit b13da60ff6
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
3 changed files with 31 additions and 1 deletions

View File

@ -449,6 +449,8 @@ public class UsersSelectActivity extends BaseFragment implements NotificationCen
onDonePressed(true);
} else if (id == 2) {
adapter.checkAllAdministrated();
} else if (id == 3) {
adapter.checkAllForum();
}
}
});
@ -458,6 +460,7 @@ public class UsersSelectActivity extends BaseFragment implements NotificationCen
ActionBarMenuItem headerItem = menu.addItem(0, R.drawable.ic_ab_other);
headerItem.setContentDescription(LocaleController.getString("AccDescrMoreOptions", R.string.AccDescrMoreOptions));
headerItem.addSubItem(2, R.drawable.group_admin, LocaleController.getString("CheckAllAdministrated", R.string.CheckAllAdministrated));
headerItem.addSubItem(3, R.drawable.msg_viewintopic, LocaleController.getString("CheckAllForum", R.string.CheckAllForum));
}
fragmentView = new ViewGroup(context) {
@ -1085,9 +1088,34 @@ public class UsersSelectActivity extends BaseFragment implements NotificationCen
if (object instanceof TLRPC.Chat) {
TLRPC.Chat chat = (TLRPC.Chat) object;
if (chat.creator || ChatObject.hasAdminRights(chat)) {
if (selectedCount >= 100) {
if (selectedCount >= 200) {
break;
}
GroupCreateSpan span = new GroupCreateSpan(editText.getContext(), object);
if (selectedContacts.indexOfKey(span.getUid()) >= 0) {
continue;
}
spansContainer.addSpan(span, true);
span.setOnClickListener(UsersSelectActivity.this);
}
}
}
updateHint();
AndroidUtilities.hideKeyboard(editText);
if (editText.length() > 0) {
editText.setText(null);
}
checkVisibleRows();
}
public void checkAllForum() {
for (Object object : contacts) {
if (object instanceof TLRPC.Chat) {
TLRPC.Chat chat = (TLRPC.Chat) object;
if (ChatObject.isForum(chat)) {
if (selectedCount >= 200) {
break;
}
GroupCreateSpan span = new GroupCreateSpan(editText.getContext(), object);
if (selectedContacts.indexOfKey(span.getUid()) >= 0) {
continue;

View File

@ -77,4 +77,5 @@
<string name="TypeMessageHintUseGroupName">使用群组名称作为输入框提示</string>
<string name="HideBotButtonInInputField">隐藏输入框中的机器人按钮</string>
<string name="ShowSendAsUnderMessageHint">在消息提示下显示发送者</string>
<string name="CheckAllForum">添加所有话题模式的群组</string>
</resources>

View File

@ -78,4 +78,5 @@
<string name="TypeMessageHintUseGroupName">Use group name as type message hint</string>
<string name="HideBotButtonInInputField">Hide bot button in input field</string>
<string name="ShowSendAsUnderMessageHint">Show send as under message hint</string>
<string name="CheckAllForum">Add forum</string>
</resources>