Search in sources :

Example 1 with TextCheckCell2

use of org.telegram.ui.Cells.TextCheckCell2 in project Telegram-FOSS by Telegram-FOSS-Team.

the class ChatUsersActivity method getThemeDescriptions.

@Override
public ArrayList<ThemeDescription> getThemeDescriptions() {
    ArrayList<ThemeDescription> themeDescriptions = new ArrayList<>();
    ThemeDescription.ThemeDescriptionDelegate cellDelegate = () -> {
        if (listView != null) {
            int count = listView.getChildCount();
            for (int a = 0; a < count; a++) {
                View child = listView.getChildAt(a);
                if (child instanceof ManageChatUserCell) {
                    ((ManageChatUserCell) child).update(0);
                }
            }
        }
    };
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR, new Class[] { HeaderCell.class, ManageChatUserCell.class, ManageChatTextCell.class, TextCheckCell2.class, TextSettingsCell.class, ChooseView.class }, null, null, null, Theme.key_windowBackgroundWhite));
    themeDescriptions.add(new ThemeDescription(fragmentView, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_windowBackgroundGray));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_actionBarDefault));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_LISTGLOWCOLOR, null, null, null, null, Theme.key_actionBarDefault));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_ITEMSCOLOR, null, null, null, null, Theme.key_actionBarDefaultIcon));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_TITLECOLOR, null, null, null, null, Theme.key_actionBarDefaultTitle));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_SELECTORCOLOR, null, null, null, null, Theme.key_actionBarDefaultSelector));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_SELECTOR, null, null, null, null, Theme.key_listSelector));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { View.class }, Theme.dividerPaint, null, null, Theme.key_divider));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[] { TextInfoPrivacyCell.class }, null, null, null, Theme.key_windowBackgroundGrayShadow));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextInfoPrivacyCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteGrayText4));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[] { ShadowSectionCell.class }, null, null, null, Theme.key_windowBackgroundGrayShadow));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { HeaderCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlueHeader));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { GraySectionCell.class }, new String[] { "textView" }, null, null, null, Theme.key_graySectionText));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR, new Class[] { GraySectionCell.class }, null, null, null, Theme.key_graySection));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextSettingsCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextSettingsCell.class }, new String[] { "valueTextView" }, null, null, null, Theme.key_windowBackgroundWhiteValueText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextCheckCell2.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextCheckCell2.class }, new String[] { "valueTextView" }, null, null, null, Theme.key_windowBackgroundWhiteGrayText2));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextCheckCell2.class }, new String[] { "checkBox" }, null, null, null, Theme.key_switch2Track));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextCheckCell2.class }, new String[] { "checkBox" }, null, null, null, Theme.key_switch2TrackChecked));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, new String[] { "nameTextView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, new String[] { "statusColor" }, null, null, cellDelegate, Theme.key_windowBackgroundWhiteGrayText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, new String[] { "statusOnlineColor" }, null, null, cellDelegate, Theme.key_windowBackgroundWhiteBlueText));
    themeDescriptions.add(new ThemeDescription(undoView, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_undo_background));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "undoImageView" }, null, null, null, Theme.key_undo_cancelColor));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "undoTextView" }, null, null, null, Theme.key_undo_cancelColor));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "infoTextView" }, null, null, null, Theme.key_undo_infoColor));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "textPaint" }, null, null, null, Theme.key_undo_infoColor));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "progressPaint" }, null, null, null, Theme.key_undo_infoColor));
    themeDescriptions.add(new ThemeDescription(undoView, ThemeDescription.FLAG_IMAGECOLOR, new Class[] { UndoView.class }, new String[] { "leftImageView" }, null, null, null, Theme.key_undo_infoColor));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "imageView" }, null, null, null, Theme.key_windowBackgroundWhiteGrayIcon));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "imageView" }, null, null, null, Theme.key_windowBackgroundWhiteBlueButton));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlueIcon));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { StickerEmptyView.class }, new String[] { "title" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { StickerEmptyView.class }, new String[] { "subtitle" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(emptyView.title, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(emptyView.subtitle, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, null, Theme.avatarDrawables, null, Theme.key_avatar_text));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundRed));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundOrange));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundViolet));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundGreen));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundCyan));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundBlue));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundPink));
    return themeDescriptions;
}
Also used : ManageChatUserCell(org.telegram.ui.Cells.ManageChatUserCell) ShadowSectionCell(org.telegram.ui.Cells.ShadowSectionCell) GraySectionCell(org.telegram.ui.Cells.GraySectionCell) HeaderCell(org.telegram.ui.Cells.HeaderCell) ArrayList(java.util.ArrayList) TextInfoPrivacyCell(org.telegram.ui.Cells.TextInfoPrivacyCell) ThemeDescription(org.telegram.ui.ActionBar.ThemeDescription) TextCheckCell2(org.telegram.ui.Cells.TextCheckCell2) StickerEmptyView(org.telegram.ui.Components.StickerEmptyView) ImageView(android.widget.ImageView) RadialProgressView(org.telegram.ui.Components.RadialProgressView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) UndoView(org.telegram.ui.Components.UndoView) TextView(android.widget.TextView) StickerEmptyView(org.telegram.ui.Components.StickerEmptyView) FlickerLoadingView(org.telegram.ui.Components.FlickerLoadingView) RecyclerListView(org.telegram.ui.Components.RecyclerListView) TextSettingsCell(org.telegram.ui.Cells.TextSettingsCell) UndoView(org.telegram.ui.Components.UndoView) ManageChatTextCell(org.telegram.ui.Cells.ManageChatTextCell)

Example 2 with TextCheckCell2

use of org.telegram.ui.Cells.TextCheckCell2 in project Telegram-FOSS by Telegram-FOSS-Team.

the class ChatRightsEditActivity method createView.

