Search in sources :

Example 1 with AccountInstance

use of org.telegram.messenger.AccountInstance in project Telegram-FOSS by Telegram-FOSS-Team.

the class AlertsCreator method showBlockReportSpamReplyAlert.

public static void showBlockReportSpamReplyAlert(ChatActivity fragment, MessageObject messageObject, long peerId, Theme.ResourcesProvider resourcesProvider, Runnable hideDim) {
    if (fragment == null || fragment.getParentActivity() == null || messageObject == null) {
        return;
    }
    AccountInstance accountInstance = fragment.getAccountInstance();
    TLRPC.User user = peerId > 0 ? accountInstance.getMessagesController().getUser(peerId) : null;
    TLRPC.Chat chat = peerId < 0 ? accountInstance.getMessagesController().getChat(-peerId) : null;
    if (user == null && chat == null) {
        return;
    }
    AlertDialog.Builder builder = new AlertDialog.Builder(fragment.getParentActivity(), resourcesProvider);
    builder.setDimEnabled(hideDim == null);
    builder.setOnPreDismissListener(di -> {
        if (hideDim != null) {
            hideDim.run();
        }
    });
    builder.setTitle(LocaleController.getString("BlockUser", R.string.BlockUser));
    if (user != null) {
        builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatString("BlockUserReplyAlert", R.string.BlockUserReplyAlert, UserObject.getFirstName(user))));
    } else {
        builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatString("BlockUserReplyAlert", R.string.BlockUserReplyAlert, chat.title)));
    }
    CheckBoxCell[] cells = new CheckBoxCell[1];
    LinearLayout linearLayout = new LinearLayout(fragment.getParentActivity());
    linearLayout.setOrientation(LinearLayout.VERTICAL);
    cells[0] = new CheckBoxCell(fragment.getParentActivity(), 1, resourcesProvider);
    cells[0].setBackgroundDrawable(Theme.getSelectorDrawable(false));
    cells[0].setTag(0);
    cells[0].setText(LocaleController.getString("DeleteReportSpam", R.string.DeleteReportSpam), "", true, false);
    cells[0].setPadding(LocaleController.isRTL ? AndroidUtilities.dp(16) : AndroidUtilities.dp(8), 0, LocaleController.isRTL ? AndroidUtilities.dp(8) : AndroidUtilities.dp(16), 0);
    linearLayout.addView(cells[0], LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
    cells[0].setOnClickListener(v -> {
        Integer num = (Integer) v.getTag();
        cells[num].setChecked(!cells[num].isChecked(), true);
    });
    builder.setCustomViewOffset(12);
    builder.setView(linearLayout);
    builder.setPositiveButton(LocaleController.getString("BlockAndDeleteReplies", R.string.BlockAndDeleteReplies), (dialogInterface, i) -> {
        if (user != null) {
            accountInstance.getMessagesStorage().deleteUserChatHistory(fragment.getDialogId(), user.id);
        } else {
            accountInstance.getMessagesStorage().deleteUserChatHistory(fragment.getDialogId(), -chat.id);
        }
        TLRPC.TL_contacts_blockFromReplies request = new TLRPC.TL_contacts_blockFromReplies();
        request.msg_id = messageObject.getId();
        request.delete_message = true;
        request.delete_history = true;
        if (cells[0].isChecked()) {
            request.report_spam = true;
            if (fragment.getParentActivity() != null) {
                if (fragment instanceof ChatActivity) {
                    fragment.getUndoView().showWithAction(0, UndoView.ACTION_REPORT_SENT, null);
                } else if (fragment != null) {
                    BulletinFactory.of(fragment).createReportSent(resourcesProvider).show();
                } else {
                    Toast.makeText(fragment.getParentActivity(), LocaleController.getString("ReportChatSent", R.string.ReportChatSent), Toast.LENGTH_SHORT).show();
                }
            }
        }
        accountInstance.getConnectionsManager().sendRequest(request, (response, error) -> {
            if (response instanceof TLRPC.Updates) {
                accountInstance.getMessagesController().processUpdates((TLRPC.Updates) response, false);
            }
        });
    });
    builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
    AlertDialog dialog = builder.create();
    fragment.showDialog(dialog);
    TextView button = (TextView) dialog.getButton(DialogInterface.BUTTON_POSITIVE);
    if (button != null) {
        button.setTextColor(Theme.getColor(Theme.key_dialogTextRed2));
    }
}
Also used : AlertDialog(org.telegram.ui.ActionBar.AlertDialog) ChatActivity(org.telegram.ui.ChatActivity) SpannableStringBuilder(android.text.SpannableStringBuilder) TLRPC(org.telegram.tgnet.TLRPC) CheckBoxCell(org.telegram.ui.Cells.CheckBoxCell) AccountInstance(org.telegram.messenger.AccountInstance) TextView(android.widget.TextView) LinearLayout(android.widget.LinearLayout)

Example 2 with AccountInstance

use of org.telegram.messenger.AccountInstance in project Telegram-FOSS by Telegram-FOSS-Team.

the class ConnectionsManager method onLogout.

public static void onLogout(final int currentAccount) {
    AndroidUtilities.runOnUIThread(() -> {
        AccountInstance accountInstance = AccountInstance.getInstance(currentAccount);
        if (accountInstance.getUserConfig().getClientUserId() != 0) {
            accountInstance.getUserConfig().clearConfig();
            accountInstance.getMessagesController().performLogout(0);
        }
    });
}
Also used : AccountInstance(org.telegram.messenger.AccountInstance)

Example 3 with AccountInstance

use of org.telegram.messenger.AccountInstance in project Telegram-FOSS by Telegram-FOSS-Team.

the class VoIPHelper method showRateAlert.

