Search in sources :

Example 91 with AlertDialog

use of org.telegram.ui.ActionBar.AlertDialog in project Telegram-FOSS by Telegram-FOSS-Team.

the class AlertsCreator method createClearDaysDialogAlert.

public static void createClearDaysDialogAlert(BaseFragment fragment, int days, TLRPC.User user, MessagesStorage.BooleanCallback onProcessRunnable, Theme.ResourcesProvider resourcesProvider) {
    if (fragment == null || fragment.getParentActivity() == null || user == null) {
        return;
    }
    int account = fragment.getCurrentAccount();
    Context context = fragment.getParentActivity();
    AlertDialog.Builder builder = new AlertDialog.Builder(context, resourcesProvider);
    long selfUserId = UserConfig.getInstance(account).getClientUserId();
    CheckBoxCell[] cell = new CheckBoxCell[1];
    TextView messageTextView = new TextView(context);
    messageTextView.setTextColor(Theme.getColor(Theme.key_dialogTextBlack));
    messageTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
    messageTextView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP);
    FrameLayout frameLayout = new FrameLayout(context) {

        @Override
        protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
            super.onMeasure(widthMeasureSpec, heightMeasureSpec);
            if (cell[0] != null) {
                setMeasuredDimension(getMeasuredWidth(), getMeasuredHeight() + cell[0].getMeasuredHeight());
            }
        }
    };
    builder.setView(frameLayout);
    TextView textView = new TextView(context);
    textView.setTextColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem));
    textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 20);
    textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
    textView.setLines(1);
    textView.setMaxLines(1);
    textView.setSingleLine(true);
    textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL);
    textView.setEllipsize(TextUtils.TruncateAt.END);
    textView.setText(LocaleController.formatPluralString("DeleteDays", days));
    frameLayout.addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 24, 11, 24, 0));
    frameLayout.addView(messageTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 24, 48, 24, 18));
    messageTextView.setText(LocaleController.getString("DeleteHistoryByDaysMessage", R.string.DeleteHistoryByDaysMessage));
    final boolean[] deleteForAll = new boolean[] { false };
    if (user.id != selfUserId) {
        cell[0] = new CheckBoxCell(context, 1, resourcesProvider);
        cell[0].setBackgroundDrawable(Theme.getSelectorDrawable(false));
        cell[0].setText(LocaleController.formatString("DeleteMessagesOptionAlso", R.string.DeleteMessagesOptionAlso, UserObject.getFirstName(user)), "", false, false);
        cell[0].setPadding(LocaleController.isRTL ? AndroidUtilities.dp(16) : AndroidUtilities.dp(8), 0, LocaleController.isRTL ? AndroidUtilities.dp(8) : AndroidUtilities.dp(16), 0);
        frameLayout.addView(cell[0], LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 48, Gravity.BOTTOM | Gravity.LEFT, 0, 0, 0, 0));
        cell[0].setChecked(false, false);
        cell[0].setOnClickListener(v -> {
            CheckBoxCell cell1 = (CheckBoxCell) v;
            deleteForAll[0] = !deleteForAll[0];
            cell1.setChecked(deleteForAll[0], true);
        });
    }
    builder.setPositiveButton(LocaleController.getString("Delete", R.string.Delete), (dialogInterface, i) -> {
        onProcessRunnable.run(deleteForAll[0]);
    });
    builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
    AlertDialog alertDialog = builder.create();
    fragment.showDialog(alertDialog);
    TextView button = (TextView) alertDialog.getButton(DialogInterface.BUTTON_POSITIVE);
    if (button != null) {
        button.setTextColor(Theme.getColor(Theme.key_dialogTextRed2));
    }
}
Also used : Context(android.content.Context) AlertDialog(org.telegram.ui.ActionBar.AlertDialog) CheckBoxCell(org.telegram.ui.Cells.CheckBoxCell) SpannableStringBuilder(android.text.SpannableStringBuilder) FrameLayout(android.widget.FrameLayout) TextView(android.widget.TextView) SuppressLint(android.annotation.SuppressLint)

Example 92 with AlertDialog

