mirror of
https://github.com/MGislv/NekoX.git
synced 2024-07-04 11:13:36 +00:00
parent
1a79157784
commit
2703c62a82
|
@ -45,6 +45,7 @@ import android.widget.ImageView;
|
|||
import android.widget.ScrollView;
|
||||
|
||||
import org.telegram.messenger.AndroidUtilities;
|
||||
import org.telegram.messenger.ChatObject;
|
||||
import org.telegram.messenger.ContactsController;
|
||||
import org.telegram.messenger.LocaleController;
|
||||
import org.telegram.messenger.MessagesController;
|
||||
|
@ -55,6 +56,8 @@ import org.telegram.messenger.Utilities;
|
|||
import org.telegram.tgnet.TLObject;
|
||||
import org.telegram.tgnet.TLRPC;
|
||||
import org.telegram.ui.ActionBar.ActionBar;
|
||||
import org.telegram.ui.ActionBar.ActionBarMenu;
|
||||
import org.telegram.ui.ActionBar.ActionBarMenuItem;
|
||||
import org.telegram.ui.ActionBar.BaseFragment;
|
||||
import org.telegram.ui.ActionBar.Theme;
|
||||
import org.telegram.ui.ActionBar.ThemeDescription;
|
||||
|
@ -414,10 +417,19 @@ public class FilterUsersActivity extends BaseFragment implements NotificationCen
|
|||
finishFragment();
|
||||
} else if (id == done_button) {
|
||||
onDonePressed(true);
|
||||
} else if (id == 2) {
|
||||
adapter.checkAllAdministrated();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (isInclude) {
|
||||
ActionBarMenu menu = actionBar.createMenu();
|
||||
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));
|
||||
}
|
||||
|
||||
fragmentView = new ViewGroup(context) {
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
|
@ -1007,6 +1019,31 @@ public class FilterUsersActivity extends BaseFragment implements NotificationCen
|
|||
});
|
||||
}
|
||||
|
||||
public void checkAllAdministrated() {
|
||||
for (Object object : contacts) {
|
||||
if (object instanceof TLRPC.Chat) {
|
||||
TLRPC.Chat chat = (TLRPC.Chat) object;
|
||||
if (chat.creator || ChatObject.hasAdminRights(chat)) {
|
||||
if (selectedCount >= 100) {
|
||||
continue;
|
||||
}
|
||||
GroupCreateSpan span = new GroupCreateSpan(editText.getContext(), object);
|
||||
if (selectedContacts.indexOfKey(span.getUid()) >= 0) {
|
||||
continue;
|
||||
}
|
||||
spansContainer.addSpan(span, true);
|
||||
span.setOnClickListener(FilterUsersActivity.this);
|
||||
}
|
||||
}
|
||||
}
|
||||
updateHint();
|
||||
AndroidUtilities.hideKeyboard(editText);
|
||||
if (editText.length() > 0) {
|
||||
editText.setText(null);
|
||||
}
|
||||
checkVisibleRows();
|
||||
}
|
||||
|
||||
public void setSearching(boolean value) {
|
||||
if (searching == value) {
|
||||
return;
|
||||
|
|
|
@ -86,4 +86,5 @@
|
|||
<string name="UserRestrictionsSendGifs">Send GIFs</string>
|
||||
<string name="UseAvatarAsDrawerBackground">Use avatar as drawer background</string>
|
||||
<string name="ShowTabsOnForward">Show tabs on forward</string>
|
||||
<string name="CheckAllAdministrated">Add administrated</string>
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user