@Override
public View createView(Context context) {
    actionBar.setBackButtonImage(R.drawable.ic_ab_back);
    actionBar.setAllowOverlayTitle(true);
    if (currentType == TYPE_ADMIN) {
        actionBar.setTitle(LocaleController.getString("EditAdmin", R.string.EditAdmin));
    } else {
        actionBar.setTitle(LocaleController.getString("UserRestrictions", R.string.UserRestrictions));
    }
    actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {

        @Override
        public void onItemClick(int id) {
            if (id == -1) {
                if (checkDiscard()) {
                    finishFragment();
                }
            } else if (id == done_button) {
                onDonePressed();
            }
        }
    });
    if (canEdit || !isChannel && currentChat.creator && UserObject.isUserSelf(currentUser)) {
        ActionBarMenu menu = actionBar.createMenu();
        menu.addItemWithWidth(done_button, R.drawable.ic_done, AndroidUtilities.dp(56), LocaleController.getString("Done", R.string.Done));
    }
    fragmentView = new FrameLayout(context);
    fragmentView.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundGray));
    FrameLayout frameLayout = (FrameLayout) fragmentView;
    fragmentView.setFocusableInTouchMode(true);
    listView = new RecyclerListView(context);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false);
    ((DefaultItemAnimator) listView.getItemAnimator()).setDelayAnimations(false);
    listView.setLayoutManager(linearLayoutManager);
    listView.setAdapter(listViewAdapter = new ListAdapter(context));
    listView.setVerticalScrollbarPosition(LocaleController.isRTL ? RecyclerListView.SCROLLBAR_POSITION_LEFT : RecyclerListView.SCROLLBAR_POSITION_RIGHT);
    frameLayout.addView(listView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
    listView.setOnScrollListener(new RecyclerView.OnScrollListener() {

        @Override
        public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
            if (newState == RecyclerView.SCROLL_STATE_DRAGGING) {
                AndroidUtilities.hideKeyboard(getParentActivity().getCurrentFocus());
            }
        }
    });
    listView.setOnItemClickListener((view, position) -> {
        if (!canEdit && (!currentChat.creator || currentType != TYPE_ADMIN || position != anonymousRow)) {
            return;
        }
        if (position == 0) {
            Bundle args = new Bundle();
            args.putLong("user_id", currentUser.id);
            presentFragment(new ProfileActivity(args));
        } else if (position == removeAdminRow) {
            if (currentType == TYPE_ADMIN) {
                MessagesController.getInstance(currentAccount).setUserAdminRole(chatId, currentUser, new TLRPC.TL_chatAdminRights(), currentRank, isChannel, getFragmentForAlert(0), isAddingNew);
                if (delegate != null) {
                    delegate.didSetRights(0, adminRights, bannedRights, currentRank);
                }
                finishFragment();
            } else if (currentType == TYPE_BANNED) {
                bannedRights = new TLRPC.TL_chatBannedRights();
                bannedRights.view_messages = true;
                bannedRights.send_media = true;
                bannedRights.send_messages = true;
                bannedRights.send_stickers = true;
                bannedRights.send_gifs = true;
                bannedRights.send_games = true;
                bannedRights.send_inline = true;
                bannedRights.embed_links = true;
                bannedRights.pin_messages = true;
                bannedRights.send_polls = true;
                bannedRights.invite_users = true;
                bannedRights.change_info = true;
                bannedRights.until_date = 0;
                onDonePressed();
            }
        } else if (position == transferOwnerRow) {
            initTransfer(null, null);
        } else if (position == untilDateRow) {
            if (getParentActivity() == null) {
                return;
            }
            BottomSheet.Builder builder = new BottomSheet.Builder(context);
            builder.setApplyTopPadding(false);
            LinearLayout linearLayout = new LinearLayout(context);
            linearLayout.setOrientation(LinearLayout.VERTICAL);
            HeaderCell headerCell = new HeaderCell(context, Theme.key_dialogTextBlue2, 23, 15, false);
            headerCell.setHeight(47);
            headerCell.setText(LocaleController.getString("UserRestrictionsDuration", R.string.UserRestrictionsDuration));
            linearLayout.addView(headerCell);
            LinearLayout linearLayoutInviteContainer = new LinearLayout(context);
            linearLayoutInviteContainer.setOrientation(LinearLayout.VERTICAL);
            linearLayout.addView(linearLayoutInviteContainer, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
            BottomSheet.BottomSheetCell[] buttons = new BottomSheet.BottomSheetCell[5];
            for (int a = 0; a < buttons.length; a++) {
                buttons[a] = new BottomSheet.BottomSheetCell(context, 0);
                buttons[a].setPadding(AndroidUtilities.dp(7), 0, AndroidUtilities.dp(7), 0);
                buttons[a].setTag(a);
                buttons[a].setBackgroundDrawable(Theme.getSelectorDrawable(false));
                String text;
                switch(a) {
                    case 0:
                        text = LocaleController.getString("UserRestrictionsUntilForever", R.string.UserRestrictionsUntilForever);
                        break;
                    case 1:
                        text = LocaleController.formatPluralString("Days", 1);
                        break;
                    case 2:
                        text = LocaleController.formatPluralString("Weeks", 1);
                        break;
                    case 3:
                        text = LocaleController.formatPluralString("Months", 1);
                        break;
                    case 4:
                    default:
                        text = LocaleController.getString("UserRestrictionsCustom", R.string.UserRestrictionsCustom);
                        break;
                }
                buttons[a].setTextAndIcon(text, 0);
                linearLayoutInviteContainer.addView(buttons[a], LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
                buttons[a].setOnClickListener(v2 -> {
                    Integer tag = (Integer) v2.getTag();
                    switch(tag) {
                        case 0:
                            bannedRights.until_date = 0;
                            listViewAdapter.notifyItemChanged(untilDateRow);
                            break;
                        case 1:
                            bannedRights.until_date = ConnectionsManager.getInstance(currentAccount).getCurrentTime() + 60 * 60 * 24;
                            listViewAdapter.notifyItemChanged(untilDateRow);
                            break;
                        case 2:
                            bannedRights.until_date = ConnectionsManager.getInstance(currentAccount).getCurrentTime() + 60 * 60 * 24 * 7;
                            listViewAdapter.notifyItemChanged(untilDateRow);
                            break;
                        case 3:
                            bannedRights.until_date = ConnectionsManager.getInstance(currentAccount).getCurrentTime() + 60 * 60 * 24 * 30;
                            listViewAdapter.notifyItemChanged(untilDateRow);
                            break;
                        case 4:
                            {
                                Calendar calendar = Calendar.getInstance();
                                int year = calendar.get(Calendar.YEAR);
                                int monthOfYear = calendar.get(Calendar.MONTH);
                                int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
                                try {
                                    DatePickerDialog dialog = new DatePickerDialog(getParentActivity(), (view1, year1, month, dayOfMonth1) -> {
                                        Calendar calendar1 = Calendar.getInstance();
                                        calendar1.clear();
                                        calendar1.set(year1, month, dayOfMonth1);
                                        final int time = (int) (calendar1.getTime().getTime() / 1000);
                                        try {
                                            TimePickerDialog dialog13 = new TimePickerDialog(getParentActivity(), (view11, hourOfDay, minute) -> {
                                                bannedRights.until_date = time + hourOfDay * 3600 + minute * 60;
                                                listViewAdapter.notifyItemChanged(untilDateRow);
                                            }, 0, 0, true);
                                            dialog13.setButton(DialogInterface.BUTTON_POSITIVE, LocaleController.getString("Set", R.string.Set), dialog13);
                                            dialog13.setButton(DialogInterface.BUTTON_NEGATIVE, LocaleController.getString("Cancel", R.string.Cancel), (dialog131, which) -> {
                                            });
                                            showDialog(dialog13);
                                        } catch (Exception e) {
                                            FileLog.e(e);
                                        }
                                    }, year, monthOfYear, dayOfMonth);
                                    final DatePicker datePicker = dialog.getDatePicker();
                                    Calendar date = Calendar.getInstance();
                                    date.setTimeInMillis(System.currentTimeMillis());
                                    date.set(Calendar.HOUR_OF_DAY, date.getMinimum(Calendar.HOUR_OF_DAY));
                                    date.set(Calendar.MINUTE, date.getMinimum(Calendar.MINUTE));
                                    date.set(Calendar.SECOND, date.getMinimum(Calendar.SECOND));
                                    date.set(Calendar.MILLISECOND, date.getMinimum(Calendar.MILLISECOND));
                                    datePicker.setMinDate(date.getTimeInMillis());
                                    date.setTimeInMillis(System.currentTimeMillis() + 31536000000L);
                                    date.set(Calendar.HOUR_OF_DAY, date.getMaximum(Calendar.HOUR_OF_DAY));
                                    date.set(Calendar.MINUTE, date.getMaximum(Calendar.MINUTE));
                                    date.set(Calendar.SECOND, date.getMaximum(Calendar.SECOND));
                                    date.set(Calendar.MILLISECOND, date.getMaximum(Calendar.MILLISECOND));
                                    datePicker.setMaxDate(date.getTimeInMillis());
                                    dialog.setButton(DialogInterface.BUTTON_POSITIVE, LocaleController.getString("Set", R.string.Set), dialog);
                                    dialog.setButton(DialogInterface.BUTTON_NEGATIVE, LocaleController.getString("Cancel", R.string.Cancel), (dialog1, which) -> {
                                    });
                                    if (Build.VERSION.SDK_INT >= 21) {
                                        dialog.setOnShowListener(dialog12 -> {
                                            int count = datePicker.getChildCount();
                                            for (int b = 0; b < count; b++) {
                                                View child = datePicker.getChildAt(b);
                                                ViewGroup.LayoutParams layoutParams = child.getLayoutParams();
                                                layoutParams.width = LayoutHelper.MATCH_PARENT;
                                                child.setLayoutParams(layoutParams);
                                            }
                                        });
                                    }
                                    showDialog(dialog);
                                } catch (Exception e) {
                                    FileLog.e(e);
                                }
                                break;
                            }
                    }
                    builder.getDismissRunnable().run();
                });
            }
            builder.setCustomView(linearLayout);
            showDialog(builder.create());
        } else if (view instanceof TextCheckCell2) {
            TextCheckCell2 checkCell = (TextCheckCell2) view;
            if (checkCell.hasIcon()) {
                Toast.makeText(getParentActivity(), LocaleController.getString("UserRestrictionsDisabled", R.string.UserRestrictionsDisabled), Toast.LENGTH_SHORT).show();
                return;
            }
            if (!checkCell.isEnabled()) {
                return;
            }
            checkCell.setChecked(!checkCell.isChecked());
            if (position == changeInfoRow) {
                if (currentType == TYPE_ADMIN) {
                    adminRights.change_info = !adminRights.change_info;
                } else {
                    bannedRights.change_info = !bannedRights.change_info;
                }
            } else if (position == postMessagesRow) {
                adminRights.post_messages = !adminRights.post_messages;
            } else if (position == editMesagesRow) {
                adminRights.edit_messages = !adminRights.edit_messages;
            } else if (position == deleteMessagesRow) {
                adminRights.delete_messages = !adminRights.delete_messages;
            } else if (position == addAdminsRow) {
                adminRights.add_admins = !adminRights.add_admins;
            } else if (position == anonymousRow) {
                adminRights.anonymous = !adminRights.anonymous;
            } else if (position == banUsersRow) {
                adminRights.ban_users = !adminRights.ban_users;
            } else if (position == startVoiceChatRow) {
                adminRights.manage_call = !adminRights.manage_call;
            } else if (position == addUsersRow) {
                if (currentType == TYPE_ADMIN) {
                    adminRights.invite_users = !adminRights.invite_users;
                } else {
                    bannedRights.invite_users = !bannedRights.invite_users;
                }
            } else if (position == pinMessagesRow) {
                if (currentType == TYPE_ADMIN) {
                    adminRights.pin_messages = !adminRights.pin_messages;
                } else {
                    bannedRights.pin_messages = !bannedRights.pin_messages;
                }
            } else if (bannedRights != null) {
                boolean disabled = !checkCell.isChecked();
                if (position == sendMessagesRow) {
                    bannedRights.send_messages = !bannedRights.send_messages;
                } else if (position == sendMediaRow) {
                    bannedRights.send_media = !bannedRights.send_media;
                } else if (position == sendStickersRow) {
                    bannedRights.send_stickers = bannedRights.send_games = bannedRights.send_gifs = bannedRights.send_inline = !bannedRights.send_stickers;
                } else if (position == embedLinksRow) {
                    bannedRights.embed_links = !bannedRights.embed_links;
                } else if (position == sendPollsRow) {
                    bannedRights.send_polls = !bannedRights.send_polls;
                }
                if (disabled) {
                    if (bannedRights.view_messages && !bannedRights.send_messages) {
                        bannedRights.send_messages = true;
                        RecyclerListView.ViewHolder holder = listView.findViewHolderForAdapterPosition(sendMessagesRow);
                        if (holder != null) {
                            ((TextCheckCell2) holder.itemView).setChecked(false);
                        }
                    }
                    if ((bannedRights.view_messages || bannedRights.send_messages) && !bannedRights.send_media) {
                        bannedRights.send_media = true;
                        RecyclerListView.ViewHolder holder = listView.findViewHolderForAdapterPosition(sendMediaRow);
                        if (holder != null) {
                            ((TextCheckCell2) holder.itemView).setChecked(false);
                        }
                    }
                    if ((bannedRights.view_messages || bannedRights.send_messages) && !bannedRights.send_polls) {
                        bannedRights.send_polls = true;
                        RecyclerListView.ViewHolder holder = listView.findViewHolderForAdapterPosition(sendPollsRow);
                        if (holder != null) {
                            ((TextCheckCell2) holder.itemView).setChecked(false);
                        }
                    }
                    if ((bannedRights.view_messages || bannedRights.send_messages) && !bannedRights.send_stickers) {
                        bannedRights.send_stickers = bannedRights.send_games = bannedRights.send_gifs = bannedRights.send_inline = true;
                        RecyclerListView.ViewHolder holder = listView.findViewHolderForAdapterPosition(sendStickersRow);
                        if (holder != null) {
                            ((TextCheckCell2) holder.itemView).setChecked(false);
                        }
                    }
                    if ((bannedRights.view_messages || bannedRights.send_messages) && !bannedRights.embed_links) {
                        bannedRights.embed_links = true;
                        RecyclerListView.ViewHolder holder = listView.findViewHolderForAdapterPosition(embedLinksRow);
                        if (holder != null) {
                            ((TextCheckCell2) holder.itemView).setChecked(false);
                        }
                    }
                } else {
                    if ((!bannedRights.send_messages || !bannedRights.embed_links || !bannedRights.send_inline || !bannedRights.send_media || !bannedRights.send_polls) && bannedRights.view_messages) {
                        bannedRights.view_messages = false;
                    }
                    if ((!bannedRights.embed_links || !bannedRights.send_inline || !bannedRights.send_media || !bannedRights.send_polls) && bannedRights.send_messages) {
                        bannedRights.send_messages = false;
                        RecyclerListView.ViewHolder holder = listView.findViewHolderForAdapterPosition(sendMessagesRow);
                        if (holder != null) {
                            ((TextCheckCell2) holder.itemView).setChecked(true);
                        }
                    }
                }
            }
            updateRows(true);
        }
    });
    return fragmentView;
}
Also used : ThemeDescription(org.telegram.ui.ActionBar.ThemeDescription) LinearLayout(android.widget.LinearLayout) Bundle(android.os.Bundle) FrameLayout(android.widget.FrameLayout) ImageView(android.widget.ImageView) AndroidUtilities(org.telegram.messenger.AndroidUtilities) DialogRadioCell(org.telegram.ui.Cells.DialogRadioCell) DatePicker(android.widget.DatePicker) TextCheckCell2(org.telegram.ui.Cells.TextCheckCell2) ShadowSectionCell(org.telegram.ui.Cells.ShadowSectionCell) DatePickerDialog(android.app.DatePickerDialog) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) PollEditTextCell(org.telegram.ui.Cells.PollEditTextCell) BaseFragment(org.telegram.ui.ActionBar.BaseFragment) UserCell2(org.telegram.ui.Cells.UserCell2) PorterDuff(android.graphics.PorterDuff) ConnectionsManager(org.telegram.tgnet.ConnectionsManager) ViewGroup(android.view.ViewGroup) DefaultItemAnimator(androidx.recyclerview.widget.DefaultItemAnimator) TextView(android.widget.TextView) PorterDuffColorFilter(android.graphics.PorterDuffColorFilter) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) EditorInfo(android.view.inputmethod.EditorInfo) TextWatcher(android.text.TextWatcher) Context(android.content.Context) TimePickerDialog(android.app.TimePickerDialog) Theme(org.telegram.ui.ActionBar.Theme) TextDetailCell(org.telegram.ui.Cells.TextDetailCell) LocaleController(org.telegram.messenger.LocaleController) HeaderCell(org.telegram.ui.Cells.HeaderCell) AlertsCreator(org.telegram.ui.Components.AlertsCreator) Editable(android.text.Editable) TextInfoPrivacyCell(org.telegram.ui.Cells.TextInfoPrivacyCell) ArrayList(java.util.ArrayList) Calendar(java.util.Calendar) TLRPC(org.telegram.tgnet.TLRPC) Toast(android.widget.Toast) ActionBar(org.telegram.ui.ActionBar.ActionBar) Build(android.os.Build) DialogInterface(android.content.DialogInterface) SimpleTextView(org.telegram.ui.ActionBar.SimpleTextView) TextSettingsCell(org.telegram.ui.Cells.TextSettingsCell) ActionBarMenu(org.telegram.ui.ActionBar.ActionBarMenu) R(org.telegram.messenger.R) BottomSheet(org.telegram.ui.ActionBar.BottomSheet) LayoutHelper(org.telegram.ui.Components.LayoutHelper) FileLog(org.telegram.messenger.FileLog) MessagesController(org.telegram.messenger.MessagesController) Gravity(android.view.Gravity) UserObject(org.telegram.messenger.UserObject) TypedValue(android.util.TypedValue) Vibrator(android.os.Vibrator) ChatObject(org.telegram.messenger.ChatObject) AlertDialog(org.telegram.ui.ActionBar.AlertDialog) RecyclerListView(org.telegram.ui.Components.RecyclerListView) HeaderCell(org.telegram.ui.Cells.HeaderCell) RecyclerListView(org.telegram.ui.Components.RecyclerListView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) DefaultItemAnimator(androidx.recyclerview.widget.DefaultItemAnimator) TLRPC(org.telegram.tgnet.TLRPC) ActionBar(org.telegram.ui.ActionBar.ActionBar) DatePickerDialog(android.app.DatePickerDialog) Bundle(android.os.Bundle) ViewGroup(android.view.ViewGroup) Calendar(java.util.Calendar) TimePickerDialog(android.app.TimePickerDialog) TextCheckCell2(org.telegram.ui.Cells.TextCheckCell2) ActionBarMenu(org.telegram.ui.ActionBar.ActionBarMenu) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView) SimpleTextView(org.telegram.ui.ActionBar.SimpleTextView) RecyclerListView(org.telegram.ui.Components.RecyclerListView) FrameLayout(android.widget.FrameLayout) RecyclerView(androidx.recyclerview.widget.RecyclerView) BottomSheet(org.telegram.ui.ActionBar.BottomSheet) DatePicker(android.widget.DatePicker) LinearLayout(android.widget.LinearLayout)