use of org.telegram.ui.ActionBar.AlertDialog in project Telegram-FOSS by Telegram-FOSS-Team.

the class AlertsCreator method createImportDialogAlert.

public static void createImportDialogAlert(BaseFragment fragment, String title, String message, TLRPC.User user, TLRPC.Chat chat, Runnable onProcessRunnable) {
    if (fragment == null || fragment.getParentActivity() == null || chat == null && user == null) {
        return;
    }
    int account = fragment.getCurrentAccount();
    Context context = fragment.getParentActivity();
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    long selfUserId = UserConfig.getInstance(account).getClientUserId();
    TextView messageTextView = new TextView(context);
    messageTextView.setTextColor(Theme.getColor(Theme.key_dialogTextBlack));
    messageTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
    messageTextView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP);
    FrameLayout frameLayout = new FrameLayout(context);
    builder.setView(frameLayout);
    AvatarDrawable avatarDrawable = new AvatarDrawable();
    avatarDrawable.setTextSize(AndroidUtilities.dp(12));
    BackupImageView imageView = new BackupImageView(context);
    imageView.setRoundRadius(AndroidUtilities.dp(20));
    frameLayout.addView(imageView, LayoutHelper.createFrame(40, 40, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 22, 5, 22, 0));
    TextView textView = new TextView(context);
    textView.setTextColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem));
    textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 20);
    textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
    textView.setLines(1);
    textView.setMaxLines(1);
    textView.setSingleLine(true);
    textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL);
    textView.setEllipsize(TextUtils.TruncateAt.END);
    textView.setText(LocaleController.getString("ImportMessages", R.string.ImportMessages));
    frameLayout.addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, (LocaleController.isRTL ? 21 : 76), 11, (LocaleController.isRTL ? 76 : 21), 0));
    frameLayout.addView(messageTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 24, 57, 24, 9));
    if (user != null) {
        if (UserObject.isReplyUser(user)) {
            avatarDrawable.setSmallSize(true);
            avatarDrawable.setAvatarType(AvatarDrawable.AVATAR_TYPE_REPLIES);
            imageView.setImage(null, null, avatarDrawable, user);
        } else if (user.id == selfUserId) {
            avatarDrawable.setSmallSize(true);
            avatarDrawable.setAvatarType(AvatarDrawable.AVATAR_TYPE_SAVED);
            imageView.setImage(null, null, avatarDrawable, user);
        } else {
            avatarDrawable.setSmallSize(false);
            avatarDrawable.setInfo(user);
            imageView.setForUserOrChat(user, avatarDrawable);
        }
    } else {
        avatarDrawable.setInfo(chat);
        imageView.setForUserOrChat(chat, avatarDrawable);
    }
    messageTextView.setText(AndroidUtilities.replaceTags(message));
    /*if (chat != null) {
            if (TextUtils.isEmpty(title)) {
                messageTextView.setText(AndroidUtilities.replaceTags(LocaleController.formatString("ImportToChatNoTitle", R.string.ImportToChatNoTitle, chat.title)));
            } else {
                messageTextView.setText(AndroidUtilities.replaceTags(LocaleController.formatString("ImportToChat", R.string.ImportToChat, title, chat.title)));
            }
        } else {
            if (TextUtils.isEmpty(title)) {
                messageTextView.setText(AndroidUtilities.replaceTags(LocaleController.formatString("ImportToUserNoTitle", R.string.ImportToUserNoTitle, ContactsController.formatName(user.first_name, user.last_name))));
            } else {
                messageTextView.setText(AndroidUtilities.replaceTags(LocaleController.formatString("ImportToUser", R.string.ImportToUser, title, ContactsController.formatName(user.first_name, user.last_name))));
            }
        }*/
    builder.setPositiveButton(LocaleController.getString("Import", R.string.Import), (dialogInterface, i) -> {
        if (onProcessRunnable != null) {
            onProcessRunnable.run();
        }
    });
    builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
    AlertDialog alertDialog = builder.create();
    fragment.showDialog(alertDialog);
}
Also used : Context(android.content.Context) AlertDialog(org.telegram.ui.ActionBar.AlertDialog) SpannableStringBuilder(android.text.SpannableStringBuilder) FrameLayout(android.widget.FrameLayout) TextView(android.widget.TextView) SuppressLint(android.annotation.SuppressLint)