public static void showRateAlert(final Context context, final Runnable onDismiss, boolean isVideo, final long callID, final long accessHash, final int account, final boolean userInitiative) {
    final File log = getLogFile(callID);
    final int[] page = { 0 };
    LinearLayout alertView = new LinearLayout(context);
    alertView.setOrientation(LinearLayout.VERTICAL);
    int pad = AndroidUtilities.dp(16);
    alertView.setPadding(pad, pad, pad, 0);
    TextView text = new TextView(context);
    text.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
    text.setTextColor(Theme.getColor(Theme.key_dialogTextBlack));
    text.setGravity(Gravity.CENTER);
    text.setText(LocaleController.getString("VoipRateCallAlert", R.string.VoipRateCallAlert));
    alertView.addView(text);
    final BetterRatingView bar = new BetterRatingView(context);
    alertView.addView(bar, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL, 0, 16, 0, 0));
    final LinearLayout problemsWrap = new LinearLayout(context);
    problemsWrap.setOrientation(LinearLayout.VERTICAL);
    View.OnClickListener problemCheckboxClickListener = v -> {
        CheckBoxCell check = (CheckBoxCell) v;
        check.setChecked(!check.isChecked(), true);
    };
    final String[] problems = { isVideo ? "distorted_video" : null, isVideo ? "pixelated_video" : null, "echo", "noise", "interruptions", "distorted_speech", "silent_local", "silent_remote", "dropped" };
    for (int i = 0; i < problems.length; i++) {
        if (problems[i] == null) {
            continue;
        }
        CheckBoxCell check = new CheckBoxCell(context, 1);
        check.setClipToPadding(false);
        check.setTag(problems[i]);
        String label = null;
        switch(i) {
            case 0:
                label = LocaleController.getString("RateCallVideoDistorted", R.string.RateCallVideoDistorted);
                break;
            case 1:
                label = LocaleController.getString("RateCallVideoPixelated", R.string.RateCallVideoPixelated);
                break;
            case 2:
                label = LocaleController.getString("RateCallEcho", R.string.RateCallEcho);
                break;
            case 3:
                label = LocaleController.getString("RateCallNoise", R.string.RateCallNoise);
                break;
            case 4:
                label = LocaleController.getString("RateCallInterruptions", R.string.RateCallInterruptions);
                break;
            case 5:
                label = LocaleController.getString("RateCallDistorted", R.string.RateCallDistorted);
                break;
            case 6:
                label = LocaleController.getString("RateCallSilentLocal", R.string.RateCallSilentLocal);
                break;
            case 7:
                label = LocaleController.getString("RateCallSilentRemote", R.string.RateCallSilentRemote);
                break;
            case 8:
                label = LocaleController.getString("RateCallDropped", R.string.RateCallDropped);
                break;
        }
        check.setText(label, null, false, false);
        check.setOnClickListener(problemCheckboxClickListener);
        check.setTag(problems[i]);
        problemsWrap.addView(check);
    }
    alertView.addView(problemsWrap, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, -8, 0, -8, 0));
    problemsWrap.setVisibility(View.GONE);
    final EditTextBoldCursor commentBox = new EditTextBoldCursor(context);
    commentBox.setHint(LocaleController.getString("VoipFeedbackCommentHint", R.string.VoipFeedbackCommentHint));
    commentBox.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
    commentBox.setTextColor(Theme.getColor(Theme.key_dialogTextBlack));
    commentBox.setHintTextColor(Theme.getColor(Theme.key_dialogTextHint));
    commentBox.setBackgroundDrawable(Theme.createEditTextDrawable(context, true));
    commentBox.setPadding(0, AndroidUtilities.dp(4), 0, AndroidUtilities.dp(4));
    commentBox.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
    commentBox.setVisibility(View.GONE);
    alertView.addView(commentBox, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 8, 8, 8, 0));
    final boolean[] includeLogs = { true };
    final CheckBoxCell checkbox = new CheckBoxCell(context, 1);
    View.OnClickListener checkClickListener = v -> {
        includeLogs[0] = !includeLogs[0];
        checkbox.setChecked(includeLogs[0], true);
    };
    checkbox.setText(LocaleController.getString("CallReportIncludeLogs", R.string.CallReportIncludeLogs), null, true, false);
    checkbox.setClipToPadding(false);
    checkbox.setOnClickListener(checkClickListener);
    alertView.addView(checkbox, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, -8, 0, -8, 0));
    final TextView logsText = new TextView(context);
    logsText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
    logsText.setTextColor(Theme.getColor(Theme.key_dialogTextGray3));
    logsText.setText(LocaleController.getString("CallReportLogsExplain", R.string.CallReportLogsExplain));
    logsText.setPadding(AndroidUtilities.dp(8), 0, AndroidUtilities.dp(8), 0);
    logsText.setOnClickListener(checkClickListener);
    alertView.addView(logsText);
    checkbox.setVisibility(View.GONE);
    logsText.setVisibility(View.GONE);
    if (!log.exists()) {
        includeLogs[0] = false;
    }
    final AlertDialog alert = new AlertDialog.Builder(context).setTitle(LocaleController.getString("CallMessageReportProblem", R.string.CallMessageReportProblem)).setView(alertView).setPositiveButton(LocaleController.getString("Send", R.string.Send), (dialog, which) -> {
    // SendMessagesHelper.getInstance(currentAccount).sendMessage(commentBox.getText().toString(), VOIP_SUPPORT_ID, null, null, true, null, null, null);
    }).setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null).setOnDismissListener(dialog -> {
        if (onDismiss != null)
            onDismiss.run();
    }).create();
    if (BuildVars.LOGS_ENABLED && log.exists()) {
        alert.setNeutralButton("Send log", (dialog, which) -> {
            Intent intent = new Intent(context, LaunchActivity.class);
            intent.setAction(Intent.ACTION_SEND);
            intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(log));
            context.startActivity(intent);
        });
    }
    alert.show();
    alert.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
    final View btn = alert.getButton(DialogInterface.BUTTON_POSITIVE);
    btn.setEnabled(false);
    bar.setOnRatingChangeListener(rating -> {
        btn.setEnabled(rating > 0);
        /*commentBox.setHint(rating<4 ? LocaleController.getString("CallReportHint", R.string.CallReportHint) : LocaleController.getString("VoipFeedbackCommentHint", R.string.VoipFeedbackCommentHint));
			commentBox.setVisibility(rating < 5 && rating > 0 ? View.VISIBLE : View.GONE);
			if (commentBox.getVisibility() == View.GONE) {
				((InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(commentBox.getWindowToken(), 0);
			}
			*/
        ((TextView) btn).setText((rating < 4 ? LocaleController.getString("Next", R.string.Next) : LocaleController.getString("Send", R.string.Send)).toUpperCase());
    });
    btn.setOnClickListener(v -> {
        int rating = bar.getRating();
        if (rating >= 4 || page[0] == 1) {
            final int currentAccount = UserConfig.selectedAccount;
            final TLRPC.TL_phone_setCallRating req = new TLRPC.TL_phone_setCallRating();
            req.rating = bar.getRating();
            ArrayList<String> problemTags = new ArrayList<>();
            for (int i = 0; i < problemsWrap.getChildCount(); i++) {
                CheckBoxCell check = (CheckBoxCell) problemsWrap.getChildAt(i);
                if (check.isChecked())
                    problemTags.add("#" + check.getTag());
            }
            if (req.rating < 5) {
                req.comment = commentBox.getText().toString();
            } else {
                req.comment = "";
            }
            if (!problemTags.isEmpty() && !includeLogs[0]) {
                req.comment += " " + TextUtils.join(" ", problemTags);
            }
            req.peer = new TLRPC.TL_inputPhoneCall();
            req.peer.access_hash = accessHash;
            req.peer.id = callID;
            req.user_initiative = userInitiative;
            ConnectionsManager.getInstance(account).sendRequest(req, (response, error) -> {
                if (response instanceof TLRPC.TL_updates) {
                    TLRPC.TL_updates updates = (TLRPC.TL_updates) response;
                    MessagesController.getInstance(currentAccount).processUpdates(updates, false);
                }
                if (includeLogs[0] && log.exists() && req.rating < 4) {
                    AccountInstance accountInstance = AccountInstance.getInstance(UserConfig.selectedAccount);
                    SendMessagesHelper.prepareSendingDocument(accountInstance, log.getAbsolutePath(), log.getAbsolutePath(), null, TextUtils.join(" ", problemTags), "text/plain", VOIP_SUPPORT_ID, null, null, null, null, true, 0);
                    Toast.makeText(context, LocaleController.getString("CallReportSent", R.string.CallReportSent), Toast.LENGTH_LONG).show();
                }
            });
            alert.dismiss();
        } else {
            page[0] = 1;
            bar.setVisibility(View.GONE);
            // text.setText(LocaleController.getString("CallReportHint", R.string.CallReportHint));
            text.setVisibility(View.GONE);
            alert.setTitle(LocaleController.getString("CallReportHint", R.string.CallReportHint));
            commentBox.setVisibility(View.VISIBLE);
            if (log.exists()) {
                checkbox.setVisibility(View.VISIBLE);
                logsText.setVisibility(View.VISIBLE);
            }
            problemsWrap.setVisibility(View.VISIBLE);
            ((TextView) btn).setText(LocaleController.getString("Send", R.string.Send).toUpperCase());
        }
    });
}
Also used : LinearLayout(android.widget.LinearLayout) Arrays(java.util.Arrays) PackageManager(android.content.pm.PackageManager) Uri(android.net.Uri) WindowManager(android.view.WindowManager) AccountInstance(org.telegram.messenger.AccountInstance) BetterRatingView(org.telegram.ui.Components.BetterRatingView) AndroidUtilities(org.telegram.messenger.AndroidUtilities) EditTextBoldCursor(org.telegram.ui.Components.EditTextBoldCursor) JoinCallByUrlAlert(org.telegram.ui.Components.JoinCallByUrlAlert) CheckBoxCell(org.telegram.ui.Cells.CheckBoxCell) Manifest(android.Manifest) ApplicationLoader(org.telegram.messenger.ApplicationLoader) Locale(java.util.Locale) View(android.view.View) TargetApi(android.annotation.TargetApi) InputType(android.text.InputType) Set(java.util.Set) BaseFragment(org.telegram.ui.ActionBar.BaseFragment) Instance(org.telegram.messenger.voip.Instance) SendMessagesHelper(org.telegram.messenger.SendMessagesHelper) ConnectionsManager(org.telegram.tgnet.ConnectionsManager) GroupCallActivity(org.telegram.ui.GroupCallActivity) UserConfig(org.telegram.messenger.UserConfig) TextView(android.widget.TextView) LaunchActivity(org.telegram.ui.LaunchActivity) Context(android.content.Context) VoIPService(org.telegram.messenger.voip.VoIPService) Theme(org.telegram.ui.ActionBar.Theme) Intent(android.content.Intent) SystemClock(android.os.SystemClock) LocaleController(org.telegram.messenger.LocaleController) ArrayList(java.util.ArrayList) Calendar(java.util.Calendar) TLRPC(org.telegram.tgnet.TLRPC) Toast(android.widget.Toast) Settings(android.provider.Settings) MessageObject(org.telegram.messenger.MessageObject) BuildVars(org.telegram.messenger.BuildVars) Build(android.os.Build) DownloadController(org.telegram.messenger.DownloadController) DialogInterface(android.content.DialogInterface) R(org.telegram.messenger.R) JoinCallAlert(org.telegram.ui.Components.JoinCallAlert) TextUtils(android.text.TextUtils) LayoutHelper(org.telegram.ui.Components.LayoutHelper) FileLog(org.telegram.messenger.FileLog) File(java.io.File) MessagesController(org.telegram.messenger.MessagesController) Gravity(android.view.Gravity) SharedPreferences(android.content.SharedPreferences) TypedValue(android.util.TypedValue) ContactsController(org.telegram.messenger.ContactsController) TextCheckCell(org.telegram.ui.Cells.TextCheckCell) Activity(android.app.Activity) ChatObject(org.telegram.messenger.ChatObject) AlertDialog(org.telegram.ui.ActionBar.AlertDialog) Collections(java.util.Collections) AlertDialog(org.telegram.ui.ActionBar.AlertDialog) ArrayList(java.util.ArrayList) TLRPC(org.telegram.tgnet.TLRPC) TextView(android.widget.TextView) EditTextBoldCursor(org.telegram.ui.Components.EditTextBoldCursor) Intent(android.content.Intent) BetterRatingView(org.telegram.ui.Components.BetterRatingView) View(android.view.View) TextView(android.widget.TextView) CheckBoxCell(org.telegram.ui.Cells.CheckBoxCell) AccountInstance(org.telegram.messenger.AccountInstance) File(java.io.File) LinearLayout(android.widget.LinearLayout) BetterRatingView(org.telegram.ui.Components.BetterRatingView)