Example 3 with TextCheckCell2

use of org.telegram.ui.Cells.TextCheckCell2 in project Telegram-FOSS by Telegram-FOSS-Team.

the class ChatUsersActivity method createView.

@Override
public View createView(Context context) {
    searching = false;
    actionBar.setBackButtonImage(R.drawable.ic_ab_back);
    actionBar.setAllowOverlayTitle(true);
    if (type == TYPE_KICKED) {
        actionBar.setTitle(LocaleController.getString("ChannelPermissions", R.string.ChannelPermissions));
    } else if (type == TYPE_BANNED) {
        actionBar.setTitle(LocaleController.getString("ChannelBlacklist", R.string.ChannelBlacklist));
    } else if (type == TYPE_ADMIN) {
        actionBar.setTitle(LocaleController.getString("ChannelAdministrators", R.string.ChannelAdministrators));
    } else if (type == TYPE_USERS) {
        if (selectType == SELECT_TYPE_MEMBERS) {
            if (isChannel) {
                actionBar.setTitle(LocaleController.getString("ChannelSubscribers", R.string.ChannelSubscribers));
            } else {
                actionBar.setTitle(LocaleController.getString("ChannelMembers", R.string.ChannelMembers));
            }
        } else {
            if (selectType == SELECT_TYPE_ADMIN) {
                actionBar.setTitle(LocaleController.getString("ChannelAddAdmin", R.string.ChannelAddAdmin));
            } else if (selectType == SELECT_TYPE_BLOCK) {
                actionBar.setTitle(LocaleController.getString("ChannelBlockUser", R.string.ChannelBlockUser));
            } else if (selectType == SELECT_TYPE_EXCEPTION) {
                actionBar.setTitle(LocaleController.getString("ChannelAddException", R.string.ChannelAddException));
            }
        }
    }
    actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {

        @Override
        public void onItemClick(int id) {
            if (id == -1) {
                if (checkDiscard()) {
                    finishFragment();
                }
            } else if (id == done_button) {
                processDone();
            }
        }
    });
    if (selectType != SELECT_TYPE_MEMBERS || type == TYPE_USERS || type == TYPE_BANNED || type == TYPE_KICKED) {
        searchListViewAdapter = new SearchAdapter(context);
        ActionBarMenu menu = actionBar.createMenu();
        searchItem = menu.addItem(search_button, R.drawable.ic_ab_search).setIsSearchField(true).setActionBarMenuItemSearchListener(new ActionBarMenuItem.ActionBarMenuItemSearchListener() {

            @Override
            public void onSearchExpand() {
                searching = true;
                if (doneItem != null) {
                    doneItem.setVisibility(View.GONE);
                }
            }

            @Override
            public void onSearchCollapse() {
                searchListViewAdapter.searchUsers(null);
                searching = false;
                listView.setAnimateEmptyView(false, 0);
                listView.setAdapter(listViewAdapter);
                listViewAdapter.notifyDataSetChanged();
                listView.setFastScrollVisible(true);
                listView.setVerticalScrollBarEnabled(false);
                if (doneItem != null) {
                    doneItem.setVisibility(View.VISIBLE);
                }
            }

            @Override
            public void onTextChanged(EditText editText) {
                if (searchListViewAdapter == null) {
                    return;
                }
                String text = editText.getText().toString();
                int oldItemsCount = listView.getAdapter() == null ? 0 : listView.getAdapter().getItemCount();
                searchListViewAdapter.searchUsers(text);
                if (TextUtils.isEmpty(text) && listView != null && listView.getAdapter() != listViewAdapter) {
                    listView.setAnimateEmptyView(false, 0);
                    listView.setAdapter(listViewAdapter);
                    if (oldItemsCount == 0) {
                        showItemsAnimated(0);
                    }
                }
                progressBar.setVisibility(View.GONE);
                flickerLoadingView.setVisibility(View.VISIBLE);
            }
        });
        if (type == TYPE_KICKED) {
            searchItem.setSearchFieldHint(LocaleController.getString("ChannelSearchException", R.string.ChannelSearchException));
        } else {
            searchItem.setSearchFieldHint(LocaleController.getString("Search", R.string.Search));
        }
        if (!(ChatObject.isChannel(currentChat) || currentChat.creator)) {
            searchItem.setVisibility(View.GONE);
        }
        if (type == TYPE_KICKED) {
            doneItem = menu.addItemWithWidth(done_button, R.drawable.ic_done, AndroidUtilities.dp(56), LocaleController.getString("Done", R.string.Done));
        }
    }
    fragmentView = new FrameLayout(context) {

        @Override
        protected void dispatchDraw(Canvas canvas) {
            canvas.drawColor(Theme.getColor(listView.getAdapter() == searchListViewAdapter ? Theme.key_windowBackgroundWhite : Theme.key_windowBackgroundGray));
            super.dispatchDraw(canvas);
        }
    };
    FrameLayout frameLayout = (FrameLayout) fragmentView;
    FrameLayout progressLayout = new FrameLayout(context);
    flickerLoadingView = new FlickerLoadingView(context);
    flickerLoadingView.setViewType(FlickerLoadingView.USERS_TYPE);
    flickerLoadingView.showDate(false);
    flickerLoadingView.setUseHeaderOffset(true);
    progressLayout.addView(flickerLoadingView);
    progressBar = new RadialProgressView(context);
    progressLayout.addView(progressBar, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER));
    flickerLoadingView.setVisibility(View.GONE);
    progressBar.setVisibility(View.GONE);
    emptyView = new StickerEmptyView(context, progressLayout, StickerEmptyView.STICKER_TYPE_SEARCH);
    emptyView.title.setText(LocaleController.getString("NoResult", R.string.NoResult));
    emptyView.subtitle.setText(LocaleController.getString("SearchEmptyViewFilteredSubtitle2", R.string.SearchEmptyViewFilteredSubtitle2));
    emptyView.setVisibility(View.GONE);
    emptyView.setAnimateLayoutChange(true);
    emptyView.showProgress(true, false);
    frameLayout.addView(emptyView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
    emptyView.addView(progressLayout, 0);
    listView = new RecyclerListView(context) {

        @Override
        public void invalidate() {
            super.invalidate();
            if (fragmentView != null) {
                fragmentView.invalidate();
            }
        }
    };
    listView.setLayoutManager(layoutManager = new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false) {

        @Override
        public int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler, RecyclerView.State state) {
            if (!firstLoaded && type == TYPE_BANNED && participants.size() == 0) {
                return 0;
            }
            return super.scrollVerticallyBy(dy, recycler, state);
        }
    });
    DefaultItemAnimator itemAnimator = new DefaultItemAnimator() {

        @Override
        protected long getAddAnimationDelay(long removeDuration, long moveDuration, long changeDuration) {
            return 0;
        }

        @Override
        protected long getMoveAnimationDelay() {
            return 0;
        }

        @Override
        public long getMoveDuration() {
            return 220;
        }

        @Override
        public long getRemoveDuration() {
            return 220;
        }

        @Override
        public long getAddDuration() {
            return 220;
        }

        int animationIndex = -1;

        @Override
        protected void onAllAnimationsDone() {
            super.onAllAnimationsDone();
            getNotificationCenter().onAnimationFinish(animationIndex);
        }

        @Override
        public void runPendingAnimations() {
            boolean removalsPending = !mPendingRemovals.isEmpty();
            boolean movesPending = !mPendingMoves.isEmpty();
            boolean changesPending = !mPendingChanges.isEmpty();
            boolean additionsPending = !mPendingAdditions.isEmpty();
            if (removalsPending || movesPending || additionsPending || changesPending) {
                animationIndex = getNotificationCenter().setAnimationInProgress(animationIndex, null);
            }
            super.runPendingAnimations();
        }
    };
    listView.setItemAnimator(itemAnimator);
    itemAnimator.setSupportsChangeAnimations(false);
    listView.setAnimateEmptyView(true, 0);
    listView.setAdapter(listViewAdapter = new ListAdapter(context));
    listView.setVerticalScrollbarPosition(LocaleController.isRTL ? RecyclerListView.SCROLLBAR_POSITION_LEFT : RecyclerListView.SCROLLBAR_POSITION_RIGHT);
    frameLayout.addView(listView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
    listView.setOnItemClickListener((view, position) -> {
        boolean listAdapter = listView.getAdapter() == listViewAdapter;
        if (listAdapter) {
            if (position == addNewRow) {
                if (type == TYPE_BANNED || type == TYPE_KICKED) {
                    Bundle bundle = new Bundle();
                    bundle.putLong("chat_id", chatId);
                    bundle.putInt("type", ChatUsersActivity.TYPE_USERS);
                    bundle.putInt("selectType", type == TYPE_BANNED ? ChatUsersActivity.SELECT_TYPE_BLOCK : ChatUsersActivity.SELECT_TYPE_EXCEPTION);
                    ChatUsersActivity fragment = new ChatUsersActivity(bundle);
                    fragment.setInfo(info);
                    fragment.setDelegate(new ChatUsersActivityDelegate() {

                        @Override
                        public void didAddParticipantToList(long uid, TLObject participant) {
                            if (participantsMap.get(uid) == null) {
                                DiffCallback diffCallback = saveState();
                                participants.add(participant);
                                participantsMap.put(uid, participant);
                                sortUsers(participants);
                                updateListAnimated(diffCallback);
                            }
                        }

                        @Override
                        public void didKickParticipant(long uid) {
                            if (participantsMap.get(uid) == null) {
                                DiffCallback diffCallback = saveState();
                                TLRPC.TL_channelParticipantBanned chatParticipant = new TLRPC.TL_channelParticipantBanned();
                                if (uid > 0) {
                                    chatParticipant.peer = new TLRPC.TL_peerUser();
                                    chatParticipant.peer.user_id = uid;
                                } else {
                                    chatParticipant.peer = new TLRPC.TL_peerChannel();
                                    chatParticipant.peer.channel_id = -uid;
                                }
                                chatParticipant.date = getConnectionsManager().getCurrentTime();
                                chatParticipant.kicked_by = getAccountInstance().getUserConfig().clientUserId;
                                info.kicked_count++;
                                participants.add(chatParticipant);
                                participantsMap.put(uid, chatParticipant);
                                sortUsers(participants);
                                updateListAnimated(diffCallback);
                            }
                        }
                    });
                    presentFragment(fragment);
                } else if (type == TYPE_ADMIN) {
                    Bundle bundle = new Bundle();
                    bundle.putLong("chat_id", chatId);
                    bundle.putInt("type", ChatUsersActivity.TYPE_USERS);
                    bundle.putInt("selectType", ChatUsersActivity.SELECT_TYPE_ADMIN);
                    ChatUsersActivity fragment = new ChatUsersActivity(bundle);
                    fragment.setDelegate(new ChatUsersActivityDelegate() {

                        @Override
                        public void didAddParticipantToList(long uid, TLObject participant) {
                            if (participant != null && participantsMap.get(uid) == null) {
                                DiffCallback diffCallback = saveState();
                                participants.add(participant);
                                participantsMap.put(uid, participant);
                                sortAdmins(participants);
                                updateListAnimated(diffCallback);
                            }
                        }

                        @Override
                        public void didChangeOwner(TLRPC.User user) {
                            onOwnerChaged(user);
                        }

                        @Override
                        public void didSelectUser(long uid) {
                            final TLRPC.User user = getMessagesController().getUser(uid);
                            if (user != null) {
                                AndroidUtilities.runOnUIThread(() -> {
                                    if (BulletinFactory.canShowBulletin(ChatUsersActivity.this)) {
                                        BulletinFactory.createPromoteToAdminBulletin(ChatUsersActivity.this, user.first_name).show();
                                    }
                                }, 200);
                            }
                            if (participantsMap.get(uid) == null) {
                                DiffCallback diffCallback = saveState();
                                TLRPC.TL_channelParticipantAdmin chatParticipant = new TLRPC.TL_channelParticipantAdmin();
                                chatParticipant.peer = new TLRPC.TL_peerUser();
                                chatParticipant.peer.user_id = user.id;
                                chatParticipant.date = getConnectionsManager().getCurrentTime();
                                chatParticipant.promoted_by = getAccountInstance().getUserConfig().clientUserId;
                                participants.add(chatParticipant);
                                participantsMap.put(user.id, chatParticipant);
                                sortAdmins(participants);
                                updateListAnimated(diffCallback);
                            }
                        }
                    });
                    fragment.setInfo(info);
                    presentFragment(fragment);
                } else if (type == TYPE_USERS) {
                    Bundle args = new Bundle();
                    args.putBoolean("addToGroup", true);
                    args.putLong(isChannel ? "channelId" : "chatId", currentChat.id);
                    GroupCreateActivity fragment = new GroupCreateActivity(args);
                    fragment.setInfo(info);
                    fragment.setIgnoreUsers(contactsMap != null && contactsMap.size() != 0 ? contactsMap : participantsMap);
                    fragment.setDelegate(new GroupCreateActivity.ContactsAddActivityDelegate() {

                        @Override
                        public void didSelectUsers(ArrayList<TLRPC.User> users, int fwdCount) {
                            DiffCallback savedState = saveState();
                            ArrayList<TLObject> array = contactsMap != null && contactsMap.size() != 0 ? contacts : participants;
                            LongSparseArray<TLObject> map = contactsMap != null && contactsMap.size() != 0 ? contactsMap : participantsMap;
                            int k = 0;
                            for (int a = 0, N = users.size(); a < N; a++) {
                                TLRPC.User user = users.get(a);
                                getMessagesController().addUserToChat(chatId, user, fwdCount, null, ChatUsersActivity.this, null);
                                getMessagesController().putUser(user, false);
                                if (map.get(user.id) == null) {
                                    if (ChatObject.isChannel(currentChat)) {
                                        TLRPC.TL_channelParticipant channelParticipant1 = new TLRPC.TL_channelParticipant();
                                        channelParticipant1.inviter_id = getUserConfig().getClientUserId();
                                        channelParticipant1.peer = new TLRPC.TL_peerUser();
                                        channelParticipant1.peer.user_id = user.id;
                                        channelParticipant1.date = getConnectionsManager().getCurrentTime();
                                        array.add(k, channelParticipant1);
                                        k++;
                                        map.put(user.id, channelParticipant1);
                                    } else {
                                        TLRPC.ChatParticipant participant = new TLRPC.TL_chatParticipant();
                                        participant.user_id = user.id;
                                        participant.inviter_id = getUserConfig().getClientUserId();
                                        array.add(k, participant);
                                        k++;
                                        map.put(user.id, participant);
                                    }
                                }
                            }
                            if (array == participants) {
                                sortAdmins(participants);
                            }
                            updateListAnimated(savedState);
                        }

                        @Override
                        public void needAddBot(TLRPC.User user) {
                            openRightsEdit(user.id, null, null, null, "", true, ChatRightsEditActivity.TYPE_ADMIN, false);
                        }
                    });
                    presentFragment(fragment);
                }
                return;
            } else if (position == recentActionsRow) {
                presentFragment(new ChannelAdminLogActivity(currentChat));
                return;
            } else if (position == removedUsersRow) {
                Bundle args = new Bundle();
                args.putLong("chat_id", chatId);
                args.putInt("type", ChatUsersActivity.TYPE_BANNED);
                ChatUsersActivity fragment = new ChatUsersActivity(args);
                fragment.setInfo(info);
                presentFragment(fragment);
                return;
            } else if (position == gigaConvertRow) {
                showDialog(new GigagroupConvertAlert(getParentActivity(), ChatUsersActivity.this) {

                    @Override
                    protected void onCovert() {
                        getMessagesController().convertToGigaGroup(getParentActivity(), currentChat, ChatUsersActivity.this, (result) -> {
                            if (result && parentLayout != null) {
                                BaseFragment editActivity = parentLayout.fragmentsStack.get(parentLayout.fragmentsStack.size() - 2);
                                if (editActivity instanceof ChatEditActivity) {
                                    editActivity.removeSelfFromStack();
                                    Bundle args = new Bundle();
                                    args.putLong("chat_id", chatId);
                                    ChatEditActivity fragment = new ChatEditActivity(args);
                                    fragment.setInfo(info);
                                    parentLayout.addFragmentToStack(fragment, parentLayout.fragmentsStack.size() - 1);
                                    finishFragment();
                                    fragment.showConvertTooltip();
                                } else {
                                    finishFragment();
                                }
                            }
                        });
                    }

                    @Override
                    protected void onCancel() {
                    }
                });
            } else if (position == addNew2Row) {
                ManageLinksActivity fragment = new ManageLinksActivity(chatId, 0, 0);
                fragment.setInfo(info, info.exported_invite);
                presentFragment(fragment);
                return;
            } else if (position > permissionsSectionRow && position <= changeInfoRow) {
                TextCheckCell2 checkCell = (TextCheckCell2) view;
                if (!checkCell.isEnabled()) {
                    return;
                }
                if (checkCell.hasIcon()) {
                    if (!TextUtils.isEmpty(currentChat.username) && (position == pinMessagesRow || position == changeInfoRow)) {
                        BulletinFactory.of(this).createErrorBulletin(LocaleController.getString("EditCantEditPermissionsPublic", R.string.EditCantEditPermissionsPublic)).show();
                    } else {
                        BulletinFactory.of(this).createErrorBulletin(LocaleController.getString("EditCantEditPermissions", R.string.EditCantEditPermissions)).show();
                    }
                    return;
                }
                checkCell.setChecked(!checkCell.isChecked());
                if (position == changeInfoRow) {
                    defaultBannedRights.change_info = !defaultBannedRights.change_info;
                } else if (position == addUsersRow) {
                    defaultBannedRights.invite_users = !defaultBannedRights.invite_users;
                } else if (position == pinMessagesRow) {
                    defaultBannedRights.pin_messages = !defaultBannedRights.pin_messages;
                } else {
                    boolean disabled = !checkCell.isChecked();
                    if (position == sendMessagesRow) {
                        defaultBannedRights.send_messages = !defaultBannedRights.send_messages;
                    } else if (position == sendMediaRow) {
                        defaultBannedRights.send_media = !defaultBannedRights.send_media;
                    } else if (position == sendStickersRow) {
                        defaultBannedRights.send_stickers = defaultBannedRights.send_games = defaultBannedRights.send_gifs = defaultBannedRights.send_inline = !defaultBannedRights.send_stickers;
                    } else if (position == embedLinksRow) {
                        defaultBannedRights.embed_links = !defaultBannedRights.embed_links;
                    } else if (position == sendPollsRow) {
                        defaultBannedRights.send_polls = !defaultBannedRights.send_polls;
                    }
                    if (disabled) {
                        if (defaultBannedRights.view_messages && !defaultBannedRights.send_messages) {
                            defaultBannedRights.send_messages = true;
                            RecyclerListView.ViewHolder holder = listView.findViewHolderForAdapterPosition(sendMessagesRow);
                            if (holder != null) {
                                ((TextCheckCell2) holder.itemView).setChecked(false);
                            }
                        }
                        if ((defaultBannedRights.view_messages || defaultBannedRights.send_messages) && !defaultBannedRights.send_media) {
                            defaultBannedRights.send_media = true;
                            RecyclerListView.ViewHolder holder = listView.findViewHolderForAdapterPosition(sendMediaRow);
                            if (holder != null) {
                                ((TextCheckCell2) holder.itemView).setChecked(false);
                            }
                        }
                        if ((defaultBannedRights.view_messages || defaultBannedRights.send_messages) && !defaultBannedRights.send_polls) {
                            defaultBannedRights.send_polls = true;
                            RecyclerListView.ViewHolder holder = listView.findViewHolderForAdapterPosition(sendPollsRow);
                            if (holder != null) {
                                ((TextCheckCell2) holder.itemView).setChecked(false);
                            }
                        }
                        if ((defaultBannedRights.view_messages || defaultBannedRights.send_messages) && !defaultBannedRights.send_stickers) {
                            defaultBannedRights.send_stickers = defaultBannedRights.send_games = defaultBannedRights.send_gifs = defaultBannedRights.send_inline = true;
                            RecyclerListView.ViewHolder holder = listView.findViewHolderForAdapterPosition(sendStickersRow);
                            if (holder != null) {
                                ((TextCheckCell2) holder.itemView).setChecked(false);
                            }
                        }
                        if ((defaultBannedRights.view_messages || defaultBannedRights.send_messages) && !defaultBannedRights.embed_links) {
                            defaultBannedRights.embed_links = true;
                            RecyclerListView.ViewHolder holder = listView.findViewHolderForAdapterPosition(embedLinksRow);
                            if (holder != null) {
                                ((TextCheckCell2) holder.itemView).setChecked(false);
                            }
                        }
                    } else {
                        if ((!defaultBannedRights.embed_links || !defaultBannedRights.send_inline || !defaultBannedRights.send_media || !defaultBannedRights.send_polls) && defaultBannedRights.send_messages) {
                            defaultBannedRights.send_messages = false;
                            RecyclerListView.ViewHolder holder = listView.findViewHolderForAdapterPosition(sendMessagesRow);
                            if (holder != null) {
                                ((TextCheckCell2) holder.itemView).setChecked(true);
                            }
                        }
                    }
                }
                return;
            }
        }
        TLRPC.TL_chatBannedRights bannedRights = null;
        TLRPC.TL_chatAdminRights adminRights = null;
        String rank = "";
        final TLObject participant;
        long peerId = 0;
        long promoted_by = 0;
        boolean canEditAdmin = false;
        if (listAdapter) {
            participant = listViewAdapter.getItem(position);
            if (participant instanceof TLRPC.ChannelParticipant) {
                TLRPC.ChannelParticipant channelParticipant = (TLRPC.ChannelParticipant) participant;
                peerId = MessageObject.getPeerId(channelParticipant.peer);
                bannedRights = channelParticipant.banned_rights;
                adminRights = channelParticipant.admin_rights;
                rank = channelParticipant.rank;
                canEditAdmin = !(channelParticipant instanceof TLRPC.TL_channelParticipantAdmin || channelParticipant instanceof TLRPC.TL_channelParticipantCreator) || channelParticipant.can_edit;
                if (participant instanceof TLRPC.TL_channelParticipantCreator) {
                    adminRights = ((TLRPC.TL_channelParticipantCreator) participant).admin_rights;
                    if (adminRights == null) {
                        adminRights = new TLRPC.TL_chatAdminRights();
                        adminRights.change_info = adminRights.post_messages = adminRights.edit_messages = adminRights.delete_messages = adminRights.ban_users = adminRights.invite_users = adminRights.pin_messages = adminRights.add_admins = true;
                        if (!isChannel) {
                            adminRights.manage_call = true;
                        }
                    }
                }
            } else if (participant instanceof TLRPC.ChatParticipant) {
                TLRPC.ChatParticipant chatParticipant = (TLRPC.ChatParticipant) participant;
                peerId = chatParticipant.user_id;
                canEditAdmin = currentChat.creator;
                if (participant instanceof TLRPC.TL_chatParticipantCreator) {
                    adminRights = new TLRPC.TL_chatAdminRights();
                    adminRights.change_info = adminRights.post_messages = adminRights.edit_messages = adminRights.delete_messages = adminRights.ban_users = adminRights.invite_users = adminRights.pin_messages = adminRights.add_admins = true;
                    if (!isChannel) {
                        adminRights.manage_call = true;
                    }
                }
            }
        } else {
            TLObject object = searchListViewAdapter.getItem(position);
            if (object instanceof TLRPC.User) {
                TLRPC.User user = (TLRPC.User) object;
                getMessagesController().putUser(user, false);
                participant = getAnyParticipant(peerId = user.id);
            } else if (object instanceof TLRPC.ChannelParticipant || object instanceof TLRPC.ChatParticipant) {
                participant = object;
            } else {
                participant = null;
            }
            if (participant instanceof TLRPC.ChannelParticipant) {
                TLRPC.ChannelParticipant channelParticipant = (TLRPC.ChannelParticipant) participant;
                peerId = MessageObject.getPeerId(channelParticipant.peer);
                canEditAdmin = !(channelParticipant instanceof TLRPC.TL_channelParticipantAdmin || channelParticipant instanceof TLRPC.TL_channelParticipantCreator) || channelParticipant.can_edit;
                bannedRights = channelParticipant.banned_rights;
                adminRights = channelParticipant.admin_rights;
                rank = channelParticipant.rank;
            } else if (participant instanceof TLRPC.ChatParticipant) {
                TLRPC.ChatParticipant chatParticipant = (TLRPC.ChatParticipant) participant;
                peerId = chatParticipant.user_id;
                canEditAdmin = currentChat.creator;
                bannedRights = null;
                adminRights = null;
            } else if (participant == null) {
                canEditAdmin = true;
            }
        }
        if (peerId != 0) {
            if (selectType != SELECT_TYPE_MEMBERS) {
                if (selectType == SELECT_TYPE_EXCEPTION || selectType == SELECT_TYPE_ADMIN) {
                    if (selectType != SELECT_TYPE_ADMIN && canEditAdmin && (participant instanceof TLRPC.TL_channelParticipantAdmin || participant instanceof TLRPC.TL_chatParticipantAdmin)) {
                        final TLRPC.User user = getMessagesController().getUser(peerId);
                        final TLRPC.TL_chatBannedRights br = bannedRights;
                        final TLRPC.TL_chatAdminRights ar = adminRights;
                        final boolean canEdit = canEditAdmin;
                        final String rankFinal = rank;
                        AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
                        builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
                        builder.setMessage(LocaleController.formatString("AdminWillBeRemoved", R.string.AdminWillBeRemoved, UserObject.getUserName(user)));
                        builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialog, which) -> openRightsEdit(user.id, participant, ar, br, rankFinal, canEdit, selectType == SELECT_TYPE_ADMIN ? 0 : 1, false));
                        builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
                        showDialog(builder.create());
                    } else {
                        openRightsEdit(peerId, participant, adminRights, bannedRights, rank, canEditAdmin, selectType == SELECT_TYPE_ADMIN ? 0 : 1, selectType == SELECT_TYPE_ADMIN || selectType == SELECT_TYPE_EXCEPTION);
                    }
                } else {
                    removeParticipant(peerId);
                }
            } else {
                boolean canEdit = false;
                if (type == TYPE_ADMIN) {
                    canEdit = peerId != getUserConfig().getClientUserId() && (currentChat.creator || canEditAdmin);
                } else if (type == TYPE_BANNED || type == TYPE_KICKED) {
                    canEdit = ChatObject.canBlockUsers(currentChat);
                }
                if (type == TYPE_BANNED || type != TYPE_ADMIN && isChannel || type == TYPE_USERS && selectType == SELECT_TYPE_MEMBERS) {
                    if (peerId == getUserConfig().getClientUserId()) {
                        return;
                    }
                    Bundle args = new Bundle();
                    if (peerId > 0) {
                        args.putLong("user_id", peerId);
                    } else {
                        args.putLong("chat_id", -peerId);
                    }
                    presentFragment(new ProfileActivity(args));
                } else {
                    if (bannedRights == null) {
                        bannedRights = new TLRPC.TL_chatBannedRights();
                        bannedRights.view_messages = true;
                        bannedRights.send_stickers = true;
                        bannedRights.send_media = true;
                        bannedRights.embed_links = true;
                        bannedRights.send_messages = true;
                        bannedRights.send_games = true;
                        bannedRights.send_inline = true;
                        bannedRights.send_gifs = true;
                        bannedRights.pin_messages = true;
                        bannedRights.send_polls = true;
                        bannedRights.invite_users = true;
                        bannedRights.change_info = true;
                    }
                    ChatRightsEditActivity fragment = new ChatRightsEditActivity(peerId, chatId, adminRights, defaultBannedRights, bannedRights, rank, type == TYPE_ADMIN ? ChatRightsEditActivity.TYPE_ADMIN : ChatRightsEditActivity.TYPE_BANNED, canEdit, participant == null);
                    fragment.setDelegate(new ChatRightsEditActivity.ChatRightsEditActivityDelegate() {

                        @Override
                        public void didSetRights(int rights, TLRPC.TL_chatAdminRights rightsAdmin, TLRPC.TL_chatBannedRights rightsBanned, String rank) {
                            if (participant instanceof TLRPC.ChannelParticipant) {
                                TLRPC.ChannelParticipant channelParticipant = (TLRPC.ChannelParticipant) participant;
                                channelParticipant.admin_rights = rightsAdmin;
                                channelParticipant.banned_rights = rightsBanned;
                                channelParticipant.rank = rank;
                                updateParticipantWithRights(channelParticipant, rightsAdmin, rightsBanned, 0, false);
                            }
                        }

                        @Override
                        public void didChangeOwner(TLRPC.User user) {
                            onOwnerChaged(user);
                        }
                    });
                    presentFragment(fragment);
                }
            }
        }
    });
    listView.setOnItemLongClickListener((view, position) -> !(getParentActivity() == null || listView.getAdapter() != listViewAdapter) && createMenuForParticipant(listViewAdapter.getItem(position), false));
    if (searchItem != null) {
        listView.setOnScrollListener(new RecyclerView.OnScrollListener() {

            @Override
            public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
                if (newState == RecyclerView.SCROLL_STATE_DRAGGING) {
                    AndroidUtilities.hideKeyboard(getParentActivity().getCurrentFocus());
                }
            }

            @Override
            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
            }
        });
    }
    undoView = new UndoView(context);
    frameLayout.addView(undoView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.BOTTOM | Gravity.LEFT, 8, 0, 8, 8));
    updateRows();
    listView.setEmptyView(emptyView);
    listView.setAnimateEmptyView(false, 0);
    if (needOpenSearch) {
        searchItem.openSearch(false);
    }
    return fragmentView;
}
Also used : AlertDialog(org.telegram.ui.ActionBar.AlertDialog) SpannableStringBuilder(android.text.SpannableStringBuilder) ArrayList(java.util.ArrayList) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) DefaultItemAnimator(androidx.recyclerview.widget.DefaultItemAnimator) TLRPC(org.telegram.tgnet.TLRPC) BaseFragment(org.telegram.ui.ActionBar.BaseFragment) ActionBar(org.telegram.ui.ActionBar.ActionBar) EditText(android.widget.EditText) RadialProgressView(org.telegram.ui.Components.RadialProgressView) Canvas(android.graphics.Canvas) StickerEmptyView(org.telegram.ui.Components.StickerEmptyView) TextCheckCell2(org.telegram.ui.Cells.TextCheckCell2) ActionBarMenu(org.telegram.ui.ActionBar.ActionBarMenu) GigagroupConvertAlert(org.telegram.ui.Components.GigagroupConvertAlert) LongSparseArray(androidx.collection.LongSparseArray) RecyclerListView(org.telegram.ui.Components.RecyclerListView) UndoView(org.telegram.ui.Components.UndoView) FlickerLoadingView(org.telegram.ui.Components.FlickerLoadingView) Bundle(android.os.Bundle) TextPaint(android.text.TextPaint) Paint(android.graphics.Paint) TLObject(org.telegram.tgnet.TLObject) FrameLayout(android.widget.FrameLayout) RecyclerView(androidx.recyclerview.widget.RecyclerView)