Example 93 with AlertDialog

use of org.telegram.ui.ActionBar.AlertDialog in project Telegram-FOSS by Telegram-FOSS-Team.

the class AlertsCreator method createSupportAlert.

public static AlertDialog createSupportAlert(BaseFragment fragment) {
    if (fragment == null || fragment.getParentActivity() == null) {
        return null;
    }
    final TextView message = new TextView(fragment.getParentActivity());
    Spannable spanned = new SpannableString(Html.fromHtml(LocaleController.getString("AskAQuestionInfo", R.string.AskAQuestionInfo).replace("\n", "<br>")));
    URLSpan[] spans = spanned.getSpans(0, spanned.length(), URLSpan.class);
    for (int i = 0; i < spans.length; i++) {
        URLSpan span = spans[i];
        int start = spanned.getSpanStart(span);
        int end = spanned.getSpanEnd(span);
        spanned.removeSpan(span);
        span = new URLSpanNoUnderline(span.getURL()) {

            @Override
            public void onClick(View widget) {
                fragment.dismissCurrentDialog();
                super.onClick(widget);
            }
        };
        spanned.setSpan(span, start, end, 0);
    }
    message.setText(spanned);
    message.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
    message.setLinkTextColor(Theme.getColor(Theme.key_dialogTextLink));
    message.setHighlightColor(Theme.getColor(Theme.key_dialogLinkSelection));
    message.setPadding(AndroidUtilities.dp(23), 0, AndroidUtilities.dp(23), 0);
    message.setMovementMethod(new AndroidUtilities.LinkMovementMethodMy());
    message.setTextColor(Theme.getColor(Theme.key_dialogTextBlack));
    AlertDialog.Builder builder1 = new AlertDialog.Builder(fragment.getParentActivity());
    builder1.setView(message);
    builder1.setTitle(LocaleController.getString("AskAQuestion", R.string.AskAQuestion));
    builder1.setPositiveButton(LocaleController.getString("AskButton", R.string.AskButton), (dialogInterface, i) -> performAskAQuestion(fragment));
    builder1.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
    return builder1.create();
}
Also used : AlertDialog(org.telegram.ui.ActionBar.AlertDialog) SpannableStringBuilder(android.text.SpannableStringBuilder) URLSpan(android.text.style.URLSpan) View(android.view.View) TextView(android.widget.TextView) SuppressLint(android.annotation.SuppressLint) SpannableString(android.text.SpannableString) AndroidUtilities(org.telegram.messenger.AndroidUtilities) TextView(android.widget.TextView) Spannable(android.text.Spannable)

Example 94 with AlertDialog

use of org.telegram.ui.ActionBar.AlertDialog in project Telegram-FOSS by Telegram-FOSS-Team.

the class AlertsCreator method createBlockDialogAlert.