Example 4 with AccountInstance

use of org.telegram.messenger.AccountInstance in project Telegram-FOSS by Telegram-FOSS-Team.

the class LaunchActivity method didSelectDialogs.

@Override
public void didSelectDialogs(DialogsActivity dialogsFragment, ArrayList<Long> dids, CharSequence message, boolean param) {
    final int account = dialogsFragment != null ? dialogsFragment.getCurrentAccount() : currentAccount;
    if (exportingChatUri != null) {
        Uri uri = exportingChatUri;
        ArrayList<Uri> documentsUris = documentsUrisArray != null ? new ArrayList<>(documentsUrisArray) : null;
        final AlertDialog progressDialog = new AlertDialog(this, 3);
        SendMessagesHelper.getInstance(account).prepareImportHistory(dids.get(0), exportingChatUri, documentsUrisArray, (result) -> {
            if (result != 0) {
                Bundle args = new Bundle();
                args.putBoolean("scrollToTopOnResume", true);
                if (!AndroidUtilities.isTablet()) {
                    NotificationCenter.getInstance(account).postNotificationName(NotificationCenter.closeChats);
                }
                if (DialogObject.isUserDialog(result)) {
                    args.putLong("user_id", result);
                } else {
                    args.putLong("chat_id", -result);
                }
                ChatActivity fragment = new ChatActivity(args);
                fragment.setOpenImport();
                actionBarLayout.presentFragment(fragment, dialogsFragment != null || param, dialogsFragment == null, true, false);
            } else {
                documentsUrisArray = documentsUris;
                if (documentsUrisArray == null) {
                    documentsUrisArray = new ArrayList<>();
                }
                documentsUrisArray.add(0, uri);
                openDialogsToSend(true);
            }
            try {
                progressDialog.dismiss();
            } catch (Exception e) {
                FileLog.e(e);
            }
        });
        try {
            progressDialog.showDelayed(300);
        } catch (Exception ignore) {
        }
    } else {
        boolean notify = dialogsFragment == null || dialogsFragment.notify;
        final ChatActivity fragment;
        if (dids.size() <= 1) {
            final long did = dids.get(0);
            Bundle args = new Bundle();
            args.putBoolean("scrollToTopOnResume", true);
            if (!AndroidUtilities.isTablet()) {
                NotificationCenter.getInstance(account).postNotificationName(NotificationCenter.closeChats);
            }
            if (DialogObject.isEncryptedDialog(did)) {
                args.putInt("enc_id", DialogObject.getEncryptedChatId(did));
            } else if (DialogObject.isUserDialog(did)) {
                args.putLong("user_id", did);
            } else {
                args.putLong("chat_id", -did);
            }
            if (!MessagesController.getInstance(account).checkCanOpenChat(args, dialogsFragment)) {
                return;
            }
            fragment = new ChatActivity(args);
        } else {
            fragment = null;
        }
        int attachesCount = 0;
        if (contactsToSend != null) {
            attachesCount += contactsToSend.size();
        }
        if (videoPath != null) {
            attachesCount++;
        }
        if (photoPathsArray != null) {
            attachesCount += photoPathsArray.size();
        }
        if (documentsPathsArray != null) {
            attachesCount += documentsPathsArray.size();
        }
        if (documentsUrisArray != null) {
            attachesCount += documentsUrisArray.size();
        }
        if (videoPath == null && photoPathsArray == null && documentsPathsArray == null && documentsUrisArray == null && sendingText != null) {
            attachesCount++;
        }
        for (int i = 0; i < dids.size(); i++) {
            final long did = dids.get(i);
            if (AlertsCreator.checkSlowMode(this, currentAccount, did, attachesCount > 1)) {
                return;
            }
        }
        if (contactsToSend != null && contactsToSend.size() == 1 && !mainFragmentsStack.isEmpty()) {
            PhonebookShareAlert alert = new PhonebookShareAlert(mainFragmentsStack.get(mainFragmentsStack.size() - 1), null, null, contactsToSendUri, null, null, null);
            alert.setDelegate((user, notify2, scheduleDate) -> {
                if (fragment != null) {
                    actionBarLayout.presentFragment(fragment, true, false, true, false);
                }
                for (int i = 0; i < dids.size(); i++) {
                    SendMessagesHelper.getInstance(account).sendMessage(user, dids.get(i), null, null, null, null, notify2, scheduleDate);
                }
            });
            mainFragmentsStack.get(mainFragmentsStack.size() - 1).showDialog(alert);
        } else {
            String captionToSend = null;
            for (int i = 0; i < dids.size(); i++) {
                final long did = dids.get(i);
                AccountInstance accountInstance = AccountInstance.getInstance(UserConfig.selectedAccount);
                boolean photosEditorOpened = false;
                if (fragment != null) {
                    boolean withoutAnimation = dialogsFragment == null || (videoPath != null || (photoPathsArray != null && photoPathsArray.size() > 0));
                    actionBarLayout.presentFragment(fragment, dialogsFragment != null, withoutAnimation, true, false);
                    if (videoPath != null) {
                        fragment.openVideoEditor(videoPath, sendingText);
                        sendingText = null;
                    } else if (photoPathsArray != null && photoPathsArray.size() > 0) {
                        photosEditorOpened = fragment.openPhotosEditor(photoPathsArray, message == null || message.length() == 0 ? sendingText : message);
                        if (photosEditorOpened) {
                            sendingText = null;
                        }
                    }
                } else {
                    if (videoPath != null) {
                        if (sendingText != null && sendingText.length() <= 1024) {
                            captionToSend = sendingText;
                            sendingText = null;
                        }
                        ArrayList<String> arrayList = new ArrayList<>();
                        arrayList.add(videoPath);
                        SendMessagesHelper.prepareSendingDocuments(accountInstance, arrayList, arrayList, null, captionToSend, null, did, null, null, null, null, notify, 0);
                    }
                }
                if (photoPathsArray != null && !photosEditorOpened) {
                    if (sendingText != null && sendingText.length() <= 1024 && photoPathsArray.size() == 1) {
                        photoPathsArray.get(0).caption = sendingText;
                        sendingText = null;
                    }
                    SendMessagesHelper.prepareSendingMedia(accountInstance, photoPathsArray, did, null, null, null, false, false, null, notify, 0);
                }
                if (documentsPathsArray != null || documentsUrisArray != null) {
                    if (sendingText != null && sendingText.length() <= 1024 && ((documentsPathsArray != null ? documentsPathsArray.size() : 0) + (documentsUrisArray != null ? documentsUrisArray.size() : 0)) == 1) {
                        captionToSend = sendingText;
                        sendingText = null;
                    }
                    SendMessagesHelper.prepareSendingDocuments(accountInstance, documentsPathsArray, documentsOriginalPathsArray, documentsUrisArray, captionToSend, documentsMimeType, did, null, null, null, null, notify, 0);
                }
                if (sendingLocation != null) {
                    SendMessagesHelper.prepareSendingLocation(accountInstance, sendingLocation, did);
                    sendingText = null;
                }
                if (sendingText != null) {
                    SendMessagesHelper.prepareSendingText(accountInstance, sendingText, did, true, 0);
                }
                if (contactsToSend != null && !contactsToSend.isEmpty()) {
                    for (int a = 0; a < contactsToSend.size(); a++) {
                        TLRPC.User user = contactsToSend.get(a);
                        SendMessagesHelper.getInstance(account).sendMessage(user, did, null, null, null, null, notify, 0);
                    }
                }
                if (!TextUtils.isEmpty(message)) {
                    SendMessagesHelper.prepareSendingText(accountInstance, message.toString(), did, notify, 0);
                }
            }
        }
        if (dialogsFragment != null && fragment == null) {
            dialogsFragment.finishFragment();
        }
    }
    photoPathsArray = null;
    videoPath = null;
    sendingText = null;
    sendingLocation = null;
    documentsPathsArray = null;
    documentsOriginalPathsArray = null;
    contactsToSend = null;
    contactsToSendUri = null;
    exportingChatUri = null;
}
Also used : AlertDialog(org.telegram.ui.ActionBar.AlertDialog) UpdateAppAlertDialog(org.telegram.ui.Components.UpdateAppAlertDialog) PhonebookShareAlert(org.telegram.ui.Components.PhonebookShareAlert) Bundle(android.os.Bundle) ArrayList(java.util.ArrayList) Uri(android.net.Uri) Paint(android.graphics.Paint) Point(android.graphics.Point) ParseException(java.text.ParseException) TLRPC(org.telegram.tgnet.TLRPC) AccountInstance(org.telegram.messenger.AccountInstance)