Example 4 with TextCheckCell2

use of org.telegram.ui.Cells.TextCheckCell2 in project Telegram-FOSS by Telegram-FOSS-Team.

the class ChatRightsEditActivity method getThemeDescriptions.

@Override
public ArrayList<ThemeDescription> getThemeDescriptions() {
    ArrayList<ThemeDescription> themeDescriptions = new ArrayList<>();
    ThemeDescription.ThemeDescriptionDelegate cellDelegate = () -> {
        if (listView != null) {
            int count = listView.getChildCount();
            for (int a = 0; a < count; a++) {
                View child = listView.getChildAt(a);
                if (child instanceof UserCell2) {
                    ((UserCell2) child).update(0);
                }
            }
        }
    };
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR, new Class[] { UserCell2.class, TextSettingsCell.class, TextCheckCell2.class, HeaderCell.class, TextDetailCell.class, PollEditTextCell.class }, null, null, null, Theme.key_windowBackgroundWhite));
    themeDescriptions.add(new ThemeDescription(fragmentView, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_windowBackgroundGray));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_actionBarDefault));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_LISTGLOWCOLOR, null, null, null, null, Theme.key_actionBarDefault));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_ITEMSCOLOR, null, null, null, null, Theme.key_actionBarDefaultIcon));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_TITLECOLOR, null, null, null, null, Theme.key_actionBarDefaultTitle));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_SELECTORCOLOR, null, null, null, null, Theme.key_actionBarDefaultSelector));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_SELECTOR, null, null, null, null, Theme.key_listSelector));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { View.class }, Theme.dividerPaint, null, null, Theme.key_divider));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[] { TextInfoPrivacyCell.class }, null, null, null, Theme.key_windowBackgroundGrayShadow));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextInfoPrivacyCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteGrayText4));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { TextSettingsCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteRedText5));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { TextSettingsCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextSettingsCell.class }, new String[] { "valueTextView" }, null, null, null, Theme.key_windowBackgroundWhiteValueText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextSettingsCell.class }, new String[] { "valueImageView" }, null, null, null, Theme.key_windowBackgroundWhiteGrayIcon));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextDetailCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextDetailCell.class }, new String[] { "valueTextView" }, null, null, null, Theme.key_windowBackgroundWhiteGrayText2));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextCheckCell2.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextCheckCell2.class }, new String[] { "valueTextView" }, null, null, null, Theme.key_windowBackgroundWhiteGrayText2));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextCheckCell2.class }, new String[] { "checkBox" }, null, null, null, Theme.key_switch2Track));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextCheckCell2.class }, new String[] { "checkBox" }, null, null, null, Theme.key_switch2TrackChecked));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[] { ShadowSectionCell.class }, null, null, null, Theme.key_windowBackgroundGrayShadow));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { HeaderCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlueHeader));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { HeaderCell.class }, new String[] { "textView2" }, null, null, null, Theme.key_windowBackgroundWhiteRedText5));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { HeaderCell.class }, new String[] { "textView2" }, null, null, null, Theme.key_windowBackgroundWhiteGrayText3));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_TEXTCOLOR, new Class[] { PollEditTextCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_HINTTEXTCOLOR, new Class[] { PollEditTextCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteHintText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { UserCell2.class }, new String[] { "nameTextView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { UserCell2.class }, new String[] { "statusColor" }, null, null, cellDelegate, Theme.key_windowBackgroundWhiteGrayText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { UserCell2.class }, new String[] { "statusOnlineColor" }, null, null, cellDelegate, Theme.key_windowBackgroundWhiteBlueText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { UserCell2.class }, null, Theme.avatarDrawables, null, Theme.key_avatar_text));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundRed));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundOrange));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundViolet));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundGreen));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundCyan));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundBlue));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundPink));
    themeDescriptions.add(new ThemeDescription(null, 0, new Class[] { DialogRadioCell.class }, new String[] { "textView" }, null, null, null, Theme.key_dialogTextBlack));
    themeDescriptions.add(new ThemeDescription(null, 0, new Class[] { DialogRadioCell.class }, new String[] { "textView" }, null, null, null, Theme.key_dialogTextGray2));
    themeDescriptions.add(new ThemeDescription(null, ThemeDescription.FLAG_CHECKBOX, new Class[] { DialogRadioCell.class }, new String[] { "radioButton" }, null, null, null, Theme.key_dialogRadioBackground));
    themeDescriptions.add(new ThemeDescription(null, ThemeDescription.FLAG_CHECKBOXCHECK, new Class[] { DialogRadioCell.class }, new String[] { "radioButton" }, null, null, null, Theme.key_dialogRadioBackgroundChecked));
    return themeDescriptions;
}
Also used : TextDetailCell(org.telegram.ui.Cells.TextDetailCell) ShadowSectionCell(org.telegram.ui.Cells.ShadowSectionCell) HeaderCell(org.telegram.ui.Cells.HeaderCell) ArrayList(java.util.ArrayList) TextInfoPrivacyCell(org.telegram.ui.Cells.TextInfoPrivacyCell) ThemeDescription(org.telegram.ui.ActionBar.ThemeDescription) TextCheckCell2(org.telegram.ui.Cells.TextCheckCell2) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView) SimpleTextView(org.telegram.ui.ActionBar.SimpleTextView) RecyclerListView(org.telegram.ui.Components.RecyclerListView) PollEditTextCell(org.telegram.ui.Cells.PollEditTextCell) TextSettingsCell(org.telegram.ui.Cells.TextSettingsCell) DialogRadioCell(org.telegram.ui.Cells.DialogRadioCell) UserCell2(org.telegram.ui.Cells.UserCell2)

Aggregations

RecyclerView (androidx.recyclerview.widget.RecyclerView)4 ArrayList (java.util.ArrayList)4 TextCheckCell2 (org.telegram.ui.Cells.TextCheckCell2)4 RecyclerListView (org.telegram.ui.Components.RecyclerListView)4 View (android.view.View)3 ImageView (android.widget.ImageView)3 TextView (android.widget.TextView)3 ThemeDescription (org.telegram.ui.ActionBar.ThemeDescription)3 HeaderCell (org.telegram.ui.Cells.HeaderCell)3 ShadowSectionCell (org.telegram.ui.Cells.ShadowSectionCell)3 TextInfoPrivacyCell (org.telegram.ui.Cells.TextInfoPrivacyCell)3 TextSettingsCell (org.telegram.ui.Cells.TextSettingsCell)3 Bundle (android.os.Bundle)2 FrameLayout (android.widget.FrameLayout)2 DefaultItemAnimator (androidx.recyclerview.widget.DefaultItemAnimator)2 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)2 TLRPC (org.telegram.tgnet.TLRPC)2 ActionBar (org.telegram.ui.ActionBar.ActionBar)2 ActionBarMenu (org.telegram.ui.ActionBar.ActionBarMenu)2 AlertDialog (org.telegram.ui.ActionBar.AlertDialog)2