public static void createBlockDialogAlert(BaseFragment fragment, int count, boolean reportSpam, TLRPC.User user, BlockDialogCallback onProcessRunnable) {
    if (fragment == null || fragment.getParentActivity() == null || count == 1 && user == null) {
        return;
    }
    Context context = fragment.getParentActivity();
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    CheckBoxCell[] cell = new CheckBoxCell[2];
    LinearLayout linearLayout = new LinearLayout(context);
    linearLayout.setOrientation(LinearLayout.VERTICAL);
    builder.setView(linearLayout);
    String actionText;
    if (count == 1) {
        String name = ContactsController.formatName(user.first_name, user.last_name);
        builder.setTitle(LocaleController.formatString("BlockUserTitle", R.string.BlockUserTitle, name));
        actionText = LocaleController.getString("BlockUser", R.string.BlockUser);
        builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatString("BlockUserMessage", R.string.BlockUserMessage, name)));
    } else {
        builder.setTitle(LocaleController.formatString("BlockUserTitle", R.string.BlockUserTitle, LocaleController.formatPluralString("UsersCountTitle", count)));
        actionText = LocaleController.getString("BlockUsers", R.string.BlockUsers);
        builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatString("BlockUsersMessage", R.string.BlockUsersMessage, LocaleController.formatPluralString("UsersCount", count))));
    }
    final boolean[] checks = new boolean[] { true, true };
    for (int a = 0; a < cell.length; a++) {
        if (a == 0 && !reportSpam) {
            continue;
        }
        int num = a;
        cell[a] = new CheckBoxCell(context, 1);
        cell[a].setBackgroundDrawable(Theme.getSelectorDrawable(false));
        if (a == 0) {
            cell[a].setText(LocaleController.getString("ReportSpamTitle", R.string.ReportSpamTitle), "", true, false);
        } else {
            cell[a].setText(count == 1 ? LocaleController.getString("DeleteThisChatBothSides", R.string.DeleteThisChatBothSides) : LocaleController.getString("DeleteTheseChatsBothSides", R.string.DeleteTheseChatsBothSides), "", true, false);
        }
        cell[a].setPadding(LocaleController.isRTL ? AndroidUtilities.dp(16) : AndroidUtilities.dp(8), 0, LocaleController.isRTL ? AndroidUtilities.dp(8) : AndroidUtilities.dp(16), 0);
        linearLayout.addView(cell[a], LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 48));
        cell[a].setOnClickListener(v -> {
            CheckBoxCell cell1 = (CheckBoxCell) v;
            checks[num] = !checks[num];
            cell1.setChecked(checks[num], true);
        });
    }
    builder.setPositiveButton(actionText, (dialogInterface, i) -> onProcessRunnable.run(checks[0], checks[1]));
    builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
    AlertDialog alertDialog = builder.create();
    fragment.showDialog(alertDialog);
    TextView button = (TextView) alertDialog.getButton(DialogInterface.BUTTON_POSITIVE);
    if (button != null) {
        button.setTextColor(Theme.getColor(Theme.key_dialogTextRed2));
    }
}
Also used : Context(android.content.Context) AlertDialog(org.telegram.ui.ActionBar.AlertDialog) CheckBoxCell(org.telegram.ui.Cells.CheckBoxCell) SpannableStringBuilder(android.text.SpannableStringBuilder) TextView(android.widget.TextView) SpannableString(android.text.SpannableString) LinearLayout(android.widget.LinearLayout) SuppressLint(android.annotation.SuppressLint)

Example 95 with AlertDialog

use of org.telegram.ui.ActionBar.AlertDialog in project Telegram-FOSS by Telegram-FOSS-Team.

the class AlertsCreator method createChangeBioAlert.