Example 5 with AccountInstance

use of org.telegram.messenger.AccountInstance in project Telegram-FOSS by Telegram-FOSS-Team.

the class ChatActivityEnterView method createEmojiView.

private void createEmojiView() {
    if (emojiView != null) {
        return;
    }
    emojiView = new EmojiView(allowStickers, allowGifs, getContext(), true, info, sizeNotifierLayout, resourcesProvider) {

        @Override
        public void setTranslationY(float translationY) {
            super.setTranslationY(translationY);
            if (panelAnimation != null && animatingContentType == 0) {
                delegate.bottomPanelTranslationYChanged(translationY);
            }
        }
    };
    emojiView.setVisibility(GONE);
    emojiView.setShowing(false);
    emojiView.setDelegate(new EmojiView.EmojiViewDelegate() {

        @Override
        public boolean onBackspace() {
            if (messageEditText.length() == 0) {
                return false;
            }
            messageEditText.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL));
            return true;
        }

        @Override
        public void onEmojiSelected(String symbol) {
            int i = messageEditText.getSelectionEnd();
            if (i < 0) {
                i = 0;
            }
            try {
                innerTextChange = 2;
                CharSequence localCharSequence = Emoji.replaceEmoji(symbol, messageEditText.getPaint().getFontMetricsInt(), AndroidUtilities.dp(20), false);
                messageEditText.setText(messageEditText.getText().insert(i, localCharSequence));
                int j = i + localCharSequence.length();
                messageEditText.setSelection(j, j);
            } catch (Exception e) {
                FileLog.e(e);
            } finally {
                innerTextChange = 0;
            }
        }

        @Override
        public void onStickerSelected(View view, TLRPC.Document sticker, String query, Object parent, MessageObject.SendAnimationData sendAnimationData, boolean notify, int scheduleDate) {
            if (trendingStickersAlert != null) {
                trendingStickersAlert.dismiss();
                trendingStickersAlert = null;
            }
            if (slowModeTimer > 0 && !isInScheduleMode()) {
                if (delegate != null) {
                    delegate.onUpdateSlowModeButton(view != null ? view : slowModeButton, true, slowModeButton.getText());
                }
                return;
            }
            if (stickersExpanded) {
                if (searchingType != 0) {
                    setSearchingTypeInternal(0, true);
                    emojiView.closeSearch(true, MessageObject.getStickerSetId(sticker));
                    emojiView.hideSearchKeyboard();
                }
                setStickersExpanded(false, true, false);
            }
            ChatActivityEnterView.this.onStickerSelected(sticker, query, parent, sendAnimationData, false, notify, scheduleDate);
            if (DialogObject.isEncryptedDialog(dialog_id) && MessageObject.isGifDocument(sticker)) {
                accountInstance.getMessagesController().saveGif(parent, sticker);
            }
        }

        @Override
        public void onStickersSettingsClick() {
            if (parentFragment != null) {
                parentFragment.presentFragment(new StickersActivity(MediaDataController.TYPE_IMAGE));
            }
        }

        @Override
        public void onGifSelected(View view, Object gif, String query, Object parent, boolean notify, int scheduleDate) {
            if (isInScheduleMode() && scheduleDate == 0) {
                AlertsCreator.createScheduleDatePickerDialog(parentActivity, parentFragment.getDialogId(), (n, s) -> onGifSelected(view, gif, query, parent, n, s), resourcesProvider);
            } else {
                if (slowModeTimer > 0 && !isInScheduleMode()) {
                    if (delegate != null) {
                        delegate.onUpdateSlowModeButton(view != null ? view : slowModeButton, true, slowModeButton.getText());
                    }
                    return;
                }
                if (stickersExpanded) {
                    if (searchingType != 0) {
                        emojiView.hideSearchKeyboard();
                    }
                    setStickersExpanded(false, true, false);
                }
                if (gif instanceof TLRPC.Document) {
                    TLRPC.Document document = (TLRPC.Document) gif;
                    SendMessagesHelper.getInstance(currentAccount).sendSticker(document, query, dialog_id, replyingMessageObject, getThreadMessage(), parent, null, notify, scheduleDate);
                    MediaDataController.getInstance(currentAccount).addRecentGif(document, (int) (System.currentTimeMillis() / 1000));
                    if (DialogObject.isEncryptedDialog(dialog_id)) {
                        accountInstance.getMessagesController().saveGif(parent, document);
                    }
                } else if (gif instanceof TLRPC.BotInlineResult) {
                    TLRPC.BotInlineResult result = (TLRPC.BotInlineResult) gif;
                    if (result.document != null) {
                        MediaDataController.getInstance(currentAccount).addRecentGif(result.document, (int) (System.currentTimeMillis() / 1000));
                        if (DialogObject.isEncryptedDialog(dialog_id)) {
                            accountInstance.getMessagesController().saveGif(parent, result.document);
                        }
                    }
                    TLRPC.User bot = (TLRPC.User) parent;
                    HashMap<String, String> params = new HashMap<>();
                    params.put("id", result.id);
                    params.put("query_id", "" + result.query_id);
                    params.put("force_gif", "1");
                    SendMessagesHelper.prepareSendingBotContextResult(accountInstance, result, params, dialog_id, replyingMessageObject, getThreadMessage(), notify, scheduleDate);
                    if (searchingType != 0) {
                        setSearchingTypeInternal(0, true);
                        emojiView.closeSearch(true);
                        emojiView.hideSearchKeyboard();
                    }
                }
                if (delegate != null) {
                    delegate.onMessageSend(null, notify, scheduleDate);
                }
            }
        }

        @Override
        public void onTabOpened(int type) {
            delegate.onStickersTab(type == 3);
            post(updateExpandabilityRunnable);
        }

        @Override
        public void onClearEmojiRecent() {
            if (parentFragment == null || parentActivity == null) {
                return;
            }
            AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity, resourcesProvider);
            builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
            builder.setMessage(LocaleController.getString("ClearRecentEmoji", R.string.ClearRecentEmoji));
            builder.setPositiveButton(LocaleController.getString("ClearButton", R.string.ClearButton).toUpperCase(), (dialogInterface, i) -> emojiView.clearRecentEmoji());
            builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
            parentFragment.showDialog(builder.create());
        }

        @Override
        public void onShowStickerSet(TLRPC.StickerSet stickerSet, TLRPC.InputStickerSet inputStickerSet) {
            if (trendingStickersAlert != null && !trendingStickersAlert.isDismissed()) {
                trendingStickersAlert.getLayout().showStickerSet(stickerSet, inputStickerSet);
                return;
            }
            if (parentFragment == null || parentActivity == null) {
                return;
            }
            if (stickerSet != null) {
                inputStickerSet = new TLRPC.TL_inputStickerSetID();
                inputStickerSet.access_hash = stickerSet.access_hash;
                inputStickerSet.id = stickerSet.id;
            }
            parentFragment.showDialog(new StickersAlert(parentActivity, parentFragment, inputStickerSet, null, ChatActivityEnterView.this, resourcesProvider));
        }

        @Override
        public void onStickerSetAdd(TLRPC.StickerSetCovered stickerSet) {
            MediaDataController.getInstance(currentAccount).toggleStickerSet(parentActivity, stickerSet, 2, parentFragment, false, false);
        }

        @Override
        public void onStickerSetRemove(TLRPC.StickerSetCovered stickerSet) {
            MediaDataController.getInstance(currentAccount).toggleStickerSet(parentActivity, stickerSet, 0, parentFragment, false, false);
        }

        @Override
        public void onStickersGroupClick(long chatId) {
            if (parentFragment != null) {
                if (AndroidUtilities.isTablet()) {
                    hidePopup(false);
                }
                GroupStickersActivity fragment = new GroupStickersActivity(chatId);
                fragment.setInfo(info);
                parentFragment.presentFragment(fragment);
            }
        }

        @Override
        public void onSearchOpenClose(int type) {
            setSearchingTypeInternal(type, true);
            if (type != 0) {
                setStickersExpanded(true, true, false);
            }
            if (emojiTabOpen && searchingType == 2) {
                checkStickresExpandHeight();
            }
        }

        @Override
        public boolean isSearchOpened() {
            return searchingType != 0;
        }

        @Override
        public boolean isExpanded() {
            return stickersExpanded;
        }

        @Override
        public boolean canSchedule() {
            return parentFragment != null && parentFragment.canScheduleMessage();
        }

        @Override
        public boolean isInScheduleMode() {
            return parentFragment != null && parentFragment.isInScheduleMode();
        }

        @Override
        public long getDialogId() {
            return dialog_id;
        }

        @Override
        public int getThreadId() {
            return getThreadMessageId();
        }

        @Override
        public void showTrendingStickersAlert(TrendingStickersLayout layout) {
            if (parentActivity != null && parentFragment != null) {
                trendingStickersAlert = new TrendingStickersAlert(parentActivity, parentFragment, layout, resourcesProvider) {

                    @Override
                    public void dismiss() {
                        super.dismiss();
                        if (trendingStickersAlert == this) {
                            trendingStickersAlert = null;
                        }
                        if (delegate != null) {
                            delegate.onTrendingStickersShowed(false);
                        }
                    }
                };
                if (delegate != null) {
                    delegate.onTrendingStickersShowed(true);
                }
                trendingStickersAlert.show();
            }
        }

        @Override
        public void invalidateEnterView() {
            invalidate();
        }

        @Override
        public float getProgressToSearchOpened() {
            return searchToOpenProgress;
        }
    });
    emojiView.setDragListener(new EmojiView.DragListener() {

        boolean wasExpanded;

        int initialOffset;

        @Override
        public void onDragStart() {
            if (!allowDragging()) {
                return;
            }
            if (stickersExpansionAnim != null) {
                stickersExpansionAnim.cancel();
            }
            stickersDragging = true;
            wasExpanded = stickersExpanded;
            stickersExpanded = true;
            NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.stopAllHeavyOperations, 1);
            stickersExpandedHeight = sizeNotifierLayout.getHeight() - (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? AndroidUtilities.statusBarHeight : 0) - ActionBar.getCurrentActionBarHeight() - getHeight() + Theme.chat_composeShadowDrawable.getIntrinsicHeight();
            if (searchingType == 2) {
                stickersExpandedHeight = Math.min(stickersExpandedHeight, AndroidUtilities.dp(120) + (AndroidUtilities.displaySize.x > AndroidUtilities.displaySize.y ? keyboardHeightLand : keyboardHeight));
            }
            emojiView.getLayoutParams().height = stickersExpandedHeight;
            emojiView.setLayerType(LAYER_TYPE_HARDWARE, null);
            sizeNotifierLayout.requestLayout();
            sizeNotifierLayout.setForeground(new ScrimDrawable());
            initialOffset = (int) getTranslationY();
            if (delegate != null) {
                delegate.onStickersExpandedChange();
            }
        }

        @Override
        public void onDragEnd(float velocity) {
            if (!allowDragging()) {
                return;
            }
            stickersDragging = false;
            if ((wasExpanded && velocity >= AndroidUtilities.dp(200)) || (!wasExpanded && velocity <= AndroidUtilities.dp(-200)) || (wasExpanded && stickersExpansionProgress <= 0.6f) || (!wasExpanded && stickersExpansionProgress >= 0.4f)) {
                setStickersExpanded(!wasExpanded, true, true);
            } else {
                setStickersExpanded(wasExpanded, true, true);
            }
        }

        @Override
        public void onDragCancel() {
            if (!stickersTabOpen) {
                return;
            }
            stickersDragging = false;
            setStickersExpanded(wasExpanded, true, false);
        }

        @Override
        public void onDrag(int offset) {
            if (!allowDragging()) {
                return;
            }
            int origHeight = AndroidUtilities.displaySize.x > AndroidUtilities.displaySize.y ? keyboardHeightLand : keyboardHeight;
            offset += initialOffset;
            offset = Math.max(Math.min(offset, 0), -(stickersExpandedHeight - origHeight));
            emojiView.setTranslationY(offset);
            setTranslationY(offset);
            stickersExpansionProgress = (float) offset / (-(stickersExpandedHeight - origHeight));
            sizeNotifierLayout.invalidate();
        }

        private boolean allowDragging() {
            return stickersTabOpen && !(!stickersExpanded && messageEditText.length() > 0) && emojiView.areThereAnyStickers() && !waitingForKeyboardOpen;
        }
    });
    sizeNotifierLayout.addView(emojiView, sizeNotifierLayout.getChildCount() - 5);
    checkChannelRights();
}
Also used : Bundle(android.os.Bundle) ProfileActivity(org.telegram.ui.ProfileActivity) AdjustPanLayoutHelper(org.telegram.ui.ActionBar.AdjustPanLayoutHelper) NonNull(androidx.annotation.NonNull) Uri(android.net.Uri) FrameLayout(android.widget.FrameLayout) ImageView(android.widget.ImageView) Drawable(android.graphics.drawable.Drawable) Property(android.util.Property) Manifest(android.Manifest) Keep(androidx.annotation.Keep) ActionBarMenuSubItem(org.telegram.ui.ActionBar.ActionBarMenuSubItem) DialogsActivity(org.telegram.ui.DialogsActivity) ClipboardManager(android.content.ClipboardManager) Canvas(android.graphics.Canvas) AccessibilityEvent(android.view.accessibility.AccessibilityEvent) Emoji(org.telegram.messenger.Emoji) ContextCompat(androidx.core.content.ContextCompat) NotificationsController(org.telegram.messenger.NotificationsController) ViewCompat(androidx.core.view.ViewCompat) ChatListItemAnimator(androidx.recyclerview.widget.ChatListItemAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) NotificationCenter(org.telegram.messenger.NotificationCenter) HapticFeedbackConstants(android.view.HapticFeedbackConstants) Nullable(androidx.annotation.Nullable) Layout(android.text.Layout) TextPaint(android.text.TextPaint) LaunchActivity(org.telegram.ui.LaunchActivity) PorterDuffColorFilter(android.graphics.PorterDuffColorFilter) Paint(android.graphics.Paint) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) TextWatcher(android.text.TextWatcher) ChatActivity(org.telegram.ui.ChatActivity) Path(android.graphics.Path) ImageSpan(android.text.style.ImageSpan) BuildCompat(androidx.core.os.BuildCompat) Dialog(android.app.Dialog) SystemClock(android.os.SystemClock) Editable(android.text.Editable) ArrayList(java.util.ArrayList) SpannableStringBuilder(android.text.SpannableStringBuilder) TLRPC(org.telegram.tgnet.TLRPC) Toast(android.widget.Toast) Menu(android.view.Menu) ColorFilter(android.graphics.ColorFilter) SimpleTextView(org.telegram.ui.ActionBar.SimpleTextView) R(org.telegram.messenger.R) FileOutputStream(java.io.FileOutputStream) TextUtils(android.text.TextUtils) File(java.io.File) Gravity(android.view.Gravity) UserObject(org.telegram.messenger.UserObject) SharedPreferences(android.content.SharedPreferences) TypedValue(android.util.TypedValue) Configuration(android.content.res.Configuration) AccessibilityNodeInfoCompat(androidx.core.view.accessibility.AccessibilityNodeInfoCompat) ColorUtils(androidx.core.graphics.ColorUtils) ChatObject(org.telegram.messenger.ChatObject) CameraController(org.telegram.messenger.camera.CameraController) AlertDialog(org.telegram.ui.ActionBar.AlertDialog) ValueAnimator(android.animation.ValueAnimator) Rect(android.graphics.Rect) ActionMode(android.view.ActionMode) LinearLayout(android.widget.LinearLayout) StickersActivity(org.telegram.ui.StickersActivity) PackageManager(android.content.pm.PackageManager) Spannable(android.text.Spannable) WindowManager(android.view.WindowManager) InputConnectionCompat(androidx.core.view.inputmethod.InputConnectionCompat) AccountInstance(org.telegram.messenger.AccountInstance) AndroidUtilities(org.telegram.messenger.AndroidUtilities) Animator(android.animation.Animator) ViewConfiguration(android.view.ViewConfiguration) PowerManager(android.os.PowerManager) ApplicationLoader(org.telegram.messenger.ApplicationLoader) GroupStickersActivity(org.telegram.ui.GroupStickersActivity) Locale(java.util.Locale) MediaController(org.telegram.messenger.MediaController) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) Matrix(android.graphics.Matrix) RectF(android.graphics.RectF) Utilities(org.telegram.messenger.Utilities) ExploreByTouchHelper(androidx.customview.widget.ExploreByTouchHelper) ObjectAnimator(android.animation.ObjectAnimator) PorterDuff(android.graphics.PorterDuff) SendMessagesHelper(org.telegram.messenger.SendMessagesHelper) ConnectionsManager(org.telegram.tgnet.ConnectionsManager) ViewGroup(android.view.ViewGroup) UserConfig(org.telegram.messenger.UserConfig) List(java.util.List) TextView(android.widget.TextView) WindowInsets(android.view.WindowInsets) EditorInfo(android.view.inputmethod.EditorInfo) DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ActionBarPopupWindow(org.telegram.ui.ActionBar.ActionBarPopupWindow) Typeface(android.graphics.Typeface) Context(android.content.Context) StaticLayout(android.text.StaticLayout) AccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo) Spanned(android.text.Spanned) KeyEvent(android.view.KeyEvent) Theme(org.telegram.ui.ActionBar.Theme) InputConnection(android.view.inputmethod.InputConnection) LocaleController(org.telegram.messenger.LocaleController) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) PixelFormat(android.graphics.PixelFormat) AudioManager(android.media.AudioManager) ClipData(android.content.ClipData) SuppressLint(android.annotation.SuppressLint) AccessibilityManager(android.view.accessibility.AccessibilityManager) VideoEditedInfo(org.telegram.messenger.VideoEditedInfo) PhotoViewer(org.telegram.ui.PhotoViewer) MotionEvent(android.view.MotionEvent) ActionBar(org.telegram.ui.ActionBar.ActionBar) AnimatorSet(android.animation.AnimatorSet) MessageObject(org.telegram.messenger.MessageObject) SharedConfig(org.telegram.messenger.SharedConfig) MediaDataController(org.telegram.messenger.MediaDataController) Build(android.os.Build) LongSparseArray(androidx.collection.LongSparseArray) DialogObject(org.telegram.messenger.DialogObject) InputContentInfoCompat(androidx.core.view.inputmethod.InputContentInfoCompat) FileLog(org.telegram.messenger.FileLog) MessagesController(org.telegram.messenger.MessagesController) Color(android.graphics.Color) EditorInfoCompat(androidx.core.view.inputmethod.EditorInfoCompat) Bitmap(android.graphics.Bitmap) ClipDescription(android.content.ClipDescription) ViewTreeObserver(android.view.ViewTreeObserver) Vibrator(android.os.Vibrator) Activity(android.app.Activity) MimeTypeMap(android.webkit.MimeTypeMap) InputStream(java.io.InputStream) AlertDialog(org.telegram.ui.ActionBar.AlertDialog) HashMap(java.util.HashMap) SpannableStringBuilder(android.text.SpannableStringBuilder) StickersActivity(org.telegram.ui.StickersActivity) GroupStickersActivity(org.telegram.ui.GroupStickersActivity) GroupStickersActivity(org.telegram.ui.GroupStickersActivity) TLRPC(org.telegram.tgnet.TLRPC) KeyEvent(android.view.KeyEvent) ImageView(android.widget.ImageView) SimpleTextView(org.telegram.ui.ActionBar.SimpleTextView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView) TextPaint(android.text.TextPaint) Paint(android.graphics.Paint) SuppressLint(android.annotation.SuppressLint) UserObject(org.telegram.messenger.UserObject) ChatObject(org.telegram.messenger.ChatObject) MessageObject(org.telegram.messenger.MessageObject) DialogObject(org.telegram.messenger.DialogObject) MessageObject(org.telegram.messenger.MessageObject)

Aggregations

AccountInstance (org.telegram.messenger.AccountInstance)6 TLRPC (org.telegram.tgnet.TLRPC)5 AlertDialog (org.telegram.ui.ActionBar.AlertDialog)5 LinearLayout (android.widget.LinearLayout)4 TextView (android.widget.TextView)4 SharedPreferences (android.content.SharedPreferences)3 Uri (android.net.Uri)3 SpannableStringBuilder (android.text.SpannableStringBuilder)3 ArrayList (java.util.ArrayList)3 Manifest (android.Manifest)2 SuppressLint (android.annotation.SuppressLint)2 Activity (android.app.Activity)2 Context (android.content.Context)2 PackageManager (android.content.pm.PackageManager)2 Paint (android.graphics.Paint)2 Bundle (android.os.Bundle)2 CheckBoxCell (org.telegram.ui.Cells.CheckBoxCell)2 Animator (android.animation.Animator)1 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)1 AnimatorSet (android.animation.AnimatorSet)1