public static void createChangeBioAlert(String currentBio, long peerId, Context context, int currentAccount) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setTitle(peerId > 0 ? LocaleController.getString("UserBio", R.string.UserBio) : LocaleController.getString("DescriptionPlaceholder", R.string.DescriptionPlaceholder));
    builder.setMessage(peerId > 0 ? LocaleController.getString("VoipGroupBioEditAlertText", R.string.VoipGroupBioEditAlertText) : LocaleController.getString("DescriptionInfo", R.string.DescriptionInfo));
    FrameLayout dialogView = new FrameLayout(context);
    dialogView.setClipChildren(false);
    if (peerId < 0) {
        TLRPC.ChatFull chatFull = MessagesController.getInstance(currentAccount).getChatFull(-peerId);
        if (chatFull == null) {
            MessagesController.getInstance(currentAccount).loadFullChat(-peerId, ConnectionsManager.generateClassGuid(), true);
        }
    }
    NumberTextView checkTextView = new NumberTextView(context);
    EditText editTextView = new EditText(context);
    editTextView.setTextColor(Theme.getColor(Theme.key_voipgroup_actionBarItems));
    editTextView.setHint(peerId > 0 ? LocaleController.getString("UserBio", R.string.UserBio) : LocaleController.getString("DescriptionPlaceholder", R.string.DescriptionPlaceholder));
    editTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
    editTextView.setBackground(Theme.createEditTextDrawable(context, true));
    editTextView.setMaxLines(4);
    editTextView.setRawInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
    editTextView.setImeOptions(EditorInfo.IME_ACTION_DONE);
    InputFilter[] inputFilters = new InputFilter[1];
    int maxSymbolsCount = peerId > 0 ? 70 : 255;
    inputFilters[0] = new CodepointsLengthInputFilter(maxSymbolsCount) {

        @Override
        public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
            CharSequence result = super.filter(source, start, end, dest, dstart, dend);
            if (result != null && source != null && result.length() != source.length()) {
                Vibrator v = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
                if (v != null) {
                    v.vibrate(200);
                }
                AndroidUtilities.shakeView(checkTextView, 2, 0);
            }
            return result;
        }
    };
    editTextView.setFilters(inputFilters);
    checkTextView.setCenterAlign(true);
    checkTextView.setTextSize(15);
    checkTextView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText4));
    checkTextView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    dialogView.addView(checkTextView, LayoutHelper.createFrame(20, 20, LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT, 0, 14, 21, 0));
    editTextView.setPadding(LocaleController.isRTL ? AndroidUtilities.dp(24) : 0, AndroidUtilities.dp(8), LocaleController.isRTL ? 0 : AndroidUtilities.dp(24), AndroidUtilities.dp(8));
    editTextView.addTextChangedListener(new TextWatcher() {

        @Override
        public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
        }

        @Override
        public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
        }

        @Override
        public void afterTextChanged(Editable s) {
            int count = maxSymbolsCount - Character.codePointCount(s, 0, s.length());
            if (count < 30) {
                checkTextView.setNumber(count, checkTextView.getVisibility() == View.VISIBLE);
                AndroidUtilities.updateViewVisibilityAnimated(checkTextView, true);
            } else {
                AndroidUtilities.updateViewVisibilityAnimated(checkTextView, false);
            }
        }
    });
    AndroidUtilities.updateViewVisibilityAnimated(checkTextView, false, 0, false);
    editTextView.setText(currentBio);
    editTextView.setSelection(editTextView.getText().toString().length());
    builder.setView(dialogView);
    DialogInterface.OnClickListener onDoneListener = (dialogInterface, i) -> {
        if (peerId > 0) {
            final TLRPC.UserFull userFull = MessagesController.getInstance(currentAccount).getUserFull(UserConfig.getInstance(currentAccount).getClientUserId());
            final String newName = editTextView.getText().toString().replace("\n", " ").replaceAll(" +", " ").trim();
            if (userFull != null) {
                String currentName = userFull.about;
                if (currentName == null) {
                    currentName = "";
                }
                if (currentName.equals(newName)) {
                    AndroidUtilities.hideKeyboard(editTextView);
                    dialogInterface.dismiss();
                    return;
                }
                userFull.about = newName;
                NotificationCenter.getInstance(currentAccount).postNotificationName(NotificationCenter.userInfoDidLoad, peerId, userFull);
            }
            final TLRPC.TL_account_updateProfile req = new TLRPC.TL_account_updateProfile();
            req.about = newName;
            req.flags |= 4;
            NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.showBulletin, Bulletin.TYPE_BIO_CHANGED, peerId);
            ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> {
            }, ConnectionsManager.RequestFlagFailOnServerErrors);
        } else {
            TLRPC.ChatFull chatFull = MessagesController.getInstance(currentAccount).getChatFull(-peerId);
            final String newAbout = editTextView.getText().toString();
            if (chatFull != null) {
                String currentName = chatFull.about;
                if (currentName == null) {
                    currentName = "";
                }
                if (currentName.equals(newAbout)) {
                    AndroidUtilities.hideKeyboard(editTextView);
                    dialogInterface.dismiss();
                    return;
                }
                chatFull.about = newAbout;
                NotificationCenter.getInstance(currentAccount).postNotificationName(NotificationCenter.chatInfoDidLoad, chatFull, 0, false, false);
            }
            NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.showBulletin, Bulletin.TYPE_BIO_CHANGED, peerId);
            MessagesController.getInstance(currentAccount).updateChatAbout(-peerId, newAbout, chatFull);
        }
        dialogInterface.dismiss();
    };
    builder.setPositiveButton(LocaleController.getString("Save", R.string.Save), onDoneListener);
    builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
    builder.setOnPreDismissListener(dialogInterface -> AndroidUtilities.hideKeyboard(editTextView));
    dialogView.addView(editTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 0, 23, 12, 23, 21));
    editTextView.requestFocus();
    AndroidUtilities.showKeyboard(editTextView);
    AlertDialog dialog = builder.create();
    editTextView.setOnEditorActionListener((textView, i, keyEvent) -> {
        if ((i == EditorInfo.IME_ACTION_DONE || (peerId > 0 && keyEvent.getKeyCode() == KeyEvent.KEYCODE_ENTER)) && dialog.isShowing()) {
            onDoneListener.onClick(dialog, 0);
            return true;
        }
        return false;
    });
    dialog.setBackgroundColor(Theme.getColor(Theme.key_voipgroup_dialogBackground));
    dialog.show();
    dialog.setTextColor(Theme.getColor(Theme.key_voipgroup_actionBarItems));
}
Also used : AlertDialog(org.telegram.ui.ActionBar.AlertDialog) Arrays(java.util.Arrays) Bundle(android.os.Bundle) SvgHelper(org.telegram.messenger.SvgHelper) Uri(android.net.Uri) FrameLayout(android.widget.FrameLayout) Drawable(android.graphics.drawable.Drawable) Manifest(android.Manifest) NotificationsController(org.telegram.messenger.NotificationsController) CacheControlActivity(org.telegram.ui.CacheControlActivity) NotificationCenter(org.telegram.messenger.NotificationCenter) Outline(android.graphics.Outline) HapticFeedbackConstants(android.view.HapticFeedbackConstants) CountDownLatch(java.util.concurrent.CountDownLatch) LaunchActivity(org.telegram.ui.LaunchActivity) Html(android.text.Html) PorterDuffColorFilter(android.graphics.PorterDuffColorFilter) InputFilter(android.text.InputFilter) TextWatcher(android.text.TextWatcher) ChatActivity(org.telegram.ui.ChatActivity) Dialog(android.app.Dialog) Editable(android.text.Editable) ArrayList(java.util.ArrayList) SpannableStringBuilder(android.text.SpannableStringBuilder) ThemePreviewActivity(org.telegram.ui.ThemePreviewActivity) Calendar(java.util.Calendar) TLRPC(org.telegram.tgnet.TLRPC) GradientDrawable(android.graphics.drawable.GradientDrawable) Toast(android.widget.Toast) Settings(android.provider.Settings) NotificationsCustomSettingsActivity(org.telegram.ui.NotificationsCustomSettingsActivity) URLSpan(android.text.style.URLSpan) SpannableString(android.text.SpannableString) R(org.telegram.messenger.R) BottomSheet(org.telegram.ui.ActionBar.BottomSheet) TextUtils(android.text.TextUtils) Gravity(android.view.Gravity) UserObject(org.telegram.messenger.UserObject) SharedPreferences(android.content.SharedPreferences) TypedValue(android.util.TypedValue) ContactsController(org.telegram.messenger.ContactsController) MessagesStorage(org.telegram.messenger.MessagesStorage) ChatObject(org.telegram.messenger.ChatObject) AlertDialog(org.telegram.ui.ActionBar.AlertDialog) VoIPHelper(org.telegram.ui.Components.voip.VoIPHelper) EditText(android.widget.EditText) ProfileNotificationsActivity(org.telegram.ui.ProfileNotificationsActivity) RequiresApi(androidx.annotation.RequiresApi) Rect(android.graphics.Rect) LinearLayout(android.widget.LinearLayout) ActionBarMenuItem(org.telegram.ui.ActionBar.ActionBarMenuItem) PackageManager(android.content.pm.PackageManager) Spannable(android.text.Spannable) WindowManager(android.view.WindowManager) AccountInstance(org.telegram.messenger.AccountInstance) AndroidUtilities(org.telegram.messenger.AndroidUtilities) LanguageSelectActivity(org.telegram.ui.LanguageSelectActivity) CheckBoxCell(org.telegram.ui.Cells.CheckBoxCell) ApplicationLoader(org.telegram.messenger.ApplicationLoader) Locale(java.util.Locale) View(android.view.View) Button(android.widget.Button) TextColorCell(org.telegram.ui.Cells.TextColorCell) Utilities(org.telegram.messenger.Utilities) TooManyCommunitiesActivity(org.telegram.ui.TooManyCommunitiesActivity) InputType(android.text.InputType) BaseFragment(org.telegram.ui.ActionBar.BaseFragment) BitmapDrawable(android.graphics.drawable.BitmapDrawable) PorterDuff(android.graphics.PorterDuff) ConnectionsManager(org.telegram.tgnet.ConnectionsManager) SparseArray(android.util.SparseArray) UserConfig(org.telegram.messenger.UserConfig) List(java.util.List) TextView(android.widget.TextView) SecretChatHelper(org.telegram.messenger.SecretChatHelper) EditorInfo(android.view.inputmethod.EditorInfo) ActionBarPopupWindow(org.telegram.ui.ActionBar.ActionBarPopupWindow) Context(android.content.Context) IDN(java.net.IDN) Spanned(android.text.Spanned) KeyEvent(android.view.KeyEvent) Theme(org.telegram.ui.ActionBar.Theme) ViewOutlineProvider(android.view.ViewOutlineProvider) Intent(android.content.Intent) LocaleController(org.telegram.messenger.LocaleController) HashMap(java.util.HashMap) SuppressLint(android.annotation.SuppressLint) MotionEvent(android.view.MotionEvent) TLObject(org.telegram.tgnet.TLObject) MessageObject(org.telegram.messenger.MessageObject) SharedConfig(org.telegram.messenger.SharedConfig) BuildVars(org.telegram.messenger.BuildVars) NotificationsSettingsActivity(org.telegram.ui.NotificationsSettingsActivity) Build(android.os.Build) SerializedData(org.telegram.tgnet.SerializedData) DialogInterface(android.content.DialogInterface) Browser(org.telegram.messenger.browser.Browser) LoginActivity(org.telegram.ui.LoginActivity) DialogObject(org.telegram.messenger.DialogObject) FileLog(org.telegram.messenger.FileLog) AccountSelectCell(org.telegram.ui.Cells.AccountSelectCell) MessagesController(org.telegram.messenger.MessagesController) Color(android.graphics.Color) Base64(android.util.Base64) RadioColorCell(org.telegram.ui.Cells.RadioColorCell) Vibrator(android.os.Vibrator) Activity(android.app.Activity) DialogInterface(android.content.DialogInterface) SpannableStringBuilder(android.text.SpannableStringBuilder) SpannableString(android.text.SpannableString) TLRPC(org.telegram.tgnet.TLRPC) TextWatcher(android.text.TextWatcher) Editable(android.text.Editable) EditText(android.widget.EditText) InputFilter(android.text.InputFilter) Spanned(android.text.Spanned) SuppressLint(android.annotation.SuppressLint) FrameLayout(android.widget.FrameLayout) Vibrator(android.os.Vibrator)

Aggregations

AlertDialog (org.telegram.ui.ActionBar.AlertDialog)101 TLRPC (org.telegram.tgnet.TLRPC)71 TextView (android.widget.TextView)63 FrameLayout (android.widget.FrameLayout)47 ArrayList (java.util.ArrayList)47 Context (android.content.Context)45 View (android.view.View)44 AndroidUtilities (org.telegram.messenger.AndroidUtilities)41 LocaleController (org.telegram.messenger.LocaleController)41 Theme (org.telegram.ui.ActionBar.Theme)41 R (org.telegram.messenger.R)40 BaseFragment (org.telegram.ui.ActionBar.BaseFragment)40 LinearLayout (android.widget.LinearLayout)38 Paint (android.graphics.Paint)37 MessagesController (org.telegram.messenger.MessagesController)37 SuppressLint (android.annotation.SuppressLint)36 TextUtils (android.text.TextUtils)36 FileLog (org.telegram.messenger.FileLog)36 Build (android.os.Build)34 Gravity (android.view.Gravity)34