导航菜单

页面标题

页面副标题

Plus 12 v10.13.1.1 - ProfileActivity.java 源代码

正在查看: Plus 12 v10.13.1.1 应用的 ProfileActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package org.telegram.ui;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.StateListAnimator;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ConfigurationInfo;
import android.content.pm.PackageInfo;
import android.content.res.Configuration;
import android.database.DataSetObserver;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.LinearGradient;
import android.graphics.Outline;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Point;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.Typeface;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.media.MediaCodecInfo;
import android.media.MediaCodecList;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.style.CharacterStyle;
import android.text.style.ClickableSpan;
import android.text.style.ForegroundColorSpan;
import android.text.style.URLSpan;
import android.util.Property;
import android.util.SparseArray;
import android.util.SparseIntArray;
import android.view.MotionEvent;
import android.view.TextureView;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
import android.view.ViewTreeObserver;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.webkit.WebStorage;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.Keep;
import androidx.collection.LongSparseArray;
import androidx.core.content.ContextCompat;
import androidx.core.content.FileProvider;
import androidx.core.graphics.ColorUtils;
import androidx.core.math.MathUtils;
import androidx.core.view.NestedScrollingParent3;
import androidx.core.view.NestedScrollingParentHelper;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import j$.util.Comparator;
import j$.util.function.Consumer;
import j$.util.function.ToIntFunction;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
import org.telegram.PhoneFormat.PhoneFormat;
import org.telegram.messenger.AccountInstance;
import org.telegram.messenger.AndroidUtilities;
import org.telegram.messenger.ApplicationLoader;
import org.telegram.messenger.AuthTokensHelper;
import org.telegram.messenger.BirthdayController;
import org.telegram.messenger.BuildVars;
import org.telegram.messenger.ChannelBoostsController;
import org.telegram.messenger.ChatObject;
import org.telegram.messenger.ChatThemeController;
import org.telegram.messenger.ContactsController;
import org.telegram.messenger.DialogObject;
import org.telegram.messenger.DispatchQueue;
import org.telegram.messenger.DocumentObject;
import org.telegram.messenger.FileLoader;
import org.telegram.messenger.FileLog;
import org.telegram.messenger.FlagSecureReason;
import org.telegram.messenger.ImageLoader;
import org.telegram.messenger.ImageLocation;
import org.telegram.messenger.ImageReceiver;
import org.telegram.messenger.LanguageDetector;
import org.telegram.messenger.LocaleController;
import org.telegram.messenger.MediaController;
import org.telegram.messenger.MediaDataController;
import org.telegram.messenger.MessageObject;
import org.telegram.messenger.MessagesController;
import org.telegram.messenger.MessagesStorage;
import org.telegram.messenger.NotificationCenter;
import org.telegram.messenger.NotificationsController;
import org.telegram.messenger.PlusUtils;
import org.telegram.messenger.R;
import org.telegram.messenger.SendMessagesHelper;
import org.telegram.messenger.SharedConfig;
import org.telegram.messenger.SvgHelper;
import org.telegram.messenger.UserConfig;
import org.telegram.messenger.UserObject;
import org.telegram.messenger.Utilities;
import org.telegram.messenger.browser.Browser;
import org.telegram.tgnet.ConnectionsManager;
import org.telegram.tgnet.RequestDelegate;
import org.telegram.tgnet.SerializedData;
import org.telegram.tgnet.TLObject;
import org.telegram.tgnet.TLRPC;
import org.telegram.tgnet.tl.TL_fragment;
import org.telegram.tgnet.tl.TL_stories;
import org.telegram.ui.ActionBar.ActionBar;
import org.telegram.ui.ActionBar.ActionBarMenu;
import org.telegram.ui.ActionBar.ActionBarMenuItem;
import org.telegram.ui.ActionBar.ActionBarMenuSubItem;
import org.telegram.ui.ActionBar.ActionBarPopupWindow;
import org.telegram.ui.ActionBar.AlertDialog;
import org.telegram.ui.ActionBar.BackDrawable;
import org.telegram.ui.ActionBar.BaseFragment;
import org.telegram.ui.ActionBar.BaseFragment$BottomSheetParams;
import org.telegram.ui.ActionBar.BottomSheet;
import org.telegram.ui.ActionBar.INavigationLayout;
import org.telegram.ui.ActionBar.OKLCH;
import org.telegram.ui.ActionBar.PlusSettings;
import org.telegram.ui.ActionBar.SimpleTextView;
import org.telegram.ui.ActionBar.Theme;
import org.telegram.ui.ActionBar.ThemeDescription;
import org.telegram.ui.Business.OpeningHoursActivity;
import org.telegram.ui.Business.ProfileHoursCell;
import org.telegram.ui.Business.ProfileLocationCell;
import org.telegram.ui.Cells.AboutLinkCell;
import org.telegram.ui.Cells.CheckBoxCell;
import org.telegram.ui.Cells.DividerCell;
import org.telegram.ui.Cells.DrawerProfileCell;
import org.telegram.ui.Cells.GraySectionCell;
import org.telegram.ui.Cells.HeaderCell;
import org.telegram.ui.Cells.NotificationsCheckCell;
import org.telegram.ui.Cells.ProfileChannelCell;
import org.telegram.ui.Cells.SettingsSearchCell;
import org.telegram.ui.Cells.SettingsSuggestionCell;
import org.telegram.ui.Cells.ShadowSectionCell;
import org.telegram.ui.Cells.TextCell;
import org.telegram.ui.Cells.TextCheckCell;
import org.telegram.ui.Cells.TextDetailCell;
import org.telegram.ui.Cells.TextInfoPrivacyCell;
import org.telegram.ui.Cells.UserCell;
import org.telegram.ui.ChatActivity;
import org.telegram.ui.ChatRightsEditActivity;
import org.telegram.ui.Components.AlertsCreator;
import org.telegram.ui.Components.AnimatedColor;
import org.telegram.ui.Components.AnimatedEmojiDrawable;
import org.telegram.ui.Components.AnimatedFileDrawable;
import org.telegram.ui.Components.AnimatedFloat;
import org.telegram.ui.Components.AnimatedTextView;
import org.telegram.ui.Components.AnimationProperties;
import org.telegram.ui.Components.AudioPlayerAlert;
import org.telegram.ui.Components.AutoDeletePopupWrapper;
import org.telegram.ui.Components.AvatarDrawable;
import org.telegram.ui.Components.BackButtonMenu;
import org.telegram.ui.Components.BackupImageView;
import org.telegram.ui.Components.Bulletin;
import org.telegram.ui.Components.BulletinFactory;
import org.telegram.ui.Components.ButtonBounce;
import org.telegram.ui.Components.CanvasButton;
import org.telegram.ui.Components.ChatActivityInterface;
import org.telegram.ui.Components.ChatAvatarContainer;
import org.telegram.ui.Components.ChatNotificationsPopupWrapper;
import org.telegram.ui.Components.ColoredImageSpan;
import org.telegram.ui.Components.CombinedDrawable;
import org.telegram.ui.Components.CrossfadeDrawable;
import org.telegram.ui.Components.CubicBezierInterpolator;
import org.telegram.ui.Components.EmojiPacksAlert;
import org.telegram.ui.Components.FloatingDebug.FloatingDebugController;
import org.telegram.ui.Components.FragmentContextView;
import org.telegram.ui.Components.HintView;
import org.telegram.ui.Components.ImageUpdater;
import org.telegram.ui.Components.InstantCameraView;
import org.telegram.ui.Components.ItemOptions;
import org.telegram.ui.Components.JoinGroupAlert;
import org.telegram.ui.Components.LayoutHelper;
import org.telegram.ui.Components.LinkSpanDrawable;
import org.telegram.ui.Components.MediaActivity;
import org.telegram.ui.Components.MessagePrivateSeenView;
import org.telegram.ui.Components.Paint.PersistColorPalette;
import org.telegram.ui.Components.PopupSwipeBackLayout;
import org.telegram.ui.Components.Premium.GiftPremiumBottomSheet;
import org.telegram.ui.Components.Premium.LimitReachedBottomSheet;
import org.telegram.ui.Components.Premium.PremiumFeatureBottomSheet;
import org.telegram.ui.Components.Premium.PremiumPreviewBottomSheet;
import org.telegram.ui.Components.Premium.ProfilePremiumCell;
import org.telegram.ui.Components.Premium.boosts.BoostRepository;
import org.telegram.ui.Components.Premium.boosts.PremiumPreviewGiftToUsersBottomSheet;
import org.telegram.ui.Components.Premium.boosts.UserSelectorBottomSheet;
import org.telegram.ui.Components.ProfileGalleryView;
import org.telegram.ui.Components.RLottieDrawable;
import org.telegram.ui.Components.RLottieImageView;
import org.telegram.ui.Components.RadialProgressView;
import org.telegram.ui.Components.Reactions.ReactionsLayoutInBubble;
import org.telegram.ui.Components.RecyclerListView;
import org.telegram.ui.Components.ScamDrawable;
import org.telegram.ui.Components.ShareAlert;
import org.telegram.ui.Components.SharedMediaLayout;
import org.telegram.ui.Components.SizeNotifierFrameLayout;
import org.telegram.ui.Components.StickerEmptyView;
import org.telegram.ui.Components.TimerDrawable;
import org.telegram.ui.Components.TranslateAlert2;
import org.telegram.ui.Components.TypefaceSpan;
import org.telegram.ui.Components.UndoView;
import org.telegram.ui.Components.VectorAvatarThumbDrawable;
import org.telegram.ui.Components.voip.VoIPHelper;
import org.telegram.ui.ContactAddActivity;
import org.telegram.ui.DialogsActivity;
import org.telegram.ui.GroupCreateActivity;
import org.telegram.ui.PhotoViewer;
import org.telegram.ui.PinchToZoomHelper;
import org.telegram.ui.ProfileActivity;
import org.telegram.ui.ProfileBirthdayEffect;
import org.telegram.ui.SelectAnimatedEmojiDialog;
import org.telegram.ui.Stars.StarsIntroActivity;
import org.telegram.ui.Stories.ProfileStoriesView;
import org.telegram.ui.Stories.StoriesController;
import org.telegram.ui.Stories.StoriesListPlaceProvider;
import org.telegram.ui.Stories.StoryViewer;
import org.telegram.ui.Stories.recorder.ButtonWithCounterView;
import org.telegram.ui.Stories.recorder.DualCameraView;
import org.telegram.ui.Stories.recorder.StoryRecorder;
import org.telegram.ui.bots.BotBiometry;

public class ProfileActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate, DialogsActivity.DialogsActivityDelegate, SharedMediaLayout.SharedMediaPreloaderDelegate, ImageUpdater.ImageUpdaterDelegate, SharedMediaLayout.Delegate {
    public Property<ActionBar, Float> ACTIONBAR_HEADER_PROGRESS;
    public final Property<ProfileActivity, Float> HEADER_SHADOW;
    public AboutLinkCell aboutLinkCell;
    public int actionBarAnimationColorFrom;
    public int actionBarBackgroundColor;
    public Paint actionBarBackgroundPaint;
    public final SparseIntArray adaptedColors;
    public int addMemberRow;
    public int addToContactsRow;
    public int addToGroupButtonRow;
    public int addToGroupInfoRow;
    public SimpleTextView adminTextView;
    public int administratorsRow;
    public ActionBarMenuItem adminsItem;
    public boolean allowProfileAnimation;
    public boolean allowPullingDown;
    public DrawerProfileCell.AnimatedStatusView animatedStatusView;
    public ActionBarMenuItem animatingItem;
    public Runnable applyBulletin;
    public int audioRow;
    public ActionBarMenuSubItem autoDeleteItem;
    public TimerDrawable autoDeleteItemDrawable;
    public AutoDeletePopupWrapper autoDeletePopupWrapper;
    public TLRPC.FileLocation avatar;
    public AnimatorSet avatarAnimation;
    public float avatarAnimationProgress;
    public TLRPC.FileLocation avatarBig;
    public int avatarColor;
    public FrameLayout avatarContainer;
    public FrameLayout avatarContainer2;
    public AvatarDrawable avatarDrawable;
    public AvatarImageView avatarImage;
    public RadialProgressView avatarProgressView;
    public float avatarScale;
    public int avatarUploadingRequest;
    public float avatarX;
    public float avatarY;
    public ProfileGalleryView avatarsViewPager;
    public PagerIndicatorView avatarsViewPagerIndicatorView;
    public long banFromGroup;
    public int bioRow;
    public ProfileBirthdayEffect birthdayEffect;
    public ProfileBirthdayEffect.BirthdayEffectFetcher birthdayFetcher;
    public int birthdayRow;
    public int bizHoursRow;
    public int bizLocationRow;
    public int blockedUsersRow;
    public View blurredView;
    public String botDetails;
    public TLRPC.BotInfo botInfo;
    public ButtonWithCounterView[] bottomButton;
    public FrameLayout[] bottomButtonContainer;
    public SpannableStringBuilder bottomButtonPostText;
    public FrameLayout bottomButtonsContainer;
    public int bottomPaddingRow;
    public int businessRow;
    public ActionBarMenuItem callItem;
    public boolean callItemVisible;
    public RLottieDrawable cameraDrawable;
    public boolean canSearchMembers;
    public RLottieDrawable cellCameraDrawable;
    public int channelDividerRow;
    public int channelInfoRow;
    public int channelRow;
    public long chatId;
    public TLRPC.ChatFull chatInfo;
    public int chatRow;
    public int clearLogsRow;
    public NestedFrameLayout contentView;
    public int count;
    public boolean countEnd;
    public boolean createdBirthdayFetcher;
    public boolean creatingChat;
    public long creatorID;
    public CharSequence currentBio;
    public TLRPC.ChannelParticipant currentChannelParticipant;
    public TLRPC.Chat currentChat;
    public TLRPC.EncryptedChat currentEncryptedChat;
    public float currentExpanAnimatorFracture;
    public float currentExpandAnimatorValue;
    public TLRPC.TL_account_password currentPassword;
    public float customAvatarProgress;
    public float customPhotoOffset;
    public int dataRow;
    public int debugHeaderRow;
    public ArrayList<TLRPC.ChatParticipant> deletedAccounts;
    public LongSparseArray<TLRPC.ChatParticipant> deletedAccountsMap;
    public int devicesRow;
    public int devicesSectionRow;
    public long dialogId;
    public boolean disableProfileAnimation;
    public boolean doNotSetForeground;
    public ActionBarMenuSubItem editColorItem;
    public ActionBarMenuItem editItem;
    public boolean editItemVisible;
    public AnimatedEmojiDrawable.SwapAnimatedEmojiDrawable[] emojiStatusDrawable;
    public int emptyRow;
    public StickerEmptyView emptyView;
    public ValueAnimator expandAnimator;
    public float[] expandAnimatorValues;
    public boolean expandPhoto;
    public float expandProgress;
    public float extraHeight;
    public ImageReceiver fallbackImage;
    public int faqRow;
    public int filesRow;
    public int filterType;
    public int filtersRow;
    public boolean firstLayout;
    public FlagSecureReason flagSecure;
    public RLottieImageView floatingButton;
    public FrameLayout floatingButtonContainer;
    public float floatingButtonHideProgress;
    public boolean floatingHidden;
    public final AccelerateDecelerateInterpolator floatingInterpolator;
    public boolean fragmentOpened;
    public boolean fragmentViewAttached;
    public boolean fromMain;
    public boolean fullyVisible;
    public HintView fwdRestrictedHint;
    public int graceSuggestionRow;
    public int graceSuggestionSectionRow;
    public boolean hasCustomPhoto;
    public boolean hasFallbackPhoto;
    public boolean hasVoiceChatItem;
    public AnimatorSet headerAnimatorSet;
    public float headerShadowAlpha;
    public AnimatorSet headerShadowAnimatorSet;
    public int helpHeaderRow;
    public int helpSectionCell;
    public boolean hideAudios;
    public boolean hideFiles;
    public boolean hideGifs;
    public boolean hideLinks;
    public boolean hideMembersFilter;
    public boolean hideMusic;
    public boolean hidePhotos;
    public boolean hideVideos;
    public boolean hoursExpanded;
    public boolean hoursShownMine;
    public ImageUpdater imageUpdater;
    public int infoEndRow;
    public int infoHeaderRow;
    public int infoSectionRow;
    public int infoStartRow;
    public float initialAnimationExtraHeight;
    public boolean invalidateScroll;
    public boolean isBot;
    public boolean isFragmentOpened;
    public boolean isFragmentPhoneNumber;
    public boolean isInLandscapeMode;
    public boolean[] isOnline;
    public boolean isPulledDown;
    public boolean isQrItemVisible;
    public boolean isTopic;
    public int joinRow;
    public int languageRow;
    public float lastEmojiStatusProgress;
    public int lastMeasuredContentHeight;
    public int lastMeasuredContentWidth;
    public int lastSectionRow;
    public LinearLayoutManager layoutManager;
    public ActionBarMenuSubItem linkItem;
    public int linksRow;
    public ListAdapter listAdapter;
    public int listContentHeight;
    public RecyclerListView listView;
    public float listViewVelocityY;
    public int liteModeRow;
    public boolean loadingBoostsStats;
    public CharacterStyle loadingSpan;
    public boolean loadingUsers;
    public int locationRow;
    public Drawable lockIconDrawable;
    public AudioPlayerAlert.ClippingTextViewSwitcher mediaCounterTextView;
    public float mediaHeaderAnimationProgress;
    public boolean mediaHeaderVisible;
    public int membersEndRow;
    public int membersFilterRow;
    public int membersHeaderRow;
    public ActionBarMenuItem membersItem;
    public int membersSectionRow;
    public int membersStartRow;
    public long mergeDialogId;
    public boolean myProfile;
    public SimpleTextView[] nameTextView;
    public String nameTextViewRightDrawable2ContentDescription;
    public String nameTextViewRightDrawableContentDescription;
    public float nameX;
    public float nameY;
    public int navigationBarAnimationColorFrom;
    public boolean needSendMessage;
    public boolean needTimerImage;
    public int notificationRow;
    public int notificationsDividerRow;
    public HashSet<Integer> notificationsExceptionTopics;
    public int notificationsRow;
    public int notificationsSimpleRow;
    public int numberRow;
    public int numberSectionRow;
    public int onlineCount;
    public SimpleTextView[] onlineTextView;
    public float onlineX;
    public float onlineY;
    public long onlyId;
    public long onlyIdMedia;
    public boolean openAnimationInProgress;
    public boolean openSimilar;
    public boolean openingAvatar;
    public ActionBarMenuItem otherItem;
    public int overlayCountVisible;
    public OverlaysView overlaysView;
    public ChatActivity parentChatActivity;
    public LongSparseArray<TLRPC.ChatParticipant> participantsMap;
    public int passwordSuggestionRow;
    public int passwordSuggestionSectionRow;
    public MessagesController.PeerColor peerColor;
    public ActionBarMenuItem permissionsItem;
    public int phoneRow;
    public int phoneSuggestionRow;
    public int phoneSuggestionSectionRow;
    public float photoDescriptionProgress;
    public int photosRow;
    public PinchToZoomHelper pinchToZoomHelper;
    public int playProfileAnimation;
    public int policyRow;
    public HashMap<Integer, Integer> positionToOffset;
    public boolean preloadedChannelEmojiStatuses;
    public final CrossfadeDrawable[] premiumCrossfadeDrawable;
    public int premiumGiftingRow;
    public int premiumRow;
    public int premiumSectionsRow;
    public final Drawable[] premiumStarDrawable;
    public ImageLocation prevLoadedImageLocation;
    public ChatActivityInterface previousTransitionFragment;
    public int privacyRow;
    public ProfileChannelCell.ChannelMessageFetcher profileChannelMessageFetcher;
    public boolean profileTransitionInProgress;
    public AlertDialog progressDialog;
    public PhotoViewer.PhotoViewerProvider provider;
    public ActionBarMenuItem qrItem;
    public AnimatorSet qrItemAnimation;
    public int questionRow;
    public ActionBarMenuItem recentActionsItem;
    public boolean recreateMenuAfterAnimation;
    public Rect rect;
    public ActionBarMenuItem removedUsersItem;
    public int reportDividerRow;
    public long reportReactionFromDialogId;
    public int reportReactionMessageId;
    public int reportReactionRow;
    public int reportRow;
    public boolean reportSpam;
    public Theme.ResourcesProvider resourcesProvider;
    public int restrictionHeaderRow;
    public int restrictionRow;
    public int rowCount;
    public boolean saved;
    public int savedScrollOffset;
    public int savedScrollPosition;
    public boolean savedScrollToSharedMedia;
    public ScamDrawable scamDrawable;
    public AnimatorSet scrimAnimatorSet;
    public Paint scrimPaint;
    public View scrimView;
    public boolean scrolling;
    public SearchAdapter searchAdapter;
    public ActionBarMenuItem searchItem;
    public RecyclerListView searchListView;
    public boolean searchMode;
    public String searchSetting;
    public int searchTransitionOffset;
    public float searchTransitionProgress;
    public Animator searchViewTransition;
    public int secretSettingsSectionRow;
    public SelectAnimatedEmojiDialog.SelectAnimatedEmojiDialogWindow selectAnimatedEmojiDialog;
    public long selectedUser;
    public int sendLastLogsRow;
    public int sendLogsRow;
    public int sendMessageRow;
    public TextCell setAvatarCell;
    public int setAvatarRow;
    public int setAvatarSectionRow;
    public ActionBarMenuSubItem setUsernameItem;
    public int setUsernameRow;
    public int settingsKeyRow;
    public int settingsRow;
    public int settingsSectionRow;
    public int settingsSectionRow2;
    public int settingsTimerRow;
    public int sharedGifsRow;
    public SharedMediaLayout sharedMediaLayout;
    public boolean sharedMediaLayoutAttached;
    public SharedMediaLayout.SharedMediaPreloader sharedMediaPreloader;
    public int sharedMediaRow;
    public int sharedPhotosRow;
    public int sharedVideosRow;
    public boolean showAddToContacts;
    public boolean showBoostsAlert;
    public boolean showMoreButtons;
    public boolean showRecentActions;
    public ShowDrawable showStatusButton;
    public int sortIndex;
    public ArrayList<Integer> sortedUsers;
    public int starsRow;
    public int stickersRow;
    public ProfileStoriesView storyView;
    public int subscribersRequestsRow;
    public int subscribersRow;
    public int switchBackendRow;
    public ImageView timeItem;
    public TimerDrawable timerDrawable;
    public float titleAnimationsYDiff;
    public TopView topView;
    public long topicId;
    public int totalGifsCount;
    public int totalPhotosCount;
    public int totalVideosCount;
    public boolean transitionAnimationInProress;
    public int transitionIndex;
    public View transitionOnlineText;
    public ImageView ttlIconView;
    public int unblockRow;
    public UndoView undoView;
    public boolean updatingDate;
    public ImageLocation uploadingImageLocation;
    public boolean userBlocked;
    public long userId;
    public TLRPC.UserFull userInfo;
    public int userInfoRow;
    public int usernameRow;
    public boolean usersEndReached;
    public int usersForceShowingIn;
    public String vcardFirstName;
    public String vcardLastName;
    public String vcardPhone;
    public final Drawable[] verifiedCheckDrawable;
    public final CrossfadeDrawable[] verifiedCrossfadeDrawable;
    public final Drawable[] verifiedDrawable;
    public int versionRow;
    public ActionBarMenuItem videoCallItem;
    public boolean videoCallItemVisible;
    public final ArrayList<TLRPC.ChatParticipant> visibleChatParticipants;
    public final ArrayList<Integer> visibleSortedUsers;
    public int voiceRow;
    public boolean waitCanSendStoryRequest;
    public Paint whitePaint;
    public RLottieImageView writeButton;
    public AnimatorSet writeButtonAnimation;

    public static void m7882$$Nest$monTextDetailCellImageClicked(ProfileActivity profileActivity, View view) {
        profileActivity.onTextDetailCellImageClicked(view);
    }

    public static void m7883$$Nest$monWriteButtonClick(ProfileActivity profileActivity) {
        profileActivity.onWriteButtonClick();
    }

    public boolean canFinishFragment() {
        return ImageUpdater.ImageUpdaterDelegate.-CC.$default$canFinishFragment(this);
    }

    @Override
    public boolean didSelectDialogs(DialogsActivity dialogsActivity, ArrayList arrayList, CharSequence charSequence, boolean z, TopicsFragment topicsFragment, boolean z2) {
        return DialogsActivity.DialogsActivityDelegate.CC.$default$didSelectDialogs(this, dialogsActivity, arrayList, charSequence, z, topicsFragment, z2);
    }

    public void didUploadFailed() {
        ImageUpdater.ImageUpdaterDelegate.-CC.$default$didUploadFailed(this);
    }

    public final String getDCInfo(int dc) {
        if (dc != 1 && dc != 2) {
            if (dc == 3) {
                return "Miami FL, USA";
            }
            if (dc != 4) {
                return dc != 5 ? "Miami FL, USA" : "Singapore, SG";
            }
        }
        return "Amsterdam, NL";
    }

    public String getInitialSearchString() {
        return ImageUpdater.ImageUpdaterDelegate.-CC.$default$getInitialSearchString(this);
    }

    public final boolean isQrNeedVisible() {
        return true;
    }

    public static ProfileActivity of(long dialogId) {
        Bundle bundle = new Bundle();
        if (dialogId >= 0) {
            bundle.putLong("user_id", dialogId);
        } else {
            bundle.putLong("chat_id", -dialogId);
        }
        return new ProfileActivity(bundle);
    }

    public long getTopicId() {
        return this.topicId;
    }

    public static class AvatarImageView extends BackupImageView {
        public ProfileGalleryView avatarsViewPager;
        public float bounceScale;
        public boolean drawAvatar;
        public boolean drawForeground;
        public ImageReceiver.BitmapHolder drawableHolder;
        public float foregroundAlpha;
        public ImageReceiver foregroundImageReceiver;
        public boolean hasStories;
        public final Paint placeholderPaint;
        public float progressToExpand;
        public float progressToInsets;
        public final RectF rect;

        public ChatActivityInterface getPrevFragment() {
            return null;
        }

        public void setAvatarsViewPager(ProfileGalleryView avatarsViewPager) {
            this.avatarsViewPager = avatarsViewPager;
        }

        public AvatarImageView(Context context) {
            super(context);
            this.rect = new RectF();
            this.drawAvatar = true;
            this.bounceScale = 1.0f;
            this.drawForeground = true;
            this.progressToInsets = 1.0f;
            this.foregroundImageReceiver = new ImageReceiver(this);
            Paint paint = new Paint(1);
            this.placeholderPaint = paint;
            paint.setColor(-16777216);
        }

        public void setForegroundImage(ImageLocation imageLocation, String imageFilter, Drawable thumb) {
            this.foregroundImageReceiver.setImage(imageLocation, imageFilter, thumb, 0L, (String) null, (Object) null, 0);
            ImageReceiver.BitmapHolder bitmapHolder = this.drawableHolder;
            if (bitmapHolder != null) {
                bitmapHolder.release();
                this.drawableHolder = null;
            }
        }

        public void setForegroundImageDrawable(ImageReceiver.BitmapHolder holder) {
            if (holder != null) {
                this.foregroundImageReceiver.setImageBitmap(holder.drawable);
            }
            ImageReceiver.BitmapHolder bitmapHolder = this.drawableHolder;
            if (bitmapHolder != null) {
                bitmapHolder.release();
                this.drawableHolder = null;
            }
            this.drawableHolder = holder;
        }

        public float getForegroundAlpha() {
            return this.foregroundAlpha;
        }

        public void setForegroundAlpha(float value) {
            this.foregroundAlpha = value;
            invalidate();
        }

        public void clearForeground() {
            AnimatedFileDrawable animation = this.foregroundImageReceiver.getAnimation();
            if (animation != null) {
                animation.removeSecondParentView(this);
            }
            this.foregroundImageReceiver.clearImage();
            ImageReceiver.BitmapHolder bitmapHolder = this.drawableHolder;
            if (bitmapHolder != null) {
                bitmapHolder.release();
                this.drawableHolder = null;
            }
            this.foregroundAlpha = 0.0f;
            invalidate();
        }

        public void onDetachedFromWindow() {
            super.onDetachedFromWindow();
            this.foregroundImageReceiver.onDetachedFromWindow();
            ImageReceiver.BitmapHolder bitmapHolder = this.drawableHolder;
            if (bitmapHolder != null) {
                bitmapHolder.release();
                this.drawableHolder = null;
            }
        }

        public void onAttachedToWindow() {
            super.onAttachedToWindow();
            this.foregroundImageReceiver.onAttachedToWindow();
        }

        public void setRoundRadius(int value) {
            super.setRoundRadius(value);
            this.foregroundImageReceiver.setRoundRadius(value);
        }

        public void onDraw(Canvas canvas) {
            AnimatedEmojiDrawable animatedEmojiDrawable = ((BackupImageView) this).animatedEmojiDrawable;
            ImageReceiver imageReceiver = animatedEmojiDrawable != null ? animatedEmojiDrawable.getImageReceiver() : ((BackupImageView) this).imageReceiver;
            canvas.save();
            float f = this.bounceScale;
            canvas.scale(f, f, getMeasuredWidth() / 2.0f, getMeasuredHeight() / 2.0f);
            float dpf2 = (this.hasStories ? (int) AndroidUtilities.dpf2(3.5f) : 0.0f) * (1.0f - this.progressToExpand);
            float f2 = this.progressToInsets;
            float f3 = this.foregroundAlpha;
            float f4 = dpf2 * f2 * (1.0f - f3);
            if (imageReceiver != null && (f3 < 1.0f || !this.drawForeground)) {
                float f5 = f4 * 2.0f;
                imageReceiver.setImageCoords(f4, f4, getMeasuredWidth() - f5, getMeasuredHeight() - f5);
                if (this.drawAvatar) {
                    imageReceiver.draw(canvas);
                }
            }
            if (this.foregroundAlpha > 0.0f && this.drawForeground) {
                if (this.foregroundImageReceiver.getDrawable() != null) {
                    float f6 = 2.0f * f4;
                    this.foregroundImageReceiver.setImageCoords(f4, f4, getMeasuredWidth() - f6, getMeasuredHeight() - f6);
                    this.foregroundImageReceiver.setAlpha(this.foregroundAlpha);
                    this.foregroundImageReceiver.draw(canvas);
                } else {
                    this.rect.set(0.0f, 0.0f, getMeasuredWidth(), getMeasuredHeight());
                    this.placeholderPaint.setAlpha((int) (this.foregroundAlpha * 255.0f));
                    float f7 = this.foregroundImageReceiver.getRoundRadius()[0];
                    canvas.drawRoundRect(this.rect, f7, f7, this.placeholderPaint);
                }
            }
            canvas.restore();
        }

        public void invalidate() {
            super/*android.view.View*/.invalidate();
            ProfileGalleryView profileGalleryView = this.avatarsViewPager;
            if (profileGalleryView != null) {
                profileGalleryView.invalidate();
            }
        }

        public void setProgressToStoriesInsets(float progressToInsets) {
            if (progressToInsets == this.progressToInsets) {
                return;
            }
            this.progressToInsets = progressToInsets;
            invalidate();
        }

        public void drawForeground(boolean drawForeground) {
            this.drawForeground = drawForeground;
        }

        public void setHasStories(boolean hasStories) {
            if (this.hasStories == hasStories) {
                return;
            }
            this.hasStories = hasStories;
            invalidate();
        }

        public void setProgressToExpand(float animatedFracture) {
            if (this.progressToExpand == animatedFracture) {
                return;
            }
            this.progressToExpand = animatedFracture;
            invalidate();
        }
    }

    public class TopView extends View {
        public LinearGradient backgroundGradient;
        public int backgroundGradientColor1;
        public int backgroundGradientColor2;
        public int backgroundGradientHeight;
        public final Paint backgroundPaint;
        public Rect blurBounds;
        public int color1;
        public final AnimatedColor color1Animated;
        public int color2;
        public final AnimatedColor color2Animated;
        public int currentColor;
        public final AnimatedEmojiDrawable.SwapAnimatedEmojiDrawable emoji;
        public int emojiColor;
        public boolean emojiLoaded;
        public final AnimatedFloat emojiLoadedT;
        public final AnimatedFloat hasColorAnimated;
        public boolean hasColorById;
        public boolean hasEmoji;
        public Paint paint;

        public TopView(Context context) {
            super(context);
            this.paint = new Paint();
            CubicBezierInterpolator cubicBezierInterpolator = CubicBezierInterpolator.EASE_OUT_QUINT;
            this.hasColorAnimated = new AnimatedFloat(this, 350L, cubicBezierInterpolator);
            this.color1Animated = new AnimatedColor(this, 350L, cubicBezierInterpolator);
            this.color2Animated = new AnimatedColor(this, 350L, cubicBezierInterpolator);
            this.backgroundPaint = new Paint(1);
            this.emoji = new AnimatedEmojiDrawable.SwapAnimatedEmojiDrawable(this, false, AndroidUtilities.dp(20.0f), 13);
            this.emojiLoadedT = new AnimatedFloat(this, 0L, 440L, cubicBezierInterpolator);
            this.blurBounds = new Rect();
        }

        @Override
        public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
            setMeasuredDimension(View.MeasureSpec.getSize(widthMeasureSpec), View.MeasureSpec.getSize(widthMeasureSpec) + AndroidUtilities.dp(3.0f));
        }

        @Override
        public void setBackgroundColor(int color) {
            if (color != this.currentColor) {
                this.currentColor = color;
                this.paint.setColor(color);
                invalidate();
                if (this.hasColorById) {
                    return;
                }
                ProfileActivity.this.actionBarBackgroundColor = this.currentColor;
            }
        }

        public void setBackgroundColorId(MessagesController.PeerColor peerColor, boolean animated) {
            if (peerColor != null) {
                this.hasColorById = true;
                this.color1 = peerColor.getBgColor1(Theme.isCurrentThemeDark());
                int bgColor2 = peerColor.getBgColor2(Theme.isCurrentThemeDark());
                this.color2 = bgColor2;
                ProfileActivity.this.actionBarBackgroundColor = ColorUtils.blendARGB(this.color1, bgColor2, 0.25f);
                this.emojiColor = PeerColorActivity.adaptProfileEmojiColor(this.color1);
            } else {
                ProfileActivity.this.actionBarBackgroundColor = this.currentColor;
                this.hasColorById = false;
                ProfileActivity profileActivity = ProfileActivity.this;
                int i = Theme.key_actionBarDefault;
                if (AndroidUtilities.computePerceivedBrightness(profileActivity.getThemedColor(i)) > 0.8f) {
                    this.emojiColor = ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhiteBlueText);
                } else if (AndroidUtilities.computePerceivedBrightness(ProfileActivity.this.getThemedColor(i)) < 0.2f) {
                    this.emojiColor = Theme.multAlpha(ProfileActivity.this.getThemedColor(Theme.key_actionBarDefaultTitle), 0.5f);
                } else {
                    this.emojiColor = PeerColorActivity.adaptProfileEmojiColor(ProfileActivity.this.getThemedColor(i));
                }
            }
            if (!animated) {
                this.color1Animated.set(this.color1, true);
                this.color2Animated.set(this.color2, true);
            }
            invalidate();
        }

        @Override
        public void onAttachedToWindow() {
            super.onAttachedToWindow();
            this.emoji.attach();
        }

        @Override
        public void onDetachedFromWindow() {
            super.onDetachedFromWindow();
            this.emoji.detach();
        }

        public void setBackgroundEmojiId(long emojiId, boolean animated) {
            this.emoji.set(emojiId, animated);
            this.emoji.setColor(Integer.valueOf(this.emojiColor));
            this.hasEmoji = this.hasEmoji || !(emojiId == 0 || emojiId == -1);
            invalidate();
        }

        public final boolean isEmojiLoaded() {
            if (this.emojiLoaded) {
                return true;
            }
            AnimatedEmojiDrawable.SwapAnimatedEmojiDrawable swapAnimatedEmojiDrawable = this.emoji;
            if (swapAnimatedEmojiDrawable == null || !(swapAnimatedEmojiDrawable.getDrawable() instanceof AnimatedEmojiDrawable)) {
                return false;
            }
            AnimatedEmojiDrawable drawable = this.emoji.getDrawable();
            if (drawable.getImageReceiver() == null || !drawable.getImageReceiver().hasImageLoaded()) {
                return false;
            }
            this.emojiLoaded = true;
            return true;
        }

        @Override
        public void onDraw(final Canvas canvas) {
            ActionBar actionBar;
            ActionBarMenu actionBarMenu;
            float currentActionBarHeight = ProfileActivity.this.extraHeight + ActionBar.getCurrentActionBarHeight() + (((BaseFragment) ProfileActivity.this).actionBar.getOccupyStatusBar() ? AndroidUtilities.statusBarHeight : 0) + ProfileActivity.this.searchTransitionOffset;
            int i = (int) ((1.0f - ProfileActivity.this.mediaHeaderAnimationProgress) * currentActionBarHeight);
            if (i != 0) {
                ChatActivityInterface chatActivityInterface = ProfileActivity.this.previousTransitionFragment;
                if (chatActivityInterface != null && chatActivityInterface.getContentView() != null) {
                    this.blurBounds.set(0, 0, getMeasuredWidth(), i);
                    if (ProfileActivity.this.previousTransitionFragment.getActionBar() != null && !ProfileActivity.this.previousTransitionFragment.getContentView().blurWasDrawn() && ProfileActivity.this.previousTransitionFragment.getActionBar().getBackground() == null) {
                        this.paint.setColor(Theme.getColor(Theme.key_actionBarDefault, ProfileActivity.this.previousTransitionFragment.getResourceProvider()));
                        canvas.drawRect(this.blurBounds, this.paint);
                    } else {
                        ProfileActivity.this.previousTransitionFragment.getContentView().drawBlurRect(canvas, getY(), this.blurBounds, ProfileActivity.this.previousTransitionFragment.getActionBar().blurScrimPaint, true);
                    }
                }
                this.paint.setColor(this.currentColor);
                int i2 = this.color1Animated.set(this.color1);
                int i3 = this.color2Animated.set(this.color2);
                int dp = AndroidUtilities.statusBarHeight + AndroidUtilities.dp(144.0f);
                if (this.backgroundGradient == null || this.backgroundGradientColor1 != i2 || this.backgroundGradientColor2 != i3 || this.backgroundGradientHeight != dp) {
                    this.backgroundGradientHeight = dp;
                    this.backgroundGradientColor2 = i3;
                    this.backgroundGradientColor1 = i2;
                    LinearGradient linearGradient = new LinearGradient(0.0f, 0.0f, 0.0f, dp, new int[]{i3, i2}, new float[]{0.0f, 1.0f}, Shader.TileMode.CLAMP);
                    this.backgroundGradient = linearGradient;
                    this.backgroundPaint.setShader(linearGradient);
                }
                float f = (ProfileActivity.this.playProfileAnimation == 0 ? 1.0f : ProfileActivity.this.avatarAnimationProgress) * this.hasColorAnimated.set(this.hasColorById);
                if (f < 1.0f) {
                    canvas.drawRect(0.0f, 0.0f, getMeasuredWidth(), i, this.paint);
                }
                if (f > 0.0f) {
                    this.backgroundPaint.setAlpha((int) (f * 255.0f));
                    canvas.drawRect(0.0f, 0.0f, getMeasuredWidth(), i, this.backgroundPaint);
                }
                if (this.hasEmoji && this.emojiLoadedT.set(isEmojiLoaded()) > 0.0f) {
                    canvas.save();
                    canvas.clipRect(0, 0, getMeasuredWidth(), i);
                    PeerColorActivity.drawProfileIconPattern(getMeasuredWidth() - AndroidUtilities.dp(46.0f), ((((BaseFragment) ProfileActivity.this).actionBar.getOccupyStatusBar() ? AndroidUtilities.statusBarHeight : 0) + AndroidUtilities.dp(144.0f)) - ((1.0f - (ProfileActivity.this.extraHeight / AndroidUtilities.dp(88.0f))) * AndroidUtilities.dp(33.0f)), (((ProfileActivity.this.extraHeight / AndroidUtilities.dp(88.0f)) - 1.0f) * 0.2f) + 1.0f, new Utilities.Callback4() {
                        public final void run(Object obj, Object obj2, Object obj3, Object obj4) {
                            ProfileActivity.TopView.this.lambda$onDraw$0(canvas, (Float) obj, (Float) obj2, (Float) obj3, (Float) obj4);
                        }
                    });
                    canvas.restore();
                }
                ChatActivityInterface chatActivityInterface2 = ProfileActivity.this.previousTransitionFragment;
                if (chatActivityInterface2 != null && (actionBarMenu = (actionBar = chatActivityInterface2.getActionBar()).menu) != null) {
                    int save = canvas.save();
                    canvas.translate(actionBar.getX() + actionBarMenu.getX(), actionBar.getY() + actionBarMenu.getY());
                    canvas.saveLayerAlpha(0.0f, 0.0f, actionBarMenu.getMeasuredWidth(), actionBarMenu.getMeasuredHeight(), (int) ((1.0f - ProfileActivity.this.avatarAnimationProgress) * 255.0f), 31);
                    actionBarMenu.draw(canvas);
                    canvas.restoreToCount(save);
                }
            }
            if (i != currentActionBarHeight) {
                this.paint.setColor(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite));
                this.blurBounds.set(0, i, getMeasuredWidth(), (int) currentActionBarHeight);
                ProfileActivity.this.contentView.drawBlurRect(canvas, getY(), this.blurBounds, this.paint, true);
            }
            if (((BaseFragment) ProfileActivity.this).parentLayout != null) {
                ((BaseFragment) ProfileActivity.this).parentLayout.drawHeaderShadow(canvas, (int) (ProfileActivity.this.headerShadowAlpha * 255.0f), (int) currentActionBarHeight);
            }
        }

        public void lambda$onDraw$0(Canvas canvas, Float f, Float f2, Float f3, Float f4) {
            this.emoji.setAlpha((int) (f4.floatValue() * 255.0f * Math.min(1.0f, ProfileActivity.this.extraHeight / AndroidUtilities.dp(88.0f))));
            this.emoji.setBounds((int) (f.floatValue() - (f3.floatValue() * 0.45f)), (int) (f2.floatValue() - (f3.floatValue() * 0.45f)), (int) (f.floatValue() + (f3.floatValue() * 0.45f)), (int) (f2.floatValue() + (f3.floatValue() * 0.45f)));
            this.emoji.draw(canvas);
        }
    }

    public class OverlaysView extends View implements ProfileGalleryView.Callback {
        public float alpha;
        public float[] alphas;
        public final ValueAnimator animator;
        public final float[] animatorValues;
        public final Paint backgroundPaint;
        public final Paint barPaint;
        public final GradientDrawable bottomOverlayGradient;
        public final Rect bottomOverlayRect;
        public float currentAnimationValue;
        public int currentLoadingAnimationDirection;
        public float currentLoadingAnimationProgress;
        public float currentProgress;
        public boolean isOverlaysVisible;
        public long lastTime;
        public final float[] pressedOverlayAlpha;
        public final GradientDrawable[] pressedOverlayGradient;
        public final boolean[] pressedOverlayVisible;
        public int previousSelectedPotision;
        public float previousSelectedProgress;
        public final RectF rect;
        public final Paint selectedBarPaint;
        public int selectedPosition;
        public final int statusBarHeight;
        public final GradientDrawable topOverlayGradient;
        public final Rect topOverlayRect;

        public OverlaysView(Context context) {
            super(context);
            this.statusBarHeight = (!((BaseFragment) ProfileActivity.this).actionBar.getOccupyStatusBar() || ((BaseFragment) ProfileActivity.this).inBubbleMode) ? 0 : AndroidUtilities.statusBarHeight;
            this.topOverlayRect = new Rect();
            this.bottomOverlayRect = new Rect();
            this.rect = new RectF();
            this.animatorValues = new float[]{0.0f, 1.0f};
            this.pressedOverlayGradient = new GradientDrawable[2];
            this.pressedOverlayVisible = new boolean[2];
            this.pressedOverlayAlpha = new float[2];
            this.alpha = 0.0f;
            this.alphas = null;
            this.previousSelectedPotision = -1;
            this.currentLoadingAnimationDirection = 1;
            setVisibility(8);
            Paint paint = new Paint(1);
            this.barPaint = paint;
            paint.setColor(1442840575);
            Paint paint2 = new Paint(1);
            this.selectedBarPaint = paint2;
            paint2.setColor(-1);
            GradientDrawable gradientDrawable = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{1107296256, 0});
            this.topOverlayGradient = gradientDrawable;
            gradientDrawable.setShape(0);
            GradientDrawable gradientDrawable2 = new GradientDrawable(GradientDrawable.Orientation.BOTTOM_TOP, new int[]{1107296256, 0});
            this.bottomOverlayGradient = gradientDrawable2;
            gradientDrawable2.setShape(0);
            int i = 0;
            while (i < 2) {
                this.pressedOverlayGradient[i] = new GradientDrawable(i == 0 ? GradientDrawable.Orientation.LEFT_RIGHT : GradientDrawable.Orientation.RIGHT_LEFT, new int[]{838860800, 0});
                this.pressedOverlayGradient[i].setShape(0);
                i++;
            }
            Paint paint3 = new Paint(1);
            this.backgroundPaint = paint3;
            paint3.setColor(-16777216);
            paint3.setAlpha(66);
            ValueAnimator ofFloat = ValueAnimator.ofFloat(0.0f, 1.0f);
            this.animator = ofFloat;
            ofFloat.setDuration(250L);
            ofFloat.setInterpolator(CubicBezierInterpolator.EASE_BOTH);
            ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                @Override
                public final void onAnimationUpdate(ValueAnimator valueAnimator) {
                    ProfileActivity.OverlaysView.this.lambda$new$0(valueAnimator);
                }
            });
            ofFloat.addListener(new AnimatorListenerAdapter(ProfileActivity.this) {
                @Override
                public void onAnimationEnd(Animator animation) {
                    if (OverlaysView.this.isOverlaysVisible) {
                        return;
                    }
                    OverlaysView.this.setVisibility(8);
                }

                @Override
                public void onAnimationStart(Animator animation) {
                    OverlaysView.this.setVisibility(0);
                }
            });
        }

        public void lambda$new$0(ValueAnimator valueAnimator) {
            float[] fArr = this.animatorValues;
            float animatedFraction = valueAnimator.getAnimatedFraction();
            this.currentAnimationValue = animatedFraction;
            setAlphaValue(AndroidUtilities.lerp(fArr, animatedFraction), true);
        }

        public void saveCurrentPageProgress() {
            this.previousSelectedProgress = this.currentProgress;
            this.previousSelectedPotision = this.selectedPosition;
            this.currentLoadingAnimationProgress = 0.0f;
            this.currentLoadingAnimationDirection = 1;
        }

        public void setAlphaValue(float value, boolean self) {
            if (Build.VERSION.SDK_INT > 18) {
                int i = (int) (255.0f * value);
                this.topOverlayGradient.setAlpha(i);
                this.bottomOverlayGradient.setAlpha(i);
                this.backgroundPaint.setAlpha((int) (66.0f * value));
                this.barPaint.setAlpha((int) (85.0f * value));
                this.selectedBarPaint.setAlpha(i);
                this.alpha = value;
            } else {
                setAlpha(value);
            }
            if (!self) {
                this.currentAnimationValue = value;
            }
            invalidate();
        }

        public boolean isOverlaysVisible() {
            return this.isOverlaysVisible;
        }

        public void setOverlaysVisible() {
            this.isOverlaysVisible = true;
            setVisibility(0);
        }

        public void setOverlaysVisible(boolean overlaysVisible, float durationFactor) {
            if (overlaysVisible != this.isOverlaysVisible) {
                this.isOverlaysVisible = overlaysVisible;
                this.animator.cancel();
                float lerp = AndroidUtilities.lerp(this.animatorValues, this.currentAnimationValue);
                if (overlaysVisible) {
                    this.animator.setDuration((long) (((1.0f - lerp) * 250.0f) / durationFactor));
                } else {
                    this.animator.setDuration((long) ((250.0f * lerp) / durationFactor));
                }
                float[] fArr = this.animatorValues;
                fArr[0] = lerp;
                fArr[1] = overlaysVisible ? 1.0f : 0.0f;
                this.animator.start();
            }
        }

        @Override
        public void onSizeChanged(int w, int h, int oldw, int oldh) {
            int currentActionBarHeight = this.statusBarHeight + ActionBar.getCurrentActionBarHeight();
            this.topOverlayRect.set(0, 0, w, (int) (currentActionBarHeight * 0.5f));
            this.bottomOverlayRect.set(0, (int) (h - (AndroidUtilities.dp(72.0f) * 0.5f)), w, h);
            this.topOverlayGradient.setBounds(0, this.topOverlayRect.bottom, w, currentActionBarHeight + AndroidUtilities.dp(16.0f));
            this.bottomOverlayGradient.setBounds(0, (h - AndroidUtilities.dp(72.0f)) - AndroidUtilities.dp(24.0f), w, this.bottomOverlayRect.top);
            int i = w / 5;
            this.pressedOverlayGradient[0].setBounds(0, 0, i, h);
            this.pressedOverlayGradient[1].setBounds(w - i, 0, w, h);
        }

        @Override
        public void onDraw(android.graphics.Canvas r22) {
            throw new UnsupportedOperationException("Method not decompiled: org.telegram.ui.ProfileActivity.OverlaysView.onDraw(android.graphics.Canvas):void");
        }

        public void onDown(boolean z) {
            this.pressedOverlayVisible[!z ? 1 : 0] = true;
            postInvalidateOnAnimation();
        }

        public void onRelease() {
            Arrays.fill(this.pressedOverlayVisible, false);
            postInvalidateOnAnimation();
        }

        public void onPhotosLoaded() {
            ProfileActivity.this.updateProfileData(false);
        }

        public void onVideoSet() {
            invalidate();
        }
    }

    public class NestedFrameLayout extends SizeNotifierFrameLayout implements NestedScrollingParent3 {
        public NestedScrollingParentHelper nestedScrollingParentHelper;

        public void onNestedScroll(View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int type) {
        }

        public void onStopNestedScroll(View child) {
        }

        public NestedFrameLayout(Context context) {
            super(context);
            this.nestedScrollingParentHelper = new NestedScrollingParentHelper(this);
        }

        public void onNestedScroll(View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int type, int[] consumed) {
            try {
                boolean z = true;
                if (target == ProfileActivity.this.listView && ProfileActivity.this.sharedMediaLayoutAttached) {
                    RecyclerListView currentListView = ProfileActivity.this.sharedMediaLayout.getCurrentListView();
                    if (ProfileActivity.this.sharedMediaLayout.getTop() == 0) {
                        consumed[1] = dyUnconsumed;
                        currentListView.scrollBy(0, dyUnconsumed);
                    }
                }
                if (dyConsumed == 0 || type != 0) {
                    return;
                }
                ProfileActivity profileActivity = ProfileActivity.this;
                if (dyConsumed <= 0) {
                    z = false;
                }
                profileActivity.hideFloatingButton(z);
            } catch (Throwable th) {
                FileLog.e(th);
                AndroidUtilities.runOnUIThread(new Runnable() {
                    @Override
                    public final void run() {
                        ProfileActivity.NestedFrameLayout.this.lambda$onNestedScroll$0();
                    }
                });
            }
        }

        public void lambda$onNestedScroll$0() {
            try {
                RecyclerListView currentListView = ProfileActivity.this.sharedMediaLayout.getCurrentListView();
                if (currentListView == null || currentListView.getAdapter() == null) {
                    return;
                }
                currentListView.getAdapter().notifyDataSetChanged();
            } catch (Throwable unused) {
            }
        }

        public boolean onNestedPreFling(View target, float velocityX, float velocityY) {
            return super/*android.widget.FrameLayout*/.onNestedPreFling(target, velocityX, velocityY);
        }

        public void onNestedPreScroll(View target, int dx, int dy, int[] consumed, int type) {
            RecyclerListView currentListView;
            int findFirstVisibleItemPosition;
            if (target == ProfileActivity.this.listView) {
                if (ProfileActivity.this.sharedMediaRow == -1 || !ProfileActivity.this.sharedMediaLayoutAttached) {
                    return;
                }
                boolean isSearchFieldVisible = ((BaseFragment) ProfileActivity.this).actionBar.isSearchFieldVisible();
                int top = ProfileActivity.this.sharedMediaLayout.getTop();
                boolean z = false;
                if (dy >= 0) {
                    if (isSearchFieldVisible) {
                        RecyclerListView currentListView2 = ProfileActivity.this.sharedMediaLayout.getCurrentListView();
                        consumed[1] = dy;
                        if (top > 0) {
                            consumed[1] = consumed[1] - dy;
                        }
                        if (currentListView2 == null || consumed[1] <= 0) {
                            return;
                        }
                        currentListView2.scrollBy(0, consumed[1]);
                        return;
                    }
                    return;
                }
                if (top <= 0 && (currentListView = ProfileActivity.this.sharedMediaLayout.getCurrentListView()) != null && (findFirstVisibleItemPosition = currentListView.getLayoutManager().findFirstVisibleItemPosition()) != -1) {
                    RecyclerView.ViewHolder findViewHolderForAdapterPosition = currentListView.findViewHolderForAdapterPosition(findFirstVisibleItemPosition);
                    int top2 = findViewHolderForAdapterPosition != null ? findViewHolderForAdapterPosition.itemView.getTop() : -1;
                    int paddingTop = currentListView.getPaddingTop();
                    if (top2 != paddingTop || findFirstVisibleItemPosition != 0) {
                        consumed[1] = findFirstVisibleItemPosition != 0 ? dy : Math.max(dy, top2 - paddingTop);
                        currentListView.scrollBy(0, dy);
                        z = true;
                    }
                }
                if (isSearchFieldVisible) {
                    if (!z && top < 0) {
                        consumed[1] = dy - Math.max(top, dy);
                    } else {
                        consumed[1] = dy;
                    }
                }
            }
        }

        public boolean onStartNestedScroll(View child, View target, int axes, int type) {
            return ProfileActivity.this.sharedMediaRow != -1 && axes == 2;
        }

        public void onNestedScrollAccepted(View child, View target, int axes, int type) {
            this.nestedScrollingParentHelper.onNestedScrollAccepted(child, target, axes);
        }

        public void onStopNestedScroll(View target, int type) {
            this.nestedScrollingParentHelper.onStopNestedScroll(target);
        }

        public void drawList(Canvas blurCanvas, boolean top, ArrayList<SizeNotifierFrameLayout.IViewWithInvalidateCallback> views) {
            super.drawList(blurCanvas, top, views);
            blurCanvas.save();
            blurCanvas.translate(0.0f, ProfileActivity.this.listView.getY());
            ProfileActivity.this.sharedMediaLayout.drawListForBlur(blurCanvas, views);
            blurCanvas.restore();
        }
    }

    public class PagerIndicatorView extends View {
        public final PagerAdapter adapter;
        public final ValueAnimator animator;
        public final float[] animatorValues;
        public final Paint backgroundPaint;
        public final RectF indicatorRect;
        public boolean isIndicatorVisible;
        public final TextPaint textPaint;

        public PagerIndicatorView(Context context) {
            super(context);
            this.indicatorRect = new RectF();
            this.animatorValues = new float[]{0.0f, 1.0f};
            PagerAdapter adapter = ProfileActivity.this.avatarsViewPager.getAdapter();
            this.adapter = adapter;
            setVisibility(8);
            TextPaint textPaint = new TextPaint(1);
            this.textPaint = textPaint;
            textPaint.setColor(-1);
            textPaint.setTypeface(Typeface.SANS_SERIF);
            textPaint.setTextAlign(Paint.Align.CENTER);
            textPaint.setTextSize(AndroidUtilities.dpf2(15.0f));
            Paint paint = new Paint(1);
            this.backgroundPaint = paint;
            paint.setColor(637534208);
            ValueAnimator ofFloat = ValueAnimator.ofFloat(0.0f, 1.0f);
            this.animator = ofFloat;
            ofFloat.setInterpolator(CubicBezierInterpolator.EASE_BOTH);
            ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                @Override
                public final void onAnimationUpdate(ValueAnimator valueAnimator) {
                    ProfileActivity.PagerIndicatorView.this.lambda$new$0(valueAnimator);
                }
            });
            ofFloat.addListener(new AnimatorListenerAdapter(ProfileActivity.this, ProfileActivity.this.expandPhoto) {
                public final boolean val$expanded;

                {
                    this.val$expanded = val$expanded;
                }

                @Override
                public void onAnimationEnd(Animator animation) {
                    if (PagerIndicatorView.this.isIndicatorVisible) {
                        if (ProfileActivity.this.searchItem != null) {
                            ProfileActivity.this.searchItem.setClickable(false);
                        }
                        if (ProfileActivity.this.editItemVisible) {
                            ProfileActivity.this.editItem.setVisibility(8);
                        }
                        if (ProfileActivity.this.callItemVisible) {
                            ProfileActivity.this.callItem.setVisibility(8);
                        }
                        if (ProfileActivity.this.videoCallItemVisible) {
                            ProfileActivity.this.videoCallItem.setVisibility(8);
                        }
                    } else {
                        PagerIndicatorView.this.setVisibility(8);
                    }
                    ProfileActivity.this.updateStoriesViewBounds(false);
                }

                @Override
                public void onAnimationStart(Animator animation) {
                    if (ProfileActivity.this.searchItem != null && !this.val$expanded) {
                        ProfileActivity.this.searchItem.setClickable(true);
                    }
                    if (ProfileActivity.this.editItemVisible) {
                        ProfileActivity.this.editItem.setVisibility(0);
                    }
                    if (ProfileActivity.this.callItemVisible) {
                        ProfileActivity.this.callItem.setVisibility(0);
                    }
                    if (ProfileActivity.this.videoCallItemVisible) {
                        ProfileActivity.this.videoCallItem.setVisibility(0);
                    }
                    PagerIndicatorView.this.setVisibility(0);
                    ProfileActivity.this.updateStoriesViewBounds(false);
                }
            });
            ProfileActivity.this.avatarsViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener(ProfileActivity.this) {
                public int prevPage;

                public void onPageScrollStateChanged(int state) {
                }

                public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
                }

                public void onPageSelected(int position) {
                    int realPosition = ProfileActivity.this.avatarsViewPager.getRealPosition(position);
                    PagerIndicatorView.this.invalidateIndicatorRect(this.prevPage != realPosition);
                    this.prevPage = realPosition;
                    PagerIndicatorView.this.updateAvatarItems();
                }
            });
            adapter.registerDataSetObserver(new DataSetObserver(ProfileActivity.this) {
                @Override
                public void onChanged() {
                    int realCount = ProfileActivity.this.avatarsViewPager.getRealCount();
                    if (ProfileActivity.this.overlayCountVisible == 0 && realCount > 1 && realCount <= 20 && ProfileActivity.this.overlaysView.isOverlaysVisible()) {
                        ProfileActivity.this.overlayCountVisible = 1;
                    }
                    PagerIndicatorView.this.invalidateIndicatorRect(false);
                    PagerIndicatorView.this.refreshVisibility(1.0f);
                    PagerIndicatorView.this.updateAvatarItems();
                }
            });
        }

        public void lambda$new$0(ValueAnimator valueAnimator) {
            float lerp = AndroidUtilities.lerp(this.animatorValues, valueAnimator.getAnimatedFraction());
            if (ProfileActivity.this.searchItem != null && !ProfileActivity.this.isPulledDown) {
                float f = 1.0f - lerp;
                ProfileActivity.this.searchItem.setScaleX(f);
                ProfileActivity.this.searchItem.setScaleY(f);
                ProfileActivity.this.searchItem.setAlpha(f);
            }
            if (ProfileActivity.this.editItemVisible) {
                float f2 = 1.0f - lerp;
                ProfileActivity.this.editItem.setScaleX(f2);
                ProfileActivity.this.editItem.setScaleY(f2);
                ProfileActivity.this.editItem.setAlpha(f2);
            }
            if (ProfileActivity.this.callItemVisible) {
                float f3 = 1.0f - lerp;
                ProfileActivity.this.callItem.setScaleX(f3);
                ProfileActivity.this.callItem.setScaleY(f3);
                ProfileActivity.this.callItem.setAlpha(f3);
            }
            if (ProfileActivity.this.videoCallItemVisible) {
                float f4 = 1.0f - lerp;
                ProfileActivity.this.videoCallItem.setScaleX(f4);
                ProfileActivity.this.videoCallItem.setScaleY(f4);
                ProfileActivity.this.videoCallItem.setAlpha(f4);
            }
            setScaleX(lerp);
            setScaleY(lerp);
            setAlpha(lerp);
        }

        public final void updateAvatarItemsInternal() {
            if (ProfileActivity.this.otherItem == null || ProfileActivity.this.avatarsViewPager == null || !ProfileActivity.this.isPulledDown) {
                return;
            }
            if (ProfileActivity.this.avatarsViewPager.getRealPosition() == 0) {
                ProfileActivity.this.otherItem.hideSubItem(33);
                ProfileActivity.this.otherItem.showSubItem(36);
            } else {
                ProfileActivity.this.otherItem.showSubItem(33);
                ProfileActivity.this.otherItem.hideSubItem(36);
            }
        }

        public final void updateAvatarItems() {
            if (ProfileActivity.this.imageUpdater == null) {
                return;
            }
            if (ProfileActivity.this.otherItem.isSubMenuShowing()) {
                AndroidUtilities.runOnUIThread(new Runnable() {
                    @Override
                    public final void run() {
                        ProfileActivity.PagerIndicatorView.this.updateAvatarItemsInternal();
                    }
                }, 500L);
            } else {
                updateAvatarItemsInternal();
            }
        }

        public boolean isIndicatorFullyVisible() {
            return this.isIndicatorVisible && !this.animator.isRunning();
        }

        public void setIndicatorVisible(boolean indicatorVisible, float durationFactor) {
            if (indicatorVisible != this.isIndicatorVisible) {
                this.isIndicatorVisible = indicatorVisible;
                this.animator.cancel();
                float lerp = AndroidUtilities.lerp(this.animatorValues, this.animator.getAnimatedFraction());
                if (durationFactor <= 0.0f) {
                    this.animator.setDuration(0L);
                } else if (indicatorVisible) {
                    this.animator.setDuration((long) (((1.0f - lerp) * 250.0f) / durationFactor));
                } else {
                    this.animator.setDuration((long) ((250.0f * lerp) / durationFactor));
                }
                float[] fArr = this.animatorValues;
                fArr[0] = lerp;
                fArr[1] = indicatorVisible ? 1.0f : 0.0f;
                this.animator.start();
            }
        }

        public void refreshVisibility(float durationFactor) {
            setIndicatorVisible(ProfileActivity.this.isPulledDown && ProfileActivity.this.avatarsViewPager.getRealCount() > 20, durationFactor);
            ProfileActivity.this.updatePicDate();
        }

        @Override
        public void onSizeChanged(int w, int h, int oldw, int oldh) {
            invalidateIndicatorRect(false);
        }

        public final void invalidateIndicatorRect(boolean pageChanged) {
            if (pageChanged) {
                ProfileActivity.this.overlaysView.saveCurrentPageProgress();
            }
            ProfileActivity.this.overlaysView.invalidate();
            float measureText = this.textPaint.measureText(getCurrentTitle());
            this.indicatorRect.right = (getMeasuredWidth() - AndroidUtilities.dp(54.0f)) - (ProfileActivity.this.qrItem != null ? AndroidUtilities.dp(48.0f) : 0);
            RectF rectF = this.indicatorRect;
            rectF.left = rectF.right - (measureText + AndroidUtilities.dpf2(16.0f));
            this.indicatorRect.top = (((BaseFragment) ProfileActivity.this).actionBar.getOccupyStatusBar() ? AndroidUtilities.statusBarHeight : 0) + AndroidUtilities.dp(15.0f);
            RectF rectF2 = this.indicatorRect;
            rectF2.bottom = rectF2.top + AndroidUtilities.dp(26.0f);
            setPivotX(this.indicatorRect.centerX());
            setPivotY(this.indicatorRect.centerY());
            ProfileActivity.this.updatePicDate();
            invalidate();
        }

        @Override
        public void onDraw(Canvas canvas) {
            float dpf2 = AndroidUtilities.dpf2(12.0f);
            canvas.drawRoundRect(this.indicatorRect, dpf2, dpf2, this.backgroundPaint);
            canvas.drawText(getCurrentTitle(), this.indicatorRect.centerX(), this.indicatorRect.top + AndroidUtilities.dpf2(18.5f), this.textPaint);
        }

        public final String getCurrentTitle() {
            return this.adapter.getPageTitle(ProfileActivity.this.avatarsViewPager.getCurrentItem()).toString();
        }

        public final ActionBarMenuItem getSecondaryMenuItem() {
            if (ProfileActivity.this.callItemVisible) {
                return ProfileActivity.this.callItem;
            }
            if (ProfileActivity.this.editItemVisible) {
                return ProfileActivity.this.editItem;
            }
            if (ProfileActivity.this.searchItem != null) {
                return ProfileActivity.this.searchItem;
            }
            return null;
        }
    }

    public ProfileActivity(Bundle args) {
        this(args, null);
    }

    public ProfileActivity(Bundle args, SharedMediaLayout.SharedMediaPreloader preloader) {
        super(args);
        this.nameTextView = new SimpleTextView[2];
        this.nameTextViewRightDrawableContentDescription = null;
        this.nameTextViewRightDrawable2ContentDescription = null;
        this.onlineTextView = new SimpleTextView[4];
        this.verifiedDrawable = new Drawable[2];
        this.premiumStarDrawable = new Drawable[2];
        this.emojiStatusDrawable = new AnimatedEmojiDrawable.SwapAnimatedEmojiDrawable[2];
        this.verifiedCheckDrawable = new Drawable[2];
        this.verifiedCrossfadeDrawable = new CrossfadeDrawable[2];
        this.premiumCrossfadeDrawable = new CrossfadeDrawable[2];
        this.scrimView = null;
        this.scrimPaint = new Paint(1) {
            @Override
            public void setAlpha(int a) {
                super.setAlpha(a);
                ((BaseFragment) ProfileActivity.this).fragmentView.invalidate();
            }
        };
        this.actionBarBackgroundPaint = new Paint(1);
        this.isOnline = new boolean[1];
        this.headerShadowAlpha = 1.0f;
        this.totalPhotosCount = -1;
        this.totalVideosCount = -1;
        this.totalGifsCount = -1;
        this.deletedAccounts = new ArrayList<>();
        this.deletedAccountsMap = new LongSparseArray<>();
        this.participantsMap = new LongSparseArray<>();
        this.allowProfileAnimation = true;
        this.disableProfileAnimation = false;
        this.positionToOffset = new HashMap<>();
        this.expandAnimatorValues = new float[]{0.0f, 1.0f};
        this.whitePaint = new Paint();
        this.onlineCount = -1;
        this.rect = new Rect();
        this.filterType = 0;
        this.sortIndex = 0;
        this.visibleChatParticipants = new ArrayList<>();
        this.visibleSortedUsers = new ArrayList<>();
        this.usersForceShowingIn = 0;
        this.firstLayout = true;
        this.invalidateScroll = true;
        this.isQrItemVisible = true;
        this.actionBarAnimationColorFrom = 0;
        this.navigationBarAnimationColorFrom = 0;
        this.reportReactionMessageId = 0;
        this.reportReactionFromDialogId = 0L;
        this.notificationsExceptionTopics = new HashSet<>();
        this.HEADER_SHADOW = new AnimationProperties.FloatProperty<ProfileActivity>("headerShadow") {
            public void setValue(ProfileActivity object, float value) {
                ProfileActivity profileActivity = ProfileActivity.this;
                profileActivity.headerShadowAlpha = value;
                profileActivity.topView.invalidate();
            }

            public Float get(ProfileActivity object) {
                return Float.valueOf(ProfileActivity.this.headerShadowAlpha);
            }
        };
        this.provider = new PhotoViewer.EmptyPhotoViewerProvider() {
            @Override
            public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index, boolean needPreview) {
                TLRPC.Chat chat;
                TLRPC.ChatPhoto chatPhoto;
                TLRPC.FileLocation fileLocation2;
                TLRPC.User user;
                TLRPC.UserProfilePhoto userProfilePhoto;
                if (fileLocation == null) {
                    return null;
                }
                if (ProfileActivity.this.userId == 0 ? ProfileActivity.this.chatId == 0 || (chat = ProfileActivity.this.getMessagesController().getChat(Long.valueOf(ProfileActivity.this.chatId))) == null || (chatPhoto = chat.photo) == null || (fileLocation2 = chatPhoto.photo_big) == null : (user = ProfileActivity.this.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.userId))) == null || (userProfilePhoto = user.photo) == null || (fileLocation2 = userProfilePhoto.photo_big) == null) {
                    fileLocation2 = null;
                }
                if (fileLocation2 == null || fileLocation2.local_id != fileLocation.local_id || fileLocation2.volume_id != fileLocation.volume_id || fileLocation2.dc_id != fileLocation.dc_id) {
                    return null;
                }
                int[] iArr = new int[2];
                ProfileActivity.this.avatarImage.getLocationInWindow(iArr);
                PhotoViewer.PlaceProviderObject placeProviderObject = new PhotoViewer.PlaceProviderObject();
                placeProviderObject.viewX = iArr[0];
                placeProviderObject.viewY = iArr[1] - (Build.VERSION.SDK_INT >= 21 ? 0 : AndroidUtilities.statusBarHeight);
                placeProviderObject.parentView = ProfileActivity.this.avatarImage;
                placeProviderObject.imageReceiver = ProfileActivity.this.avatarImage.getImageReceiver();
                if (ProfileActivity.this.userId != 0) {
                    placeProviderObject.dialogId = ProfileActivity.this.userId;
                } else if (ProfileActivity.this.chatId != 0) {
                    placeProviderObject.dialogId = -ProfileActivity.this.chatId;
                }
                placeProviderObject.thumb = placeProviderObject.imageReceiver.getBitmapSafe();
                placeProviderObject.size = -1L;
                placeProviderObject.radius = ProfileActivity.this.avatarImage.getImageReceiver().getRoundRadius(true);
                placeProviderObject.scale = ProfileActivity.this.avatarContainer.getScaleX();
                placeProviderObject.canEdit = ProfileActivity.this.userId == ProfileActivity.this.getUserConfig().clientUserId;
                return placeProviderObject;
            }

            @Override
            public void willHidePhotoViewer() {
                ProfileActivity.this.avatarImage.getImageReceiver().setVisible(true, true);
            }

            @Override
            public void openPhotoForEdit(String file, String thumb, boolean isVideo) {
                ProfileActivity.this.imageUpdater.openPhotoForEdit(file, thumb, 0, isVideo);
            }
        };
        this.floatingInterpolator = new AccelerateDecelerateInterpolator();
        this.count = -1;
        this.ACTIONBAR_HEADER_PROGRESS = new AnimationProperties.FloatProperty<ActionBar>("avatarAnimationProgress") {
            public void setValue(ActionBar object, float value) {
                int themedColor;
                ProfileActivity.this.mediaHeaderAnimationProgress = value;
                if (ProfileActivity.this.storyView != null) {
                    ProfileActivity.this.storyView.setActionBarActionMode(value);
                }
                ProfileActivity.this.topView.invalidate();
                int themedColor2 = ProfileActivity.this.getThemedColor(Theme.key_profile_title);
                ProfileActivity profileActivity = ProfileActivity.this;
                int i = Theme.key_player_actionBarTitle;
                int themedColor3 = profileActivity.getThemedColor(i);
                int offsetColor = AndroidUtilities.getOffsetColor(themedColor2, themedColor3, value, 1.0f);
                ProfileActivity.this.nameTextView[1].setTextColor(offsetColor);
                if (ProfileActivity.this.lockIconDrawable != null) {
                    ProfileActivity.this.lockIconDrawable.setColorFilter(offsetColor, PorterDuff.Mode.MULTIPLY);
                }
                if (ProfileActivity.this.scamDrawable != null) {
                    ProfileActivity.this.scamDrawable.setColor(AndroidUtilities.getOffsetColor(ProfileActivity.this.getThemedColor(Theme.key_avatar_subtitleInProfileBlue), themedColor3, value, 1.0f));
                }
                int i2 = -1;
                ((BaseFragment) ProfileActivity.this).actionBar.setItemsColor(AndroidUtilities.getOffsetColor(ProfileActivity.this.peerColor != null ? -1 : ProfileActivity.this.getThemedColor(Theme.key_actionBarDefaultIcon), ProfileActivity.this.getThemedColor(Theme.key_actionBarActionModeDefaultIcon), value, 1.0f), false);
                ((BaseFragment) ProfileActivity.this).actionBar.setItemsBackgroundColor(AndroidUtilities.getOffsetColor(ProfileActivity.this.peerColor != null ? 1090519039 : ProfileActivity.this.peerColor != null ? 553648127 : ProfileActivity.this.getThemedColor(Theme.key_avatar_actionBarSelectorBlue), ProfileActivity.this.getThemedColor(Theme.key_actionBarActionModeDefaultSelector), value, 1.0f), false);
                ProfileActivity.this.topView.invalidate();
                ProfileActivity.this.otherItem.setIconColor(ProfileActivity.this.peerColor != null ? -1 : ProfileActivity.this.getThemedColor(Theme.key_actionBarDefaultIcon));
                ProfileActivity.this.callItem.setIconColor(ProfileActivity.this.peerColor != null ? -1 : ProfileActivity.this.getThemedColor(Theme.key_actionBarDefaultIcon));
                ProfileActivity.this.videoCallItem.setIconColor(ProfileActivity.this.peerColor != null ? -1 : ProfileActivity.this.getThemedColor(Theme.key_actionBarDefaultIcon));
                ProfileActivity.this.editItem.setIconColor(ProfileActivity.this.peerColor != null ? -1 : ProfileActivity.this.getThemedColor(Theme.key_actionBarDefaultIcon));
                if (ProfileActivity.this.verifiedDrawable[0] != null) {
                    ProfileActivity.this.verifiedDrawable[0].setColorFilter(AndroidUtilities.getOffsetColor(ProfileActivity.this.getThemedColor(Theme.key_profile_verifiedBackground), ProfileActivity.this.getThemedColor(i), value, 1.0f), PorterDuff.Mode.MULTIPLY);
                }
                if (ProfileActivity.this.verifiedDrawable[1] != null) {
                    if (ProfileActivity.this.peerColor != null) {
                        themedColor = Theme.adaptHSV(ColorUtils.blendARGB(ProfileActivity.this.peerColor.getColor2(), ProfileActivity.this.peerColor.hasColor6(Theme.isCurrentThemeDark()) ? ProfileActivity.this.peerColor.getColor5() : ProfileActivity.this.peerColor.getColor3(), 0.4f), 0.1f, Theme.isCurrentThemeDark() ? -0.1f : -0.08f);
                    } else {
                        themedColor = ProfileActivity.this.getThemedColor(Theme.key_profile_verifiedBackground);
                    }
                    ProfileActivity.this.verifiedDrawable[1].setColorFilter(AndroidUtilities.getOffsetColor(themedColor, ProfileActivity.this.getThemedColor(i), value, 1.0f), PorterDuff.Mode.MULTIPLY);
                }
                if (ProfileActivity.this.verifiedCheckDrawable[0] != null) {
                    ProfileActivity.this.verifiedCheckDrawable[0].setColorFilter(AndroidUtilities.getOffsetColor(ProfileActivity.this.getThemedColor(Theme.key_profile_verifiedCheck), ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite), value, 1.0f), PorterDuff.Mode.MULTIPLY);
                }
                if (ProfileActivity.this.verifiedCheckDrawable[1] != null) {
                    if (ProfileActivity.this.peerColor == null) {
                        ProfileActivity profileActivity2 = ProfileActivity.this;
                        i2 = profileActivity2.applyPeerColor(profileActivity2.getThemedColor(Theme.key_profile_verifiedCheck));
                    }
                    ProfileActivity.this.verifiedCheckDrawable[1].setColorFilter(AndroidUtilities.getOffsetColor(i2, ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite), value, 1.0f), PorterDuff.Mode.MULTIPLY);
                }
                if (ProfileActivity.this.premiumStarDrawable[0] != null) {
                    ProfileActivity.this.premiumStarDrawable[0].setColorFilter(AndroidUtilities.getOffsetColor(ProfileActivity.this.getThemedColor(Theme.key_profile_verifiedBackground), ProfileActivity.this.getThemedColor(i), value, 1.0f), PorterDuff.Mode.MULTIPLY);
                }
                if (ProfileActivity.this.premiumStarDrawable[1] != null) {
                    ProfileActivity profileActivity3 = ProfileActivity.this;
                    int applyPeerColor = profileActivity3.applyPeerColor(profileActivity3.getThemedColor(Theme.key_profile_verifiedBackground));
                    ProfileActivity profileActivity4 = ProfileActivity.this;
                    ProfileActivity.this.premiumStarDrawable[1].setColorFilter(AndroidUtilities.getOffsetColor(applyPeerColor, profileActivity4.applyPeerColor(profileActivity4.getThemedColor(i)), value, 1.0f), PorterDuff.Mode.MULTIPLY);
                }
                ProfileActivity.this.updateEmojiStatusDrawableColor();
                if (ProfileActivity.this.avatarsViewPagerIndicatorView.getSecondaryMenuItem() != null) {
                    if (ProfileActivity.this.videoCallItemVisible || ProfileActivity.this.editItemVisible || ProfileActivity.this.callItemVisible) {
                        ProfileActivity profileActivity5 = ProfileActivity.this;
                        profileActivity5.needLayoutText(Math.min(1.0f, profileActivity5.extraHeight / AndroidUtilities.dp(88.0f)));
                    }
                }
            }

            public Float get(ActionBar object) {
                return Float.valueOf(ProfileActivity.this.mediaHeaderAnimationProgress);
            }
        };
        new Comparator<Integer>() {
            @Override
            public int compare(Integer lhs, Integer rhs) {
                TLRPC.User user = ProfileActivity.this.getMessagesController().getUser(Long.valueOf(((TLRPC.ChatParticipant) ProfileActivity.this.chatInfo.participants.participants.get(rhs.intValue())).user_id));
                TLRPC.User user2 = ProfileActivity.this.getMessagesController().getUser(Long.valueOf(((TLRPC.ChatParticipant) ProfileActivity.this.chatInfo.participants.participants.get(lhs.intValue())).user_id));
                return UserObject.getFirstName(user2).compareTo(UserObject.getFirstName(user));
            }
        };
        this.adaptedColors = new SparseIntArray();
        this.scrimAnimatorSet = null;
        this.savedScrollPosition = -1;
        this.photoDescriptionProgress = -1.0f;
        this.sharedMediaPreloader = preloader;
    }

    public boolean onFragmentCreate() {
        int i;
        String str;
        this.fromMain = ((BaseFragment) this).arguments.getBoolean("fromMain", false);
        this.searchSetting = ((BaseFragment) this).arguments.getString("search");
        this.userId = ((BaseFragment) this).arguments.getLong("user_id", 0L);
        this.chatId = ((BaseFragment) this).arguments.getLong("chat_id", 0L);
        this.topicId = ((BaseFragment) this).arguments.getLong("topic_id", 0L);
        this.saved = ((BaseFragment) this).arguments.getBoolean("saved", false);
        this.openSimilar = ((BaseFragment) this).arguments.getBoolean("similar", false);
        this.isTopic = this.topicId != 0;
        this.banFromGroup = ((BaseFragment) this).arguments.getLong("ban_chat_id", 0L);
        this.reportReactionMessageId = ((BaseFragment) this).arguments.getInt("report_reaction_message_id", 0);
        this.reportReactionFromDialogId = ((BaseFragment) this).arguments.getLong("report_reaction_from_dialog_id", 0L);
        this.showAddToContacts = ((BaseFragment) this).arguments.getBoolean("show_add_to_contacts", true);
        this.vcardPhone = PhoneFormat.stripExceptNumbers(((BaseFragment) this).arguments.getString("vcard_phone"));
        this.vcardFirstName = ((BaseFragment) this).arguments.getString("vcard_first_name");
        this.vcardLastName = ((BaseFragment) this).arguments.getString("vcard_last_name");
        this.reportSpam = ((BaseFragment) this).arguments.getBoolean("reportSpam", false);
        this.myProfile = ((BaseFragment) this).arguments.getBoolean("my_profile", false);
        if (!this.expandPhoto) {
            boolean z = ((BaseFragment) this).arguments.getBoolean("expandPhoto", false);
            this.expandPhoto = z;
            if (z) {
                this.currentExpandAnimatorValue = 1.0f;
                this.needSendMessage = true;
            }
        }
        if (this.userId != 0) {
            long j = ((BaseFragment) this).arguments.getLong("dialog_id", 0L);
            this.dialogId = j;
            if (j != 0) {
                this.currentEncryptedChat = getMessagesController().getEncryptedChat(Integer.valueOf(DialogObject.getEncryptedChatId(this.dialogId)));
            }
            FlagSecureReason flagSecureReason = this.flagSecure;
            if (flagSecureReason != null) {
                flagSecureReason.invalidate();
            }
            TLRPC.User user = getMessagesController().getUser(Long.valueOf(this.userId));
            if (user == null) {
                return false;
            }
            getNotificationCenter().addObserver(this, NotificationCenter.contactsDidLoad);
            getNotificationCenter().addObserver(this, NotificationCenter.newSuggestionsAvailable);
            getNotificationCenter().addObserver(this, NotificationCenter.encryptedChatCreated);
            getNotificationCenter().addObserver(this, NotificationCenter.encryptedChatUpdated);
            getNotificationCenter().addObserver(this, NotificationCenter.blockedUsersDidLoad);
            getNotificationCenter().addObserver(this, NotificationCenter.botInfoDidLoad);
            getNotificationCenter().addObserver(this, NotificationCenter.userInfoDidLoad);
            getNotificationCenter().addObserver(this, NotificationCenter.privacyRulesUpdated);
            NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.reloadInterface);
            this.userBlocked = getMessagesController().blockePeers.indexOfKey(this.userId) >= 0;
            if (user.bot) {
                this.isBot = true;
                MediaDataController mediaDataController = getMediaDataController();
                long j2 = user.id;
                mediaDataController.loadBotInfo(j2, j2, true, ((BaseFragment) this).classGuid);
                String publicUsername = UserObject.getPublicUsername(user);
                if (PlusSettings.showBotMoreInfo) {
                    this.botDetails = "";
                    if (!TextUtils.isEmpty(user.bot_inline_placeholder)) {
                        this.botDetails += "Inline bot\n";
                    }
                    StringBuilder sb = new StringBuilder();
                    sb.append(this.botDetails);
                    sb.append('@');
                    sb.append(publicUsername);
                    sb.append(" ");
                    if (user.bot_chat_history) {
                        i = R.string.BotStatusRead;
                        str = "BotStatusRead";
                    } else {
                        i = R.string.BotStatusCantRead;
                        str = "BotStatusCantRead";
                    }
                    sb.append(LocaleController.getString(str, i));
                    this.botDetails = sb.toString();
                }
            }
            this.userInfo = getMessagesController().getUserFull(this.userId);
            getMessagesController().loadFullUser(getMessagesController().getUser(Long.valueOf(this.userId)), ((BaseFragment) this).classGuid, true);
            this.participantsMap = null;
            if (UserObject.isUserSelf(user)) {
                ImageUpdater imageUpdater = new ImageUpdater(true, 0, true);
                this.imageUpdater = imageUpdater;
                imageUpdater.setOpenWithFrontfaceCamera(true);
                ImageUpdater imageUpdater2 = this.imageUpdater;
                imageUpdater2.parentFragment = this;
                imageUpdater2.setDelegate(this);
                getMediaDataController().checkFeaturedStickers();
                getMessagesController().loadSuggestedFilters();
                getMessagesController().loadUserInfo(getUserConfig().getCurrentUser(), true, ((BaseFragment) this).classGuid);
            }
            this.actionBarAnimationColorFrom = ((BaseFragment) this).arguments.getInt("actionBarColor", 0);
        } else {
            if (this.chatId == 0) {
                return false;
            }
            TLRPC.Chat chat = getMessagesController().getChat(Long.valueOf(this.chatId));
            this.currentChat = chat;
            if (chat == null) {
                final CountDownLatch countDownLatch = new CountDownLatch(1);
                getMessagesStorage().getStorageQueue().postRunnable(new Runnable() {
                    @Override
                    public final void run() {
                        ProfileActivity.this.lambda$onFragmentCreate$0(countDownLatch);
                    }
                });
                try {
                    countDownLatch.await();
                } catch (Exception e) {
                    FileLog.e(e);
                }
                if (this.currentChat == null) {
                    return false;
                }
                getMessagesController().putChat(this.currentChat, true);
            }
            FlagSecureReason flagSecureReason2 = this.flagSecure;
            if (flagSecureReason2 != null) {
                flagSecureReason2.invalidate();
            }
            if (this.currentChat.megagroup) {
                getChannelParticipants(true);
            } else {
                this.participantsMap = null;
            }
            getNotificationCenter().addObserver(this, NotificationCenter.chatInfoDidLoad);
            getNotificationCenter().addObserver(this, NotificationCenter.chatOnlineCountDidLoad);
            getNotificationCenter().addObserver(this, NotificationCenter.groupCallUpdated);
            getNotificationCenter().addObserver(this, NotificationCenter.channelRightsUpdated);
            getNotificationCenter().addObserver(this, NotificationCenter.chatWasBoostedByUser);
            NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.uploadStoryEnd);
            this.sortedUsers = new ArrayList<>();
            updateOnlineCount(true);
            if (this.chatInfo == null) {
                this.chatInfo = getMessagesController().getChatFull(this.chatId);
            }
            if (ChatObject.isChannel(this.currentChat)) {
                getMessagesController().loadFullChat(this.chatId, ((BaseFragment) this).classGuid, true);
            } else if (this.chatInfo == null) {
                this.chatInfo = getMessagesStorage().loadChatInfo(this.chatId, false, (CountDownLatch) null, false, false);
            }
            updateExceptions();
            ChatActivity chatActivity = this.parentChatActivity;
            if (chatActivity != null) {
                this.onlyId = chatActivity.getOnlyId();
                this.onlyIdMedia = this.parentChatActivity.getOnlyIdMedia();
            }
        }
        if (this.sharedMediaPreloader == null) {
            this.sharedMediaPreloader = new SharedMediaLayout.SharedMediaPreloader(this);
        }
        this.sharedMediaPreloader.addDelegate(this);
        getNotificationCenter().addObserver(this, NotificationCenter.updateInterfaces);
        getNotificationCenter().addObserver(this, NotificationCenter.didReceiveNewMessages);
        getNotificationCenter().addObserver(this, NotificationCenter.closeChats);
        getNotificationCenter().addObserver(this, NotificationCenter.topicsDidLoaded);
        getNotificationCenter().addObserver(this, NotificationCenter.updateSearchSettings);
        getNotificationCenter().addObserver(this, NotificationCenter.reloadDialogPhotos);
        getNotificationCenter().addObserver(this, NotificationCenter.storiesUpdated);
        getNotificationCenter().addObserver(this, NotificationCenter.storiesReadUpdated);
        getNotificationCenter().addObserver(this, NotificationCenter.userIsPremiumBlockedUpadted);
        getNotificationCenter().addObserver(this, NotificationCenter.currentUserPremiumStatusChanged);
        getNotificationCenter().addObserver(this, NotificationCenter.starBalanceUpdated);
        NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.emojiLoaded);
        NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.plusSettingsChanged);
        updateRowsIds();
        ListAdapter listAdapter = this.listAdapter;
        if (listAdapter != null) {
            listAdapter.notifyDataSetChanged();
        }
        if (((BaseFragment) this).arguments.containsKey("preload_messages")) {
            getMessagesController().ensureMessagesLoaded(this.userId, 0, (MessagesController.MessagesLoadedCallback) null);
        }
        if (this.userId != 0 && UserObject.isUserSelf(getMessagesController().getUser(Long.valueOf(this.userId)))) {
            getConnectionsManager().sendRequest(new TLRPC.TL_account_getPassword(), new RequestDelegate() {
                public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                    ProfileActivity.this.lambda$onFragmentCreate$1(tLObject, tL_error);
                }
            });
        }
        Bulletin.addDelegate(this, new Bulletin.Delegate() {
            public boolean allowLayoutChanges() {
                return Bulletin.Delegate.-CC.$default$allowLayoutChanges(this);
            }

            public boolean clipWithGradient(int i2) {
                return Bulletin.Delegate.-CC.$default$clipWithGradient(this, i2);
            }

            public void onBottomOffsetChange(float f) {
                Bulletin.Delegate.-CC.$default$onBottomOffsetChange(this, f);
            }

            public void onHide(Bulletin bulletin) {
                Bulletin.Delegate.-CC.$default$onHide(this, bulletin);
            }

            public void onShow(Bulletin bulletin) {
                Bulletin.Delegate.-CC.$default$onShow(this, bulletin);
            }

            public int getTopOffset(int tag) {
                return AndroidUtilities.statusBarHeight;
            }

            public int getBottomOffset(int tag) {
                if (ProfileActivity.this.bottomButtonsContainer == null) {
                    return 0;
                }
                return (int) (((AndroidUtilities.dp(72.0f) - ProfileActivity.this.bottomButtonsContainer.getTranslationY()) - (Math.min(1.0f, 1.0f - Math.abs(ProfileActivity.this.sharedMediaLayout.getTabProgress() - 9.0f)) * ProfileActivity.this.bottomButtonContainer[1].getTranslationY())) - (Math.min(1.0f, 1.0f - Math.abs(ProfileActivity.this.sharedMediaLayout.getTabProgress() - 8.0f)) * ProfileActivity.this.bottomButtonContainer[0].getTranslationY()));
            }

            public boolean bottomOffsetAnimated() {
                return ProfileActivity.this.bottomButtonsContainer == null;
            }
        });
        return true;
    }

    public void lambda$onFragmentCreate$0(CountDownLatch countDownLatch) {
        this.currentChat = getMessagesStorage().getChat(this.chatId);
        countDownLatch.countDown();
    }

    public void lambda$onFragmentCreate$1(TLObject tLObject, TLRPC.TL_error tL_error) {
        if (tLObject instanceof TLRPC.TL_account_password) {
            this.currentPassword = (TLRPC.TL_account_password) tLObject;
        }
    }

    public final void updateExceptions() {
        if (this.isTopic || !ChatObject.isForum(this.currentChat)) {
            return;
        }
        getNotificationsController().loadTopicsNotificationsExceptions(-this.chatId, new Consumer() {
            public final void accept(Object obj) {
                ProfileActivity.this.lambda$updateExceptions$2((HashSet) obj);
            }

            public Consumer andThen(Consumer consumer) {
                return Consumer.-CC.$default$andThen(this, consumer);
            }
        });
    }

    public void lambda$updateExceptions$2(HashSet hashSet) {
        ListAdapter listAdapter;
        ArrayList arrayList = new ArrayList(hashSet);
        int i = 0;
        while (i < arrayList.size()) {
            if (getMessagesController().getTopicsController().findTopic(this.chatId, ((Integer) arrayList.get(i)).intValue()) == null) {
                arrayList.remove(i);
                i--;
            }
            i++;
        }
        this.notificationsExceptionTopics.clear();
        this.notificationsExceptionTopics.addAll(arrayList);
        int i2 = this.notificationsRow;
        if (i2 < 0 || (listAdapter = this.listAdapter) == null) {
            return;
        }
        listAdapter.notifyItemChanged(i2);
    }

    public void onFragmentDestroy() {
        super.onFragmentDestroy();
        SharedMediaLayout sharedMediaLayout = this.sharedMediaLayout;
        if (sharedMediaLayout != null) {
            sharedMediaLayout.onDestroy();
        }
        SharedMediaLayout.SharedMediaPreloader sharedMediaPreloader = this.sharedMediaPreloader;
        if (sharedMediaPreloader != null) {
            sharedMediaPreloader.onDestroy(this);
        }
        SharedMediaLayout.SharedMediaPreloader sharedMediaPreloader2 = this.sharedMediaPreloader;
        if (sharedMediaPreloader2 != null) {
            sharedMediaPreloader2.removeDelegate(this);
        }
        getNotificationCenter().removeObserver(this, NotificationCenter.updateInterfaces);
        getNotificationCenter().removeObserver(this, NotificationCenter.closeChats);
        getNotificationCenter().removeObserver(this, NotificationCenter.didReceiveNewMessages);
        getNotificationCenter().removeObserver(this, NotificationCenter.topicsDidLoaded);
        getNotificationCenter().removeObserver(this, NotificationCenter.updateSearchSettings);
        getNotificationCenter().removeObserver(this, NotificationCenter.reloadDialogPhotos);
        getNotificationCenter().removeObserver(this, NotificationCenter.storiesUpdated);
        getNotificationCenter().removeObserver(this, NotificationCenter.storiesReadUpdated);
        getNotificationCenter().removeObserver(this, NotificationCenter.userIsPremiumBlockedUpadted);
        getNotificationCenter().removeObserver(this, NotificationCenter.currentUserPremiumStatusChanged);
        getNotificationCenter().removeObserver(this, NotificationCenter.starBalanceUpdated);
        NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.emojiLoaded);
        ProfileGalleryView profileGalleryView = this.avatarsViewPager;
        if (profileGalleryView != null) {
            profileGalleryView.onDestroy();
        }
        if (this.userId != 0) {
            getNotificationCenter().removeObserver(this, NotificationCenter.newSuggestionsAvailable);
            getNotificationCenter().removeObserver(this, NotificationCenter.contactsDidLoad);
            getNotificationCenter().removeObserver(this, NotificationCenter.encryptedChatCreated);
            getNotificationCenter().removeObserver(this, NotificationCenter.encryptedChatUpdated);
            getNotificationCenter().removeObserver(this, NotificationCenter.blockedUsersDidLoad);
            getNotificationCenter().removeObserver(this, NotificationCenter.botInfoDidLoad);
            getNotificationCenter().removeObserver(this, NotificationCenter.userInfoDidLoad);
            getNotificationCenter().removeObserver(this, NotificationCenter.privacyRulesUpdated);
            NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.reloadInterface);
            getMessagesController().cancelLoadFullUser(this.userId);
        } else if (this.chatId != 0) {
            NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.uploadStoryEnd);
            getNotificationCenter().removeObserver(this, NotificationCenter.chatWasBoostedByUser);
            getNotificationCenter().removeObserver(this, NotificationCenter.chatInfoDidLoad);
            getNotificationCenter().removeObserver(this, NotificationCenter.chatOnlineCountDidLoad);
            getNotificationCenter().removeObserver(this, NotificationCenter.groupCallUpdated);
            getNotificationCenter().removeObserver(this, NotificationCenter.channelRightsUpdated);
        }
        NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.plusSettingsChanged);
        AvatarImageView avatarImageView = this.avatarImage;
        if (avatarImageView != null) {
            avatarImageView.setImageDrawable((Drawable) null);
        }
        ImageUpdater imageUpdater = this.imageUpdater;
        if (imageUpdater != null) {
            imageUpdater.clear();
        }
        PinchToZoomHelper pinchToZoomHelper = this.pinchToZoomHelper;
        if (pinchToZoomHelper != null) {
            pinchToZoomHelper.clear();
        }
        ProfileBirthdayEffect.BirthdayEffectFetcher birthdayEffectFetcher = this.birthdayFetcher;
        if (birthdayEffectFetcher != null && this.createdBirthdayFetcher) {
            birthdayEffectFetcher.detach(true);
            this.birthdayFetcher = null;
        }
        Runnable runnable = this.applyBulletin;
        if (runnable != null) {
            this.applyBulletin = null;
            AndroidUtilities.runOnUIThread(runnable);
        }
    }

    public ActionBar createActionBar(Context context) {
        ChatActivity.ThemeDelegate themeDelegate;
        BaseFragment lastFragment = ((BaseFragment) this).parentLayout.getLastFragment();
        if ((lastFragment instanceof ChatActivity) && (themeDelegate = ((ChatActivity) lastFragment).themeDelegate) != null && themeDelegate.getCurrentTheme() != null) {
            this.resourcesProvider = lastFragment.getResourceProvider();
        }
        ActionBar actionBar = new ActionBar(context, this.resourcesProvider) {
            @Override
            public boolean onTouchEvent(MotionEvent event) {
                ProfileActivity.this.avatarContainer.getHitRect(ProfileActivity.this.rect);
                if (ProfileActivity.this.rect.contains((int) event.getX(), (int) event.getY())) {
                    return false;
                }
                return super.onTouchEvent(event);
            }

            @Override
            public void setItemsColor(int color, boolean isActionMode) {
                super.setItemsColor(color, isActionMode);
                if (isActionMode || ProfileActivity.this.ttlIconView == null) {
                    return;
                }
                ProfileActivity.this.ttlIconView.setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.MULTIPLY));
            }

            @Override
            public void onLayout(boolean changed, int left, int top, int right, int bottom) {
                super.onLayout(changed, left, top, right, bottom);
                ProfileActivity.this.updateStoriesViewBounds(false);
            }
        };
        actionBar.setForceSkipTouches(true);
        actionBar.setBackgroundColor(0);
        actionBar.setItemsBackgroundColor(this.peerColor != null ? 553648127 : getThemedColor(Theme.key_avatar_actionBarSelectorBlue), false);
        actionBar.setItemsColor(Theme.usePlusTheme ? Theme.profileActionbarIconsColor : getThemedColor(Theme.key_actionBarDefaultIcon), false);
        actionBar.setItemsColor(getThemedColor(Theme.key_actionBarDefaultIcon), true);
        actionBar.setBackButtonDrawable(new BackDrawable(false));
        actionBar.setCastShadows(false);
        actionBar.setAddToContainer(false);
        actionBar.setClipContent(true);
        actionBar.setOccupyStatusBar((Build.VERSION.SDK_INT < 21 || AndroidUtilities.isTablet() || ((BaseFragment) this).inBubbleMode) ? false : true);
        final ImageView backButton = actionBar.getBackButton();
        backButton.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public final boolean onLongClick(View view) {
                boolean lambda$createActionBar$4;
                lambda$createActionBar$4 = ProfileActivity.this.lambda$createActionBar$4(backButton, view);
                return lambda$createActionBar$4;
            }
        });
        return actionBar;
    }

    public boolean lambda$createActionBar$4(ImageView imageView, View view) {
        ActionBarPopupWindow show = BackButtonMenu.show(this, imageView, getDialogId(), getTopicId(), this.resourcesProvider);
        if (show == null) {
            return false;
        }
        show.setOnDismissListener(new PopupWindow.OnDismissListener() {
            @Override
            public final void onDismiss() {
                ProfileActivity.this.lambda$createActionBar$3();
            }
        });
        dimBehindView(imageView, 0.3f);
        UndoView undoView = this.undoView;
        if (undoView != null) {
            undoView.hide(true, 1);
        }
        return true;
    }

    public void lambda$createActionBar$3() {
        dimBehindView(false);
    }

    public void setParentLayout(INavigationLayout layout) {
        super.setParentLayout(layout);
        FlagSecureReason flagSecureReason = this.flagSecure;
        if (flagSecureReason != null) {
            flagSecureReason.detach();
            this.flagSecure = null;
        }
        if (layout == null || layout.getParentActivity() == null) {
            return;
        }
        this.flagSecure = new FlagSecureReason(layout.getParentActivity().getWindow(), new FlagSecureReason.FlagSecureCondition() {
            public final boolean run() {
                boolean lambda$setParentLayout$5;
                lambda$setParentLayout$5 = ProfileActivity.this.lambda$setParentLayout$5();
                return lambda$setParentLayout$5;
            }
        });
    }

    public boolean lambda$setParentLayout$5() {
        return this.currentEncryptedChat != null || getMessagesController().isChatNoForwards(this.currentChat);
    }

    public View createView(final Context context) {
        ?? r12;
        ?? r14;
        int i;
        Object obj;
        FrameLayout frameLayout;
        Theme.ResourcesProvider resourcesProvider;
        boolean z;
        float f;
        float f2;
        ChatAvatarContainer avatarContainer;
        TLRPC.UserFull userFull;
        TLRPC.ChatParticipants chatParticipants;
        ChatActivity.ThemeDelegate themeDelegate;
        Theme.createProfileResources(context);
        Theme.createChatResources(context, false);
        final BaseFragment lastFragment = ((BaseFragment) this).parentLayout.getLastFragment();
        if ((lastFragment instanceof ChatActivity) && (themeDelegate = ((ChatActivity) lastFragment).themeDelegate) != null && themeDelegate.getCurrentTheme() != null) {
            this.resourcesProvider = lastFragment.getResourceProvider();
        }
        this.searchTransitionOffset = 0;
        this.searchTransitionProgress = 1.0f;
        this.searchMode = false;
        ((BaseFragment) this).hasOwnBackground = true;
        this.extraHeight = AndroidUtilities.dp(88.0f);
        ((BaseFragment) this).actionBar.setActionBarMenuOnItemClick(new AnonymousClass6());
        SharedMediaLayout sharedMediaLayout = this.sharedMediaLayout;
        if (sharedMediaLayout != null) {
            sharedMediaLayout.onDestroy();
        }
        long j = this.dialogId;
        if (j == 0) {
            j = this.userId;
            if (j == 0) {
                j = -this.chatId;
            }
        }
        final long j2 = j;
        ((BaseFragment) this).fragmentView = new AnonymousClass7(context);
        TLRPC.ChatFull chatFull = this.chatInfo;
        ArrayList<Integer> arrayList = (chatFull == null || (chatParticipants = chatFull.participants) == null || chatParticipants.participants.size() <= 5) ? null : this.sortedUsers;
        SharedMediaLayout.SharedMediaPreloader sharedMediaPreloader = this.sharedMediaPreloader;
        TLRPC.UserFull userFull2 = this.userInfo;
        SharedMediaLayout anonymousClass8 = new AnonymousClass8(context, j2, sharedMediaPreloader, userFull2 != null ? userFull2.common_chats_count : 0, this.sortedUsers, this.chatInfo, userFull2, this.openSimilar ? 10 : arrayList != null ? 7 : -1, this, this, 1, this.resourcesProvider);
        this.sharedMediaLayout = anonymousClass8;
        anonymousClass8.setLayoutParams(new RecyclerView.LayoutParams(-1, -1));
        ActionBarMenu createMenu = ((BaseFragment) this).actionBar.createMenu();
        if (this.userId != getUserConfig().clientUserId || this.myProfile) {
            r12 = 0;
        } else {
            ActionBarMenuItem addItem = createMenu.addItem(37, R.drawable.msg_qr_mini, getResourceProvider());
            this.qrItem = addItem;
            addItem.setContentDescription(LocaleController.getString("GetQRCode", R.string.GetQRCode));
            r12 = 0;
            r12 = 0;
            updateQrItemVisibility(false);
            if (ContactsController.getInstance(((BaseFragment) this).currentAccount).getPrivacyRules(7) == null) {
                ContactsController.getInstance(((BaseFragment) this).currentAccount).loadPrivacySettings();
            }
        }
        if (this.imageUpdater == null || this.myProfile) {
            r14 = 1;
        } else {
            r14 = 1;
            r14 = 1;
            ActionBarMenuItem actionBarMenuItemSearchListener = createMenu.addItem(32, R.drawable.ic_ab_search).setIsSearchField(true).setActionBarMenuItemSearchListener(new ActionBarMenuItem.ActionBarMenuItemSearchListener() {
                @Override
                public Animator getCustomToggleTransition() {
                    ProfileActivity.this.searchMode = !r0.searchMode;
                    if (!ProfileActivity.this.searchMode) {
                        ProfileActivity.this.searchItem.clearFocusOnSearchView();
                    }
                    if (ProfileActivity.this.searchMode) {
                        ProfileActivity.this.searchItem.getSearchField().setText("");
                    }
                    ProfileActivity profileActivity = ProfileActivity.this;
                    return profileActivity.searchExpandTransition(profileActivity.searchMode);
                }

                @Override
                public void onTextChanged(EditText editText) {
                    ProfileActivity.this.searchAdapter.search(editText.getText().toString().toLowerCase());
                }
            });
            this.searchItem = actionBarMenuItemSearchListener;
            int i2 = R.string.SearchInSettings;
            actionBarMenuItemSearchListener.setContentDescription(LocaleController.getString("SearchInSettings", i2));
            this.searchItem.setSearchFieldHint(LocaleController.getString("SearchInSettings", i2));
            this.sharedMediaLayout.getSearchItem().setVisibility(8);
            if (this.sharedMediaLayout.getSearchOptionsItem() != null) {
                this.sharedMediaLayout.getSearchOptionsItem().setVisibility(8);
            }
            if (this.expandPhoto) {
                this.searchItem.setVisibility(8);
            }
        }
        ActionBarMenuItem addItemWithWidth = createMenu.addItemWithWidth(96, R.drawable.actions_permissions, AndroidUtilities.dp(40.0f));
        this.permissionsItem = addItemWithWidth;
        addItemWithWidth.setVisibility(this.settingsSectionRow > -1 ? 8 : 0);
        ActionBarMenuItem addItemWithWidth2 = createMenu.addItemWithWidth(95, R.drawable.actions_removed, AndroidUtilities.dp(40.0f));
        this.removedUsersItem = addItemWithWidth2;
        addItemWithWidth2.setVisibility(8);
        this.adminsItem = createMenu.addItemWithWidth(97, R.drawable.actions_addadmin, AndroidUtilities.dp(40.0f));
        ActionBarMenuItem addItemWithWidth3 = createMenu.addItemWithWidth(98, R.drawable.group_log, AndroidUtilities.dp(40.0f));
        this.recentActionsItem = addItemWithWidth3;
        addItemWithWidth3.setVisibility(8);
        ActionBarMenuItem addItemWithWidth4 = createMenu.addItemWithWidth(93, R.drawable.actions_viewmembers, AndroidUtilities.dp(40.0f));
        this.membersItem = addItemWithWidth4;
        addItemWithWidth4.setVisibility(8);
        ActionBarMenuItem addItem2 = createMenu.addItem(16, R.drawable.profile_video);
        this.videoCallItem = addItem2;
        addItem2.setContentDescription(LocaleController.getString("VideoCall", R.string.VideoCall));
        if (this.chatId != 0) {
            this.callItem = createMenu.addItem(15, R.drawable.msg_voicechat2);
            if (ChatObject.isChannelOrGiga(this.currentChat)) {
                this.callItem.setContentDescription(LocaleController.getString("VoipChannelVoiceChat", R.string.VoipChannelVoiceChat));
            } else {
                this.callItem.setContentDescription(LocaleController.getString("VoipGroupVoiceChat", R.string.VoipGroupVoiceChat));
            }
        } else {
            ActionBarMenuItem addItem3 = createMenu.addItem(15, R.drawable.ic_call);
            this.callItem = addItem3;
            addItem3.setContentDescription(LocaleController.getString("Call", R.string.Call));
        }
        if (this.myProfile) {
            ActionBarMenuItem addItem4 = createMenu.addItem(41, R.drawable.group_edit_profile);
            this.editItem = addItem4;
            addItem4.setContentDescription(LocaleController.getString("Edit", R.string.Edit));
        } else {
            ActionBarMenuItem addItem5 = createMenu.addItem(12, R.drawable.group_edit_profile);
            this.editItem = addItem5;
            addItem5.setContentDescription(LocaleController.getString("Edit", R.string.Edit));
        }
        this.otherItem = createMenu.addItem(10, R.drawable.ic_ab_other, this.resourcesProvider);
        ImageView imageView = new ImageView(context);
        this.ttlIconView = imageView;
        imageView.setColorFilter(new PorterDuffColorFilter(getThemedColor(Theme.key_actionBarDefaultIcon), PorterDuff.Mode.MULTIPLY));
        AndroidUtilities.updateViewVisibilityAnimated(this.ttlIconView, (boolean) r12, 0.8f, (boolean) r12);
        this.ttlIconView.setImageResource(R.drawable.msg_mini_autodelete_timer);
        this.otherItem.addView(this.ttlIconView, LayoutHelper.createFrame(12, 12.0f, 19, 8.0f, 2.0f, 0.0f, 0.0f));
        this.otherItem.setContentDescription(LocaleController.getString("AccDescrMoreOptions", R.string.AccDescrMoreOptions));
        if (!Theme.plusShowRecentActionsInChat) {
            this.otherItem.addSubItem(98, LocaleController.getString("EventLog", R.string.EventLog));
        }
        if (this.listView == null || this.imageUpdater == null) {
            i = -1;
            obj = null;
        } else {
            int findFirstVisibleItemPosition = this.layoutManager.findFirstVisibleItemPosition();
            View findViewByPosition = this.layoutManager.findViewByPosition(findFirstVisibleItemPosition);
            if (findViewByPosition != null) {
                findViewByPosition.getTop();
                this.listView.getPaddingTop();
            } else {
                findFirstVisibleItemPosition = -1;
            }
            i = findFirstVisibleItemPosition;
            obj = this.writeButton.getTag();
        }
        createActionBarMenu(r12);
        this.listAdapter = new ListAdapter(context);
        this.searchAdapter = new SearchAdapter(context);
        AvatarDrawable avatarDrawable = new AvatarDrawable();
        this.avatarDrawable = avatarDrawable;
        avatarDrawable.setProfile((boolean) r14);
        ((BaseFragment) this).fragmentView.setWillNotDraw(r12);
        Object obj2 = ((BaseFragment) this).fragmentView;
        NestedFrameLayout nestedFrameLayout = (NestedFrameLayout) obj2;
        this.contentView = nestedFrameLayout;
        ((SizeNotifierFrameLayout) nestedFrameLayout).needBlur = r14;
        FrameLayout frameLayout2 = (FrameLayout) obj2;
        ClippedListView clippedListView = new ClippedListView(context) {
            public VelocityTracker velocityTracker;

            public boolean hasOverlappingRendering() {
                return false;
            }

            public void requestChildOnScreen(View child, View focused) {
            }

            public boolean canHighlightChildAt(View child, float x, float y) {
                return !(child instanceof AboutLinkCell);
            }

            public boolean allowSelectChildAtPosition(View child) {
                return child != ProfileActivity.this.sharedMediaLayout;
            }

            public void invalidate() {
                super/*android.view.ViewGroup*/.invalidate();
                View view = ((BaseFragment) ProfileActivity.this).fragmentView;
                if (view != null) {
                    view.invalidate();
                }
            }

            public boolean onInterceptTouchEvent(MotionEvent e) {
                if (ProfileActivity.this.sharedMediaLayout.canEditStories() && ProfileActivity.this.sharedMediaLayout != null && ProfileActivity.this.sharedMediaLayout.isActionModeShown() && ProfileActivity.this.sharedMediaLayout.getClosestTab() == 8) {
                    return false;
                }
                return super.onInterceptTouchEvent(e);
            }

            public boolean onTouchEvent(MotionEvent e) {
                VelocityTracker velocityTracker;
                View findViewByPosition2;
                int action = e.getAction();
                if (action == 0) {
                    VelocityTracker velocityTracker2 = this.velocityTracker;
                    if (velocityTracker2 == null) {
                        this.velocityTracker = VelocityTracker.obtain();
                    } else {
                        velocityTracker2.clear();
                    }
                    this.velocityTracker.addMovement(e);
                } else if (action == 2) {
                    VelocityTracker velocityTracker3 = this.velocityTracker;
                    if (velocityTracker3 != null) {
                        velocityTracker3.addMovement(e);
                        this.velocityTracker.computeCurrentVelocity(1000);
                        ProfileActivity.this.listViewVelocityY = this.velocityTracker.getYVelocity(e.getPointerId(e.getActionIndex()));
                    }
                } else if ((action == 1 || action == 3) && (velocityTracker = this.velocityTracker) != null) {
                    velocityTracker.recycle();
                    this.velocityTracker = null;
                }
                boolean onTouchEvent = super.onTouchEvent(e);
                if ((action == 1 || action == 3) && ProfileActivity.this.allowPullingDown && (findViewByPosition2 = ProfileActivity.this.layoutManager.findViewByPosition(0)) != null) {
                    if (ProfileActivity.this.isPulledDown) {
                        ProfileActivity.this.listView.smoothScrollBy(0, (findViewByPosition2.getTop() - ProfileActivity.this.listView.getMeasuredWidth()) + ActionBar.getCurrentActionBarHeight() + (((BaseFragment) ProfileActivity.this).actionBar.getOccupyStatusBar() ? AndroidUtilities.statusBarHeight : 0), CubicBezierInterpolator.EASE_OUT_QUINT);
                    } else {
                        ProfileActivity.this.listView.smoothScrollBy(0, findViewByPosition2.getTop() - AndroidUtilities.dp(88.0f), CubicBezierInterpolator.EASE_OUT_QUINT);
                    }
                }
                return onTouchEvent;
            }

            public boolean drawChild(Canvas canvas, View child, long drawingTime) {
                if (getItemAnimator().isRunning() && child.getBackground() == null && child.getTranslationY() != 0.0f) {
                    boolean z2 = ProfileActivity.this.listView.getChildAdapterPosition(child) == ProfileActivity.this.sharedMediaRow && child.getAlpha() != 1.0f;
                    if (z2) {
                        ProfileActivity.this.whitePaint.setAlpha((int) (ProfileActivity.this.listView.getAlpha() * 255.0f * child.getAlpha()));
                    }
                    canvas.drawRect(ProfileActivity.this.listView.getX(), child.getY(), ProfileActivity.this.listView.getX() + ProfileActivity.this.listView.getMeasuredWidth(), child.getY() + child.getHeight(), ProfileActivity.this.whitePaint);
                    if (z2) {
                        ProfileActivity.this.whitePaint.setAlpha((int) (ProfileActivity.this.listView.getAlpha() * 255.0f));
                    }
                }
                return super/*androidx.recyclerview.widget.RecyclerView*/.drawChild(canvas, child, drawingTime);
            }

            public void dispatchDraw(Canvas canvas) {
                if (ProfileActivity.this.bizHoursRow >= 0 && ProfileActivity.this.infoStartRow >= 0 && ProfileActivity.this.infoEndRow >= 0) {
                    drawSectionBackground(canvas, ProfileActivity.this.infoStartRow, ProfileActivity.this.infoEndRow, getThemedColor(Theme.key_windowBackgroundWhite));
                }
                super.dispatchDraw(canvas);
            }

            public void onLayout(boolean changed, int l, int t, int r, int b) {
                super.onLayout(changed, l, t, r, b);
                ProfileActivity.this.updateBottomButtonY();
            }
        };
        this.listView = clippedListView;
        clippedListView.setVerticalScrollBarEnabled((boolean) r12);
        AnonymousClass11 anonymousClass11 = new AnonymousClass11();
        this.listView.setItemAnimator(anonymousClass11);
        anonymousClass11.setMoveDelay(0L);
        anonymousClass11.setMoveDuration(320L);
        anonymousClass11.setRemoveDuration(320L);
        anonymousClass11.setAddDuration(320L);
        anonymousClass11.setSupportsChangeAnimations((boolean) r12);
        anonymousClass11.setDelayAnimations((boolean) r12);
        anonymousClass11.setInterpolator(CubicBezierInterpolator.EASE_OUT_QUINT);
        this.listView.setClipToPadding((boolean) r12);
        this.listView.setHideIfEmpty((boolean) r12);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context) {
            public boolean supportsPredictiveItemAnimations() {
                return ProfileActivity.this.imageUpdater != null;
            }

            public int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler, RecyclerView.State state) {
                View findViewByPosition2 = ProfileActivity.this.layoutManager.findViewByPosition(0);
                if (findViewByPosition2 != null && !ProfileActivity.this.openingAvatar) {
                    int top = findViewByPosition2.getTop() - AndroidUtilities.dp(88.0f);
                    if (!ProfileActivity.this.allowPullingDown && top > dy) {
                        if (ProfileActivity.this.avatarsViewPager.hasImages() && ProfileActivity.this.avatarImage.getImageReceiver().hasNotThumb() && !AndroidUtilities.isAccessibilityScreenReaderEnabled() && !ProfileActivity.this.isInLandscapeMode && !AndroidUtilities.isTablet()) {
                            ProfileActivity profileActivity = ProfileActivity.this;
                            profileActivity.allowPullingDown = profileActivity.avatarBig == null;
                        }
                    } else if (ProfileActivity.this.allowPullingDown) {
                        if (dy >= top) {
                            ProfileActivity.this.allowPullingDown = false;
                        } else if (ProfileActivity.this.listView.getScrollState() == 1 && !ProfileActivity.this.isPulledDown) {
                            dy /= 2;
                        }
                    }
                    dy = top;
                }
                return super.scrollVerticallyBy(dy, recycler, state);
            }
        };
        this.layoutManager = linearLayoutManager;
        linearLayoutManager.setOrientation((int) r14);
        LinearLayoutManager linearLayoutManager2 = this.layoutManager;
        linearLayoutManager2.mIgnoreTopPadding = r12;
        this.listView.setLayoutManager(linearLayoutManager2);
        this.listView.setGlowColor((int) r12);
        this.listView.setAdapter(this.listAdapter);
        frameLayout2.addView(this.listView, LayoutHelper.createFrame(-1, -1, 51));
        this.listView.setOnItemClickListener(new RecyclerListView.OnItemClickListenerExtended() {
            public boolean hasDoubleTap(View view, int i3) {
                return RecyclerListView.OnItemClickListenerExtended.-CC.$default$hasDoubleTap(this, view, i3);
            }

            public void onDoubleTap(View view, int i3, float f3, float f4) {
                RecyclerListView.OnItemClickListenerExtended.-CC.$default$onDoubleTap(this, view, i3, f3, f4);
            }

            public final void onItemClick(View view, int i3, float f3, float f4) {
                ProfileActivity.this.lambda$createView$10(j2, context, lastFragment, view, i3, f3, f4);
            }
        });
        this.listView.setOnItemLongClickListener(new AnonymousClass17(context));
        if (this.openSimilar) {
            updateRowsIds();
            scrollToSharedMedia();
            this.savedScrollToSharedMedia = r14;
            this.savedScrollPosition = this.sharedMediaRow;
            this.savedScrollOffset = r12;
        }
        if (this.searchItem != null) {
            RecyclerListView recyclerListView = new RecyclerListView(context);
            this.searchListView = recyclerListView;
            recyclerListView.setVerticalScrollBarEnabled((boolean) r12);
            this.searchListView.setLayoutManager(new LinearLayoutManager(context, (int) r14, (boolean) r12));
            this.searchListView.setGlowColor(getThemedColor(Theme.key_avatar_backgroundActionBarBlue));
            this.searchListView.setAdapter(this.searchAdapter);
            resourcesProvider = null;
            this.searchListView.setItemAnimator((RecyclerView.ItemAnimator) null);
            this.searchListView.setVisibility(8);
            this.searchListView.setLayoutAnimation(null);
            this.searchListView.setBackgroundColor(getThemedColor(Theme.key_windowBackgroundWhite));
            FrameLayout frameLayout3 = frameLayout2;
            frameLayout3.addView(this.searchListView, LayoutHelper.createFrame(-1, -1, 51));
            this.searchListView.setOnItemClickListener(new RecyclerListView.OnItemClickListener() {
                public final void onItemClick(View view, int i3) {
                    ProfileActivity.this.lambda$createView$11(view, i3);
                }
            });
            this.searchListView.setOnItemLongClickListener(new RecyclerListView.OnItemLongClickListener() {
                public final boolean onItemClick(View view, int i3) {
                    boolean lambda$createView$13;
                    lambda$createView$13 = ProfileActivity.this.lambda$createView$13(view, i3);
                    return lambda$createView$13;
                }
            });
            this.searchListView.setOnScrollListener(new RecyclerView.OnScrollListener() {
                public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
                    if (newState == 1) {
                        AndroidUtilities.hideKeyboard(ProfileActivity.this.getParentActivity().getCurrentFocus());
                    }
                }
            });
            this.searchListView.setAnimateEmptyView((boolean) r14, (int) r14);
            StickerEmptyView stickerEmptyView = new StickerEmptyView(context, (View) null, (int) r14);
            this.emptyView = stickerEmptyView;
            stickerEmptyView.setAnimateLayoutChange((boolean) r14);
            this.emptyView.subtitle.setVisibility(8);
            this.emptyView.setVisibility(8);
            frameLayout3.addView(this.emptyView);
            this.searchAdapter.loadFaqWebPage();
            frameLayout = frameLayout3;
        } else {
            frameLayout = frameLayout2;
            resourcesProvider = null;
        }
        if (this.banFromGroup != 0) {
            final TLRPC.Chat chat = getMessagesController().getChat(Long.valueOf(this.banFromGroup));
            if (this.currentChannelParticipant == null) {
                TLRPC.TL_channels_getParticipant tL_channels_getParticipant = new TLRPC.TL_channels_getParticipant();
                tL_channels_getParticipant.channel = MessagesController.getInputChannel(chat);
                tL_channels_getParticipant.participant = getMessagesController().getInputPeer(this.userId);
                getConnectionsManager().sendRequest(tL_channels_getParticipant, new RequestDelegate() {
                    public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                        ProfileActivity.this.lambda$createView$15(tLObject, tL_error);
                    }
                });
            }
            FrameLayout frameLayout4 = new FrameLayout(this, context) {
                @Override
                public void onDraw(Canvas canvas) {
                    int intrinsicHeight = Theme.chat_composeShadowDrawable.getIntrinsicHeight();
                    Theme.chat_composeShadowDrawable.setBounds(0, 0, getMeasuredWidth(), intrinsicHeight);
                    Theme.chat_composeShadowDrawable.draw(canvas);
                    canvas.drawRect(0.0f, intrinsicHeight, getMeasuredWidth(), getMeasuredHeight(), Theme.chat_composeBackgroundPaint);
                }
            };
            frameLayout4.setWillNotDraw(r12);
            frameLayout.addView(frameLayout4, LayoutHelper.createFrame(-1, 51, 83));
            frameLayout4.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    ProfileActivity.this.lambda$createView$16(chat, view);
                }
            });
            TextView textView = new TextView(context);
            textView.setTextColor(getThemedColor(Theme.key_text_RedRegular));
            textView.setTextSize(r14, 15.0f);
            textView.setGravity(17);
            textView.setTypeface(AndroidUtilities.bold());
            textView.setText(LocaleController.getString("BanFromTheGroup", R.string.BanFromTheGroup));
            frameLayout4.addView(textView, LayoutHelper.createFrame(-2, -2.0f, 17, 0.0f, 1.0f, 0.0f, 0.0f));
            this.listView.setPadding(r12, AndroidUtilities.dp(88.0f), r12, AndroidUtilities.dp(48.0f));
            this.listView.setBottomGlowOffset(AndroidUtilities.dp(48.0f));
        } else {
            this.listView.setPadding(r12, AndroidUtilities.dp(88.0f), r12, r12);
        }
        TopView topView = new TopView(context);
        this.topView = topView;
        topView.setBackgroundColorId(this.peerColor, r12);
        this.topView.setBackgroundColor(Theme.usePlusTheme ? Theme.profileActionbarColor : getThemedColor(Theme.key_avatar_backgroundActionBarBlue));
        frameLayout.addView(this.topView);
        ((SizeNotifierFrameLayout) this.contentView).blurBehindViews.add(this.topView);
        DrawerProfileCell.AnimatedStatusView animatedStatusView = new DrawerProfileCell.AnimatedStatusView(context, 20, 60);
        this.animatedStatusView = animatedStatusView;
        animatedStatusView.setPivotX(AndroidUtilities.dp(30.0f));
        this.animatedStatusView.setPivotY(AndroidUtilities.dp(30.0f));
        this.avatarContainer = new FrameLayout(context);
        this.avatarContainer2 = new AnonymousClass21(context);
        ImageReceiver imageReceiver = new ImageReceiver(this.avatarContainer2);
        this.fallbackImage = imageReceiver;
        imageReceiver.setRoundRadius(AndroidUtilities.dp(11.0f));
        AndroidUtilities.updateViewVisibilityAnimated(this.avatarContainer2, (boolean) r14, 1.0f, (boolean) r12);
        frameLayout.addView(this.avatarContainer2, LayoutHelper.createFrame(-1, -1.0f, 8388611, 0.0f, 0.0f, 0.0f, 0.0f));
        this.avatarContainer.setPivotX(0.0f);
        this.avatarContainer.setPivotY(0.0f);
        this.avatarContainer2.addView(this.avatarContainer, LayoutHelper.createFrame(42, 42.0f, 51, 64.0f, 0.0f, 0.0f, 0.0f));
        AvatarImageView avatarImageView = new AvatarImageView(this, context) {
            public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
                super/*android.view.View*/.onInitializeAccessibilityNodeInfo(info);
                if (getImageReceiver().hasNotThumb()) {
                    info.setText(LocaleController.getString("AccDescrProfilePicture", R.string.AccDescrProfilePicture));
                    if (Build.VERSION.SDK_INT >= 21) {
                        info.addAction(new AccessibilityNodeInfo.AccessibilityAction(16, LocaleController.getString("Open", R.string.Open)));
                        info.addAction(new AccessibilityNodeInfo.AccessibilityAction(32, LocaleController.getString("AccDescrOpenInPhotoViewer", R.string.AccDescrOpenInPhotoViewer)));
                        return;
                    }
                    return;
                }
                info.setVisibleToUser(false);
            }

            public void dispatchDraw(Canvas canvas) {
                super/*android.view.View*/.dispatchDraw(canvas);
                AnimatedEmojiDrawable animatedEmojiDrawable = ((BackupImageView) this).animatedEmojiDrawable;
                if (animatedEmojiDrawable == null || animatedEmojiDrawable.getImageReceiver() == null) {
                    return;
                }
                ((BackupImageView) this).animatedEmojiDrawable.getImageReceiver().startAnimation();
            }
        };
        this.avatarImage = avatarImageView;
        avatarImageView.getImageReceiver().setAllowDecodeSingleFrame((boolean) r14);
        this.avatarImage.setRoundRadius(getSmallAvatarRoundRadius());
        this.avatarImage.setPivotX(0.0f);
        this.avatarImage.setPivotY(0.0f);
        this.avatarContainer.addView((View) this.avatarImage, LayoutHelper.createFrame(-1, -1.0f));
        this.avatarImage.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ProfileActivity.this.lambda$createView$18(view);
            }
        });
        this.avatarImage.setHasStories(needInsetForStories());
        this.avatarImage.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public final boolean onLongClick(View view) {
                boolean lambda$createView$19;
                lambda$createView$19 = ProfileActivity.this.lambda$createView$19(view);
                return lambda$createView$19;
            }
        });
        RadialProgressView radialProgressView = new RadialProgressView(context) {
            public Paint paint;

            {
                Paint paint = new Paint(1);
                this.paint = paint;
                paint.setColor(1426063360);
            }

            public void onDraw(Canvas canvas) {
                if (ProfileActivity.this.avatarImage != null && ProfileActivity.this.avatarImage.getImageReceiver().hasNotThumb()) {
                    this.paint.setAlpha((int) (ProfileActivity.this.avatarImage.getImageReceiver().getCurrentAlpha() * 85.0f));
                    canvas.drawCircle(getMeasuredWidth() / 2.0f, getMeasuredHeight() / 2.0f, getMeasuredWidth() / 2.0f, this.paint);
                }
                super.onDraw(canvas);
            }
        };
        this.avatarProgressView = radialProgressView;
        radialProgressView.setSize(AndroidUtilities.dp(26.0f));
        this.avatarProgressView.setProgressColor(-1);
        this.avatarProgressView.setNoProgress((boolean) r12);
        this.avatarContainer.addView((View) this.avatarProgressView, (ViewGroup.LayoutParams) LayoutHelper.createFrame(-1, -1.0f));
        ImageView imageView2 = new ImageView(context);
        this.timeItem = imageView2;
        imageView2.setPadding(AndroidUtilities.dp(10.0f), AndroidUtilities.dp(10.0f), AndroidUtilities.dp(5.0f), AndroidUtilities.dp(5.0f));
        this.timeItem.setScaleType(ImageView.ScaleType.CENTER);
        this.timeItem.setAlpha(0.0f);
        ImageView imageView3 = this.timeItem;
        TimerDrawable timerDrawable = new TimerDrawable(context, resourcesProvider);
        this.timerDrawable = timerDrawable;
        imageView3.setImageDrawable(timerDrawable);
        this.timeItem.setTranslationY(-1.0f);
        frameLayout.addView(this.timeItem, LayoutHelper.createFrame(34, 34, 51));
        showAvatarProgress(r12, r12);
        ProfileGalleryView profileGalleryView = this.avatarsViewPager;
        if (profileGalleryView != null) {
            profileGalleryView.onDestroy();
        }
        this.overlaysView = new OverlaysView(context);
        long j3 = this.userId;
        if (j3 == 0) {
            j3 = -this.chatId;
        }
        int i3 = i;
        FrameLayout frameLayout5 = frameLayout;
        this.avatarsViewPager = new ProfileGalleryView(context, j3, ((BaseFragment) this).actionBar, this.listView, this.avatarImage, getClassGuid(), this.overlaysView) {
            public void setCustomAvatarProgress(float progress) {
                ProfileActivity.this.customAvatarProgress = progress;
                ProfileActivity.this.checkPhotoDescriptionAlpha();
            }
        };
        if (this.userId != getUserConfig().clientUserId && (userFull = this.userInfo) != null) {
            this.customAvatarProgress = userFull.profile_photo == null ? 0.0f : 1.0f;
        }
        if (!this.isTopic) {
            this.avatarsViewPager.setChatInfo(this.chatInfo);
        }
        this.avatarContainer2.addView(this.avatarsViewPager);
        this.avatarContainer2.addView(this.overlaysView);
        this.avatarImage.setAvatarsViewPager(this.avatarsViewPager);
        PagerIndicatorView pagerIndicatorView = new PagerIndicatorView(context);
        this.avatarsViewPagerIndicatorView = pagerIndicatorView;
        this.avatarContainer2.addView(pagerIndicatorView, LayoutHelper.createFrame(-1, -1.0f));
        frameLayout5.addView(((BaseFragment) this).actionBar);
        float f3 = 54 + ((!this.callItemVisible || this.userId == 0) ? 0 : 54);
        INavigationLayout iNavigationLayout = ((BaseFragment) this).parentLayout;
        if (iNavigationLayout == null || !(iNavigationLayout.getLastFragment() instanceof ChatActivity) || (avatarContainer = ((ChatActivity) ((BaseFragment) this).parentLayout.getLastFragment()).getAvatarContainer()) == null) {
            z = false;
        } else {
            z = avatarContainer.getTitleTextView().getPaddingRight() != 0;
            if (avatarContainer.getLayoutParams() != null && avatarContainer.getTitleTextView() != null) {
                f3 = (((ViewGroup.MarginLayoutParams) avatarContainer.getLayoutParams()).rightMargin + (avatarContainer.getWidth() - avatarContainer.getTitleTextView().getRight())) / AndroidUtilities.density;
            }
        }
        View.OnClickListener onClickListener = new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ProfileActivity.this.lambda$createView$20(view);
            }
        };
        int i4 = 0;
        while (true) {
            SimpleTextView[] simpleTextViewArr = this.nameTextView;
            if (i4 >= simpleTextViewArr.length) {
                break;
            }
            if (this.playProfileAnimation != 0 || i4 != 0) {
                simpleTextViewArr[i4] = new SimpleTextView(context) {
                    @Override
                    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
                        super.onInitializeAccessibilityNodeInfo(info);
                        if (isFocusable()) {
                            if (ProfileActivity.this.nameTextViewRightDrawableContentDescription == null && ProfileActivity.this.nameTextViewRightDrawable2ContentDescription == null) {
                                return;
                            }
                            StringBuilder sb = new StringBuilder(getText());
                            if (ProfileActivity.this.nameTextViewRightDrawable2ContentDescription != null) {
                                if (sb.length() > 0) {
                                    sb.append(", ");
                                }
                                sb.append(ProfileActivity.this.nameTextViewRightDrawable2ContentDescription);
                            }
                            if (ProfileActivity.this.nameTextViewRightDrawableContentDescription != null) {
                                if (sb.length() > 0) {
                                    sb.append(", ");
                                }
                                sb.append(ProfileActivity.this.nameTextViewRightDrawableContentDescription);
                            }
                            info.setText(sb);
                        }
                    }
                };
                if (i4 == 1) {
                    this.nameTextView[i4].setTextColor(Theme.usePlusTheme ? Theme.profileActionbarNameColor : getThemedColor(Theme.key_profile_title));
                } else {
                    this.nameTextView[i4].setTextColor(Theme.usePlusTheme ? Theme.profileActionbarNameColor : getThemedColor(Theme.key_actionBarDefaultTitle));
                }
                this.nameTextView[i4].setPadding(0, AndroidUtilities.dp(6.0f), 0, AndroidUtilities.dp(i4 == 0 ? 12.0f : 4.0f));
                this.nameTextView[i4].setTextSize(Theme.profileActionbarNameSize);
                this.nameTextView[i4].setGravity(3);
                this.nameTextView[i4].setTypeface(AndroidUtilities.bold());
                this.nameTextView[i4].setLeftDrawableTopPadding(-AndroidUtilities.dp(1.3f));
                this.nameTextView[i4].setPivotX(0.0f);
                this.nameTextView[i4].setPivotY(0.0f);
                this.nameTextView[i4].setAlpha(i4 == 0 ? 0.0f : 1.0f);
                if (i4 == 1) {
                    this.nameTextView[i4].setScrollNonFitText(true);
                    this.nameTextView[i4].setImportantForAccessibility(2);
                }
                this.nameTextView[i4].setFocusable(i4 == 0);
                this.nameTextView[i4].setEllipsizeByGradient(true);
                this.nameTextView[i4].setRightDrawableOutside(i4 == 0);
                if (this.userId > 0 && UserObject.isUserSelf(getMessagesController().getUser(Long.valueOf(this.userId)))) {
                    this.nameTextView[i4].setOnClickListener(onClickListener);
                }
                this.avatarContainer2.addView(this.nameTextView[i4], LayoutHelper.createFrame(-2, -2.0f, 51, 118.0f, -6.0f, i4 == 0 ? f3 - (z ? 10 : 0) : 0.0f, 0.0f));
            }
            i4++;
        }
        int i5 = 0;
        while (true) {
            SimpleTextView[] simpleTextViewArr2 = this.onlineTextView;
            if (i5 >= simpleTextViewArr2.length) {
                break;
            }
            if (i5 == 1) {
                simpleTextViewArr2[i5] = new LinkSpanDrawable.ClickableSmallTextView(context) {
                    public void setAlpha(float alpha) {
                        super/*android.view.View*/.setAlpha(alpha);
                        ProfileActivity.this.checkPhotoDescriptionAlpha();
                    }

                    public void setTranslationY(float translationY) {
                        super/*android.view.View*/.setTranslationY(translationY);
                        ProfileActivity.this.onlineTextView[2].setTranslationY(translationY);
                        ProfileActivity.this.onlineTextView[3].setTranslationY(translationY);
                    }

                    public void setTranslationX(float translationX) {
                        super/*android.view.View*/.setTranslationX(translationX);
                        ProfileActivity.this.onlineTextView[2].setTranslationX(translationX);
                        ProfileActivity.this.onlineTextView[3].setTranslationX(translationX);
                    }

                    public void setTextColor(int color) {
                        super/*org.telegram.ui.ActionBar.SimpleTextView*/.setTextColor(color);
                        if (ProfileActivity.this.onlineTextView[2] != null) {
                            ProfileActivity.this.onlineTextView[2].setTextColor(color);
                            ProfileActivity.this.onlineTextView[3].setTextColor(color);
                        }
                        if (ProfileActivity.this.showStatusButton != null) {
                            ProfileActivity.this.showStatusButton.setTextColor(Theme.multAlpha(Theme.adaptHSV(color, -0.02f, 0.15f), 1.4f));
                        }
                    }
                };
            } else {
                simpleTextViewArr2[i5] = new LinkSpanDrawable.ClickableSmallTextView(context);
            }
            this.onlineTextView[i5].setEllipsizeByGradient(true);
            this.onlineTextView[i5].setTextColor(applyPeerColor(getThemedColor(Theme.key_avatar_subtitleInProfileBlue), true));
            this.onlineTextView[i5].setTextSize(Theme.profileActionbarStatusSize);
            this.onlineTextView[i5].setGravity(3);
            this.onlineTextView[i5].setAlpha(i5 == 0 ? 0.0f : 1.0f);
            if (i5 == 1 || i5 == 2 || i5 == 3) {
                this.onlineTextView[i5].setPadding(AndroidUtilities.dp(f), AndroidUtilities.dp(2.0f), AndroidUtilities.dp(f), AndroidUtilities.dp(2.0f));
            }
            if (i5 > 0) {
                this.onlineTextView[i5].setImportantForAccessibility(2);
            }
            this.onlineTextView[i5].setFocusable(i5 == 0);
            this.avatarContainer2.addView(this.onlineTextView[i5], LayoutHelper.createFrame(-2, -2.0f, 51, 118 - ((i5 == 1 || i5 == 2 || i5 == 3) ? 4 : 0), (i5 == 1 || i5 == 2 || i5 == 3) ? -2 : 0, (i5 == 0 ? f3 - (z ? 10 : 0) : 8.0f) - ((i5 == 1 || i5 == 2 || i5 == 3) ? 4 : 0), 0.0f));
            i5++;
            f = 4.0f;
        }
        checkPhotoDescriptionAlpha();
        this.avatarContainer2.addView(this.animatedStatusView);
        AudioPlayerAlert.ClippingTextViewSwitcher clippingTextViewSwitcher = new AudioPlayerAlert.ClippingTextViewSwitcher(context) {
            public TextView createTextView() {
                TextView textView2 = new TextView(context);
                textView2.setTextColor(ProfileActivity.this.getThemedColor(Theme.key_player_actionBarSubtitle));
                textView2.setTextSize(0, AndroidUtilities.dp(14.0f));
                textView2.setSingleLine(true);
                textView2.setEllipsize(TextUtils.TruncateAt.END);
                textView2.setGravity(3);
                return textView2;
            }
        };
        this.mediaCounterTextView = clippingTextViewSwitcher;
        clippingTextViewSwitcher.setAlpha(0.0f);
        this.avatarContainer2.addView((View) this.mediaCounterTextView, (ViewGroup.LayoutParams) LayoutHelper.createFrame(-2, -2.0f, 51, 118.33f, -2.0f, 8.0f, 0.0f));
        this.storyView = new ProfileStoriesView(context, ((BaseFragment) this).currentAccount, getDialogId(), this.isTopic, this.avatarContainer, this.avatarImage, this.resourcesProvider) {
            public void onTap(StoryViewer.PlaceProvider provider) {
                TLRPC.UserProfilePhoto userProfilePhoto;
                if (!ProfileActivity.this.isPulledDown && PlusSettings.openProfilePicsInsteadOfStories && ProfileActivity.this.userId != 0 && (userProfilePhoto = ProfileActivity.this.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.userId)).photo) != null && userProfilePhoto.photo_big != null) {
                    if (PlusSettings.showFullScreenAvatarOnSingleTap) {
                        ProfileActivity.this.openAvatar();
                        return;
                    } else {
                        ProfileActivity.this.expandAvatar();
                        return;
                    }
                }
                long dialogId = ProfileActivity.this.getDialogId();
                StoriesController storiesController = ProfileActivity.this.getMessagesController().getStoriesController();
                if (storiesController.hasStories(dialogId) || storiesController.hasUploadingStories(dialogId) || storiesController.isLastUploadingFailed(dialogId)) {
                    ProfileActivity.this.getOrCreateStoryViewer().open(context, dialogId, provider);
                    return;
                }
                if (ProfileActivity.this.userInfo != null && ProfileActivity.this.userInfo.stories != null && !ProfileActivity.this.userInfo.stories.stories.isEmpty() && ProfileActivity.this.userId != ProfileActivity.this.getUserConfig().clientUserId) {
                    ProfileActivity.this.getOrCreateStoryViewer().open(context, ProfileActivity.this.userInfo.stories, provider);
                } else if (ProfileActivity.this.chatInfo != null && ProfileActivity.this.chatInfo.stories != null && !ProfileActivity.this.chatInfo.stories.stories.isEmpty()) {
                    ProfileActivity.this.getOrCreateStoryViewer().open(context, ProfileActivity.this.chatInfo.stories, provider);
                } else {
                    ProfileActivity.this.expandAvatar();
                }
            }

            public void onLongPress() {
                ProfileActivity.this.openAvatar();
            }
        };
        updateStoriesViewBounds(false);
        TLRPC.UserFull userFull3 = this.userInfo;
        if (userFull3 != null) {
            this.storyView.setStories(userFull3.stories);
        } else {
            TLRPC.ChatFull chatFull2 = this.chatInfo;
            if (chatFull2 != null) {
                this.storyView.setStories(chatFull2.stories);
            }
        }
        AvatarImageView avatarImageView2 = this.avatarImage;
        if (avatarImageView2 != null) {
            avatarImageView2.setHasStories(needInsetForStories());
        }
        this.avatarContainer2.addView((View) this.storyView, (ViewGroup.LayoutParams) LayoutHelper.createFrame(-1, -1.0f));
        SimpleTextView simpleTextView = new SimpleTextView(context);
        this.adminTextView = simpleTextView;
        simpleTextView.setTextColor(Theme.usePlusTheme ? Theme.profileActionbarStatusColor : AvatarDrawable.getProfileTextColorForId((this.userId != 0 || (ChatObject.isChannel(this.chatId, ((BaseFragment) this).currentAccount) && !this.currentChat.megagroup)) ? 5L : this.chatId, this.resourcesProvider));
        SimpleTextView simpleTextView2 = this.adminTextView;
        int i6 = Theme.profileActionbarStatusSize;
        if (i6 >= 14) {
            i6 = 14;
        }
        simpleTextView2.setTextSize(i6);
        this.adminTextView.setGravity(3);
        this.adminTextView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
        frameLayout5.addView(this.adminTextView, LayoutHelper.createFrame(-2, -2.0f, 51, 118.0f, 0.0f, 48.0f, 0.0f));
        updateProfileData(true);
        this.writeButton = new RLottieImageView(context);
        writeButtonSetBackground();
        if (this.userId != 0) {
            if (this.imageUpdater != null) {
                int i7 = R.raw.camera_outline;
                this.cameraDrawable = new RLottieDrawable(i7, String.valueOf(i7), AndroidUtilities.dp(56.0f), AndroidUtilities.dp(56.0f), false, (int[]) null);
                this.cellCameraDrawable = new RLottieDrawable(i7, i7 + "_cell", AndroidUtilities.dp(42.0f), AndroidUtilities.dp(42.0f), false, (int[]) null);
                this.writeButton.setAnimation(this.cameraDrawable);
                this.writeButton.setContentDescription(LocaleController.getString("AccDescrChangeProfilePicture", R.string.AccDescrChangeProfilePicture));
                this.writeButton.setPadding(AndroidUtilities.dp(2.0f), 0, 0, AndroidUtilities.dp(2.0f));
            } else {
                this.writeButton.setImageResource(R.drawable.profile_newmsg);
                this.writeButton.setContentDescription(LocaleController.getString("AccDescrOpenChat", R.string.AccDescrOpenChat));
            }
        } else {
            this.writeButton.setImageResource(R.drawable.profile_discuss);
            this.writeButton.setContentDescription(LocaleController.getString("ViewDiscussion", R.string.ViewDiscussion));
        }
        this.writeButton.setScaleType(ImageView.ScaleType.CENTER);
        frameLayout5.addView(this.writeButton, LayoutHelper.createFrame(60, 60.0f, 53, 0.0f, 0.0f, 16.0f, 0.0f));
        this.writeButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ProfileActivity.this.lambda$createView$21(view);
            }
        });
        needLayout(false);
        if (i3 == -1 || obj == null) {
            f2 = 0.0f;
        } else {
            this.writeButton.setTag(0);
            this.writeButton.setScaleX(0.2f);
            this.writeButton.setScaleY(0.2f);
            f2 = 0.0f;
            this.writeButton.setAlpha(0.0f);
        }
        this.listView.setOnScrollListener(new RecyclerView.OnScrollListener() {
            public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
                if (newState == 1) {
                    AndroidUtilities.hideKeyboard(ProfileActivity.this.getParentActivity().getCurrentFocus());
                }
                if (ProfileActivity.this.openingAvatar && newState != 2) {
                    ProfileActivity.this.openingAvatar = false;
                }
                if (ProfileActivity.this.searchItem != null) {
                    ProfileActivity.this.scrolling = newState != 0;
                    ProfileActivity.this.searchItem.setEnabled((ProfileActivity.this.scrolling || ProfileActivity.this.isPulledDown) ? false : true);
                }
                ProfileActivity.this.sharedMediaLayout.scrollingByUser = ProfileActivity.this.listView.scrollingByUser;
            }

            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
                if (ProfileActivity.this.fwdRestrictedHint != null) {
                    ProfileActivity.this.fwdRestrictedHint.hide();
                }
                ProfileActivity.this.checkListViewScroll();
                if (ProfileActivity.this.participantsMap != null && !ProfileActivity.this.usersEndReached && ProfileActivity.this.layoutManager.findLastVisibleItemPosition() > ProfileActivity.this.membersEndRow - 8) {
                    ProfileActivity.this.getChannelParticipants(false);
                }
                ProfileActivity.this.sharedMediaLayout.setPinnedToTop(ProfileActivity.this.sharedMediaLayout.getY() <= 0.0f);
                ProfileActivity.this.updateBottomButtonY();
            }
        });
        View undoView = new UndoView(context, (BaseFragment) null, false, this.resourcesProvider);
        this.undoView = undoView;
        frameLayout5.addView(undoView, LayoutHelper.createFrame(-1, -2.0f, 83, 8.0f, 0.0f, 8.0f, 8.0f));
        ValueAnimator ofFloat = ValueAnimator.ofFloat(0.0f, 1.0f);
        this.expandAnimator = ofFloat;
        ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public final void onAnimationUpdate(ValueAnimator valueAnimator) {
                ProfileActivity.this.lambda$createView$22(valueAnimator);
            }
        });
        this.expandAnimator.setInterpolator(CubicBezierInterpolator.EASE_OUT_QUINT);
        this.expandAnimator.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationStart(Animator animation) {
            }

            @Override
            public void onAnimationEnd(Animator animation) {
                ((BaseFragment) ProfileActivity.this).actionBar.setItemsBackgroundColor(ProfileActivity.this.isPulledDown ? 1090519039 : ProfileActivity.this.peerColor != null ? 553648127 : ProfileActivity.this.getThemedColor(Theme.key_avatar_actionBarSelectorBlue), false);
                ProfileActivity.this.avatarImage.clearForeground();
                ProfileActivity.this.doNotSetForeground = false;
                ProfileActivity.this.updateStoriesViewBounds(false);
            }
        });
        updateRowsIds();
        updateSelectedMediaTabText();
        HintView hintView = new HintView(getParentActivity(), 9);
        this.fwdRestrictedHint = hintView;
        hintView.setAlpha(f2);
        frameLayout5.addView(this.fwdRestrictedHint, LayoutHelper.createFrame(-2, -2.0f, 51, 12.0f, 0.0f, 12.0f, 0.0f));
        this.sharedMediaLayout.setForwardRestrictedHint(this.fwdRestrictedHint);
        int i8 = Build.VERSION.SDK_INT;
        PinchToZoomHelper pinchToZoomHelper = new PinchToZoomHelper(i8 >= 21 ? (ViewGroup) getParentActivity().getWindow().getDecorView() : frameLayout5, frameLayout5) {
            @Override
            public void invalidateViews() {
                super.invalidateViews();
                ((BaseFragment) ProfileActivity.this).fragmentView.invalidate();
                for (int i9 = 0; i9 < ProfileActivity.this.avatarsViewPager.getChildCount(); i9++) {
                    ProfileActivity.this.avatarsViewPager.getChildAt(i9).invalidate();
                }
                if (ProfileActivity.this.writeButton != null) {
                    ProfileActivity.this.writeButton.invalidate();
                }
            }

            @Override
            public void drawOverlays(Canvas canvas, float alpha, float parentOffsetX, float parentOffsetY, float clipTop, float clipBottom) {
                if (alpha > 0.0f) {
                    RectF rectF = AndroidUtilities.rectTmp;
                    rectF.set(0.0f, 0.0f, ProfileActivity.this.avatarsViewPager.getMeasuredWidth(), ProfileActivity.this.avatarsViewPager.getMeasuredHeight() + AndroidUtilities.dp(30.0f));
                    canvas.saveLayerAlpha(rectF, (int) (255.0f * alpha), 31);
                    ProfileActivity.this.avatarContainer2.draw(canvas);
                    ((BaseFragment) ProfileActivity.this).actionBar.getOccupyStatusBar();
                    canvas.save();
                    canvas.translate(((BaseFragment) ProfileActivity.this).actionBar.getX(), ((BaseFragment) ProfileActivity.this).actionBar.getY());
                    ((BaseFragment) ProfileActivity.this).actionBar.draw(canvas);
                    canvas.restore();
                    if (ProfileActivity.this.writeButton != null && ProfileActivity.this.writeButton.getVisibility() == 0 && ProfileActivity.this.writeButton.getAlpha() > 0.0f) {
                        canvas.save();
                        float f4 = (alpha * 0.5f) + 0.5f;
                        canvas.scale(f4, f4, ProfileActivity.this.writeButton.getX() + (ProfileActivity.this.writeButton.getMeasuredWidth() / 2.0f), ProfileActivity.this.writeButton.getY() + (ProfileActivity.this.writeButton.getMeasuredHeight() / 2.0f));
                        canvas.translate(ProfileActivity.this.writeButton.getX(), ProfileActivity.this.writeButton.getY());
                        ProfileActivity.this.writeButton.draw(canvas);
                        canvas.restore();
                    }
                    canvas.restore();
                }
            }

            @Override
            public boolean zoomEnabled(View child, ImageReceiver receiver) {
                return super.zoomEnabled(child, receiver) && ProfileActivity.this.listView.getScrollState() != 1;
            }
        };
        this.pinchToZoomHelper = pinchToZoomHelper;
        pinchToZoomHelper.setCallback(new PinchToZoomHelper.Callback() {
            @Override
            public TextureView getCurrentTextureView() {
                return PinchToZoomHelper.Callback.CC.$default$getCurrentTextureView(this);
            }

            @Override
            public void onZoomFinished(MessageObject messageObject) {
                PinchToZoomHelper.Callback.CC.$default$onZoomFinished(this, messageObject);
            }

            @Override
            public void onZoomStarted(MessageObject messageObject) {
                ProfileActivity.this.listView.cancelClickRunnables(true);
                if (ProfileActivity.this.sharedMediaLayout != null && ProfileActivity.this.sharedMediaLayout.getCurrentListView() != null) {
                    ProfileActivity.this.sharedMediaLayout.getCurrentListView().cancelClickRunnables(true);
                }
                TopView topView2 = ProfileActivity.this.topView;
                ProfileActivity profileActivity = ProfileActivity.this;
                topView2.setBackgroundColor(ColorUtils.blendARGB(profileActivity.getAverageColor(profileActivity.pinchToZoomHelper.getPhotoImage()), ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite), 0.1f));
            }
        });
        this.avatarsViewPager.setPinchToZoomHelper(this.pinchToZoomHelper);
        this.scrimPaint.setAlpha(0);
        this.actionBarBackgroundPaint.setColor(getThemedColor(Theme.key_listSelector));
        ((SizeNotifierFrameLayout) this.contentView).blurBehindViews.add(this.sharedMediaLayout);
        updateTtlIcon();
        View view = new View(context) {
            @Override
            public void setAlpha(float alpha) {
                super.setAlpha(alpha);
                View view2 = ((BaseFragment) ProfileActivity.this).fragmentView;
                if (view2 != null) {
                    view2.invalidate();
                }
            }
        };
        this.blurredView = view;
        if (i8 >= 23) {
            view.setForeground(new ColorDrawable(ColorUtils.setAlphaComponent(getThemedColor(Theme.key_windowBackgroundWhite), 100)));
        }
        this.blurredView.setFocusable(false);
        this.blurredView.setImportantForAccessibility(2);
        this.blurredView.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view2) {
                ProfileActivity.this.lambda$createView$23(view2);
            }
        });
        this.blurredView.setVisibility(8);
        this.blurredView.setFitsSystemWindows(true);
        this.contentView.addView(this.blurredView, LayoutHelper.createFrame(-1, -1.0f));
        createBirthdayEffect();
        createFloatingActionButton(getContext());
        if (this.myProfile) {
            FrameLayout frameLayout6 = new FrameLayout(context);
            this.bottomButtonsContainer = frameLayout6;
            this.contentView.addView(frameLayout6, LayoutHelper.createFrame(-1.0f, (1.0f / AndroidUtilities.density) + 72.0f, 87));
            this.bottomButtonContainer = new FrameLayout[2];
            this.bottomButton = new ButtonWithCounterView[2];
            for (final int i9 = 0; i9 < 2; i9++) {
                this.bottomButtonContainer[i9] = new FrameLayout(context);
                this.bottomButtonContainer[i9].setBackgroundColor(getThemedColor(Theme.key_windowBackgroundWhite));
                View view2 = new View(context);
                view2.setBackgroundColor(getThemedColor(Theme.key_windowBackgroundGray));
                this.bottomButtonContainer[i9].addView(view2, LayoutHelper.createFrame(-1.0f, 1.0f / AndroidUtilities.density, 55));
                this.bottomButton[i9] = new ButtonWithCounterView(context, this.resourcesProvider);
                if (i9 == 0) {
                    SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder("c");
                    this.bottomButtonPostText = spannableStringBuilder;
                    spannableStringBuilder.setSpan(new ColoredImageSpan(R.drawable.filled_premium_camera), 0, 1, 33);
                    this.bottomButtonPostText.append((CharSequence) "  ").append((CharSequence) LocaleController.getString(R.string.StoriesAddPost));
                    this.bottomButton[i9].setText(this.bottomButtonPostText, false);
                } else {
                    this.bottomButton[i9].setText(LocaleController.getString(R.string.StorySave), false);
                }
                this.bottomButton[i9].setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view3) {
                        ProfileActivity.this.lambda$createView$27(i9, view3);
                    }
                });
                this.bottomButtonContainer[i9].addView(this.bottomButton[i9], LayoutHelper.createFrame(-1, 48.0f, 87, 12.0f, 12.0f, 12.0f, 12.0f));
                this.bottomButtonsContainer.addView(this.bottomButtonContainer[i9], LayoutHelper.createFrame(-1, -1, 87));
                if (i9 == 1 || !getMessagesController().storiesEnabled()) {
                    this.bottomButtonContainer[i9].setTranslationY(AndroidUtilities.dp(72.0f));
                }
            }
        }
        if (!TextUtils.isEmpty(this.searchSetting)) {
            this.searchItem.openSearch(false);
            this.searchItem.setSearchFieldText(this.searchSetting, false);
            this.searchSetting = null;
        }
        if (Theme.usePlusTheme) {
            updateListBG();
        }
        return ((BaseFragment) this).fragmentView;
    }

    public class AnonymousClass6 extends ActionBar.ActionBarMenuOnItemClick {
        public AnonymousClass6() {
        }

        @Override
        public void onItemClick(int i) {
            String format;
            long j;
            if (ProfileActivity.this.getParentActivity() == null) {
                return;
            }
            if (i == -1) {
                ProfileActivity.this.finishFragment();
                return;
            }
            String str = null;
            String str2 = null;
            if (i == 2) {
                final TLRPC.User user = ProfileActivity.this.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.userId));
                if (user == null) {
                    return;
                }
                if (!ProfileActivity.this.isBot || MessagesController.isSupportUser(user)) {
                    if (ProfileActivity.this.userBlocked) {
                        ProfileActivity.this.getMessagesController().unblockPeer(ProfileActivity.this.userId);
                        if (BulletinFactory.canShowBulletin(ProfileActivity.this)) {
                            BulletinFactory.createBanBulletin(ProfileActivity.this, false).show();
                            return;
                        }
                        return;
                    }
                    if (ProfileActivity.this.reportSpam) {
                        ProfileActivity profileActivity = ProfileActivity.this;
                        AlertsCreator.showBlockReportSpamAlert(profileActivity, profileActivity.userId, user, (TLRPC.Chat) null, ProfileActivity.this.currentEncryptedChat, false, (TLRPC.ChatFull) null, new MessagesStorage.IntCallback() {
                            public final void run(int i2) {
                                ProfileActivity.AnonymousClass6.this.lambda$onItemClick$0(i2);
                            }
                        }, ProfileActivity.this.resourcesProvider);
                        return;
                    }
                    AlertDialog.Builder builder = new AlertDialog.Builder(ProfileActivity.this.getParentActivity(), ProfileActivity.this.resourcesProvider);
                    builder.setTitle(LocaleController.getString("BlockUser", R.string.BlockUser));
                    builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatString("AreYouSureBlockContact2", R.string.AreYouSureBlockContact2, new Object[]{ContactsController.formatName(user.first_name, user.last_name)})));
                    builder.setPositiveButton(LocaleController.getString("BlockContact", R.string.BlockContact), new DialogInterface.OnClickListener() {
                        @Override
                        public final void onClick(DialogInterface dialogInterface, int i2) {
                            ProfileActivity.AnonymousClass6.this.lambda$onItemClick$1(dialogInterface, i2);
                        }
                    });
                    builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
                    AlertDialog create = builder.create();
                    ProfileActivity.this.showDialog(create);
                    TextView textView = (TextView) create.getButton(-1);
                    if (textView != null) {
                        textView.setTextColor(ProfileActivity.this.getThemedColor(Theme.key_text_RedBold));
                        return;
                    }
                    return;
                }
                if (!ProfileActivity.this.userBlocked) {
                    ProfileActivity profileActivity2 = ProfileActivity.this;
                    AlertsCreator.createClearOrDeleteDialogAlert(profileActivity2, false, profileActivity2.currentChat, user, ProfileActivity.this.currentEncryptedChat != null, true, true, new MessagesStorage.BooleanCallback() {
                        public final void run(boolean z) {
                            ProfileActivity.AnonymousClass6.this.lambda$onItemClick$2(user, z);
                        }
                    }, ProfileActivity.this.getResourceProvider());
                    return;
                } else {
                    ProfileActivity.this.getMessagesController().unblockPeer(ProfileActivity.this.userId, new Runnable() {
                        @Override
                        public final void run() {
                            ProfileActivity.AnonymousClass6.this.lambda$onItemClick$3();
                        }
                    });
                    ProfileActivity.this.finishFragment();
                    return;
                }
            }
            if (i == 1) {
                TLRPC.User user2 = ProfileActivity.this.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.userId));
                Bundle bundle = new Bundle();
                bundle.putLong("user_id", user2.id);
                bundle.putBoolean("addContact", true);
                ProfileActivity.this.openAddToContact(user2, bundle);
                return;
            }
            if (i == 3) {
                Bundle bundle2 = new Bundle();
                bundle2.putBoolean("onlySelect", true);
                bundle2.putInt("dialogsType", 3);
                bundle2.putString("selectAlertString", LocaleController.getString("SendContactToText", R.string.SendContactToText));
                bundle2.putString("selectAlertStringGroup", LocaleController.getString("SendContactToGroupText", R.string.SendContactToGroupText));
                DialogsActivity dialogsActivity = new DialogsActivity(bundle2);
                dialogsActivity.setDelegate(ProfileActivity.this);
                ProfileActivity.this.presentFragment(dialogsActivity);
                return;
            }
            if (i == 4) {
                Bundle bundle3 = new Bundle();
                bundle3.putLong("user_id", ProfileActivity.this.userId);
                ProfileActivity profileActivity3 = ProfileActivity.this;
                profileActivity3.presentFragment(new ContactAddActivity(bundle3, profileActivity3.resourcesProvider));
                return;
            }
            if (i == 5) {
                final TLRPC.User user3 = ProfileActivity.this.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.userId));
                if (user3 == null || ProfileActivity.this.getParentActivity() == null) {
                    return;
                }
                AlertDialog.Builder builder2 = new AlertDialog.Builder(ProfileActivity.this.getParentActivity(), ProfileActivity.this.resourcesProvider);
                builder2.setTitle(LocaleController.getString("DeleteContact", R.string.DeleteContact));
                builder2.setMessage(LocaleController.getString("AreYouSureDeleteContact", R.string.AreYouSureDeleteContact));
                builder2.setPositiveButton(LocaleController.getString("Delete", R.string.Delete), new DialogInterface.OnClickListener() {
                    @Override
                    public final void onClick(DialogInterface dialogInterface, int i2) {
                        ProfileActivity.AnonymousClass6.this.lambda$onItemClick$4(user3, dialogInterface, i2);
                    }
                });
                builder2.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
                AlertDialog create2 = builder2.create();
                ProfileActivity.this.showDialog(create2);
                TextView textView2 = (TextView) create2.getButton(-1);
                if (textView2 != null) {
                    textView2.setTextColor(ProfileActivity.this.getThemedColor(Theme.key_text_RedBold));
                    return;
                }
                return;
            }
            if (i == 7) {
                ProfileActivity.this.leaveChatPressed();
                return;
            }
            if (i == 23) {
                AlertDialog.Builder builder3 = new AlertDialog.Builder(ProfileActivity.this.getContext());
                builder3.setTitle(LocaleController.getPluralString("DeleteTopics", 1));
                TLRPC.TL_forumTopic findTopic = MessagesController.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).getTopicsController().findTopic(ProfileActivity.this.chatId, ProfileActivity.this.topicId);
                int i2 = R.string.DeleteSelectedTopic;
                Object[] objArr = new Object[1];
                objArr[0] = findTopic == null ? "topic" : findTopic.title;
                builder3.setMessage(LocaleController.formatString("DeleteSelectedTopic", i2, objArr));
                builder3.setPositiveButton(LocaleController.getString("Delete", R.string.Delete), new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        ArrayList arrayList = new ArrayList();
                        arrayList.add(Integer.valueOf((int) ProfileActivity.this.topicId));
                        ProfileActivity.this.getMessagesController().getTopicsController().deleteTopics(ProfileActivity.this.chatId, arrayList);
                        ProfileActivity.this.playProfileAnimation = 0;
                        if (((BaseFragment) ProfileActivity.this).parentLayout != null && ((BaseFragment) ProfileActivity.this).parentLayout.getFragmentStack() != null) {
                            for (int i3 = 0; i3 < ((BaseFragment) ProfileActivity.this).parentLayout.getFragmentStack().size(); i3++) {
                                BaseFragment baseFragment = ((BaseFragment) ProfileActivity.this).parentLayout.getFragmentStack().get(i3);
                                if ((baseFragment instanceof ChatActivity) && ((ChatActivity) baseFragment).getTopicId() == ProfileActivity.this.topicId) {
                                    baseFragment.removeSelfFromStack();
                                }
                            }
                        }
                        ProfileActivity.this.finishFragment();
                        Context context = ProfileActivity.this.getContext();
                        if (context != null) {
                            BulletinFactory.of(Bulletin.BulletinWindow.make(context), ProfileActivity.this.resourcesProvider).createSimpleBulletin(R.raw.ic_delete, LocaleController.getPluralString("TopicsDeleted", 1)).show();
                        }
                        dialog.dismiss();
                    }
                });
                builder3.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), new DialogInterface.OnClickListener(this) {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                    }
                });
                AlertDialog create3 = builder3.create();
                create3.show();
                TextView textView3 = (TextView) create3.getButton(-1);
                if (textView3 != null) {
                    textView3.setTextColor(Theme.getColor(Theme.key_text_RedBold));
                    return;
                }
                return;
            }
            if (i == 12) {
                if (ProfileActivity.this.isTopic) {
                    new Bundle().putLong("chat_id", ProfileActivity.this.chatId);
                    ProfileActivity.this.presentFragment(TopicCreateFragment.create(ProfileActivity.this.chatId, ProfileActivity.this.topicId));
                    return;
                }
                Bundle bundle4 = new Bundle();
                if (ProfileActivity.this.chatId != 0) {
                    bundle4.putLong("chat_id", ProfileActivity.this.chatId);
                } else if (ProfileActivity.this.isBot) {
                    bundle4.putLong("user_id", ProfileActivity.this.userId);
                }
                ChatEditActivity chatEditActivity = new ChatEditActivity(bundle4);
                if (ProfileActivity.this.chatInfo != null) {
                    chatEditActivity.setInfo(ProfileActivity.this.chatInfo);
                } else {
                    chatEditActivity.setInfo(ProfileActivity.this.userInfo);
                }
                ProfileActivity.this.presentFragment(chatEditActivity);
                return;
            }
            if (i == 41) {
                ProfileActivity.this.presentFragment(new UserInfoActivity());
                return;
            }
            if (i == 9) {
                final TLRPC.User user4 = ProfileActivity.this.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.userId));
                if (user4 == null) {
                    return;
                }
                Bundle bundle5 = new Bundle();
                bundle5.putBoolean("onlySelect", true);
                bundle5.putInt("dialogsType", 2);
                bundle5.putBoolean("resetDelegate", false);
                bundle5.putBoolean("closeFragment", false);
                final DialogsActivity dialogsActivity2 = new DialogsActivity(bundle5);
                dialogsActivity2.setDelegate(new DialogsActivity.DialogsActivityDelegate() {
                    @Override
                    public final boolean didSelectDialogs(DialogsActivity dialogsActivity3, ArrayList arrayList, CharSequence charSequence, boolean z, TopicsFragment topicsFragment) {
                        boolean lambda$onItemClick$8;
                        lambda$onItemClick$8 = ProfileActivity.AnonymousClass6.this.lambda$onItemClick$8(user4, dialogsActivity2, dialogsActivity3, arrayList, charSequence, z, topicsFragment);
                        return lambda$onItemClick$8;
                    }

                    @Override
                    public boolean didSelectDialogs(DialogsActivity dialogsActivity3, ArrayList arrayList, CharSequence charSequence, boolean z, TopicsFragment topicsFragment, boolean z2) {
                        return DialogsActivity.DialogsActivityDelegate.CC.$default$didSelectDialogs(this, dialogsActivity3, arrayList, charSequence, z, topicsFragment, z2);
                    }
                });
                ProfileActivity.this.presentFragment(dialogsActivity2);
                return;
            }
            if (i == 10) {
                try {
                    if (ProfileActivity.this.userId != 0) {
                        TLRPC.User user5 = ProfileActivity.this.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.userId));
                        if (user5 == null) {
                            return;
                        }
                        if (ProfileActivity.this.botInfo != null && ProfileActivity.this.userInfo != null && !TextUtils.isEmpty(ProfileActivity.this.userInfo.about)) {
                            format = String.format("%s https://" + ProfileActivity.this.getMessagesController().linkPrefix + "/%s", ProfileActivity.this.userInfo.about, UserObject.getPublicUsername(user5));
                        } else {
                            format = String.format("https://" + ProfileActivity.this.getMessagesController().linkPrefix + "/%s", UserObject.getPublicUsername(user5));
                        }
                        str = format;
                    } else if (ProfileActivity.this.chatId != 0) {
                        TLRPC.Chat chat = ProfileActivity.this.getMessagesController().getChat(Long.valueOf(ProfileActivity.this.chatId));
                        if (chat == null) {
                            return;
                        }
                        if (ProfileActivity.this.chatInfo != null && !TextUtils.isEmpty(ProfileActivity.this.chatInfo.about)) {
                            str = String.format("%s\nhttps://" + ProfileActivity.this.getMessagesController().linkPrefix + "/%s", ProfileActivity.this.chatInfo.about, ChatObject.getPublicUsername(chat));
                        } else {
                            str = String.format("https://" + ProfileActivity.this.getMessagesController().linkPrefix + "/%s", ChatObject.getPublicUsername(chat));
                        }
                    }
                    if (TextUtils.isEmpty(str)) {
                        return;
                    }
                    Intent intent = new Intent("android.intent.action.SEND");
                    intent.setType("text/plain");
                    intent.putExtra("android.intent.extra.TEXT", str);
                    ProfileActivity.this.startActivityForResult(Intent.createChooser(intent, LocaleController.getString("BotShare", R.string.BotShare)), 500);
                    return;
                } catch (Exception e) {
                    FileLog.e(e);
                    return;
                }
            }
            if (i == 14) {
                try {
                    if (ProfileActivity.this.currentEncryptedChat != null) {
                        j = DialogObject.makeEncryptedDialogId(ProfileActivity.this.currentEncryptedChat.id);
                    } else if (ProfileActivity.this.userId != 0) {
                        j = ProfileActivity.this.userId;
                    } else if (ProfileActivity.this.chatId == 0) {
                        return;
                    } else {
                        j = -ProfileActivity.this.chatId;
                    }
                    ProfileActivity.this.getMediaDataController().installShortcut(j, MediaDataController.SHORTCUT_TYPE_USER_OR_CHAT);
                    return;
                } catch (Exception e2) {
                    FileLog.e(e2);
                    return;
                }
            }
            if (i == 15 || i == 16) {
                if (ProfileActivity.this.userId != 0) {
                    TLRPC.User user6 = ProfileActivity.this.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.userId));
                    if (user6 != null) {
                        VoIPHelper.startCall(user6, i == 16, ProfileActivity.this.userInfo != null && ProfileActivity.this.userInfo.video_calls_available, ProfileActivity.this.getParentActivity(), ProfileActivity.this.userInfo, ProfileActivity.this.getAccountInstance());
                        return;
                    }
                    return;
                }
                if (ProfileActivity.this.chatId != 0) {
                    if (ProfileActivity.this.getMessagesController().getGroupCall(ProfileActivity.this.chatId, false) == null) {
                        ProfileActivity profileActivity4 = ProfileActivity.this;
                        VoIPHelper.showGroupCallAlert(profileActivity4, profileActivity4.currentChat, (TLRPC.InputPeer) null, false, ProfileActivity.this.getAccountInstance());
                        return;
                    } else {
                        TLRPC.Chat chat2 = ProfileActivity.this.currentChat;
                        Activity parentActivity = ProfileActivity.this.getParentActivity();
                        ProfileActivity profileActivity5 = ProfileActivity.this;
                        VoIPHelper.startCall(chat2, (TLRPC.InputPeer) null, (String) null, false, parentActivity, profileActivity5, profileActivity5.getAccountInstance());
                        return;
                    }
                }
                return;
            }
            if (i == 17) {
                Bundle bundle6 = new Bundle();
                bundle6.putLong("chat_id", ProfileActivity.this.chatId);
                bundle6.putInt("type", 2);
                bundle6.putBoolean("open_search", true);
                ChatUsersActivity chatUsersActivity = new ChatUsersActivity(bundle6);
                chatUsersActivity.setInfo(ProfileActivity.this.chatInfo);
                ProfileActivity.this.presentFragment(chatUsersActivity);
                return;
            }
            if (i == 18) {
                ProfileActivity.this.openAddMember();
                return;
            }
            if (i == 19) {
                ProfileActivity.this.presentFragment(StatisticActivity.create(ProfileActivity.this.getMessagesController().getChat(Long.valueOf(ProfileActivity.this.chatId)), false));
                return;
            }
            if (i == 22) {
                ProfileActivity.this.openDiscussion();
                return;
            }
            if (i == 38) {
                ProfileActivity profileActivity6 = ProfileActivity.this;
                ProfileActivity profileActivity7 = ProfileActivity.this;
                profileActivity6.showDialog(new GiftPremiumBottomSheet(profileActivity7, profileActivity7.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.userId))));
                return;
            }
            if (i == 39) {
                Bundle bundle7 = new Bundle();
                bundle7.putInt("type", 2);
                bundle7.putLong("dialog_id", -ProfileActivity.this.chatId);
                MediaActivity mediaActivity = new MediaActivity(bundle7, (SharedMediaLayout.SharedMediaPreloader) null);
                mediaActivity.setChatInfo(ProfileActivity.this.chatInfo);
                ProfileActivity.this.presentFragment(mediaActivity);
                return;
            }
            if (i == 20) {
                AlertDialog.Builder builder4 = new AlertDialog.Builder(ProfileActivity.this.getParentActivity(), ProfileActivity.this.resourcesProvider);
                builder4.setTitle(LocaleController.getString("AreYouSureSecretChatTitle", R.string.AreYouSureSecretChatTitle));
                builder4.setMessage(LocaleController.getString("AreYouSureSecretChat", R.string.AreYouSureSecretChat));
                builder4.setPositiveButton(LocaleController.getString("Start", R.string.Start), new DialogInterface.OnClickListener() {
                    @Override
                    public final void onClick(DialogInterface dialogInterface, int i3) {
                        ProfileActivity.AnonymousClass6.this.lambda$onItemClick$9(dialogInterface, i3);
                    }
                });
                builder4.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
                ProfileActivity.this.showDialog(builder4.create());
                return;
            }
            if (i == 21) {
                if (ProfileActivity.this.getParentActivity() == null) {
                    return;
                }
                int i3 = Build.VERSION.SDK_INT;
                if (i3 >= 23 && ((i3 <= 28 || BuildVars.NO_SCOPED_STORAGE) && ProfileActivity.this.getParentActivity().checkSelfPermission("android.permission.WRITE_EXTERNAL_STORAGE") != 0)) {
                    ProfileActivity.this.getParentActivity().requestPermissions(new String[]{"android.permission.WRITE_EXTERNAL_STORAGE"}, 4);
                    return;
                }
                ImageLocation imageLocation = ProfileActivity.this.avatarsViewPager.getImageLocation(ProfileActivity.this.avatarsViewPager.getRealPosition());
                if (imageLocation == null) {
                    return;
                }
                final boolean z = imageLocation.imageType == 2;
                File pathToAttach = FileLoader.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).getPathToAttach(imageLocation.location, z ? "mp4" : null, true);
                if (z && !pathToAttach.exists()) {
                    pathToAttach = new File(FileLoader.getDirectory(0), FileLoader.getAttachFileName(imageLocation.location, "mp4"));
                }
                if (pathToAttach.exists()) {
                    MediaController.saveFile(pathToAttach.toString(), ProfileActivity.this.getParentActivity(), 0, (String) null, (String) null, new Utilities.Callback() {
                        public final void run(Object obj) {
                            ProfileActivity.AnonymousClass6.this.lambda$onItemClick$10(z, (Uri) obj);
                        }
                    });
                    return;
                }
                return;
            }
            if (i == 30) {
                ProfileActivity.this.presentFragment(new UserInfoActivity());
                return;
            }
            if (i == 40) {
                if (!ProfileActivity.this.getUserConfig().isPremium()) {
                    ProfileActivity.this.showDialog(new PremiumFeatureBottomSheet(ProfileActivity.this, 23, true));
                    return;
                } else {
                    ProfileActivity.this.presentFragment(new PeerColorActivity(0L).startOnProfile().setOnApplied(ProfileActivity.this));
                    return;
                }
            }
            if (i == 42) {
                AndroidUtilities.addToClipboard(ProfileActivity.this.getMessagesController().linkPrefix + "/" + UserObject.getPublicUsername(ProfileActivity.this.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.userId))));
                return;
            }
            if (i == 43) {
                ProfileActivity.this.presentFragment(new ChangeUsernameActivity());
                return;
            }
            if (i == 31) {
                ProfileActivity.this.presentFragment(new LogoutActivity());
                return;
            }
            if (i == 33) {
                int realPosition = ProfileActivity.this.avatarsViewPager.getRealPosition();
                final TLRPC.Photo photo = ProfileActivity.this.avatarsViewPager.getPhoto(realPosition);
                if (photo == null) {
                    return;
                }
                ProfileActivity.this.avatarsViewPager.startMovePhotoToBegin(realPosition);
                TLRPC.TL_photos_updateProfilePhoto tL_photos_updateProfilePhoto = new TLRPC.TL_photos_updateProfilePhoto();
                TLRPC.TL_inputPhoto tL_inputPhoto = new TLRPC.TL_inputPhoto();
                tL_photos_updateProfilePhoto.id = tL_inputPhoto;
                ((TLRPC.InputPhoto) tL_inputPhoto).id = photo.id;
                ((TLRPC.InputPhoto) tL_inputPhoto).access_hash = photo.access_hash;
                ((TLRPC.InputPhoto) tL_inputPhoto).file_reference = photo.file_reference;
                final UserConfig userConfig = ProfileActivity.this.getUserConfig();
                ProfileActivity.this.getConnectionsManager().sendRequest(tL_photos_updateProfilePhoto, new RequestDelegate() {
                    public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                        ProfileActivity.AnonymousClass6.this.lambda$onItemClick$12(userConfig, photo, tLObject, tL_error);
                    }
                });
                ProfileActivity.this.undoView.showWithAction(ProfileActivity.this.userId, 22, photo.video_sizes.isEmpty() ? null : 1);
                TLRPC.User user7 = ProfileActivity.this.getMessagesController().getUser(Long.valueOf(userConfig.clientUserId));
                TLRPC.PhotoSize closestPhotoSizeWithSize = FileLoader.getClosestPhotoSizeWithSize(photo.sizes, 800);
                if (user7 != null) {
                    TLRPC.PhotoSize closestPhotoSizeWithSize2 = FileLoader.getClosestPhotoSizeWithSize(photo.sizes, 90);
                    TLRPC.UserProfilePhoto userProfilePhoto = user7.photo;
                    userProfilePhoto.photo_id = photo.id;
                    userProfilePhoto.photo_small = closestPhotoSizeWithSize2.location;
                    userProfilePhoto.photo_big = closestPhotoSizeWithSize.location;
                    userConfig.setCurrentUser(user7);
                    userConfig.saveConfig(true);
                    NotificationCenter.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).postNotificationName(NotificationCenter.mainUserInfoChanged, new Object[0]);
                    ProfileActivity.this.updateProfileData(true);
                }
                ProfileActivity.this.avatarsViewPager.commitMoveToBegin();
                return;
            }
            if (i == 34) {
                int realPosition2 = ProfileActivity.this.avatarsViewPager.getRealPosition();
                ImageLocation imageLocation2 = ProfileActivity.this.avatarsViewPager.getImageLocation(realPosition2);
                if (imageLocation2 == null) {
                    return;
                }
                File pathToAttach2 = FileLoader.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).getPathToAttach(PhotoViewer.getFileLocation(imageLocation2), PhotoViewer.getFileLocationExt(imageLocation2), true);
                boolean z2 = imageLocation2.imageType == 2;
                if (z2) {
                    ImageLocation realImageLocation = ProfileActivity.this.avatarsViewPager.getRealImageLocation(realPosition2);
                    str2 = FileLoader.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).getPathToAttach(PhotoViewer.getFileLocation(realImageLocation), PhotoViewer.getFileLocationExt(realImageLocation), true).getAbsolutePath();
                }
                ProfileActivity.this.imageUpdater.openPhotoForEdit(pathToAttach2.getAbsolutePath(), str2, 0, z2);
                return;
            }
            if (i == 35) {
                AlertDialog.Builder builder5 = new AlertDialog.Builder(ProfileActivity.this.getParentActivity(), ProfileActivity.this.resourcesProvider);
                ImageLocation imageLocation3 = ProfileActivity.this.avatarsViewPager.getImageLocation(ProfileActivity.this.avatarsViewPager.getRealPosition());
                if (imageLocation3 == null) {
                    return;
                }
                if (imageLocation3.imageType == 2) {
                    builder5.setTitle(LocaleController.getString("AreYouSureDeleteVideoTitle", R.string.AreYouSureDeleteVideoTitle));
                    builder5.setMessage(LocaleController.formatString("AreYouSureDeleteVideo", R.string.AreYouSureDeleteVideo, new Object[0]));
                } else {
                    builder5.setTitle(LocaleController.getString("AreYouSureDeletePhotoTitle", R.string.AreYouSureDeletePhotoTitle));
                    builder5.setMessage(LocaleController.formatString("AreYouSureDeletePhoto", R.string.AreYouSureDeletePhoto, new Object[0]));
                }
                builder5.setPositiveButton(LocaleController.getString("Delete", R.string.Delete), new DialogInterface.OnClickListener() {
                    @Override
                    public final void onClick(DialogInterface dialogInterface, int i4) {
                        ProfileActivity.AnonymousClass6.this.lambda$onItemClick$13(dialogInterface, i4);
                    }
                });
                builder5.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
                AlertDialog create4 = builder5.create();
                ProfileActivity.this.showDialog(create4);
                TextView textView4 = (TextView) create4.getButton(-1);
                if (textView4 != null) {
                    textView4.setTextColor(ProfileActivity.this.getThemedColor(Theme.key_text_RedBold));
                    return;
                }
                return;
            }
            if (i == 36) {
                ProfileActivity.this.onWriteButtonClick();
                return;
            }
            if (i == 37) {
                if (ProfileActivity.this.qrItem == null || ProfileActivity.this.qrItem.getAlpha() <= 0.0f) {
                    return;
                }
                Bundle bundle8 = new Bundle();
                bundle8.putLong("chat_id", ProfileActivity.this.chatId);
                bundle8.putLong("user_id", ProfileActivity.this.userId);
                ProfileActivity.this.presentFragment(new QrActivity(bundle8));
                return;
            }
            if (i == 29) {
                ProfileActivity.this.onSharePressed();
                return;
            }
            if (i == 94) {
                PlusSettings.showOldMediaRows = !PlusSettings.showOldMediaRows;
                ApplicationLoader.applicationContext.getSharedPreferences("plusconfig", 0).edit().putBoolean("showOldMediaRows", PlusSettings.showOldMediaRows).apply();
                ProfileActivity.this.createActionBarMenu(true);
                ProfileActivity.this.updateRowsIds();
                if (ProfileActivity.this.listAdapter != null) {
                    ProfileActivity.this.listAdapter.notifyDataSetChanged();
                    return;
                }
                return;
            }
            if (i == 99) {
                ProfileActivity.this.hideMembersFilter = !r0.hideMembersFilter;
                if (ProfileActivity.this.hideMembersFilter) {
                    ProfileActivity.this.filterType = 0;
                    ProfileActivity.this.getChannelParticipants(true);
                }
                ApplicationLoader.applicationContext.getSharedPreferences("plusconfig", 0).edit().putBoolean("hideMembersFilter", ProfileActivity.this.hideMembersFilter).apply();
                ProfileActivity.this.createActionBarMenu(true);
                ProfileActivity.this.updateRowsIds();
                if (ProfileActivity.this.listAdapter != null) {
                    ProfileActivity.this.listAdapter.notifyDataSetChanged();
                    return;
                }
                return;
            }
            if (i == 98) {
                ProfileActivity.this.presentFragment(new ChannelAdminLogActivity(ProfileActivity.this.currentChat));
                return;
            }
            if (i == 97 && ProfileActivity.this.currentChat != null) {
                Bundle bundle9 = new Bundle();
                bundle9.putLong("chat_id", ProfileActivity.this.currentChat.id);
                bundle9.putInt("type", 1);
                ChatUsersActivity chatUsersActivity2 = new ChatUsersActivity(bundle9);
                chatUsersActivity2.setInfo(ProfileActivity.this.chatInfo);
                ProfileActivity.this.presentFragment(chatUsersActivity2);
                return;
            }
            if (i == 95 && ProfileActivity.this.currentChat != null) {
                Bundle bundle10 = new Bundle();
                bundle10.putLong("chat_id", ProfileActivity.this.currentChat.id);
                bundle10.putInt("type", 0);
                ChatUsersActivity chatUsersActivity3 = new ChatUsersActivity(bundle10);
                chatUsersActivity3.setInfo(ProfileActivity.this.chatInfo);
                ProfileActivity.this.presentFragment(chatUsersActivity3);
                return;
            }
            if (i == 93 && ProfileActivity.this.currentChat != null) {
                Bundle bundle11 = new Bundle();
                bundle11.putLong("chat_id", ProfileActivity.this.currentChat.id);
                bundle11.putInt("type", 2);
                ChatUsersActivity chatUsersActivity4 = new ChatUsersActivity(bundle11);
                chatUsersActivity4.setInfo(ProfileActivity.this.chatInfo);
                ProfileActivity.this.presentFragment(chatUsersActivity4);
                return;
            }
            if (i != 96 || ProfileActivity.this.currentChat == null) {
                return;
            }
            Bundle bundle12 = new Bundle();
            bundle12.putLong("chat_id", ProfileActivity.this.currentChat.id);
            bundle12.putInt("type", 3);
            ChatUsersActivity chatUsersActivity5 = new ChatUsersActivity(bundle12);
            chatUsersActivity5.setInfo(ProfileActivity.this.chatInfo);
            ProfileActivity.this.presentFragment(chatUsersActivity5);
        }

        public void lambda$onItemClick$0(int i) {
            if (i == 1) {
                NotificationCenter notificationCenter = ProfileActivity.this.getNotificationCenter();
                ProfileActivity profileActivity = ProfileActivity.this;
                int i2 = NotificationCenter.closeChats;
                notificationCenter.removeObserver(profileActivity, i2);
                ProfileActivity.this.getNotificationCenter().postNotificationName(i2, new Object[0]);
                ProfileActivity.this.playProfileAnimation = 0;
                ProfileActivity.this.finishFragment();
                return;
            }
            ProfileActivity.this.getNotificationCenter().postNotificationName(NotificationCenter.peerSettingsDidLoad, new Object[]{Long.valueOf(ProfileActivity.this.userId)});
        }

        public void lambda$onItemClick$1(DialogInterface dialogInterface, int i) {
            ProfileActivity.this.getMessagesController().blockPeer(ProfileActivity.this.userId);
            if (BulletinFactory.canShowBulletin(ProfileActivity.this)) {
                BulletinFactory.createBanBulletin(ProfileActivity.this, true).show();
            }
        }

        public void lambda$onItemClick$2(TLRPC.User user, boolean z) {
            if (ProfileActivity.this.getParentLayout() != null) {
                List<BaseFragment> fragmentStack = ProfileActivity.this.getParentLayout().getFragmentStack();
                if (((fragmentStack == null || fragmentStack.size() < 2) ? null : fragmentStack.get(fragmentStack.size() - 2)) instanceof ChatActivity) {
                    ProfileActivity.this.getParentLayout().removeFragmentFromStack(fragmentStack.size() - 2);
                }
            }
            ProfileActivity.this.finishFragment();
            ProfileActivity.this.getNotificationCenter().postNotificationName(NotificationCenter.needDeleteDialog, new Object[]{Long.valueOf(ProfileActivity.this.dialogId), user, ProfileActivity.this.currentChat, Boolean.valueOf(z)});
        }

        public void lambda$onItemClick$3() {
            ProfileActivity.this.getSendMessagesHelper().sendMessage(SendMessagesHelper.SendMessageParams.of("/start", ProfileActivity.this.userId, (MessageObject) null, (MessageObject) null, (TLRPC.WebPage) null, false, (ArrayList) null, (TLRPC.ReplyMarkup) null, (HashMap) null, true, 0, (MessageObject.SendAnimationData) null, false));
        }

        public void lambda$onItemClick$4(TLRPC.User user, DialogInterface dialogInterface, int i) {
            ArrayList arrayList = new ArrayList();
            arrayList.add(user);
            ProfileActivity.this.getContactsController().deleteContact(arrayList, true);
            if (user != null) {
                user.contact = false;
                ProfileActivity.this.updateListAnimated(false);
            }
        }

        public boolean lambda$onItemClick$8(final TLRPC.User user, final DialogsActivity dialogsActivity, final DialogsActivity dialogsActivity2, ArrayList arrayList, CharSequence charSequence, boolean z, TopicsFragment topicsFragment) {
            TLRPC.TL_chatAdminRights tL_chatAdminRights;
            final long j = ((MessagesStorage.TopicKey) arrayList.get(0)).dialogId;
            TLRPC.Chat chat = MessagesController.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).getChat(Long.valueOf(-j));
            if (chat != null && (chat.creator || ((tL_chatAdminRights = chat.admin_rights) != null && tL_chatAdminRights.add_admins))) {
                ProfileActivity.this.getMessagesController().checkIsInChat(false, chat, user, new MessagesController.IsInChatCheckedCallback() {
                    public final void run(boolean z2, TLRPC.TL_chatAdminRights tL_chatAdminRights2, String str) {
                        ProfileActivity.AnonymousClass6.this.lambda$onItemClick$6(j, dialogsActivity, z2, tL_chatAdminRights2, str);
                    }
                });
            } else {
                AlertDialog.Builder builder = new AlertDialog.Builder(ProfileActivity.this.getParentActivity(), ProfileActivity.this.resourcesProvider);
                int i = R.string.AddBot;
                builder.setTitle(LocaleController.getString("AddBot", i));
                builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatString("AddMembersAlertNamesText", R.string.AddMembersAlertNamesText, new Object[]{UserObject.getUserName(user), chat == null ? "" : chat.title})));
                builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
                builder.setPositiveButton(LocaleController.getString("AddBot", i), new DialogInterface.OnClickListener() {
                    @Override
                    public final void onClick(DialogInterface dialogInterface, int i2) {
                        ProfileActivity.AnonymousClass6.this.lambda$onItemClick$7(j, dialogsActivity2, user, dialogInterface, i2);
                    }
                });
                ProfileActivity.this.showDialog(builder.create());
            }
            return true;
        }

        public void lambda$onItemClick$6(final long j, final DialogsActivity dialogsActivity, final boolean z, final TLRPC.TL_chatAdminRights tL_chatAdminRights, final String str) {
            AndroidUtilities.runOnUIThread(new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.AnonymousClass6.this.lambda$onItemClick$5(j, tL_chatAdminRights, str, z, dialogsActivity);
                }
            });
        }

        public void lambda$onItemClick$5(long j, TLRPC.TL_chatAdminRights tL_chatAdminRights, String str, boolean z, final DialogsActivity dialogsActivity) {
            ChatRightsEditActivity chatRightsEditActivity = new ChatRightsEditActivity(ProfileActivity.this.userId, -j, tL_chatAdminRights, null, null, str, 2, true, !z, null);
            chatRightsEditActivity.setDelegate(new ChatRightsEditActivity.ChatRightsEditActivityDelegate() {
                @Override
                public void didChangeOwner(TLRPC.User user) {
                }

                @Override
                public void didSetRights(int rights, TLRPC.TL_chatAdminRights rightsAdmin, TLRPC.TL_chatBannedRights rightsBanned, String rank) {
                    ProfileActivity.this.disableProfileAnimation = true;
                    dialogsActivity.removeSelfFromStack();
                    NotificationCenter notificationCenter = ProfileActivity.this.getNotificationCenter();
                    ProfileActivity profileActivity = ProfileActivity.this;
                    int i = NotificationCenter.closeChats;
                    notificationCenter.removeObserver(profileActivity, i);
                    ProfileActivity.this.getNotificationCenter().postNotificationName(i, new Object[0]);
                }
            });
            ProfileActivity.this.presentFragment(chatRightsEditActivity);
        }

        public void lambda$onItemClick$7(long j, DialogsActivity dialogsActivity, TLRPC.User user, DialogInterface dialogInterface, int i) {
            ProfileActivity.this.disableProfileAnimation = true;
            Bundle bundle = new Bundle();
            bundle.putBoolean("scrollToTopOnResume", true);
            long j2 = -j;
            bundle.putLong("chat_id", j2);
            if (ProfileActivity.this.getMessagesController().checkCanOpenChat(bundle, dialogsActivity)) {
                ChatActivity chatActivity = new ChatActivity(bundle);
                NotificationCenter notificationCenter = ProfileActivity.this.getNotificationCenter();
                ProfileActivity profileActivity = ProfileActivity.this;
                int i2 = NotificationCenter.closeChats;
                notificationCenter.removeObserver(profileActivity, i2);
                ProfileActivity.this.getNotificationCenter().postNotificationName(i2, new Object[0]);
                ProfileActivity.this.getMessagesController().addUserToChat(j2, user, 0, (String) null, chatActivity, true, (Runnable) null, (MessagesController.ErrorDelegate) null);
                ProfileActivity.this.presentFragment(chatActivity, true);
            }
        }

        public void lambda$onItemClick$9(DialogInterface dialogInterface, int i) {
            ProfileActivity.this.creatingChat = true;
            ProfileActivity.this.getSecretChatHelper().startSecretChat(ProfileActivity.this.getParentActivity(), ProfileActivity.this.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.userId)));
        }

        public void lambda$onItemClick$10(boolean z, Uri uri) {
            if (ProfileActivity.this.getParentActivity() == null) {
                return;
            }
            BulletinFactory.createSaveToGalleryBulletin(ProfileActivity.this, z, (Theme.ResourcesProvider) null).show();
        }

        public void lambda$onItemClick$12(final UserConfig userConfig, final TLRPC.Photo photo, final TLObject tLObject, TLRPC.TL_error tL_error) {
            AndroidUtilities.runOnUIThread(new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.AnonymousClass6.this.lambda$onItemClick$11(tLObject, userConfig, photo);
                }
            });
        }

        public void lambda$onItemClick$11(TLObject tLObject, UserConfig userConfig, TLRPC.Photo photo) {
            ProfileActivity.this.avatarsViewPager.finishSettingMainPhoto();
            if (tLObject instanceof TLRPC.TL_photos_photo) {
                TLRPC.TL_photos_photo tL_photos_photo = (TLRPC.TL_photos_photo) tLObject;
                ProfileActivity.this.getMessagesController().putUsers(tL_photos_photo.users, false);
                TLRPC.User user = ProfileActivity.this.getMessagesController().getUser(Long.valueOf(userConfig.clientUserId));
                if (tL_photos_photo.photo instanceof TLRPC.TL_photo) {
                    ProfileActivity.this.avatarsViewPager.replaceFirstPhoto(photo, tL_photos_photo.photo);
                    if (user != null) {
                        user.photo.photo_id = tL_photos_photo.photo.id;
                        userConfig.setCurrentUser(user);
                        userConfig.saveConfig(true);
                    }
                }
            }
        }

        public void lambda$onItemClick$13(DialogInterface dialogInterface, int i) {
            TLRPC.Photo photo;
            int realPosition = ProfileActivity.this.avatarsViewPager.getRealPosition();
            TLRPC.Photo photo2 = ProfileActivity.this.avatarsViewPager.getPhoto(realPosition);
            TLRPC.UserFull userInfo = ProfileActivity.this.getUserInfo();
            if (ProfileActivity.this.avatar != null && realPosition == 0) {
                ProfileActivity.this.imageUpdater.cancel();
                ProfileActivity profileActivity = ProfileActivity.this;
                if (profileActivity.avatarUploadingRequest != 0) {
                    profileActivity.getConnectionsManager().cancelRequest(ProfileActivity.this.avatarUploadingRequest, true);
                }
                ProfileActivity.this.allowPullingDown = (AndroidUtilities.isTablet() || ProfileActivity.this.isInLandscapeMode || !ProfileActivity.this.avatarImage.getImageReceiver().hasNotThumb() || AndroidUtilities.isAccessibilityScreenReaderEnabled()) ? false : true;
                ProfileActivity.this.avatar = null;
                ProfileActivity.this.avatarBig = null;
                ProfileActivity.this.avatarsViewPager.scrolledByUser = true;
                ProfileActivity.this.avatarsViewPager.removeUploadingImage(ProfileActivity.this.uploadingImageLocation);
                ProfileActivity.this.avatarsViewPager.setCreateThumbFromParent(false);
                ProfileActivity.this.updateProfileData(true);
                ProfileActivity.this.showAvatarProgress(false, true);
                ProfileActivity.this.getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(MessagesController.UPDATE_MASK_ALL)});
                ProfileActivity.this.getNotificationCenter().postNotificationName(NotificationCenter.mainUserInfoChanged, new Object[0]);
                ProfileActivity.this.getUserConfig().saveConfig(true);
                return;
            }
            if (ProfileActivity.this.hasFallbackPhoto && photo2 != null && userInfo != null && (photo = userInfo.fallback_photo) != null && photo.id == photo2.id) {
                userInfo.fallback_photo = null;
                userInfo.flags &= -4194305;
                ProfileActivity.this.getMessagesStorage().updateUserInfo(userInfo, true);
                ProfileActivity.this.updateProfileData(false);
            }
            if (ProfileActivity.this.avatarsViewPager.getRealCount() == 1) {
                ProfileActivity.this.setForegroundImage(true);
            }
            if (photo2 == null || ProfileActivity.this.avatarsViewPager.getRealPosition() == 0) {
                TLRPC.Photo photo3 = ProfileActivity.this.avatarsViewPager.getPhoto(1);
                if (photo3 != null) {
                    ProfileActivity.this.getUserConfig().getCurrentUser().photo = new TLRPC.TL_userProfilePhoto();
                    TLRPC.PhotoSize closestPhotoSizeWithSize = FileLoader.getClosestPhotoSizeWithSize(photo3.sizes, 90);
                    TLRPC.PhotoSize closestPhotoSizeWithSize2 = FileLoader.getClosestPhotoSizeWithSize(photo3.sizes, 1000);
                    if (closestPhotoSizeWithSize != null && closestPhotoSizeWithSize2 != null) {
                        ProfileActivity.this.getUserConfig().getCurrentUser().photo.photo_small = closestPhotoSizeWithSize.location;
                        ProfileActivity.this.getUserConfig().getCurrentUser().photo.photo_big = closestPhotoSizeWithSize2.location;
                    }
                } else {
                    ProfileActivity.this.getUserConfig().getCurrentUser().photo = new TLRPC.TL_userProfilePhotoEmpty();
                }
                ProfileActivity.this.getMessagesController().deleteUserPhoto((TLRPC.InputPhoto) null);
            } else {
                TLRPC.TL_inputPhoto tL_inputPhoto = new TLRPC.TL_inputPhoto();
                ((TLRPC.InputPhoto) tL_inputPhoto).id = photo2.id;
                ((TLRPC.InputPhoto) tL_inputPhoto).access_hash = photo2.access_hash;
                byte[] bArr = photo2.file_reference;
                ((TLRPC.InputPhoto) tL_inputPhoto).file_reference = bArr;
                if (bArr == null) {
                    ((TLRPC.InputPhoto) tL_inputPhoto).file_reference = new byte[0];
                }
                ProfileActivity.this.getMessagesController().deleteUserPhoto(tL_inputPhoto);
                ProfileActivity.this.getMessagesStorage().clearUserPhoto(ProfileActivity.this.userId, photo2.id);
            }
            if (ProfileActivity.this.avatarsViewPager.removePhotoAtIndex(realPosition) || ProfileActivity.this.avatarsViewPager.getRealCount() <= 0) {
                ProfileActivity.this.avatarsViewPager.setVisibility(8);
                ProfileActivity.this.avatarImage.setForegroundAlpha(1.0f);
                ProfileActivity.this.avatarContainer.setVisibility(0);
                ProfileActivity.this.doNotSetForeground = true;
                View findViewByPosition = ProfileActivity.this.layoutManager.findViewByPosition(0);
                if (findViewByPosition != null) {
                    ProfileActivity.this.listView.smoothScrollBy(0, findViewByPosition.getTop() - AndroidUtilities.dp(88.0f), CubicBezierInterpolator.EASE_OUT_QUINT);
                }
            }
        }
    }

    public class AnonymousClass7 extends NestedFrameLayout {
        public Paint grayPaint;
        public boolean ignoreLayout;
        public final ArrayList<View> sortedChildren;
        public final Comparator<View> viewComparator;
        public boolean wasPortrait;

        public boolean hasOverlappingRendering() {
            return false;
        }

        public AnonymousClass7(Context context) {
            super(context);
            this.grayPaint = new Paint();
            this.sortedChildren = new ArrayList<>();
            this.viewComparator = new Comparator() {
                @Override
                public final int compare(Object obj, Object obj2) {
                    int lambda$$1;
                    lambda$$1 = ProfileActivity.AnonymousClass7.lambda$$1((View) obj, (View) obj2);
                    return lambda$$1;
                }
            };
        }

        public boolean dispatchTouchEvent(MotionEvent ev) {
            if (ProfileActivity.this.pinchToZoomHelper.isInOverlayMode()) {
                return ProfileActivity.this.pinchToZoomHelper.onTouchEvent(ev);
            }
            if (ProfileActivity.this.sharedMediaLayout != null && ProfileActivity.this.sharedMediaLayout.isInFastScroll() && ProfileActivity.this.sharedMediaLayout.isPinnedToTop()) {
                return ProfileActivity.this.sharedMediaLayout.dispatchFastScrollEvent(ev);
            }
            if (ProfileActivity.this.sharedMediaLayout == null || !ProfileActivity.this.sharedMediaLayout.checkPinchToZoom(ev)) {
                return super/*android.widget.FrameLayout*/.dispatchTouchEvent(ev);
            }
            return true;
        }

        public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
            boolean z;
            int dp;
            int i;
            View view;
            int i2;
            boolean z2;
            int measuredWidth;
            int max;
            int currentActionBarHeight = ActionBar.getCurrentActionBarHeight() + (((BaseFragment) ProfileActivity.this).actionBar.getOccupyStatusBar() ? AndroidUtilities.statusBarHeight : 0);
            if (ProfileActivity.this.listView != null) {
                FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) ProfileActivity.this.listView.getLayoutParams();
                if (layoutParams.topMargin != currentActionBarHeight) {
                    layoutParams.topMargin = currentActionBarHeight;
                }
            }
            if (ProfileActivity.this.searchListView != null) {
                FrameLayout.LayoutParams layoutParams2 = (FrameLayout.LayoutParams) ProfileActivity.this.searchListView.getLayoutParams();
                if (layoutParams2.topMargin != currentActionBarHeight) {
                    layoutParams2.topMargin = currentActionBarHeight;
                }
            }
            int size = View.MeasureSpec.getSize(heightMeasureSpec);
            super/*android.widget.FrameLayout*/.onMeasure(widthMeasureSpec, View.MeasureSpec.makeMeasureSpec(size, 1073741824));
            if (ProfileActivity.this.lastMeasuredContentWidth == getMeasuredWidth() && ProfileActivity.this.lastMeasuredContentHeight == getMeasuredHeight()) {
                z = false;
            } else {
                z = (ProfileActivity.this.lastMeasuredContentWidth == 0 || ProfileActivity.this.lastMeasuredContentWidth == getMeasuredWidth()) ? false : true;
                ProfileActivity.this.listContentHeight = 0;
                int itemCount = ProfileActivity.this.listAdapter.getItemCount();
                ProfileActivity.this.lastMeasuredContentWidth = getMeasuredWidth();
                ProfileActivity.this.lastMeasuredContentHeight = getMeasuredHeight();
                int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(getMeasuredWidth(), 1073741824);
                int makeMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(ProfileActivity.this.listView.getMeasuredHeight(), 0);
                ProfileActivity.this.positionToOffset.clear();
                for (int i3 = 0; i3 < itemCount; i3++) {
                    int itemViewType = ProfileActivity.this.listAdapter.getItemViewType(i3);
                    ProfileActivity.this.positionToOffset.put(Integer.valueOf(i3), Integer.valueOf(ProfileActivity.this.listContentHeight));
                    if (itemViewType == 13) {
                        ProfileActivity.this.listContentHeight += ProfileActivity.this.listView.getMeasuredHeight();
                    } else {
                        RecyclerView.ViewHolder createViewHolder = ProfileActivity.this.listAdapter.createViewHolder((ViewGroup) null, itemViewType);
                        ProfileActivity.this.listAdapter.onBindViewHolder(createViewHolder, i3);
                        createViewHolder.itemView.measure(makeMeasureSpec, makeMeasureSpec2);
                        ProfileActivity.this.listContentHeight += createViewHolder.itemView.getMeasuredHeight();
                    }
                }
                if (ProfileActivity.this.emptyView != null) {
                    ((FrameLayout.LayoutParams) ProfileActivity.this.emptyView.getLayoutParams()).topMargin = AndroidUtilities.dp(88.0f) + AndroidUtilities.statusBarHeight;
                }
            }
            ProfileActivity profileActivity = ProfileActivity.this;
            if (profileActivity.previousTransitionFragment != null) {
                profileActivity.nameTextView[0].setRightPadding(ProfileActivity.this.nameTextView[0].getMeasuredWidth() - ProfileActivity.this.previousTransitionFragment.getAvatarContainer().getTitleTextView().getMeasuredWidth());
            }
            if (!ProfileActivity.this.fragmentOpened && (ProfileActivity.this.expandPhoto || (ProfileActivity.this.openAnimationInProgress && ProfileActivity.this.playProfileAnimation == 2))) {
                this.ignoreLayout = true;
                if (ProfileActivity.this.expandPhoto) {
                    if (ProfileActivity.this.searchItem != null) {
                        ProfileActivity.this.searchItem.setAlpha(0.0f);
                        ProfileActivity.this.searchItem.setEnabled(false);
                        ProfileActivity.this.searchItem.setVisibility(8);
                    }
                    ProfileActivity.this.nameTextView[1].setTextColor(-1);
                    ProfileActivity.this.nameTextView[1].setPivotY(ProfileActivity.this.nameTextView[1].getMeasuredHeight());
                    ProfileActivity.this.nameTextView[1].setScaleX(1.67f);
                    ProfileActivity.this.nameTextView[1].setScaleY(1.67f);
                    if (ProfileActivity.this.scamDrawable != null) {
                        ProfileActivity.this.scamDrawable.setColor(Color.argb(179, 255, 255, 255));
                    }
                    if (ProfileActivity.this.lockIconDrawable != null) {
                        ProfileActivity.this.lockIconDrawable.setColorFilter(-1, PorterDuff.Mode.MULTIPLY);
                    }
                    if (ProfileActivity.this.verifiedCrossfadeDrawable[0] != null) {
                        ProfileActivity.this.verifiedCrossfadeDrawable[0].setProgress(1.0f);
                    }
                    if (ProfileActivity.this.verifiedCrossfadeDrawable[1] != null) {
                        ProfileActivity.this.verifiedCrossfadeDrawable[1].setProgress(1.0f);
                    }
                    if (ProfileActivity.this.premiumCrossfadeDrawable[0] != null) {
                        ProfileActivity.this.premiumCrossfadeDrawable[0].setProgress(1.0f);
                    }
                    if (ProfileActivity.this.premiumCrossfadeDrawable[1] != null) {
                        ProfileActivity.this.premiumCrossfadeDrawable[1].setProgress(1.0f);
                    }
                    ProfileActivity.this.updateEmojiStatusDrawableColor(1.0f);
                    ProfileActivity.this.onlineTextView[1].setTextColor(-1275068417);
                    ((BaseFragment) ProfileActivity.this).actionBar.setItemsBackgroundColor(1090519039, false);
                    ((BaseFragment) ProfileActivity.this).actionBar.setItemsColor(-1, false);
                    ProfileActivity.this.overlaysView.setOverlaysVisible();
                    ProfileActivity.this.overlaysView.setAlphaValue(1.0f, false);
                    ProfileActivity.this.avatarImage.setForegroundAlpha(1.0f);
                    ProfileActivity.this.avatarContainer.setVisibility(8);
                    ProfileActivity.this.avatarsViewPager.resetCurrentItem();
                    ProfileActivity.this.avatarsViewPager.setVisibility(0);
                    if (ProfileActivity.this.showStatusButton != null) {
                        ProfileActivity.this.showStatusButton.setBackgroundColor(603979775);
                    }
                    if (ProfileActivity.this.storyView != null) {
                        ProfileActivity.this.storyView.setExpandProgress(1.0f);
                    }
                    ProfileActivity.this.expandPhoto = false;
                }
                ProfileActivity.this.allowPullingDown = true;
                ProfileActivity.this.isPulledDown = true;
                NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needCheckSystemBarColors, new Object[]{Boolean.TRUE});
                if (ProfileActivity.this.otherItem != null) {
                    if (!ProfileActivity.this.getMessagesController().isChatNoForwards(ProfileActivity.this.currentChat)) {
                        ProfileActivity.this.otherItem.showSubItem(21);
                        ProfileActivity.this.otherItem.showSubItem(29);
                    } else {
                        ProfileActivity.this.otherItem.hideSubItem(21);
                        ProfileActivity.this.otherItem.hideSubItem(29);
                    }
                    if (ProfileActivity.this.imageUpdater != null) {
                        ProfileActivity.this.otherItem.showSubItem(34);
                        ProfileActivity.this.otherItem.showSubItem(35);
                        ProfileActivity.this.otherItem.hideSubItem(31);
                    }
                }
                ProfileActivity.this.currentExpanAnimatorFracture = 1.0f;
                if (ProfileActivity.this.isInLandscapeMode) {
                    measuredWidth = AndroidUtilities.dp(88.0f);
                    max = 0;
                } else {
                    measuredWidth = ProfileActivity.this.listView.getMeasuredWidth();
                    max = Math.max(0, getMeasuredHeight() - ((ProfileActivity.this.listContentHeight + AndroidUtilities.dp(88.0f)) + currentActionBarHeight));
                }
                if (ProfileActivity.this.banFromGroup != 0) {
                    max += AndroidUtilities.dp(48.0f);
                    ProfileActivity.this.listView.setBottomGlowOffset(AndroidUtilities.dp(48.0f));
                } else {
                    ProfileActivity.this.listView.setBottomGlowOffset(0);
                }
                ProfileActivity.this.initialAnimationExtraHeight = measuredWidth - currentActionBarHeight;
                if (ProfileActivity.this.playProfileAnimation == 0) {
                    ProfileActivity profileActivity2 = ProfileActivity.this;
                    profileActivity2.extraHeight = profileActivity2.initialAnimationExtraHeight;
                }
                ProfileActivity.this.layoutManager.scrollToPositionWithOffset(0, -currentActionBarHeight);
                ProfileActivity.this.listView.setPadding(0, measuredWidth, 0, max);
                measureChildWithMargins(ProfileActivity.this.listView, widthMeasureSpec, 0, heightMeasureSpec, 0);
                ProfileActivity.this.listView.layout(0, currentActionBarHeight, ProfileActivity.this.listView.getMeasuredWidth(), ProfileActivity.this.listView.getMeasuredHeight() + currentActionBarHeight);
                this.ignoreLayout = false;
            } else if (ProfileActivity.this.fragmentOpened && !ProfileActivity.this.openAnimationInProgress && !ProfileActivity.this.firstLayout) {
                boolean z3 = true;
                this.ignoreLayout = true;
                if (ProfileActivity.this.isInLandscapeMode || AndroidUtilities.isTablet()) {
                    dp = AndroidUtilities.dp(88.0f);
                    i = 0;
                } else {
                    dp = ProfileActivity.this.listView.getMeasuredWidth();
                    i = Math.max(0, getMeasuredHeight() - ((ProfileActivity.this.listContentHeight + AndroidUtilities.dp(88.0f)) + currentActionBarHeight));
                }
                if (ProfileActivity.this.banFromGroup != 0) {
                    i += AndroidUtilities.dp(48.0f);
                    ProfileActivity.this.listView.setBottomGlowOffset(AndroidUtilities.dp(48.0f));
                } else {
                    ProfileActivity.this.listView.setBottomGlowOffset(0);
                }
                int paddingTop = ProfileActivity.this.listView.getPaddingTop();
                int i4 = 0;
                while (true) {
                    if (i4 >= ProfileActivity.this.listView.getChildCount()) {
                        view = null;
                        i2 = -1;
                        break;
                    }
                    int childAdapterPosition = ProfileActivity.this.listView.getChildAdapterPosition(ProfileActivity.this.listView.getChildAt(i4));
                    if (childAdapterPosition != -1) {
                        View childAt = ProfileActivity.this.listView.getChildAt(i4);
                        i2 = childAdapterPosition;
                        view = childAt;
                        break;
                    }
                    i4++;
                }
                if (view == null && (view = ProfileActivity.this.listView.getChildAt(0)) != null) {
                    RecyclerView.ViewHolder findContainingViewHolder = ProfileActivity.this.listView.findContainingViewHolder(view);
                    int adapterPosition = findContainingViewHolder.getAdapterPosition();
                    i2 = adapterPosition == -1 ? findContainingViewHolder.getPosition() : adapterPosition;
                }
                int top = view != null ? view.getTop() : dp;
                if ((((BaseFragment) ProfileActivity.this).actionBar.isSearchFieldVisible() || ProfileActivity.this.openSimilar) && ProfileActivity.this.sharedMediaRow >= 0) {
                    ProfileActivity.this.layoutManager.scrollToPositionWithOffset(ProfileActivity.this.sharedMediaRow, -dp);
                } else {
                    if (ProfileActivity.this.invalidateScroll || paddingTop != dp) {
                        ProfileActivity profileActivity3 = ProfileActivity.this;
                        if (profileActivity3.savedScrollPosition >= 0) {
                            LinearLayoutManager linearLayoutManager = profileActivity3.layoutManager;
                            ProfileActivity profileActivity4 = ProfileActivity.this;
                            linearLayoutManager.scrollToPositionWithOffset(profileActivity4.savedScrollPosition, profileActivity4.savedScrollOffset - dp);
                        } else if ((!z || !profileActivity3.allowPullingDown) && view != null) {
                            if (i2 == 0 && !ProfileActivity.this.allowPullingDown && top > AndroidUtilities.dp(88.0f)) {
                                top = AndroidUtilities.dp(88.0f);
                            }
                            ProfileActivity.this.layoutManager.scrollToPositionWithOffset(i2, top - dp);
                            z3 = true;
                        } else {
                            ProfileActivity.this.layoutManager.scrollToPositionWithOffset(0, AndroidUtilities.dp(88.0f) - dp);
                        }
                    }
                    z3 = false;
                }
                if (paddingTop == dp && ProfileActivity.this.listView.getPaddingBottom() == i) {
                    z2 = z3;
                } else {
                    ProfileActivity.this.listView.setPadding(0, dp, 0, i);
                    z2 = true;
                }
                if (z2) {
                    measureChildWithMargins(ProfileActivity.this.listView, widthMeasureSpec, 0, heightMeasureSpec, 0);
                    try {
                        ProfileActivity.this.listView.layout(0, currentActionBarHeight, ProfileActivity.this.listView.getMeasuredWidth(), ProfileActivity.this.listView.getMeasuredHeight() + currentActionBarHeight);
                    } catch (Exception e) {
                        FileLog.e(e);
                    }
                }
                this.ignoreLayout = false;
            }
            boolean z4 = size > View.MeasureSpec.getSize(widthMeasureSpec);
            if (z4 != this.wasPortrait) {
                post(new Runnable() {
                    @Override
                    public final void run() {
                        ProfileActivity.AnonymousClass7.this.lambda$onMeasure$0();
                    }
                });
                this.wasPortrait = z4;
            }
            if (ProfileActivity.this.searchItem == null || ProfileActivity.this.qrItem == null) {
                return;
            }
            AndroidUtilities.dp(48.0f);
            float unused = ProfileActivity.this.currentExpandAnimatorValue;
        }

        public void lambda$onMeasure$0() {
            if (ProfileActivity.this.selectAnimatedEmojiDialog != null) {
                ProfileActivity.this.selectAnimatedEmojiDialog.dismiss();
                ProfileActivity.this.selectAnimatedEmojiDialog = null;
            }
        }

        public void onLayout(boolean changed, int left, int top, int right, int bottom) {
            super.onLayout(changed, left, top, right, bottom);
            ProfileActivity profileActivity = ProfileActivity.this;
            profileActivity.savedScrollPosition = -1;
            profileActivity.firstLayout = false;
            ProfileActivity.this.invalidateScroll = false;
            ProfileActivity.this.checkListViewScroll();
        }

        public void requestLayout() {
            if (this.ignoreLayout) {
                return;
            }
            super/*android.widget.FrameLayout*/.requestLayout();
        }

        public static int lambda$$1(View view, View view2) {
            return (int) (view.getY() - view2.getY());
        }

        public void dispatchDraw(Canvas canvas) {
            FragmentContextView fragmentContextView;
            boolean z;
            int i;
            ProfileActivity.this.whitePaint.setColor(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite));
            if (ProfileActivity.this.listView.getVisibility() == 0) {
                this.grayPaint.setColor(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundGray));
                if (ProfileActivity.this.transitionAnimationInProress) {
                    ProfileActivity.this.whitePaint.setAlpha((int) (ProfileActivity.this.listView.getAlpha() * 255.0f));
                }
                if (ProfileActivity.this.transitionAnimationInProress) {
                    this.grayPaint.setAlpha((int) (ProfileActivity.this.listView.getAlpha() * 255.0f));
                }
                int childCount = ProfileActivity.this.listView.getChildCount();
                this.sortedChildren.clear();
                boolean z2 = false;
                for (int i2 = 0; i2 < childCount; i2++) {
                    if (ProfileActivity.this.listView.getChildAdapterPosition(ProfileActivity.this.listView.getChildAt(i2)) != -1) {
                        this.sortedChildren.add(ProfileActivity.this.listView.getChildAt(i2));
                    } else {
                        z2 = true;
                    }
                }
                Collections.sort(this.sortedChildren, this.viewComparator);
                float y = ProfileActivity.this.listView.getY();
                int size = this.sortedChildren.size();
                if (!ProfileActivity.this.openAnimationInProgress && size > 0 && !z2) {
                    y += this.sortedChildren.get(0).getY();
                }
                float f = y;
                boolean z3 = false;
                float f2 = 1.0f;
                for (int i3 = 0; i3 < size; i3++) {
                    View view = this.sortedChildren.get(i3);
                    boolean z4 = view.getBackground() != null;
                    int y2 = (int) (ProfileActivity.this.listView.getY() + view.getY());
                    if (z3 != z4) {
                        if (z3) {
                            z = z4;
                            canvas.drawRect(ProfileActivity.this.listView.getX(), f, ProfileActivity.this.listView.getX() + ProfileActivity.this.listView.getMeasuredWidth(), y2, this.grayPaint);
                            i = y2;
                        } else {
                            z = z4;
                            if (f2 != 1.0f) {
                                float f3 = y2;
                                i = y2;
                                canvas.drawRect(ProfileActivity.this.listView.getX(), f, ProfileActivity.this.listView.getX() + ProfileActivity.this.listView.getMeasuredWidth(), f3, this.grayPaint);
                                ProfileActivity.this.whitePaint.setAlpha((int) (f2 * 255.0f));
                                canvas.drawRect(ProfileActivity.this.listView.getX(), f, ProfileActivity.this.listView.getX() + ProfileActivity.this.listView.getMeasuredWidth(), f3, ProfileActivity.this.whitePaint);
                                ProfileActivity.this.whitePaint.setAlpha(255);
                            } else {
                                i = y2;
                                canvas.drawRect(ProfileActivity.this.listView.getX(), f, ProfileActivity.this.listView.getX() + ProfileActivity.this.listView.getMeasuredWidth(), i, ProfileActivity.this.whitePaint);
                            }
                        }
                        f = i;
                        f2 = view.getAlpha();
                        z3 = z;
                    } else if (view.getAlpha() == 1.0f) {
                        f2 = 1.0f;
                    }
                }
                if (z3) {
                    canvas.drawRect(ProfileActivity.this.listView.getX(), f, ProfileActivity.this.listView.getX() + ProfileActivity.this.listView.getMeasuredWidth(), ProfileActivity.this.listView.getBottom(), this.grayPaint);
                } else if (f2 != 1.0f) {
                    canvas.drawRect(ProfileActivity.this.listView.getX(), f, ProfileActivity.this.listView.getX() + ProfileActivity.this.listView.getMeasuredWidth(), ProfileActivity.this.listView.getBottom(), this.grayPaint);
                    ProfileActivity.this.whitePaint.setAlpha((int) (f2 * 255.0f));
                    canvas.drawRect(ProfileActivity.this.listView.getX(), f, ProfileActivity.this.listView.getX() + ProfileActivity.this.listView.getMeasuredWidth(), ProfileActivity.this.listView.getBottom(), ProfileActivity.this.whitePaint);
                    ProfileActivity.this.whitePaint.setAlpha(255);
                } else {
                    canvas.drawRect(ProfileActivity.this.listView.getX(), f, ProfileActivity.this.listView.getX() + ProfileActivity.this.listView.getMeasuredWidth(), ProfileActivity.this.listView.getBottom(), ProfileActivity.this.whitePaint);
                }
            } else {
                canvas.drawRect(0.0f, ProfileActivity.this.searchListView.getTop() + ProfileActivity.this.extraHeight + ProfileActivity.this.searchTransitionOffset, getMeasuredWidth(), r1 + getMeasuredHeight(), ProfileActivity.this.whitePaint);
            }
            super.dispatchDraw(canvas);
            ProfileActivity profileActivity = ProfileActivity.this;
            if (profileActivity.profileTransitionInProgress && ((BaseFragment) profileActivity).parentLayout.getFragmentStack().size() > 1) {
                BaseFragment baseFragment = ((BaseFragment) ProfileActivity.this).parentLayout.getFragmentStack().get(((BaseFragment) ProfileActivity.this).parentLayout.getFragmentStack().size() - 2);
                if ((baseFragment instanceof ChatActivity) && (fragmentContextView = ((ChatActivity) baseFragment).getFragmentContextView()) != null && fragmentContextView.isCallStyle()) {
                    float dpf2 = ProfileActivity.this.extraHeight / AndroidUtilities.dpf2(fragmentContextView.getStyleHeight());
                    if (dpf2 > 1.0f) {
                        dpf2 = 1.0f;
                    }
                    canvas.save();
                    canvas.translate(fragmentContextView.getX(), fragmentContextView.getY());
                    fragmentContextView.setDrawOverlay(true);
                    fragmentContextView.setCollapseTransition(true, ProfileActivity.this.extraHeight, dpf2);
                    fragmentContextView.draw(canvas);
                    fragmentContextView.setCollapseTransition(false, ProfileActivity.this.extraHeight, dpf2);
                    fragmentContextView.setDrawOverlay(false);
                    canvas.restore();
                }
            }
            if (ProfileActivity.this.scrimPaint.getAlpha() > 0) {
                canvas.drawRect(0.0f, 0.0f, getWidth(), getHeight(), ProfileActivity.this.scrimPaint);
            }
            if (ProfileActivity.this.scrimView != null) {
                int save = canvas.save();
                canvas.translate(ProfileActivity.this.scrimView.getLeft(), ProfileActivity.this.scrimView.getTop());
                if (ProfileActivity.this.scrimView == ((BaseFragment) ProfileActivity.this).actionBar.getBackButton()) {
                    int max = Math.max(ProfileActivity.this.scrimView.getMeasuredWidth(), ProfileActivity.this.scrimView.getMeasuredHeight()) / 2;
                    int alpha = ProfileActivity.this.actionBarBackgroundPaint.getAlpha();
                    ProfileActivity.this.actionBarBackgroundPaint.setAlpha((int) ((alpha * (ProfileActivity.this.scrimPaint.getAlpha() / 255.0f)) / 0.3f));
                    float f4 = max;
                    canvas.drawCircle(f4, f4, 0.7f * f4, ProfileActivity.this.actionBarBackgroundPaint);
                    ProfileActivity.this.actionBarBackgroundPaint.setAlpha(alpha);
                }
                ProfileActivity.this.scrimView.draw(canvas);
                canvas.restoreToCount(save);
            }
            if (ProfileActivity.this.blurredView == null || ProfileActivity.this.blurredView.getVisibility() != 0) {
                return;
            }
            if (ProfileActivity.this.blurredView.getAlpha() == 1.0f) {
                ProfileActivity.this.blurredView.draw(canvas);
            } else if (ProfileActivity.this.blurredView.getAlpha() != 0.0f) {
                canvas.saveLayerAlpha(ProfileActivity.this.blurredView.getLeft(), ProfileActivity.this.blurredView.getTop(), ProfileActivity.this.blurredView.getRight(), ProfileActivity.this.blurredView.getBottom(), (int) (ProfileActivity.this.blurredView.getAlpha() * 255.0f), 31);
                canvas.translate(ProfileActivity.this.blurredView.getLeft(), ProfileActivity.this.blurredView.getTop());
                ProfileActivity.this.blurredView.draw(canvas);
                canvas.restore();
            }
        }

        public boolean drawChild(Canvas canvas, View child, long drawingTime) {
            if ((ProfileActivity.this.pinchToZoomHelper.isInOverlayMode() && (child == ProfileActivity.this.avatarContainer2 || child == ((BaseFragment) ProfileActivity.this).actionBar || child == ProfileActivity.this.writeButton)) || child == ProfileActivity.this.blurredView) {
                return true;
            }
            return super/*android.widget.FrameLayout*/.drawChild(canvas, child, drawingTime);
        }

        public void onAttachedToWindow() {
            super.onAttachedToWindow();
            ProfileActivity.this.fragmentViewAttached = true;
            for (int i = 0; i < ProfileActivity.this.emojiStatusDrawable.length; i++) {
                if (ProfileActivity.this.emojiStatusDrawable[i] != null) {
                    ProfileActivity.this.emojiStatusDrawable[i].attach();
                }
            }
        }

        public void onDetachedFromWindow() {
            super.onDetachedFromWindow();
            ProfileActivity.this.fragmentViewAttached = false;
            for (int i = 0; i < ProfileActivity.this.emojiStatusDrawable.length; i++) {
                if (ProfileActivity.this.emojiStatusDrawable[i] != null) {
                    ProfileActivity.this.emojiStatusDrawable[i].detach();
                }
            }
        }
    }

    public class AnonymousClass8 extends SharedMediaLayout {
        public int getInitialTab() {
            return 8;
        }

        public AnonymousClass8(Context context, long did, SharedMediaLayout.SharedMediaPreloader preloader, int commonGroupsCount, ArrayList sortedUsers, TLRPC.ChatFull chatInfo, TLRPC.UserFull userInfo, int initialTab, BaseFragment parent, SharedMediaLayout.Delegate delegate, int viewType, Theme.ResourcesProvider resourcesProvider) {
            super(context, did, preloader, commonGroupsCount, sortedUsers, chatInfo, userInfo, initialTab, parent, delegate, viewType, resourcesProvider);
        }

        public int processColor(int color) {
            return ProfileActivity.this.applyPeerColor(color, false);
        }

        public void onSelectedTabChanged() {
            ProfileActivity.this.updateSelectedMediaTabText();
        }

        public boolean includeSavedDialogs() {
            return ProfileActivity.this.dialogId == ProfileActivity.this.getUserConfig().getClientUserId() && !ProfileActivity.this.saved;
        }

        public boolean isSelf() {
            return ProfileActivity.this.myProfile;
        }

        public boolean isStoriesView() {
            return ProfileActivity.this.myProfile;
        }

        public void onSearchStateChanged(boolean expanded) {
            AndroidUtilities.removeAdjustResize(ProfileActivity.this.getParentActivity(), ((BaseFragment) ProfileActivity.this).classGuid);
            ProfileActivity.this.listView.stopScroll();
            ProfileActivity.this.avatarContainer2.setPivotY(ProfileActivity.this.avatarContainer.getPivotY() + (ProfileActivity.this.avatarContainer.getMeasuredHeight() / 2.0f));
            ProfileActivity.this.avatarContainer2.setPivotX(ProfileActivity.this.avatarContainer2.getMeasuredWidth() / 2.0f);
            AndroidUtilities.updateViewVisibilityAnimated(ProfileActivity.this.avatarContainer2, !expanded, 0.95f, true);
            ProfileActivity.this.callItem.setVisibility((expanded || !ProfileActivity.this.callItemVisible) ? 8 : 4);
            ProfileActivity.this.videoCallItem.setVisibility((expanded || !ProfileActivity.this.videoCallItemVisible) ? 8 : 4);
            ProfileActivity.this.editItem.setVisibility((expanded || !ProfileActivity.this.editItemVisible) ? 8 : 4);
            ProfileActivity.this.permissionsItem.setVisibility((expanded || !ProfileActivity.this.editItemVisible) ? 8 : 4);
            ProfileActivity.this.removedUsersItem.setVisibility((expanded || !ProfileActivity.this.editItemVisible) ? 8 : 4);
            ProfileActivity.this.adminsItem.setVisibility((expanded || !ProfileActivity.this.editItemVisible) ? 8 : 4);
            ProfileActivity.this.recentActionsItem.setVisibility((expanded || !ProfileActivity.this.editItemVisible) ? 8 : 4);
            ProfileActivity.this.membersItem.setVisibility((expanded || ProfileActivity.this.editItemVisible || !ProfileActivity.this.canSearchMembers) ? 8 : 4);
            ProfileActivity.this.otherItem.setVisibility(expanded ? 8 : 4);
            if (ProfileActivity.this.qrItem != null) {
                ProfileActivity.this.qrItem.setVisibility(expanded ? 8 : 4);
            }
            ProfileActivity.this.updateStoriesViewBounds(false);
        }

        public boolean onMemberClick(TLRPC.ChatParticipant participant, boolean isLong, View view) {
            return ProfileActivity.this.onMemberClick(participant, isLong, view);
        }

        public void drawBackgroundWithBlur(Canvas canvas, float y, Rect rectTmp2, Paint backgroundPaint) {
            ProfileActivity.this.contentView.drawBlurRect(canvas, ProfileActivity.this.listView.getY() + getY() + y, rectTmp2, backgroundPaint, true);
        }

        public void invalidateBlur() {
            if (ProfileActivity.this.contentView != null) {
                ProfileActivity.this.contentView.invalidateBlur();
            }
        }

        public void showActionMode(boolean show) {
            super.showActionMode(show);
            if (ProfileActivity.this.myProfile) {
                disableScroll(show);
                int selectedTab = getSelectedTab() - 8;
                if (selectedTab < 0 || selectedTab > 1) {
                    return;
                }
                ProfileActivity.this.bottomButtonContainer[selectedTab].animate().translationY((show || (selectedTab == 0 && MessagesController.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).storiesEnabled())) ? 0.0f : AndroidUtilities.dp(72.0f)).setDuration(320L).setInterpolator(CubicBezierInterpolator.EASE_OUT_QUINT).setUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                    @Override
                    public final void onAnimationUpdate(ValueAnimator valueAnimator) {
                        ProfileActivity.AnonymousClass8.this.lambda$showActionMode$0(valueAnimator);
                    }
                }).start();
            }
        }

        public void lambda$showActionMode$0(ValueAnimator valueAnimator) {
            ProfileActivity.this.updateBottomButtonY();
        }

        public void onTabProgress(float progress) {
            super.onTabProgress(progress);
            ProfileActivity profileActivity = ProfileActivity.this;
            if (profileActivity.myProfile) {
                profileActivity.bottomButtonContainer[0].setTranslationX((8.0f - progress) * ProfileActivity.this.sharedMediaLayout.getMeasuredWidth());
                ProfileActivity.this.bottomButtonContainer[1].setTranslationX((9.0f - progress) * ProfileActivity.this.sharedMediaLayout.getMeasuredWidth());
                ProfileActivity.this.updateBottomButtonY();
            }
        }

        public void onActionModeSelectedUpdate(SparseArray<MessageObject> messageObjects) {
            super.onActionModeSelectedUpdate(messageObjects);
            if (ProfileActivity.this.myProfile) {
                int size = messageObjects.size();
                int selectedTab = getSelectedTab() - 8;
                if (selectedTab < 0 || selectedTab > 1) {
                    return;
                }
                if (selectedTab == 0) {
                    ProfileActivity.this.bottomButton[selectedTab].setText((size > 0 || !MessagesController.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).storiesEnabled()) ? LocaleController.formatPluralString("ArchiveStories", size, new Object[0]) : ProfileActivity.this.bottomButtonPostText, true);
                }
                ProfileActivity.this.bottomButton[selectedTab].setCount(size, true);
            }
        }

        public void openStoryRecorder() {
            StoryRecorder.getInstance(ProfileActivity.this.getParentActivity(), ((BaseFragment) ProfileActivity.this).currentAccount).selectedPeerId(ProfileActivity.this.getDialogId()).canChangePeer(false).closeToWhenSent(new StoryRecorder.ClosingViewProvider() {
                public void preLayout(long dialogId, Runnable runnable) {
                    ProfileActivity.this.avatarImage.setHasStories(ProfileActivity.this.needInsetForStories());
                    if (dialogId == ProfileActivity.this.getDialogId()) {
                        ProfileActivity.this.collapseAvatarInstant();
                    }
                    AndroidUtilities.runOnUIThread(runnable, 30L);
                }

                public StoryRecorder.SourceView getView(long dialogId) {
                    if (dialogId != ProfileActivity.this.getDialogId()) {
                        return null;
                    }
                    ProfileActivity.this.updateAvatarRoundRadius();
                    return StoryRecorder.SourceView.fromAvatarImage(ProfileActivity.this.avatarImage, ChatObject.isForum(ProfileActivity.this.currentChat));
                }
            }).open(StoryRecorder.SourceView.fromFloatingButton(ProfileActivity.this.floatingButtonContainer), true);
        }
    }

    public class AnonymousClass11 extends DefaultItemAnimator {
        public int animationIndex = -1;

        public long getAddAnimationDelay(long removeDuration, long moveDuration, long changeDuration) {
            return 0L;
        }

        public AnonymousClass11() {
        }

        public void onAllAnimationsDone() {
            super.onAllAnimationsDone();
            AndroidUtilities.runOnUIThread(new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.AnonymousClass11.this.lambda$onAllAnimationsDone$0();
                }
            });
        }

        public void lambda$onAllAnimationsDone$0() {
            ProfileActivity.this.getNotificationCenter().onAnimationFinish(this.animationIndex);
        }

        public void runPendingAnimations() {
            boolean z = !((DefaultItemAnimator) this).mPendingRemovals.isEmpty();
            boolean z2 = !((DefaultItemAnimator) this).mPendingMoves.isEmpty();
            boolean z3 = !((DefaultItemAnimator) this).mPendingChanges.isEmpty();
            boolean z4 = !((DefaultItemAnimator) this).mPendingAdditions.isEmpty();
            if (z || z2 || z4 || z3) {
                ValueAnimator ofFloat = ValueAnimator.ofFloat(0.0f, 1.0f);
                ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                    @Override
                    public final void onAnimationUpdate(ValueAnimator valueAnimator) {
                        ProfileActivity.AnonymousClass11.this.lambda$runPendingAnimations$1(valueAnimator);
                    }
                });
                ofFloat.setDuration(getMoveDuration());
                ofFloat.start();
                this.animationIndex = ProfileActivity.this.getNotificationCenter().setAnimationInProgress(this.animationIndex, (int[]) null);
            }
            super.runPendingAnimations();
        }

        public void lambda$runPendingAnimations$1(ValueAnimator valueAnimator) {
            ProfileActivity.this.listView.invalidate();
        }

        public void onMoveAnimationUpdate(RecyclerView.ViewHolder holder) {
            super.onMoveAnimationUpdate(holder);
            ProfileActivity.this.updateBottomButtonY();
        }
    }

    public void lambda$createView$10(final long j, final Context context, final BaseFragment baseFragment, View view, final int i, float f, float f2) {
        int i2;
        int i3;
        TLRPC.ChatParticipant chatParticipant;
        long j2;
        ListAdapter listAdapter;
        String str;
        int i4;
        float f3 = f;
        float f4 = f2;
        if (getParentActivity() == null) {
            return;
        }
        this.listView.stopScroll();
        int i5 = this.photosRow;
        if (i == i5 || i == this.filesRow || i == this.linksRow || i == this.audioRow || i == this.voiceRow) {
            if (i == i5) {
                getMediaDataController().setMediaTypeAll();
                i2 = 0;
            } else if (i == this.filesRow) {
                i2 = 1;
            } else if (i == this.linksRow) {
                i2 = 3;
            } else {
                i2 = i == this.audioRow ? 4 : 2;
            }
            Bundle bundle = new Bundle();
            long j3 = this.userId;
            if (j3 != 0) {
                long j4 = this.dialogId;
                if (j4 == 0) {
                    j4 = j3;
                }
                bundle.putLong("dialog_id", j4);
            } else {
                bundle.putLong("dialog_id", -this.chatId);
            }
            bundle.putInt("type", 0);
            bundle.putInt("selected", i2);
            System.arraycopy(this.sharedMediaPreloader.getLastMediaCount(), 0, new int[8], 0, 8);
            MediaActivity mediaActivity = new MediaActivity(bundle, this.sharedMediaPreloader);
            mediaActivity.setChatInfo(this.chatInfo);
            presentFragment(mediaActivity);
        } else if (i == this.sharedPhotosRow || i == this.sharedVideosRow || i == this.sharedGifsRow) {
            Bundle bundle2 = new Bundle();
            long j5 = this.userId;
            if (j5 != 0) {
                str = "selected";
                long j6 = this.dialogId;
                if (j6 != 0) {
                    j5 = j6;
                }
                bundle2.putLong("dialog_id", j5);
            } else {
                str = "selected";
                bundle2.putLong("dialog_id", -this.chatId);
            }
            if (i == this.sharedPhotosRow) {
                getMediaDataController().setMediaTypePhoto();
                i4 = 6;
            } else if (i == this.sharedVideosRow) {
                getMediaDataController().setMediaTypeVideo();
                i4 = 7;
            } else if (i == this.sharedGifsRow) {
                getMediaDataController().setMediaTypeGif();
                i4 = 5;
            } else {
                i4 = 0;
            }
            bundle2.putInt("type", 0);
            bundle2.putInt(str, i4);
            MediaActivity mediaActivity2 = new MediaActivity(bundle2, this.sharedMediaPreloader);
            mediaActivity2.setMediaType(i4);
            mediaActivity2.setChatInfo(this.chatInfo);
            presentFragment(mediaActivity2);
        }
        if (i == this.notificationsSimpleRow) {
            boolean isDialogMuted = getMessagesController().isDialogMuted(j, this.topicId);
            getNotificationsController().muteDialog(j, this.topicId, !isDialogMuted);
            BulletinFactory.createMuteBulletin(this, !isDialogMuted, (Theme.ResourcesProvider) null).show();
            updateExceptions();
            int i6 = this.notificationsSimpleRow;
            if (i6 < 0 || (listAdapter = this.listAdapter) == null) {
                return;
            }
            listAdapter.notifyItemChanged(i6);
            return;
        }
        if (i == this.addToContactsRow) {
            TLRPC.User user = getMessagesController().getUser(Long.valueOf(this.userId));
            Bundle bundle3 = new Bundle();
            bundle3.putLong("user_id", user.id);
            bundle3.putBoolean("addContact", true);
            bundle3.putString("phone", this.vcardPhone);
            bundle3.putString("first_name_card", this.vcardFirstName);
            bundle3.putString("last_name_card", this.vcardLastName);
            openAddToContact(user, bundle3);
            return;
        }
        if (i == this.reportReactionRow) {
            AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity(), this.resourcesProvider);
            builder.setTitle(LocaleController.getString("ReportReaction", R.string.ReportReaction));
            builder.setMessage(LocaleController.getString("ReportAlertReaction", R.string.ReportAlertReaction));
            TLRPC.Chat chat = getMessagesController().getChat(Long.valueOf(-this.reportReactionFromDialogId));
            final CheckBoxCell[] checkBoxCellArr = new CheckBoxCell[1];
            if (chat != null && ChatObject.canBlockUsers(chat)) {
                LinearLayout linearLayout = new LinearLayout(getParentActivity());
                linearLayout.setOrientation(1);
                checkBoxCellArr[0] = new CheckBoxCell(getParentActivity(), 1, this.resourcesProvider);
                checkBoxCellArr[0].setBackgroundDrawable(Theme.getSelectorDrawable(false));
                checkBoxCellArr[0].setText(LocaleController.getString("BanUser", R.string.BanUser), "", true, false);
                checkBoxCellArr[0].setPadding(LocaleController.isRTL ? AndroidUtilities.dp(16.0f) : AndroidUtilities.dp(8.0f), 0, LocaleController.isRTL ? AndroidUtilities.dp(8.0f) : AndroidUtilities.dp(16.0f), 0);
                linearLayout.addView(checkBoxCellArr[0], LayoutHelper.createLinear(-1, -2));
                checkBoxCellArr[0].setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view2) {
                        ProfileActivity.lambda$createView$6(checkBoxCellArr, view2);
                    }
                });
                builder.setView(linearLayout);
            }
            builder.setPositiveButton(LocaleController.getString("ReportChat", R.string.ReportChat), new AnonymousClass13(checkBoxCellArr));
            builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), new DialogInterface.OnClickListener(this) {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                }
            });
            TextView textView = (TextView) builder.show().getButton(-1);
            if (textView != null) {
                textView.setTextColor(Theme.getColor(Theme.key_text_RedBold));
                return;
            }
            return;
        }
        if (i == this.settingsKeyRow) {
            Bundle bundle4 = new Bundle();
            bundle4.putInt("chat_id", DialogObject.getEncryptedChatId(this.dialogId));
            presentFragment(new IdenticonActivity(bundle4));
            return;
        }
        if (i == this.settingsTimerRow) {
            showDialog(AlertsCreator.createTTLAlert(getParentActivity(), this.currentEncryptedChat, this.resourcesProvider).create());
            return;
        }
        if (i == this.notificationsRow) {
            if ((LocaleController.isRTL && f3 <= AndroidUtilities.dp(76.0f)) || (!LocaleController.isRTL && f3 >= view.getMeasuredWidth() - AndroidUtilities.dp(76.0f))) {
                NotificationsCheckCell notificationsCheckCell = (NotificationsCheckCell) view;
                boolean z = !notificationsCheckCell.isChecked();
                boolean isGlobalNotificationsEnabled = getNotificationsController().isGlobalNotificationsEnabled(j, false, false);
                String sharedPrefKey = NotificationsController.getSharedPrefKey(j, this.topicId);
                if (z) {
                    SharedPreferences.Editor edit = MessagesController.getNotificationsSettings(((BaseFragment) this).currentAccount).edit();
                    if (isGlobalNotificationsEnabled) {
                        edit.remove("notify2_" + sharedPrefKey);
                    } else {
                        edit.putInt("notify2_" + sharedPrefKey, 0);
                    }
                    if (this.topicId == 0) {
                        getMessagesStorage().setDialogFlags(j, 0L);
                        TLRPC.Dialog dialog = (TLRPC.Dialog) getMessagesController().dialogs_dict.get(j);
                        if (dialog != null) {
                            dialog.notify_settings = new TLRPC.TL_peerNotifySettings();
                        }
                    }
                    edit.apply();
                } else {
                    SharedPreferences.Editor edit2 = MessagesController.getNotificationsSettings(((BaseFragment) this).currentAccount).edit();
                    if (!isGlobalNotificationsEnabled) {
                        edit2.remove("notify2_" + sharedPrefKey);
                        j2 = 0L;
                    } else {
                        edit2.putInt("notify2_" + sharedPrefKey, 2);
                        j2 = 1;
                    }
                    getNotificationsController().removeNotificationsForDialog(j);
                    if (this.topicId == 0) {
                        getMessagesStorage().setDialogFlags(j, j2);
                        TLRPC.Dialog dialog2 = (TLRPC.Dialog) getMessagesController().dialogs_dict.get(j);
                        if (dialog2 != null) {
                            TLRPC.TL_peerNotifySettings tL_peerNotifySettings = new TLRPC.TL_peerNotifySettings();
                            dialog2.notify_settings = tL_peerNotifySettings;
                            if (isGlobalNotificationsEnabled) {
                                ((TLRPC.PeerNotifySettings) tL_peerNotifySettings).mute_until = Integer.MAX_VALUE;
                            }
                        }
                    }
                    edit2.apply();
                }
                updateExceptions();
                getNotificationsController().updateServerNotificationsSettings(j, this.topicId);
                notificationsCheckCell.setChecked(z);
                RecyclerView.ViewHolder viewHolder = (RecyclerListView.Holder) this.listView.findViewHolderForPosition(this.notificationsRow);
                if (viewHolder != null) {
                    this.listAdapter.onBindViewHolder(viewHolder, this.notificationsRow);
                    return;
                }
                return;
            }
            ChatNotificationsPopupWrapper chatNotificationsPopupWrapper = new ChatNotificationsPopupWrapper(context, ((BaseFragment) this).currentAccount, (PopupSwipeBackLayout) null, true, true, new ChatNotificationsPopupWrapper.Callback() {
                public void dismiss() {
                    ChatNotificationsPopupWrapper.Callback.-CC.$default$dismiss(this);
                }

                public void toggleSound() {
                    SharedPreferences notificationsSettings = MessagesController.getNotificationsSettings(((BaseFragment) ProfileActivity.this).currentAccount);
                    boolean z2 = !notificationsSettings.getBoolean("sound_enabled_" + NotificationsController.getSharedPrefKey(j, ProfileActivity.this.topicId), true);
                    notificationsSettings.edit().putBoolean("sound_enabled_" + NotificationsController.getSharedPrefKey(j, ProfileActivity.this.topicId), z2).apply();
                    if (BulletinFactory.canShowBulletin(ProfileActivity.this)) {
                        ProfileActivity profileActivity = ProfileActivity.this;
                        BulletinFactory.createSoundEnabledBulletin(profileActivity, !z2 ? 1 : 0, profileActivity.getResourceProvider()).show();
                    }
                }

                public void muteFor(int timeInSeconds) {
                    if (timeInSeconds != 0) {
                        ProfileActivity.this.getNotificationsController().muteUntil(j, ProfileActivity.this.topicId, timeInSeconds);
                        if (BulletinFactory.canShowBulletin(ProfileActivity.this)) {
                            ProfileActivity profileActivity = ProfileActivity.this;
                            BulletinFactory.createMuteBulletin(profileActivity, 5, timeInSeconds, profileActivity.getResourceProvider()).show();
                        }
                        ProfileActivity.this.updateExceptions();
                        if (ProfileActivity.this.notificationsRow < 0 || ProfileActivity.this.listAdapter == null) {
                            return;
                        }
                        ProfileActivity.this.listAdapter.notifyItemChanged(ProfileActivity.this.notificationsRow);
                        return;
                    }
                    if (ProfileActivity.this.getMessagesController().isDialogMuted(j, ProfileActivity.this.topicId)) {
                        toggleMute();
                    }
                    if (BulletinFactory.canShowBulletin(ProfileActivity.this)) {
                        ProfileActivity profileActivity2 = ProfileActivity.this;
                        BulletinFactory.createMuteBulletin(profileActivity2, 4, timeInSeconds, profileActivity2.getResourceProvider()).show();
                    }
                }

                public void showCustomize() {
                    if (j != 0) {
                        Bundle bundle5 = new Bundle();
                        bundle5.putLong("dialog_id", j);
                        bundle5.putLong("topic_id", ProfileActivity.this.topicId);
                        ProfileActivity profileActivity = ProfileActivity.this;
                        profileActivity.presentFragment(new ProfileNotificationsActivity(bundle5, profileActivity.resourcesProvider));
                    }
                }

                public void toggleMute() {
                    boolean isDialogMuted2 = ProfileActivity.this.getMessagesController().isDialogMuted(j, ProfileActivity.this.topicId);
                    ProfileActivity.this.getNotificationsController().muteDialog(j, ProfileActivity.this.topicId, !isDialogMuted2);
                    ProfileActivity profileActivity = ProfileActivity.this;
                    if (((BaseFragment) profileActivity).fragmentView != null) {
                        BulletinFactory.createMuteBulletin(profileActivity, !isDialogMuted2, (Theme.ResourcesProvider) null).show();
                    }
                    ProfileActivity.this.updateExceptions();
                    if (ProfileActivity.this.notificationsRow < 0 || ProfileActivity.this.listAdapter == null) {
                        return;
                    }
                    ProfileActivity.this.listAdapter.notifyItemChanged(ProfileActivity.this.notificationsRow);
                }

                public void openExceptions() {
                    Bundle bundle5 = new Bundle();
                    bundle5.putLong("dialog_id", j);
                    TopicsNotifySettingsFragments topicsNotifySettingsFragments = new TopicsNotifySettingsFragments(bundle5);
                    topicsNotifySettingsFragments.setExceptions(ProfileActivity.this.notificationsExceptionTopics);
                    ProfileActivity.this.presentFragment(topicsNotifySettingsFragments);
                }
            }, getResourceProvider());
            chatNotificationsPopupWrapper.update(j, this.topicId, this.notificationsExceptionTopics);
            if (AndroidUtilities.isTablet()) {
                ViewGroup view2 = ((BaseFragment) this).parentLayout.getView();
                float x = view2.getX() + view2.getPaddingLeft() + f3;
                f4 += view2.getY() + view2.getPaddingTop();
                f3 = x;
            }
            chatNotificationsPopupWrapper.showAsOptions(this, view, f3, f4);
            return;
        }
        if (i == this.unblockRow) {
            getMessagesController().unblockPeer(this.userId);
            if (BulletinFactory.canShowBulletin(this)) {
                BulletinFactory.createBanBulletin(this, false).show();
                return;
            }
            return;
        }
        if (i == this.addToGroupButtonRow) {
            try {
                ((BaseFragment) this).actionBar.getActionBarMenuOnItemClick().onItemClick(9);
                return;
            } catch (Exception e) {
                FileLog.e(e);
                return;
            }
        }
        if (i == this.sendMessageRow) {
            onWriteButtonClick();
            return;
        }
        if (i == this.reportRow) {
            AlertsCreator.createReportAlert(getParentActivity(), getDialogId(), 0, 0, this, this.resourcesProvider, (Runnable) null);
            return;
        }
        int i7 = this.membersStartRow;
        if ((i > i7 && i < this.membersEndRow) || ((i3 = this.membersFilterRow) > -1 && i7 > -1 && i > i7 - 1 && i <= this.membersEndRow - 1)) {
            if (!this.sortedUsers.isEmpty()) {
                chatParticipant = (TLRPC.ChatParticipant) this.chatInfo.participants.participants.get(this.sortedUsers.get(i - this.membersStartRow).intValue());
            } else {
                chatParticipant = (TLRPC.ChatParticipant) this.chatInfo.participants.participants.get(i - this.membersStartRow);
            }
            onMemberClick(chatParticipant, false, view);
            return;
        }
        if (i == this.addMemberRow) {
            openAddMember();
            return;
        }
        if (i == this.usernameRow) {
            processOnClickOrPress(i, view, f3, f4);
            return;
        }
        if (i == this.locationRow) {
            if (this.chatInfo.location instanceof TLRPC.TL_channelLocation) {
                LocationActivity locationActivity = new LocationActivity(5);
                locationActivity.setChatLocation(this.chatId, (TLRPC.TL_channelLocation) this.chatInfo.location);
                presentFragment(locationActivity);
                return;
            }
            return;
        }
        if (i == this.joinRow) {
            getMessagesController().addUserToChat(this.currentChat.id, getUserConfig().getCurrentUser(), 0, (String) null, this, true, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$createView$7();
                }
            }, new MessagesController.ErrorDelegate() {
                public final boolean run(TLRPC.TL_error tL_error) {
                    boolean lambda$createView$8;
                    lambda$createView$8 = ProfileActivity.this.lambda$createView$8(context, baseFragment, tL_error);
                    return lambda$createView$8;
                }
            });
            NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.closeSearchByActiveAction, new Object[0]);
            return;
        }
        if (i == this.subscribersRow) {
            Bundle bundle5 = new Bundle();
            bundle5.putLong("chat_id", this.chatId);
            bundle5.putInt("type", 2);
            ChatUsersActivity chatUsersActivity = new ChatUsersActivity(bundle5);
            chatUsersActivity.setInfo(this.chatInfo);
            presentFragment(chatUsersActivity);
            return;
        }
        if (i == this.subscribersRequestsRow) {
            presentFragment(new MemberRequestsActivity(this.chatId));
            return;
        }
        if (i == this.administratorsRow) {
            Bundle bundle6 = new Bundle();
            bundle6.putLong("chat_id", this.chatId);
            bundle6.putInt("type", 1);
            ChatUsersActivity chatUsersActivity2 = new ChatUsersActivity(bundle6);
            chatUsersActivity2.setInfo(this.chatInfo);
            presentFragment(chatUsersActivity2);
            return;
        }
        if (i == this.settingsRow) {
            this.editItem.performClick();
            return;
        }
        if (i == this.blockedUsersRow) {
            Bundle bundle7 = new Bundle();
            bundle7.putLong("chat_id", this.chatId);
            bundle7.putInt("type", 0);
            ChatUsersActivity chatUsersActivity3 = new ChatUsersActivity(bundle7);
            chatUsersActivity3.setInfo(this.chatInfo);
            presentFragment(chatUsersActivity3);
            return;
        }
        if (i == i3) {
            ArrayList arrayList = new ArrayList();
            arrayList.add(LocaleController.getString("All", R.string.All));
            arrayList.add(LocaleController.getString("ChannelAdministrators", R.string.ChannelAdministrators));
            arrayList.add(LocaleController.getString("Bots", R.string.Bots));
            TLRPC.ChatFull chatFull = this.chatInfo;
            int i8 = chatFull != null ? chatFull.participants_count : 0;
            if ((BuildVars.BETA || ChatObject.hasAdminRights(this.currentChat)) && i8 < 3000) {
                arrayList.add(LocaleController.getString("HiddenName", R.string.HiddenName));
            }
            Dialog createSingleChoiceDialog = AlertsCreator.createSingleChoiceDialog(getParentActivity(), (String[]) arrayList.toArray(new String[arrayList.size()]), LocaleController.getString("MembersFilter", R.string.MembersFilter), this.filterType, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog3, int which) {
                    if (which != ProfileActivity.this.filterType) {
                        ProfileActivity.this.filterType = which;
                        if (ProfileActivity.this.filterType == 3) {
                            int size = ProfileActivity.this.participantsMap.size();
                            if (size > 200 && size < ProfileActivity.this.chatInfo.participants_count) {
                                ProfileActivity.this.usersEndReached = false;
                            }
                            ProfileActivity.this.getChannelParticipants(false);
                        } else {
                            ProfileActivity.this.getChannelParticipants(true);
                        }
                        if (ProfileActivity.this.listAdapter != null) {
                            ProfileActivity.this.listAdapter.notifyItemChanged(i);
                        }
                    }
                }
            });
            setVisibleDialog(createSingleChoiceDialog);
            createSingleChoiceDialog.show();
            return;
        }
        if (i == this.notificationRow) {
            presentFragment(new NotificationsSettingsActivity());
            return;
        }
        if (i == this.privacyRow) {
            presentFragment(new PrivacySettingsActivity().setCurrentPassword(this.currentPassword));
            return;
        }
        if (i == this.dataRow) {
            presentFragment(new DataSettingsActivity());
            return;
        }
        if (i == this.chatRow) {
            presentFragment(new ThemeActivity(0));
            return;
        }
        if (i == this.filtersRow) {
            presentFragment(new FiltersSetupActivity());
            return;
        }
        if (i == this.stickersRow) {
            presentFragment(new StickersActivity(0, null));
            return;
        }
        if (i == this.liteModeRow) {
            presentFragment(new LiteModeSettingsActivity());
            return;
        }
        if (i == this.devicesRow) {
            presentFragment(new SessionsActivity(0));
            return;
        }
        if (i == this.questionRow) {
            showDialog(AlertsCreator.createSupportAlert(this, this.resourcesProvider));
            return;
        }
        if (i == this.faqRow) {
            Browser.openUrl(getParentActivity(), LocaleController.getString("TelegramFaqUrl", R.string.TelegramFaqUrl));
            return;
        }
        if (i == this.policyRow) {
            Browser.openUrl(getParentActivity(), LocaleController.getString("PrivacyPolicyUrl", R.string.PrivacyPolicyUrl));
            return;
        }
        if (i == this.sendLogsRow) {
            sendLogs(getParentActivity(), false);
            return;
        }
        if (i == this.sendLastLogsRow) {
            sendLogs(getParentActivity(), true);
            return;
        }
        if (i == this.clearLogsRow) {
            FileLog.cleanupLogs();
            return;
        }
        if (i == this.switchBackendRow) {
            if (getParentActivity() == null) {
                return;
            }
            AlertDialog.Builder builder2 = new AlertDialog.Builder(getParentActivity(), this.resourcesProvider);
            builder2.setMessage(LocaleController.getString("AreYouSure", R.string.AreYouSure));
            builder2.setTitle(LocaleController.getString("AppName", R.string.AppName));
            builder2.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i9) {
                    ProfileActivity.this.lambda$createView$9(dialogInterface, i9);
                }
            });
            builder2.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
            showDialog(builder2.create());
            return;
        }
        if (i == this.languageRow) {
            presentFragment(new LanguageSelectActivity());
            return;
        }
        if (i == this.setUsernameRow) {
            presentFragment(new ChangeUsernameActivity());
            return;
        }
        if (i == this.bioRow) {
            presentFragment(new UserInfoActivity());
            return;
        }
        if (i == this.numberRow) {
            presentFragment(new ActionIntroActivity(3));
            return;
        }
        if (i == this.setAvatarRow) {
            onWriteButtonClick();
            return;
        }
        if (i == this.premiumRow) {
            presentFragment(new PremiumPreviewFragment("settings"));
            return;
        }
        if (i == this.starsRow) {
            presentFragment(new StarsIntroActivity());
            return;
        }
        if (i == this.businessRow) {
            presentFragment(new PremiumPreviewFragment(1, "settings"));
            return;
        }
        if (i == this.premiumGiftingRow) {
            UserSelectorBottomSheet.open(0L, BirthdayController.getInstance(((BaseFragment) this).currentAccount).getState());
            return;
        }
        if (i == this.bizHoursRow) {
            this.hoursExpanded = !this.hoursExpanded;
            saveScrollPosition();
            view.requestLayout();
            this.listAdapter.notifyItemChanged(this.bizHoursRow);
            int i9 = this.savedScrollPosition;
            if (i9 >= 0) {
                this.layoutManager.scrollToPositionWithOffset(i9, this.savedScrollOffset - this.listView.getPaddingTop());
                return;
            }
            return;
        }
        if (i == this.bizLocationRow) {
            openLocation(false);
            return;
        }
        if (i == this.channelRow) {
            if (this.userInfo == null) {
                return;
            }
            Bundle bundle8 = new Bundle();
            bundle8.putLong("chat_id", this.userInfo.personal_channel_id);
            presentFragment(new ChatActivity(bundle8));
            return;
        }
        if (i == this.birthdayRow) {
            ProfileBirthdayEffect profileBirthdayEffect = this.birthdayEffect;
            if ((profileBirthdayEffect == null || !profileBirthdayEffect.lambda$onDraw$0()) && !editRow(view, i)) {
                TextDetailCell textDetailCell = (TextDetailCell) view;
                if (textDetailCell.hasImage()) {
                    onTextDetailCellImageClicked(textDetailCell.getImageView());
                    return;
                }
                return;
            }
            return;
        }
        processOnClickOrPress(i, view, f3, f4);
    }

    public static void lambda$createView$6(CheckBoxCell[] checkBoxCellArr, View view) {
        checkBoxCellArr[0].setChecked(!checkBoxCellArr[0].isChecked(), true);
    }

    public class AnonymousClass13 implements DialogInterface.OnClickListener {
        public final CheckBoxCell[] val$cells;

        public static void lambda$onClick$0(TLObject tLObject, TLRPC.TL_error tL_error) {
        }

        public AnonymousClass13(final CheckBoxCell[] val$cells) {
            this.val$cells = val$cells;
        }

        @Override
        public void onClick(DialogInterface dialog, int which) {
            TLRPC.TL_messages_reportReaction tL_messages_reportReaction = new TLRPC.TL_messages_reportReaction();
            tL_messages_reportReaction.user_id = ProfileActivity.this.getMessagesController().getInputUser(ProfileActivity.this.userId);
            tL_messages_reportReaction.peer = ProfileActivity.this.getMessagesController().getInputPeer(ProfileActivity.this.reportReactionFromDialogId);
            tL_messages_reportReaction.id = ProfileActivity.this.reportReactionMessageId;
            ConnectionsManager.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).sendRequest(tL_messages_reportReaction, new RequestDelegate() {
                public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                    ProfileActivity.AnonymousClass13.lambda$onClick$0(tLObject, tL_error);
                }
            });
            CheckBoxCell[] checkBoxCellArr = this.val$cells;
            if (checkBoxCellArr[0] != null && checkBoxCellArr[0].isChecked()) {
                ProfileActivity.this.getMessagesController().deleteParticipantFromChat(-ProfileActivity.this.reportReactionFromDialogId, ProfileActivity.this.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.userId)));
            }
            ProfileActivity.this.reportReactionMessageId = 0;
            ProfileActivity.this.updateListAnimated(false);
            BulletinFactory.of(ProfileActivity.this).createReportSent(ProfileActivity.this.resourcesProvider).show();
        }
    }

    public void lambda$createView$7() {
        updateRowsIds();
        ListAdapter listAdapter = this.listAdapter;
        if (listAdapter != null) {
            listAdapter.notifyDataSetChanged();
        }
    }

    public boolean lambda$createView$8(Context context, BaseFragment baseFragment, TLRPC.TL_error tL_error) {
        if (tL_error == null || !"INVITE_REQUEST_SENT".equals(tL_error.text)) {
            return true;
        }
        MessagesController.getNotificationsSettings(((BaseFragment) this).currentAccount).edit().putLong("dialog_join_requested_time_" + this.dialogId, System.currentTimeMillis()).commit();
        JoinGroupAlert.showBulletin(context, this, ChatObject.isChannel(this.currentChat) && !this.currentChat.megagroup);
        updateRowsIds();
        ListAdapter listAdapter = this.listAdapter;
        if (listAdapter != null) {
            listAdapter.notifyDataSetChanged();
        }
        if (baseFragment instanceof ChatActivity) {
            ((ChatActivity) baseFragment).showBottomOverlayProgress(false, true);
        }
        return false;
    }

    public void lambda$createView$9(DialogInterface dialogInterface, int i) {
        SharedConfig.pushAuthKey = null;
        SharedConfig.pushAuthKeyId = null;
        SharedConfig.saveConfig();
        getConnectionsManager().switchBackend(true);
    }

    public class AnonymousClass17 implements RecyclerListView.OnItemLongClickListener {
        public int pressCount = 0;
        public final Context val$context;

        public AnonymousClass17(final Context val$context) {
            this.val$context = val$context;
        }

        public boolean onItemClick(View view, int position) {
            TLRPC.ChatParticipant chatParticipant;
            int i;
            String str;
            int i2;
            String str2;
            String str3;
            String str4;
            int i3;
            String str5;
            String str6 = null;
            if (position == ProfileActivity.this.versionRow) {
                int i4 = this.pressCount + 1;
                this.pressCount = i4;
                if (i4 >= 2 || BuildVars.DEBUG_PRIVATE_VERSION) {
                    AlertDialog.Builder builder = new AlertDialog.Builder(ProfileActivity.this.getParentActivity(), ProfileActivity.this.resourcesProvider);
                    builder.setTitle(LocaleController.getString("DebugMenu", R.string.DebugMenu));
                    boolean z = ApplicationLoader.applicationContext != null && ApplicationLoader.applicationContext.getResources().getBoolean(R.bool.isTablet);
                    CharSequence[] charSequenceArr = new CharSequence[38];
                    charSequenceArr[0] = LocaleController.getString("DebugMenuImportContacts", R.string.DebugMenuImportContacts);
                    charSequenceArr[1] = LocaleController.getString("DebugMenuReloadContacts", R.string.DebugMenuReloadContacts);
                    charSequenceArr[2] = LocaleController.getString("DebugMenuResetContacts", R.string.DebugMenuResetContacts);
                    charSequenceArr[3] = LocaleController.getString("DebugMenuResetDialogs", R.string.DebugMenuResetDialogs);
                    if (BuildVars.LOGS_ENABLED) {
                        i = R.string.DebugMenuDisableLogs;
                        str = "DebugMenuDisableLogs";
                    } else {
                        i = R.string.DebugMenuEnableLogs;
                        str = "DebugMenuEnableLogs";
                    }
                    charSequenceArr[4] = LocaleController.getString(str, i);
                    if (SharedConfig.inappCamera) {
                        i2 = R.string.DebugMenuDisableCamera;
                        str2 = "DebugMenuDisableCamera";
                    } else {
                        i2 = R.string.DebugMenuEnableCamera;
                        str2 = "DebugMenuEnableCamera";
                    }
                    charSequenceArr[5] = LocaleController.getString(str2, i2);
                    charSequenceArr[6] = LocaleController.getString("DebugMenuClearMediaCache", R.string.DebugMenuClearMediaCache);
                    charSequenceArr[7] = LocaleController.getString("DebugMenuCallSettings", R.string.DebugMenuCallSettings);
                    charSequenceArr[8] = null;
                    charSequenceArr[9] = !PlusUtils.verifyInstallerId() ? LocaleController.getString("DebugMenuCheckAppUpdate", R.string.DebugMenuCheckAppUpdate) : null;
                    charSequenceArr[10] = LocaleController.getString("DebugMenuReadAllDialogs", R.string.DebugMenuReadAllDialogs);
                    charSequenceArr[11] = BuildVars.DEBUG_PRIVATE_VERSION ? SharedConfig.disableVoiceAudioEffects ? "Enable voip audio effects" : "Disable voip audio effects" : null;
                    boolean z2 = BuildVars.DEBUG_PRIVATE_VERSION;
                    charSequenceArr[12] = z2 ? "Clean app update" : null;
                    charSequenceArr[13] = z2 ? "Reset suggestions" : null;
                    charSequenceArr[14] = z2 ? LocaleController.getString(R.string.DebugMenuClearWebViewCache) : null;
                    int i5 = Build.VERSION.SDK_INT;
                    charSequenceArr[15] = i5 >= 19 ? LocaleController.getString(SharedConfig.debugWebView ? R.string.DebugMenuDisableWebViewDebug : R.string.DebugMenuEnableWebViewDebug) : null;
                    String str7 = "Enable tablet mode";
                    charSequenceArr[16] = (AndroidUtilities.isTabletInternal() && BuildVars.DEBUG_PRIVATE_VERSION) ? SharedConfig.forceDisableTabletMode ? "Enable tablet mode" : "Disable tablet mode" : null;
                    charSequenceArr[17] = BuildVars.DEBUG_PRIVATE_VERSION ? LocaleController.getString(SharedConfig.isFloatingDebugActive ? R.string.FloatingDebugDisable : R.string.FloatingDebugEnable) : null;
                    boolean z3 = BuildVars.DEBUG_PRIVATE_VERSION;
                    charSequenceArr[18] = z3 ? "Force remove premium suggestions" : null;
                    charSequenceArr[19] = z3 ? "Share device info" : null;
                    charSequenceArr[20] = z3 ? "Force performance class" : null;
                    charSequenceArr[21] = (!z3 || InstantCameraView.allowBigSizeCameraDebug()) ? null : !SharedConfig.bigCameraForRound ? "Force big camera for round" : "Disable big camera for round";
                    charSequenceArr[22] = LocaleController.getString(DualCameraView.dualAvailableStatic(ProfileActivity.this.getContext()) ? "DebugMenuDualOff" : "DebugMenuDualOn");
                    charSequenceArr[23] = BuildVars.DEBUG_VERSION ? SharedConfig.useSurfaceInStories ? "back to TextureView in stories" : "use SurfaceView in stories" : null;
                    charSequenceArr[24] = BuildVars.DEBUG_PRIVATE_VERSION ? SharedConfig.photoViewerBlur ? "do not blur in photoviewer" : "blur in photoviewer" : null;
                    charSequenceArr[25] = !SharedConfig.payByInvoice ? "Enable Invoice Payment" : "Disable Invoice Payment";
                    charSequenceArr[26] = BuildVars.DEBUG_PRIVATE_VERSION ? "Update Attach Bots" : null;
                    if (i5 >= 21) {
                        str3 = !SharedConfig.useCamera2.booleanValue() ? "Use Camera 2 API" : "Use old Camera 1 API";
                    } else {
                        str3 = null;
                    }
                    charSequenceArr[27] = str3;
                    charSequenceArr[28] = BuildVars.DEBUG_VERSION ? "Clear bot biometry data" : null;
                    charSequenceArr[29] = BuildVars.DEBUG_PRIVATE_VERSION ? "Clear all login tokens" : null;
                    charSequenceArr[30] = (!SharedConfig.canBlurChat() || i5 < 31) ? null : SharedConfig.useNewBlur ? "back to cpu blur" : "use new gpu blur";
                    charSequenceArr[31] = SharedConfig.drawSnowInChat ? "Hide snow in chat" : "Show snow in chat";
                    charSequenceArr[32] = !PlusUtils.verifyInstallerId() ? "Enable access to external storage" : null;
                    charSequenceArr[33] = LocaleController.getString("ResetFolders", R.string.ResetFolders);
                    if (i5 >= 29) {
                        str4 = SharedConfig.chatBubbles ? "Disable chat bubbles" : "Enable chat bubbles";
                    } else {
                        str4 = null;
                    }
                    charSequenceArr[34] = str4;
                    if (!BuildVars.BETA_2 || !z) {
                        str7 = null;
                    } else if (!PlusSettings.disableTabletMode) {
                        str7 = "Disable tablet mode";
                    }
                    charSequenceArr[35] = str7;
                    if (SharedConfig.pauseMusicOnRecord) {
                        i3 = R.string.DebugMenuDisablePauseMusic;
                        str5 = "DebugMenuDisablePauseMusic";
                    } else {
                        i3 = R.string.DebugMenuEnablePauseMusic;
                        str5 = "DebugMenuEnablePauseMusic";
                    }
                    charSequenceArr[36] = LocaleController.getString(str5, i3);
                    charSequenceArr[37] = BuildVars.DEBUG_VERSION ? "Check beta update from firebase" : null;
                    final Context context = this.val$context;
                    builder.setItems(charSequenceArr, new DialogInterface.OnClickListener() {
                        @Override
                        public final void onClick(DialogInterface dialogInterface, int i6) {
                            ProfileActivity.AnonymousClass17.this.lambda$onItemClick$3(context, dialogInterface, i6);
                        }
                    });
                    builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
                    ProfileActivity.this.showDialog(builder.create());
                } else {
                    try {
                        Toast.makeText(ProfileActivity.this.getParentActivity(), LocaleController.getString("DebugMenuLongPress", R.string.DebugMenuLongPress), 0).show();
                    } catch (Exception e) {
                        FileLog.e(e);
                    }
                }
                return true;
            }
            if (position >= ProfileActivity.this.membersStartRow && position < ProfileActivity.this.membersEndRow) {
                if (!ProfileActivity.this.sortedUsers.isEmpty()) {
                    chatParticipant = (TLRPC.ChatParticipant) ProfileActivity.this.visibleChatParticipants.get(((Integer) ProfileActivity.this.sortedUsers.get(position - ProfileActivity.this.membersStartRow)).intValue());
                } else {
                    chatParticipant = (TLRPC.ChatParticipant) ProfileActivity.this.visibleChatParticipants.get(position - ProfileActivity.this.membersStartRow);
                }
                return ProfileActivity.this.onMemberClick(chatParticipant, true, view);
            }
            if (position == ProfileActivity.this.bioRow) {
                SharedPreferences sharedPreferences = ApplicationLoader.applicationContext.getSharedPreferences("plusconfig", 0);
                final boolean z4 = sharedPreferences.getBoolean("showEmojiKbBtn", false);
                SharedPreferences.Editor edit = sharedPreferences.edit();
                edit.putBoolean("showEmojiKbBtn", !z4);
                edit.apply();
                AndroidUtilities.runOnUIThread(new Runnable() {
                    @Override
                    public void run() {
                        if (ProfileActivity.this.getParentActivity() != null) {
                            Toast.makeText(ProfileActivity.this.getParentActivity(), "Show emoji button: " + z4 + "\n¯\\_(ツ)_/¯", 0).show();
                        }
                    }
                });
                return true;
            }
            if (position == ProfileActivity.this.languageRow) {
                if (ProfileActivity.this.getParentActivity() != null && ((BaseFragment) ProfileActivity.this).parentLayout != null) {
                    MessagesController.getGlobalMainSettings().getString("language_showed2", "");
                    String str8 = ProfileActivity.this.getMessagesController().suggestedLangCode;
                    LocaleController.LocaleInfo[] localeInfoArr = new LocaleController.LocaleInfo[2];
                    String str9 = str8.contains("-") ? str8.split("-")[0] : str8;
                    if ("in".equals(str9)) {
                        str6 = "id";
                    } else if ("iw".equals(str9)) {
                        str6 = "he";
                    } else if ("jw".equals(str9)) {
                        str6 = "jv";
                    }
                    for (int i6 = 0; i6 < LocaleController.getInstance().languages.size(); i6++) {
                        LocaleController.LocaleInfo localeInfo = (LocaleController.LocaleInfo) LocaleController.getInstance().languages.get(i6);
                        if (localeInfo.shortName.equals("en")) {
                            localeInfoArr[0] = localeInfo;
                        }
                        if (localeInfo.shortName.replace("_", "-").equals(str8) || localeInfo.shortName.equals(str9) || localeInfo.shortName.equals(str6)) {
                            localeInfoArr[1] = localeInfo;
                        }
                        if (localeInfoArr[0] != null && localeInfoArr[1] != null) {
                            break;
                        }
                    }
                    if (localeInfoArr[0] != null && localeInfoArr[1] != null && localeInfoArr[0] != localeInfoArr[1]) {
                        LocaleController.LocaleInfo localeInfo2 = localeInfoArr[1];
                        LocaleController.LocaleInfo localeInfo3 = localeInfoArr[0];
                        if (!localeInfo2.builtIn) {
                            LocaleController.getInstance().isCurrentLocalLocale();
                        }
                        LocaleController.LocaleInfo currentLocaleInfo = LocaleController.getInstance().getCurrentLocaleInfo();
                        String str10 = LocaleController.getInstance().getCurrentLocaleInfo().shortName;
                        if (currentLocaleInfo != null) {
                            LocaleController.getInstance().applyLanguage(str10.contains("en") ? localeInfo2 : localeInfo3, true, false, false, true, ((BaseFragment) ProfileActivity.this).currentAccount, (Runnable) null);
                            ((BaseFragment) ProfileActivity.this).parentLayout.rebuildAllFragmentViews(true, true);
                        }
                    }
                }
                return false;
            }
            if (position == ProfileActivity.this.filtersRow) {
                PlusUtils.resetFolders(ProfileActivity.this, true);
                return false;
            }
            ProfileActivity profileActivity = ProfileActivity.this;
            if (position == profileActivity.birthdayRow) {
                if (profileActivity.editRow(view, position)) {
                    return true;
                }
                if (ProfileActivity.this.userInfo == null) {
                    return false;
                }
                try {
                    AndroidUtilities.addToClipboard(UserInfoActivity.birthdayString(ProfileActivity.this.userInfo.birthday));
                    BulletinFactory.of(ProfileActivity.this).createCopyBulletin(LocaleController.getString(R.string.BirthdayCopied)).show();
                } catch (Exception e2) {
                    FileLog.e(e2);
                }
                return true;
            }
            if (profileActivity.editRow(view, position)) {
                return true;
            }
            return ProfileActivity.this.processOnClickOrPress(position, view, view.getWidth() / 2.0f, (int) (view.getHeight() * 0.75f));
        }

        public void lambda$onItemClick$3(Context context, DialogInterface dialogInterface, int i) {
            long j;
            int i2;
            int i3 = 0;
            if (i == 0) {
                ProfileActivity.this.getUserConfig().syncContacts = true;
                ProfileActivity.this.getUserConfig().saveConfig(false);
                ProfileActivity.this.getContactsController().forceImportContacts();
                return;
            }
            if (i == 1) {
                ProfileActivity.this.getContactsController().loadContacts(false, 0L);
                return;
            }
            if (i == 2) {
                ProfileActivity.this.getContactsController().resetImportedContacts();
                return;
            }
            if (i == 3) {
                ProfileActivity.this.getMessagesController().forceResetDialogs();
                return;
            }
            if (i == 4) {
                BuildVars.LOGS_ENABLED = !BuildVars.LOGS_ENABLED;
                ApplicationLoader.applicationContext.getSharedPreferences("systemConfig", 0).edit().putBoolean("logsEnabled", BuildVars.LOGS_ENABLED).commit();
                ProfileActivity.this.updateRowsIds();
                ProfileActivity.this.listAdapter.notifyDataSetChanged();
                if (BuildVars.LOGS_ENABLED) {
                    FileLog.d("app start time = " + ApplicationLoader.startTime);
                    try {
                        FileLog.d("buildVersion = " + ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0).versionCode);
                        return;
                    } catch (Exception e) {
                        FileLog.e(e);
                        return;
                    }
                }
                FileLog.getInstance().stopLogcat();
                return;
            }
            if (i == 5) {
                SharedConfig.toggleInappCamera();
                return;
            }
            if (i == 6) {
                ProfileActivity.this.getMessagesStorage().clearSentMedia();
                SharedConfig.setNoSoundHintShowed(false);
                MessagesController.getGlobalMainSettings().edit().remove("archivehint").remove("proximityhint").remove("archivehint_l").remove("speedhint").remove("gifhint").remove("reminderhint").remove("soundHint").remove("themehint").remove("bganimationhint").remove("filterhint").remove("n_0").remove("storyprvhint").remove("storyhint").remove("storyhint2").remove("storydualhint").remove("storysvddualhint").remove("stories_camera").remove("dualcam").remove("dualmatrix").remove("dual_available").remove("archivehint").remove("askNotificationsAfter").remove("askNotificationsDuration").remove("viewoncehint").remove("taptostorysoundhint").remove("nothanos").remove("voiceoncehint").remove("savedhint").remove("savedsearchhint").remove("savedsearchtaghint").remove("groupEmojiPackHintShown").remove("newppsms").remove("monetizationadshint").apply();
                MessagesController.getEmojiSettings(((BaseFragment) ProfileActivity.this).currentAccount).edit().remove("featured_hidden").remove("emoji_featured_hidden").commit();
                SharedConfig.textSelectionHintShows = 0;
                SharedConfig.lockRecordAudioVideoHint = 0;
                SharedConfig.stickersReorderingHintUsed = false;
                SharedConfig.forwardingOptionsHintShown = false;
                SharedConfig.replyingOptionsHintShown = false;
                SharedConfig.messageSeenHintCount = 3;
                SharedConfig.emojiInteractionsHintCount = 3;
                SharedConfig.dayNightThemeSwitchHintCount = 3;
                SharedConfig.fastScrollHintCount = 3;
                SharedConfig.stealthModeSendMessageConfirm = 2;
                SharedConfig.updateStealthModeSendMessageConfirm(2);
                SharedConfig.setStoriesReactionsLongPressHintUsed(false);
                SharedConfig.setStoriesIntroShown(false);
                SharedConfig.setMultipleReactionsPromoShowed(false);
                ChatThemeController.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).clearCache();
                ProfileActivity.this.getNotificationCenter().postNotificationName(NotificationCenter.newSuggestionsAvailable, new Object[0]);
                RestrictedLanguagesSelectActivity.cleanup();
                PersistColorPalette.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).cleanup();
                SharedPreferences mainSettings = ProfileActivity.this.getMessagesController().getMainSettings();
                SharedPreferences.Editor edit = mainSettings.edit();
                edit.remove("peerColors").remove("profilePeerColors").remove("boostingappearance").remove("bizbothint");
                for (String str : mainSettings.getAll().keySet()) {
                    if (str.contains("show_gift_for_") || str.contains("bdayhint_") || str.contains("bdayanim_")) {
                        edit.remove(str);
                    }
                }
                edit.commit();
                return;
            }
            if (i == 7) {
                VoIPHelper.showCallDebugSettings(ProfileActivity.this.getParentActivity());
                return;
            }
            if (i == 8) {
                SharedConfig.toggleRoundCamera16to9();
                return;
            }
            if (i == 9) {
                ApplicationLoader.checkForUpdates();
                return;
            }
            if (i == 10) {
                ProfileActivity.this.getMessagesStorage().readAllDialogs(-1);
                return;
            }
            if (i == 11) {
                SharedConfig.toggleDisableVoiceAudioEffects();
                return;
            }
            if (i == 12) {
                SharedConfig.pendingAppUpdate = null;
                SharedConfig.saveConfig();
                NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.appUpdateAvailable, new Object[0]);
                return;
            }
            if (i == 13) {
                Set set = ProfileActivity.this.getMessagesController().pendingSuggestions;
                set.add("VALIDATE_PHONE_NUMBER");
                set.add("VALIDATE_PASSWORD");
                ProfileActivity.this.getNotificationCenter().postNotificationName(NotificationCenter.newSuggestionsAvailable, new Object[0]);
                return;
            }
            if (i == 14) {
                ApplicationLoader.applicationContext.deleteDatabase("webview.db");
                ApplicationLoader.applicationContext.deleteDatabase("webviewCache.db");
                WebStorage.getInstance().deleteAllData();
                return;
            }
            if (i == 15) {
                SharedConfig.toggleDebugWebView();
                Toast.makeText(ProfileActivity.this.getParentActivity(), LocaleController.getString(SharedConfig.debugWebView ? R.string.DebugMenuWebViewDebugEnabled : R.string.DebugMenuWebViewDebugDisabled), 0).show();
                return;
            }
            if (i == 16) {
                SharedConfig.toggleForceDisableTabletMode();
                Activity findActivity = AndroidUtilities.findActivity(context);
                Intent launchIntentForPackage = findActivity.getPackageManager().getLaunchIntentForPackage(findActivity.getPackageName());
                findActivity.finishAffinity();
                findActivity.startActivity(launchIntentForPackage);
                System.exit(0);
                return;
            }
            if (i == 17) {
                FloatingDebugController.setActive((LaunchActivity) ProfileActivity.this.getParentActivity(), true ^ FloatingDebugController.isActive());
                return;
            }
            if (i == 18) {
                ProfileActivity.this.getMessagesController().loadAppConfig();
                TLRPC.TL_help_dismissSuggestion tL_help_dismissSuggestion = new TLRPC.TL_help_dismissSuggestion();
                tL_help_dismissSuggestion.suggestion = "VALIDATE_PHONE_NUMBER";
                tL_help_dismissSuggestion.peer = new TLRPC.TL_inputPeerEmpty();
                ProfileActivity.this.getConnectionsManager().sendRequest(tL_help_dismissSuggestion, new RequestDelegate() {
                    public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                        ProfileActivity.AnonymousClass17.this.lambda$onItemClick$1(tLObject, tL_error);
                    }
                });
                return;
            }
            if (i != 19) {
                if (i == 20) {
                    AlertDialog.Builder builder = new AlertDialog.Builder(ProfileActivity.this.getParentActivity(), ProfileActivity.this.resourcesProvider);
                    builder.setTitle("Force performance class");
                    int devicePerformanceClass = SharedConfig.getDevicePerformanceClass();
                    final int measureDevicePerformanceClass = SharedConfig.measureDevicePerformanceClass();
                    CharSequence[] charSequenceArr = new CharSequence[3];
                    StringBuilder sb = new StringBuilder();
                    sb.append(devicePerformanceClass == 2 ? "**HIGH**" : "HIGH");
                    sb.append(measureDevicePerformanceClass == 2 ? " (measured)" : "");
                    charSequenceArr[0] = AndroidUtilities.replaceTags(sb.toString());
                    StringBuilder sb2 = new StringBuilder();
                    sb2.append(devicePerformanceClass == 1 ? "**AVERAGE**" : "AVERAGE");
                    sb2.append(measureDevicePerformanceClass == 1 ? " (measured)" : "");
                    charSequenceArr[1] = AndroidUtilities.replaceTags(sb2.toString());
                    StringBuilder sb3 = new StringBuilder();
                    sb3.append(devicePerformanceClass == 0 ? "**LOW**" : "LOW");
                    sb3.append(measureDevicePerformanceClass != 0 ? "" : " (measured)");
                    charSequenceArr[2] = AndroidUtilities.replaceTags(sb3.toString());
                    builder.setItems(charSequenceArr, new DialogInterface.OnClickListener() {
                        @Override
                        public final void onClick(DialogInterface dialogInterface2, int i4) {
                            ProfileActivity.AnonymousClass17.lambda$onItemClick$2(measureDevicePerformanceClass, dialogInterface2, i4);
                        }
                    });
                    builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
                    builder.show();
                    return;
                }
                if (i == 21) {
                    SharedConfig.toggleRoundCamera();
                    return;
                }
                if (i == 22) {
                    boolean dualAvailableStatic = DualCameraView.dualAvailableStatic(ProfileActivity.this.getContext());
                    MessagesController.getGlobalMainSettings().edit().putBoolean("dual_available", !dualAvailableStatic).apply();
                    try {
                        Toast.makeText(ProfileActivity.this.getParentActivity(), LocaleController.getString(!dualAvailableStatic ? R.string.DebugMenuDualOnToast : R.string.DebugMenuDualOffToast), 0).show();
                        return;
                    } catch (Exception unused) {
                        return;
                    }
                }
                if (i == 23) {
                    SharedConfig.toggleSurfaceInStories();
                    while (i3 < ProfileActivity.this.getParentLayout().getFragmentStack().size()) {
                        ProfileActivity.this.getParentLayout().getFragmentStack().get(i3).clearStoryViewers();
                        i3++;
                    }
                    return;
                }
                if (i == 24) {
                    SharedConfig.togglePhotoViewerBlur();
                    return;
                }
                if (i == 25) {
                    SharedConfig.togglePaymentByInvoice();
                    return;
                }
                if (i == 26) {
                    ProfileActivity.this.getMediaDataController().loadAttachMenuBots(false, true);
                    return;
                }
                if (i == 27) {
                    SharedConfig.toggleUseCamera2();
                    return;
                }
                if (i == 28) {
                    BotBiometry.clear();
                    return;
                }
                if (i == 29) {
                    AuthTokensHelper.clearLogInTokens();
                    return;
                }
                if (i == 30) {
                    SharedConfig.toggleUseNewBlur();
                    return;
                }
                if (i == 31) {
                    SharedConfig.toggleDrawSnowInChat();
                    return;
                }
                if (i == 32) {
                    PlusUtils.askForExternalStoragePermission(ProfileActivity.this.getParentActivity(), true);
                    return;
                }
                if (i == 33) {
                    PlusUtils.resetFolders(ProfileActivity.this, true);
                    return;
                }
                if (i == 34) {
                    SharedConfig.toggleChatBubbles();
                    return;
                }
                if (i == 35) {
                    try {
                        PlusSettings.disableTabletMode = !PlusSettings.disableTabletMode;
                        ApplicationLoader.applicationContext.getSharedPreferences("plusconfig", 0).edit().putBoolean("disableTabletMode", PlusSettings.disableTabletMode).apply();
                        ((BaseFragment) ProfileActivity.this).parentLayout.rebuildAllFragmentViews(true, true);
                        return;
                    } catch (Exception e2) {
                        e2.printStackTrace();
                        return;
                    }
                }
                if (i == 36) {
                    SharedConfig.togglePauseMusicOnRecord();
                    return;
                } else {
                    if (i == 37) {
                        ApplicationLoader.checkFirebaseAppDistribution(true);
                        return;
                    }
                    return;
                }
            }
            int i4 = ConnectionsManager.CPU_COUNT;
            int memoryClass = ((ActivityManager) ApplicationLoader.applicationContext.getSystemService("activity")).getMemoryClass();
            StringBuilder sb4 = new StringBuilder();
            long j2 = 0;
            long j3 = 0;
            long j4 = 0;
            long j5 = 0;
            long j6 = 0;
            long j7 = 0;
            long j8 = 0;
            long j9 = 0;
            while (i3 < i4) {
                Long sysInfoLong = AndroidUtilities.getSysInfoLong("/sys/devices/system/cpu/cpu" + i3 + "/cpufreq/cpuinfo_min_freq");
                Long sysInfoLong2 = AndroidUtilities.getSysInfoLong("/sys/devices/system/cpu/cpu" + i3 + "/cpufreq/cpuinfo_cur_freq");
                StringBuilder sb5 = new StringBuilder();
                sb5.append("/sys/devices/system/cpu/cpu");
                sb5.append(i3);
                int i5 = i4;
                sb5.append("/cpufreq/cpuinfo_max_freq");
                Long sysInfoLong3 = AndroidUtilities.getSysInfoLong(sb5.toString());
                Long sysInfoLong4 = AndroidUtilities.getSysInfoLong("/sys/devices/system/cpu/cpu" + i3 + "/cpu_capacity");
                sb4.append("#");
                sb4.append(i3);
                sb4.append(" ");
                int i6 = memoryClass;
                if (sysInfoLong != null) {
                    sb4.append("min=");
                    i2 = i3;
                    sb4.append(sysInfoLong.longValue() / 1000);
                    sb4.append(" ");
                    j2 += sysInfoLong.longValue() / 1000;
                    j3++;
                } else {
                    i2 = i3;
                }
                if (sysInfoLong2 != null) {
                    sb4.append("cur=");
                    sb4.append(sysInfoLong2.longValue() / 1000);
                    sb4.append(" ");
                    j4 += sysInfoLong2.longValue() / 1000;
                    j5++;
                }
                if (sysInfoLong3 != null) {
                    sb4.append("max=");
                    sb4.append(sysInfoLong3.longValue() / 1000);
                    sb4.append(" ");
                    j6 += sysInfoLong3.longValue() / 1000;
                    j7++;
                }
                if (sysInfoLong4 != null) {
                    sb4.append("cpc=");
                    sb4.append(sysInfoLong4);
                    sb4.append(" ");
                    j8 += sysInfoLong4.longValue();
                    j9++;
                }
                sb4.append("\n");
                i3 = i2 + 1;
                i4 = i5;
                memoryClass = i6;
            }
            int i7 = i4;
            int i8 = memoryClass;
            StringBuilder sb6 = new StringBuilder();
            sb6.append(Build.MANUFACTURER);
            sb6.append(", ");
            sb6.append(Build.MODEL);
            sb6.append(" (");
            sb6.append(Build.PRODUCT);
            sb6.append(", ");
            sb6.append(Build.DEVICE);
            sb6.append(") ");
            sb6.append(" (android ");
            int i9 = Build.VERSION.SDK_INT;
            sb6.append(i9);
            sb6.append(")\n");
            if (i9 >= 31) {
                sb6.append("SoC: ");
                sb6.append(Build.SOC_MANUFACTURER);
                sb6.append(", ");
                sb6.append(Build.SOC_MODEL);
                sb6.append("\n");
            }
            String sysInfoString = AndroidUtilities.getSysInfoString("/sys/kernel/gpu/gpu_model");
            if (sysInfoString != null) {
                sb6.append("GPU: ");
                sb6.append(sysInfoString);
                Long sysInfoLong5 = AndroidUtilities.getSysInfoLong("/sys/kernel/gpu/gpu_min_clock");
                Long sysInfoLong6 = AndroidUtilities.getSysInfoLong("/sys/kernel/gpu/gpu_mm_min_clock");
                Long sysInfoLong7 = AndroidUtilities.getSysInfoLong("/sys/kernel/gpu/gpu_max_clock");
                if (sysInfoLong5 != null) {
                    sb6.append(", min=");
                    j = j4;
                    sb6.append(sysInfoLong5.longValue() / 1000);
                } else {
                    j = j4;
                }
                if (sysInfoLong6 != null) {
                    sb6.append(", mmin=");
                    sb6.append(sysInfoLong6.longValue() / 1000);
                }
                if (sysInfoLong7 != null) {
                    sb6.append(", max=");
                    sb6.append(sysInfoLong7.longValue() / 1000);
                }
                sb6.append("\n");
            } else {
                j = j4;
            }
            ConfigurationInfo deviceConfigurationInfo = ((ActivityManager) ApplicationLoader.applicationContext.getSystemService("activity")).getDeviceConfigurationInfo();
            sb6.append("GLES Version: ");
            sb6.append(deviceConfigurationInfo.getGlEsVersion());
            sb6.append("\n");
            sb6.append("Memory: class=");
            sb6.append(AndroidUtilities.formatFileSize(i8 * 1024 * 1024));
            ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();
            ((ActivityManager) ApplicationLoader.applicationContext.getSystemService("activity")).getMemoryInfo(memoryInfo);
            sb6.append(", total=");
            sb6.append(AndroidUtilities.formatFileSize(memoryInfo.totalMem));
            sb6.append(", avail=");
            sb6.append(AndroidUtilities.formatFileSize(memoryInfo.availMem));
            sb6.append(", low?=");
            sb6.append(memoryInfo.lowMemory);
            sb6.append(" (threshold=");
            sb6.append(AndroidUtilities.formatFileSize(memoryInfo.threshold));
            sb6.append(")");
            sb6.append("\n");
            sb6.append("Current class: ");
            sb6.append(SharedConfig.performanceClassName(SharedConfig.getDevicePerformanceClass()));
            sb6.append(", measured: ");
            sb6.append(SharedConfig.performanceClassName(SharedConfig.measureDevicePerformanceClass()));
            if (i9 >= 31) {
                sb6.append(", suggest=");
                sb6.append(Build.VERSION.MEDIA_PERFORMANCE_CLASS);
            }
            sb6.append("\n");
            sb6.append(i7);
            sb6.append(" CPUs");
            if (j3 > 0) {
                sb6.append(", avgMinFreq=");
                sb6.append(j2 / j3);
            }
            if (j5 > 0) {
                sb6.append(", avgCurFreq=");
                sb6.append(j / j5);
            }
            if (j7 > 0) {
                sb6.append(", avgMaxFreq=");
                sb6.append(j6 / j7);
            }
            if (j9 > 0) {
                sb6.append(", avgCapacity=");
                sb6.append(j8 / j9);
            }
            sb6.append("\n");
            sb6.append((CharSequence) sb4);
            ProfileActivity.this.listCodecs("video/avc", sb6);
            ProfileActivity.this.listCodecs("video/hevc", sb6);
            ProfileActivity.this.listCodecs("video/x-vnd.on2.vp8", sb6);
            ProfileActivity.this.listCodecs("video/x-vnd.on2.vp9", sb6);
            ProfileActivity.this.showDialog(new AnonymousClass1(ProfileActivity.this.getParentActivity(), null, sb6.toString(), false, null, false));
        }

        public void lambda$onItemClick$1(TLObject tLObject, TLRPC.TL_error tL_error) {
            TLRPC.TL_help_dismissSuggestion tL_help_dismissSuggestion = new TLRPC.TL_help_dismissSuggestion();
            tL_help_dismissSuggestion.suggestion = "VALIDATE_PASSWORD";
            tL_help_dismissSuggestion.peer = new TLRPC.TL_inputPeerEmpty();
            ProfileActivity.this.getConnectionsManager().sendRequest(tL_help_dismissSuggestion, new RequestDelegate() {
                public final void run(TLObject tLObject2, TLRPC.TL_error tL_error2) {
                    ProfileActivity.AnonymousClass17.this.lambda$onItemClick$0(tLObject2, tL_error2);
                }
            });
        }

        public void lambda$onItemClick$0(TLObject tLObject, TLRPC.TL_error tL_error) {
            ProfileActivity.this.getMessagesController().loadAppConfig();
        }

        public class AnonymousClass1 extends ShareAlert {
            public AnonymousClass1(final Context context, ArrayList messages, final String text, boolean channel, final String copyLink, boolean fullScreen) {
                super(context, messages, text, channel, copyLink, fullScreen);
            }

            public void onSend(final LongSparseArray<TLRPC.Dialog> dids, final int count, TLRPC.TL_forumTopic topic) {
                AndroidUtilities.runOnUIThread(new Runnable() {
                    @Override
                    public final void run() {
                        ProfileActivity.AnonymousClass17.AnonymousClass1.this.lambda$onSend$0(dids, count);
                    }
                }, 250L);
            }

            public void lambda$onSend$0(LongSparseArray longSparseArray, int i) {
                BulletinFactory.createInviteSentBulletin(ProfileActivity.this.getParentActivity(), ProfileActivity.this.contentView, longSparseArray.size(), longSparseArray.size() == 1 ? ((TLRPC.Dialog) longSparseArray.valueAt(0)).id : 0L, i, getThemedColor(Theme.key_undo_background), getThemedColor(Theme.key_undo_infoColor)).show();
            }
        }

        public static void lambda$onItemClick$2(int i, DialogInterface dialogInterface, int i2) {
            int i3 = 2 - i2;
            if (i3 == i) {
                SharedConfig.overrideDevicePerformanceClass(-1);
            } else {
                SharedConfig.overrideDevicePerformanceClass(i3);
            }
        }
    }

    public void lambda$createView$11(android.view.View r8, int r9) {
        throw new UnsupportedOperationException("Method not decompiled: org.telegram.ui.ProfileActivity.lambda$createView$11(android.view.View, int):void");
    }

    public boolean lambda$createView$13(View view, int i) {
        if (this.searchAdapter.isSearchWas() || this.searchAdapter.recentSearches.isEmpty()) {
            return false;
        }
        AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity(), this.resourcesProvider);
        builder.setTitle(LocaleController.getString(R.string.ClearSearchAlertTitle));
        builder.setMessage(LocaleController.getString(R.string.ClearSearchAlert));
        builder.setPositiveButton(LocaleController.getString("ClearButton", R.string.ClearButton), new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i2) {
                ProfileActivity.this.lambda$createView$12(dialogInterface, i2);
            }
        });
        builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
        AlertDialog create = builder.create();
        showDialog(create);
        TextView textView = (TextView) create.getButton(-1);
        if (textView == null) {
            return true;
        }
        textView.setTextColor(Theme.getColor(Theme.key_text_RedBold));
        return true;
    }

    public void lambda$createView$12(DialogInterface dialogInterface, int i) {
        this.searchAdapter.clearRecent();
    }

    public void lambda$createView$14(TLObject tLObject) {
        this.currentChannelParticipant = ((TLRPC.TL_channels_channelParticipant) tLObject).participant;
    }

    public void lambda$createView$15(final TLObject tLObject, TLRPC.TL_error tL_error) {
        if (tLObject != null) {
            AndroidUtilities.runOnUIThread(new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$createView$14(tLObject);
                }
            });
        }
    }

    public class AnonymousClass20 implements ChatRightsEditActivity.ChatRightsEditActivityDelegate {
        public final TLRPC.Chat val$chat;
        public final ChatRightsEditActivity val$fragment;

        public AnonymousClass20(final TLRPC.Chat val$chat, final ChatRightsEditActivity val$fragment) {
            this.val$chat = val$chat;
            this.val$fragment = val$fragment;
        }

        @Override
        public void didSetRights(int rights, TLRPC.TL_chatAdminRights rightsAdmin, TLRPC.TL_chatBannedRights rightsBanned, String rank) {
            ChatRightsEditActivity chatRightsEditActivity;
            ProfileActivity.this.removeSelfFromStack();
            final TLRPC.User user = ProfileActivity.this.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.userId));
            if (user == null || this.val$chat == null || ProfileActivity.this.userId == 0 || (chatRightsEditActivity = this.val$fragment) == null || !chatRightsEditActivity.banning || chatRightsEditActivity.getParentLayout() == null) {
                return;
            }
            for (final BaseFragment baseFragment : this.val$fragment.getParentLayout().getFragmentStack()) {
                if (baseFragment instanceof ChannelAdminLogActivity) {
                    ((ChannelAdminLogActivity) baseFragment).lambda$processSelectedOption$20();
                    final TLRPC.Chat chat = this.val$chat;
                    AndroidUtilities.runOnUIThread(new Runnable() {
                        @Override
                        public final void run() {
                            ProfileActivity.AnonymousClass20.lambda$didSetRights$0(baseFragment, user, chat);
                        }
                    });
                    return;
                }
            }
        }

        public static void lambda$didSetRights$0(BaseFragment baseFragment, TLRPC.User user, TLRPC.Chat chat) {
            BulletinFactory.createRemoveFromChatBulletin(baseFragment, user, chat.title).show();
        }

        @Override
        public void didChangeOwner(TLRPC.User user) {
            ProfileActivity.this.undoView.showWithAction(-ProfileActivity.this.chatId, ProfileActivity.this.currentChat.megagroup ? 10 : 9, user);
        }
    }

    public void lambda$createView$16(TLRPC.Chat chat, View view) {
        long j = this.userId;
        long j2 = this.banFromGroup;
        TLRPC.TL_chatBannedRights tL_chatBannedRights = chat.default_banned_rights;
        TLRPC.ChannelParticipant channelParticipant = this.currentChannelParticipant;
        ChatRightsEditActivity chatRightsEditActivity = new ChatRightsEditActivity(j, j2, null, tL_chatBannedRights, channelParticipant != null ? channelParticipant.banned_rights : null, "", 1, true, false, null);
        chatRightsEditActivity.setDelegate(new AnonymousClass20(chat, chatRightsEditActivity));
        presentFragment(chatRightsEditActivity);
    }

    public class AnonymousClass21 extends FrameLayout {
        public CanvasButton canvasButton;

        public AnonymousClass21(Context context) {
            super(context);
        }

        @Override
        public void dispatchDraw(Canvas canvas) {
            super.dispatchDraw(canvas);
            if (ProfileActivity.this.transitionOnlineText != null) {
                canvas.save();
                canvas.translate(ProfileActivity.this.onlineTextView[0].getX(), ProfileActivity.this.onlineTextView[0].getY());
                canvas.saveLayerAlpha(0.0f, 0.0f, ProfileActivity.this.transitionOnlineText.getMeasuredWidth(), ProfileActivity.this.transitionOnlineText.getMeasuredHeight(), (int) ((1.0f - ProfileActivity.this.avatarAnimationProgress) * 255.0f), 31);
                ProfileActivity.this.transitionOnlineText.draw(canvas);
                canvas.restore();
                canvas.restore();
                invalidate();
            }
            if (ProfileActivity.this.hasFallbackPhoto) {
                ProfileActivity profileActivity = ProfileActivity.this;
                if (profileActivity.photoDescriptionProgress == 0.0f || profileActivity.customAvatarProgress == 1.0f) {
                    return;
                }
                float y = ProfileActivity.this.onlineTextView[1].getY() + (ProfileActivity.this.onlineTextView[1].getMeasuredHeight() / 2.0f);
                float dp = AndroidUtilities.dp(22.0f);
                float dp2 = ((AndroidUtilities.dp(28.0f) - ProfileActivity.this.customPhotoOffset) + ProfileActivity.this.onlineTextView[1].getX()) - dp;
                ProfileActivity.this.fallbackImage.setImageCoords(dp2, y - (dp / 2.0f), dp, dp);
                ProfileActivity.this.fallbackImage.setAlpha(ProfileActivity.this.photoDescriptionProgress);
                canvas.save();
                ProfileActivity profileActivity2 = ProfileActivity.this;
                float f = profileActivity2.photoDescriptionProgress;
                canvas.scale(f, f, profileActivity2.fallbackImage.getCenterX(), ProfileActivity.this.fallbackImage.getCenterY());
                ProfileActivity.this.fallbackImage.draw(canvas);
                canvas.restore();
                if (ProfileActivity.this.customAvatarProgress == 0.0f) {
                    if (this.canvasButton == null) {
                        CanvasButton canvasButton = new CanvasButton(this);
                        this.canvasButton = canvasButton;
                        canvasButton.setDelegate(new Runnable() {
                            @Override
                            public final void run() {
                                ProfileActivity.AnonymousClass21.this.lambda$dispatchDraw$0();
                            }
                        });
                    }
                    RectF rectF = AndroidUtilities.rectTmp;
                    rectF.set(dp2 - AndroidUtilities.dp(4.0f), y - AndroidUtilities.dp(14.0f), dp2 + ProfileActivity.this.onlineTextView[2].getTextWidth() + (AndroidUtilities.dp(28.0f) * (1.0f - ProfileActivity.this.customAvatarProgress)) + AndroidUtilities.dp(4.0f), y + AndroidUtilities.dp(14.0f));
                    this.canvasButton.setRect(rectF);
                    this.canvasButton.setRounded(true);
                    this.canvasButton.setColor(0, ColorUtils.setAlphaComponent(-1, 50));
                    this.canvasButton.draw(canvas);
                    return;
                }
                CanvasButton canvasButton2 = this.canvasButton;
                if (canvasButton2 != null) {
                    canvasButton2.cancelRipple();
                }
            }
        }

        public void lambda$dispatchDraw$0() {
            if (ProfileActivity.this.customAvatarProgress != 1.0f) {
                ProfileActivity.this.avatarsViewPager.scrollToLastItem();
            }
        }

        @Override
        public boolean onInterceptTouchEvent(MotionEvent ev) {
            CanvasButton canvasButton = this.canvasButton;
            return (canvasButton != null && canvasButton.checkTouchEvent(ev)) || super.onInterceptTouchEvent(ev);
        }

        @Override
        public boolean onTouchEvent(MotionEvent event) {
            CanvasButton canvasButton = this.canvasButton;
            return (canvasButton != null && canvasButton.checkTouchEvent(event)) || super.onTouchEvent(event);
        }

        @Override
        public void onAttachedToWindow() {
            super.onAttachedToWindow();
            ProfileActivity.this.fallbackImage.onAttachedToWindow();
        }

        @Override
        public void onDetachedFromWindow() {
            super.onDetachedFromWindow();
            ProfileActivity.this.fallbackImage.onDetachedFromWindow();
        }
    }

    public void lambda$createView$18(View view) {
        TLRPC.Document findDocument;
        Bulletin createContainsEmojiBulletin;
        if (this.avatarBig != null) {
            return;
        }
        if (this.isTopic && !getMessagesController().premiumFeaturesBlocked()) {
            ArrayList topics = getMessagesController().getTopicsController().getTopics(this.chatId);
            if (topics != null) {
                TLRPC.TL_forumTopic tL_forumTopic = null;
                for (int i = 0; tL_forumTopic == null && i < topics.size(); i++) {
                    TLRPC.TL_forumTopic tL_forumTopic2 = (TLRPC.TL_forumTopic) topics.get(i);
                    if (tL_forumTopic2 != null && tL_forumTopic2.id == this.topicId) {
                        tL_forumTopic = tL_forumTopic2;
                    }
                }
                if (tL_forumTopic != null) {
                    long j = tL_forumTopic.icon_emoji_id;
                    if (j == 0 || (findDocument = AnimatedEmojiDrawable.findDocument(((BaseFragment) this).currentAccount, j)) == null || (createContainsEmojiBulletin = BulletinFactory.of(this).createContainsEmojiBulletin(findDocument, 1, new Utilities.Callback() {
                        public final void run(Object obj) {
                            ProfileActivity.this.lambda$createView$17((TLRPC.InputStickerSet) obj);
                        }
                    })) == null) {
                        return;
                    }
                    createContainsEmojiBulletin.show();
                    return;
                }
                return;
            }
            return;
        }
        if (PlusSettings.showFullScreenAvatarOnSingleTap) {
            openAvatar();
        } else {
            if (expandAvatar()) {
                return;
            }
            openAvatar();
        }
    }

    public void lambda$createView$17(TLRPC.InputStickerSet inputStickerSet) {
        ArrayList arrayList = new ArrayList(1);
        arrayList.add(inputStickerSet);
        showDialog(new EmojiPacksAlert(this, getParentActivity(), this.resourcesProvider, arrayList));
    }

    public boolean lambda$createView$19(View view) {
        if (this.avatarBig == null && !this.isTopic) {
            openAvatar();
        }
        return false;
    }

    public void lambda$createView$20(View view) {
        presentFragment(new ChangeNameActivity(this.resourcesProvider));
    }

    public void lambda$createView$21(View view) {
        if (this.writeButton.getTag() != null) {
            return;
        }
        onWriteButtonClick();
    }

    public void lambda$createView$22(ValueAnimator valueAnimator) {
        setAvatarExpandProgress(valueAnimator.getAnimatedFraction());
    }

    public void lambda$createView$23(View view) {
        finishPreviewFragment();
    }

    public void lambda$createView$27(int i, View view) {
        int i2;
        Bulletin show;
        if (i == 0 && !this.sharedMediaLayout.isActionModeShown()) {
            if (!getMessagesController().storiesEnabled()) {
                showDialog(new PremiumFeatureBottomSheet(this, 14, true));
                return;
            } else {
                getMessagesController().getMainSettings().edit().putBoolean("story_keep", true).apply();
                StoryRecorder.getInstance(getParentActivity(), getCurrentAccount()).closeToWhenSent(new StoryRecorder.ClosingViewProvider() {
                    public void preLayout(long dialogId, Runnable runnable) {
                        ProfileActivity.this.avatarImage.setHasStories(ProfileActivity.this.needInsetForStories());
                        if (dialogId == ProfileActivity.this.getDialogId()) {
                            ProfileActivity.this.collapseAvatarInstant();
                        }
                        AndroidUtilities.runOnUIThread(runnable, 30L);
                    }

                    public StoryRecorder.SourceView getView(long dialogId) {
                        if (dialogId != ProfileActivity.this.getDialogId()) {
                            return null;
                        }
                        ProfileActivity.this.updateAvatarRoundRadius();
                        return StoryRecorder.SourceView.fromAvatarImage(ProfileActivity.this.avatarImage, ChatObject.isForum(ProfileActivity.this.currentChat));
                    }
                }).open((StoryRecorder.SourceView) null);
                return;
            }
        }
        final long clientUserId = getUserConfig().getClientUserId();
        Runnable runnable = this.applyBulletin;
        if (runnable != null) {
            runnable.run();
            this.applyBulletin = null;
        }
        Bulletin.hideVisible();
        boolean z = this.sharedMediaLayout.getClosestTab() == 9;
        final ArrayList arrayList = new ArrayList();
        SparseArray actionModeSelected = this.sharedMediaLayout.getActionModeSelected();
        if (actionModeSelected != null) {
            int i3 = 0;
            for (int i4 = 0; i4 < actionModeSelected.size(); i4++) {
                TL_stories.StoryItem storyItem = ((MessageObject) actionModeSelected.valueAt(i4)).storyItem;
                if (storyItem != null) {
                    arrayList.add(storyItem);
                    i3++;
                }
            }
            i2 = i3;
        } else {
            i2 = 0;
        }
        this.sharedMediaLayout.closeActionMode(false);
        if (z) {
            this.sharedMediaLayout.scrollToPage(8);
        }
        if (arrayList.isEmpty()) {
            return;
        }
        final boolean[] zArr = new boolean[arrayList.size()];
        for (int i5 = 0; i5 < arrayList.size(); i5++) {
            TL_stories.StoryItem storyItem2 = (TL_stories.StoryItem) arrayList.get(i5);
            zArr[i5] = storyItem2.pinned;
            storyItem2.pinned = z;
        }
        getMessagesController().getStoriesController().updateStoriesInLists(clientUserId, arrayList);
        final boolean[] zArr2 = {false};
        final boolean z2 = z;
        this.applyBulletin = new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$createView$24(clientUserId, arrayList, z2);
            }
        };
        Runnable runnable2 = new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$createView$25(zArr2, arrayList, zArr, clientUserId);
            }
        };
        if (z) {
            show = BulletinFactory.of(this).createSimpleBulletin(R.raw.contact_check, LocaleController.formatPluralString("StorySavedTitle", i2, new Object[0]), LocaleController.getString(R.string.StorySavedSubtitle), LocaleController.getString(R.string.Undo), runnable2).show();
        } else {
            show = BulletinFactory.of(this).createSimpleBulletin(R.raw.chats_archived, LocaleController.formatPluralString("StoryArchived", i2, new Object[0]), LocaleController.getString(R.string.Undo), 5000, runnable2).show();
        }
        show.setOnHideListener(new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$createView$26(zArr2);
            }
        });
    }

    public void lambda$createView$24(long j, ArrayList arrayList, boolean z) {
        getMessagesController().getStoriesController().updateStoriesPinned(j, arrayList, z, (Utilities.Callback) null);
    }

    public void lambda$createView$25(boolean[] zArr, ArrayList arrayList, boolean[] zArr2, long j) {
        zArr[0] = true;
        AndroidUtilities.cancelRunOnUIThread(this.applyBulletin);
        for (int i = 0; i < arrayList.size(); i++) {
            ((TL_stories.StoryItem) arrayList.get(i)).pinned = zArr2[i];
        }
        getMessagesController().getStoriesController().updateStoriesInLists(j, arrayList);
    }

    public void lambda$createView$26(boolean[] zArr) {
        Runnable runnable;
        if (!zArr[0] && (runnable = this.applyBulletin) != null) {
            runnable.run();
        }
        this.applyBulletin = null;
    }

    public final void onSharePressed() {
        if (getParentActivity() == null) {
            return;
        }
        ProfileGalleryView profileGalleryView = this.avatarsViewPager;
        ImageLocation imageLocation = profileGalleryView.getImageLocation(profileGalleryView.getRealPosition());
        if (imageLocation == null) {
            return;
        }
        boolean z = imageLocation.imageType == 2;
        File pathToAttach = FileLoader.getInstance(((BaseFragment) this).currentAccount).getPathToAttach(imageLocation.location, z ? "mp4" : null, true);
        try {
            if (!pathToAttach.exists()) {
                pathToAttach = new File(FileLoader.getDirectory(4), pathToAttach.getName());
            }
            if (pathToAttach.exists()) {
                Intent intent = new Intent("android.intent.action.SEND");
                if (z) {
                    intent.setType("video/mp4");
                } else {
                    intent.setType("image/jpeg");
                }
                if (Build.VERSION.SDK_INT >= 24) {
                    try {
                        intent.putExtra("android.intent.extra.STREAM", FileProvider.getUriForFile(getParentActivity(), ApplicationLoader.getApplicationId() + ".provider", pathToAttach));
                        intent.setFlags(1);
                    } catch (Exception unused) {
                        intent.putExtra("android.intent.extra.STREAM", Uri.fromFile(pathToAttach));
                    }
                } else {
                    intent.putExtra("android.intent.extra.STREAM", Uri.fromFile(pathToAttach));
                }
                startActivityForResult(Intent.createChooser(intent, LocaleController.getString("ShareFile", R.string.ShareFile)), 500);
            }
        } catch (Exception e) {
            FileLog.e(e);
        }
    }

    public void setParentChatActivity(ChatActivity chatActivity) {
        this.parentChatActivity = chatActivity;
    }

    public final void showUserMsgs(long id) {
        Bundle bundle = new Bundle();
        bundle.putLong("chat_id", this.currentChat.id);
        bundle.putLong("only_id", id);
        if (!PlusSettings.useOldShowUserMessagesMethod) {
            bundle.putLong(DialogObject.isUserDialog(id) ? "search_from_user_id" : "search_from_chat_id", id);
        }
        presentFragment(new ChatActivity(bundle));
    }

    public final void updateBottomButtonY() {
        FrameLayout frameLayout = this.bottomButtonsContainer;
        if (frameLayout == null) {
            return;
        }
        frameLayout.setTranslationY(this.sharedMediaLayout.isAttachedToWindow() ? Math.max(0.0f, AndroidUtilities.dp(184.0f) - (this.listView.getMeasuredHeight() - this.sharedMediaLayout.getY())) : AndroidUtilities.dp(72.0f));
        Bulletin visibleBulletin = Bulletin.getVisibleBulletin();
        if (visibleBulletin != null) {
            visibleBulletin.updatePosition();
        }
    }

    public final void checkCanSendStoryForPosting() {
        if (ChatObject.isBoostSupported(MessagesController.getInstance(((BaseFragment) this).currentAccount).getChat(Long.valueOf(this.chatId)))) {
            StoriesController storiesController = getMessagesController().getStoriesController();
            this.waitCanSendStoryRequest = true;
            storiesController.canSendStoryFor(getDialogId(), new com.google.android.exoplayer2.util.Consumer() {
                public final void accept(Object obj) {
                    ProfileActivity.this.lambda$checkCanSendStoryForPosting$28((Boolean) obj);
                }
            }, false, this.resourcesProvider);
        }
    }

    public void lambda$checkCanSendStoryForPosting$28(Boolean bool) {
        this.waitCanSendStoryRequest = false;
        this.showBoostsAlert = !bool.booleanValue();
        hideFloatingButton(false);
    }

    public final void updateAvatarRoundRadius() {
        this.avatarImage.setRoundRadius((int) AndroidUtilities.lerp(getSmallAvatarRoundRadius(), 0.0f, this.currentExpandAnimatorValue));
    }

    public final void createFloatingActionButton(Context context) {
        if (getMessagesController().storiesEnabled() && getDialogId() <= 0) {
            final TLRPC.Chat chat = MessagesController.getInstance(((BaseFragment) this).currentAccount).getChat(Long.valueOf(this.chatId));
            if (ChatObject.isBoostSupported(chat) && getMessagesController().getStoriesController().canPostStories(getDialogId())) {
                checkCanSendStoryForPosting();
                final long dialogId = getDialogId();
                FrameLayout frameLayout = new FrameLayout(context);
                this.floatingButtonContainer = frameLayout;
                frameLayout.setVisibility(0);
                NestedScrollingParent3 nestedScrollingParent3 = this.contentView;
                View view = this.floatingButtonContainer;
                int i = Build.VERSION.SDK_INT;
                int i2 = i >= 21 ? 56 : 60;
                float f = i >= 21 ? 56 : 60;
                boolean z = LocaleController.isRTL;
                nestedScrollingParent3.addView(view, LayoutHelper.createFrame(i2, f, (z ? 3 : 5) | 80, z ? 14.0f : 0.0f, 0.0f, z ? 0.0f : 14.0f, 14.0f));
                this.floatingButtonContainer.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view2) {
                        ProfileActivity.this.lambda$createFloatingActionButton$32(dialogId, chat, view2);
                    }
                });
                RLottieImageView rLottieImageView = new RLottieImageView(context);
                this.floatingButton = rLottieImageView;
                rLottieImageView.setScaleType(ImageView.ScaleType.CENTER);
                this.floatingButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_chats_actionIcon), PorterDuff.Mode.MULTIPLY));
                if (i >= 21) {
                    StateListAnimator stateListAnimator = new StateListAnimator();
                    int[] iArr = {android.R.attr.state_pressed};
                    FrameLayout frameLayout2 = this.floatingButtonContainer;
                    Property property = View.TRANSLATION_Z;
                    stateListAnimator.addState(iArr, ObjectAnimator.ofFloat(frameLayout2, (Property<FrameLayout, Float>) property, AndroidUtilities.dp(2.0f), AndroidUtilities.dp(4.0f)).setDuration(200L));
                    stateListAnimator.addState(new int[0], ObjectAnimator.ofFloat(this.floatingButtonContainer, (Property<FrameLayout, Float>) property, AndroidUtilities.dp(4.0f), AndroidUtilities.dp(2.0f)).setDuration(200L));
                    this.floatingButtonContainer.setStateListAnimator(stateListAnimator);
                    this.floatingButtonContainer.setOutlineProvider(new ViewOutlineProvider(this) {
                        @Override
                        @SuppressLint({"NewApi"})
                        public void getOutline(View view2, Outline outline) {
                            outline.setOval(0, 0, AndroidUtilities.dp(56.0f), AndroidUtilities.dp(56.0f));
                        }
                    });
                }
                this.floatingButtonContainer.addView((View) this.floatingButton, (ViewGroup.LayoutParams) LayoutHelper.createFrame(-1, -1.0f));
                this.floatingButton.setAnimation(R.raw.write_contacts_fab_icon_camera, 56, 56);
                this.floatingButtonContainer.setContentDescription(LocaleController.getString("AccDescrCaptureStory", R.string.AccDescrCaptureStory));
                updateFloatingButtonColor();
            }
        }
    }

    public void lambda$createFloatingActionButton$32(final long j, final TLRPC.Chat chat, View view) {
        if (this.showBoostsAlert) {
            if (this.loadingBoostsStats) {
                return;
            }
            final MessagesController messagesController = MessagesController.getInstance(((BaseFragment) this).currentAccount);
            this.loadingBoostsStats = true;
            messagesController.getBoostsController().getBoostsStats(j, new com.google.android.exoplayer2.util.Consumer() {
                public final void accept(Object obj) {
                    ProfileActivity.this.lambda$createFloatingActionButton$31(messagesController, j, (TL_stories.TL_premium_boostsStatus) obj);
                }
            });
            return;
        }
        StoryRecorder.getInstance(getParentActivity(), ((BaseFragment) this).currentAccount).selectedPeerId(getDialogId()).canChangePeer(false).closeToWhenSent(new StoryRecorder.ClosingViewProvider() {
            public void preLayout(long dialogId, Runnable runnable) {
                ProfileActivity.this.avatarImage.setHasStories(ProfileActivity.this.needInsetForStories());
                if (dialogId == ProfileActivity.this.getDialogId()) {
                    ProfileActivity.this.collapseAvatarInstant();
                }
                AndroidUtilities.runOnUIThread(runnable, 30L);
            }

            public StoryRecorder.SourceView getView(long dialogId) {
                if (dialogId != ProfileActivity.this.getDialogId()) {
                    return null;
                }
                ProfileActivity.this.updateAvatarRoundRadius();
                return StoryRecorder.SourceView.fromAvatarImage(ProfileActivity.this.avatarImage, ChatObject.isForum(chat));
            }
        }).open(StoryRecorder.SourceView.fromFloatingButton(this.floatingButtonContainer), true);
    }

    public void lambda$createFloatingActionButton$31(MessagesController messagesController, final long j, final TL_stories.TL_premium_boostsStatus tL_premium_boostsStatus) {
        this.loadingBoostsStats = false;
        if (tL_premium_boostsStatus == null) {
            return;
        }
        messagesController.getBoostsController().userCanBoostChannel(j, tL_premium_boostsStatus, new com.google.android.exoplayer2.util.Consumer() {
            public final void accept(Object obj) {
                ProfileActivity.this.lambda$createFloatingActionButton$30(j, tL_premium_boostsStatus, (ChannelBoostsController.CanApplyBoost) obj);
            }
        });
    }

    public void lambda$createFloatingActionButton$30(long j, TL_stories.TL_premium_boostsStatus tL_premium_boostsStatus, ChannelBoostsController.CanApplyBoost canApplyBoost) {
        if (canApplyBoost == null) {
            return;
        }
        LimitReachedBottomSheet.openBoostsForPostingStories(LaunchActivity.getLastFragment(), j, canApplyBoost, tL_premium_boostsStatus, new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$createFloatingActionButton$29();
            }
        });
    }

    public void lambda$createFloatingActionButton$29() {
        presentFragment(StatisticActivity.create(getMessagesController().getChat(Long.valueOf(this.chatId))));
    }

    public final void collapseAvatarInstant() {
        if (!this.allowPullingDown || this.currentExpandAnimatorValue <= 0.0f) {
            return;
        }
        this.layoutManager.scrollToPositionWithOffset(0, AndroidUtilities.dp(88.0f) - this.listView.getPaddingTop());
        this.listView.post(new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$collapseAvatarInstant$33();
            }
        });
    }

    public void lambda$collapseAvatarInstant$33() {
        needLayout(true);
        if (this.expandAnimator.isRunning()) {
            this.expandAnimator.cancel();
        }
        setAvatarExpandProgress(1.0f);
    }

    public final void updateFloatingButtonColor() {
        if (getParentActivity() == null || this.floatingButtonContainer == null) {
            return;
        }
        Drawable createSimpleSelectorCircleDrawable = Theme.createSimpleSelectorCircleDrawable(AndroidUtilities.dp(56.0f), applyPeerColor(Theme.getColor(Theme.key_chats_actionBackground), false), applyPeerColor(Theme.getColor(Theme.key_chats_actionPressedBackground), false));
        if (Build.VERSION.SDK_INT < 21) {
            Drawable mutate = ContextCompat.getDrawable(getParentActivity(), R.drawable.floating_shadow).mutate();
            mutate.setColorFilter(new PorterDuffColorFilter(-16777216, PorterDuff.Mode.MULTIPLY));
            Drawable combinedDrawable = new CombinedDrawable(mutate, createSimpleSelectorCircleDrawable, 0, 0);
            combinedDrawable.setIconSize(AndroidUtilities.dp(56.0f), AndroidUtilities.dp(56.0f));
            createSimpleSelectorCircleDrawable = combinedDrawable;
        }
        this.floatingButtonContainer.setBackground(createSimpleSelectorCircleDrawable);
    }

    public final void hideFloatingButton(boolean hide) {
        if (this.floatingHidden == hide || this.floatingButtonContainer == null || this.waitCanSendStoryRequest) {
            return;
        }
        this.floatingHidden = hide;
        AnimatorSet animatorSet = new AnimatorSet();
        float[] fArr = new float[2];
        fArr[0] = this.floatingButtonHideProgress;
        fArr[1] = this.floatingHidden ? 1.0f : 0.0f;
        ValueAnimator ofFloat = ValueAnimator.ofFloat(fArr);
        ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public final void onAnimationUpdate(ValueAnimator valueAnimator) {
                ProfileActivity.this.lambda$hideFloatingButton$34(valueAnimator);
            }
        });
        animatorSet.playTogether(ofFloat);
        animatorSet.setDuration(300L);
        animatorSet.setInterpolator(this.floatingInterpolator);
        this.floatingButtonContainer.setClickable(!hide);
        animatorSet.start();
    }

    public void lambda$hideFloatingButton$34(ValueAnimator valueAnimator) {
        this.floatingButtonHideProgress = ((Float) valueAnimator.getAnimatedValue()).floatValue();
        updateFloatingButtonOffset();
    }

    public final void updateFloatingButtonOffset() {
        FrameLayout frameLayout = this.floatingButtonContainer;
        if (frameLayout != null) {
            frameLayout.setTranslationY(AndroidUtilities.dp(100.0f) * this.floatingButtonHideProgress);
        }
    }

    public final boolean expandAvatar() {
        RecyclerView.ViewHolder findContainingViewHolder;
        Integer num;
        if (!AndroidUtilities.isTablet() && !this.isInLandscapeMode && this.avatarImage.getImageReceiver().hasNotThumb() && !AndroidUtilities.isAccessibilityScreenReaderEnabled()) {
            this.openingAvatar = true;
            this.allowPullingDown = true;
            View view = null;
            int i = 0;
            while (true) {
                if (i >= this.listView.getChildCount()) {
                    break;
                }
                RecyclerListView recyclerListView = this.listView;
                if (recyclerListView.getChildAdapterPosition(recyclerListView.getChildAt(i)) == 0) {
                    view = this.listView.getChildAt(i);
                    break;
                }
                i++;
            }
            if (view != null && (findContainingViewHolder = this.listView.findContainingViewHolder(view)) != null && (num = this.positionToOffset.get(Integer.valueOf(findContainingViewHolder.getAdapterPosition()))) != null) {
                this.listView.smoothScrollBy(0, -(num.intValue() + ((this.listView.getPaddingTop() - view.getTop()) - ((BaseFragment) this).actionBar.getMeasuredHeight())), CubicBezierInterpolator.EASE_OUT_QUINT);
                return true;
            }
        }
        return false;
    }

    public final void setAvatarExpandProgress(float r23) {
        throw new UnsupportedOperationException("Method not decompiled: org.telegram.ui.ProfileActivity.setAvatarExpandProgress(float):void");
    }

    public final int getSmallAvatarRoundRadius() {
        if (this.chatId == 0 || !ChatObject.isForum(getMessagesController().getChat(Long.valueOf(this.chatId)))) {
            return AndroidUtilities.dp(21.0f);
        }
        return AndroidUtilities.dp(needInsetForStories() ? 11.0f : 16.0f);
    }

    public final void updateTtlIcon() {
        TLRPC.UserFull userFull;
        if (this.ttlIconView == null) {
            return;
        }
        boolean z = false;
        if (this.currentEncryptedChat == null && (((userFull = this.userInfo) != null && userFull.ttl_period > 0) || (this.chatInfo != null && ChatObject.canUserDoAdminAction(this.currentChat, 13) && this.chatInfo.ttl_period > 0))) {
            z = true;
        }
        AndroidUtilities.updateViewVisibilityAnimated(this.ttlIconView, z, 0.8f, this.fragmentOpened);
    }

    public final void showUserMedia(long id) {
        Bundle bundle = new Bundle();
        bundle.putLong("chat_id", this.currentChat.id);
        bundle.putLong("only_id_media", id);
        presentFragment(new ChatActivity(bundle));
    }

    public long getDialogId() {
        long j = this.dialogId;
        if (j != 0) {
            return j;
        }
        long j2 = this.userId;
        return j2 != 0 ? j2 : -this.chatId;
    }

    public void getEmojiStatusLocation(Rect rect) {
        SimpleTextView[] simpleTextViewArr = this.nameTextView;
        if (simpleTextViewArr[1] == null) {
            return;
        }
        if (simpleTextViewArr[1].getRightDrawable() == null) {
            rect.set(this.nameTextView[1].getWidth() - 1, (this.nameTextView[1].getHeight() / 2) - 1, this.nameTextView[1].getWidth() + 1, (this.nameTextView[1].getHeight() / 2) + 1);
            return;
        }
        rect.set(this.nameTextView[1].getRightDrawable().getBounds());
        rect.offset((int) (rect.centerX() * (this.nameTextView[1].getScaleX() - 1.0f)), 0);
        rect.offset((int) this.nameTextView[1].getX(), (int) this.nameTextView[1].getY());
    }

    public void goToForum() {
        if (getParentLayout() != null && getParentLayout().getFragmentStack() != null) {
            int i = 0;
            while (i < getParentLayout().getFragmentStack().size()) {
                BaseFragment baseFragment = getParentLayout().getFragmentStack().get(i);
                if (baseFragment instanceof DialogsActivity) {
                    DialogsActivity dialogsActivity = (DialogsActivity) baseFragment;
                    RightSlidingDialogContainer rightSlidingDialogContainer = dialogsActivity.rightSlidingDialogContainer;
                    if (rightSlidingDialogContainer != null) {
                        BaseFragment fragment = rightSlidingDialogContainer.getFragment();
                        if ((fragment instanceof TopicsFragment) && ((TopicsFragment) fragment).getDialogId() == getDialogId()) {
                            dialogsActivity.rightSlidingDialogContainer.lambda$presentFragment$1();
                        }
                    }
                } else if (baseFragment instanceof ChatActivity) {
                    if (((ChatActivity) baseFragment).getDialogId() == getDialogId()) {
                        getParentLayout().removeFragmentFromStack(baseFragment);
                        i--;
                    }
                } else if (baseFragment instanceof TopicsFragment) {
                    if (((TopicsFragment) baseFragment).getDialogId() == getDialogId()) {
                        getParentLayout().removeFragmentFromStack(baseFragment);
                        i--;
                    }
                } else if ((baseFragment instanceof ProfileActivity) && baseFragment != this) {
                    ProfileActivity profileActivity = (ProfileActivity) baseFragment;
                    if (profileActivity.getDialogId() == getDialogId() && profileActivity.isTopic) {
                        getParentLayout().removeFragmentFromStack(baseFragment);
                        i--;
                    }
                }
                i++;
            }
        }
        this.playProfileAnimation = 0;
        Bundle bundle = new Bundle();
        bundle.putLong("chat_id", this.chatId);
        presentFragment(TopicsFragment.getTopicsOrChat(this, bundle));
    }

    public void showStatusSelect() {
        if (this.selectAnimatedEmojiDialog != null) {
            return;
        }
        final SelectAnimatedEmojiDialog.SelectAnimatedEmojiDialogWindow[] selectAnimatedEmojiDialogWindowArr = new SelectAnimatedEmojiDialog.SelectAnimatedEmojiDialogWindow[1];
        Rect rect = AndroidUtilities.rectTmp2;
        getEmojiStatusLocation(rect);
        int i = this.nameTextView[1].getScaleX() < 1.5f ? 16 : 32;
        int dp = (-(this.avatarContainer2.getHeight() - rect.centerY())) - AndroidUtilities.dp(i);
        int min = (int) Math.min(AndroidUtilities.dp(324.0f), AndroidUtilities.displaySize.x * 0.95f);
        int centerX = rect.centerX();
        int clamp = MathUtils.clamp(centerX - (min / 2), 0, AndroidUtilities.displaySize.x - min);
        int i2 = centerX - clamp;
        AnimatedEmojiDrawable.SwapAnimatedEmojiDrawable[] swapAnimatedEmojiDrawableArr = this.emojiStatusDrawable;
        if (swapAnimatedEmojiDrawableArr[1] != null) {
            boolean z = swapAnimatedEmojiDrawableArr[1].getDrawable() instanceof AnimatedEmojiDrawable;
        }
        SelectAnimatedEmojiDialog selectAnimatedEmojiDialog = new SelectAnimatedEmojiDialog(this, getContext(), true, Integer.valueOf(Math.max(0, i2)), this.currentChat == null ? 0 : 9, true, this.resourcesProvider, i) {
            @Override
            public void onEmojiSelected(View emojiView, Long documentId, TLRPC.Document document, Integer until) {
                TLRPC.TL_account_updateEmojiStatus tL_channels_updateEmojiStatus;
                if (ProfileActivity.this.currentChat == null) {
                    tL_channels_updateEmojiStatus = new TLRPC.TL_account_updateEmojiStatus();
                    if (documentId == null) {
                        tL_channels_updateEmojiStatus.emoji_status = new TLRPC.TL_emojiStatusEmpty();
                    } else if (until != null) {
                        TLRPC.TL_emojiStatusUntil tL_emojiStatusUntil = new TLRPC.TL_emojiStatusUntil();
                        tL_channels_updateEmojiStatus.emoji_status = tL_emojiStatusUntil;
                        tL_emojiStatusUntil.document_id = documentId.longValue();
                        tL_channels_updateEmojiStatus.emoji_status.until = until.intValue();
                    } else {
                        TLRPC.TL_emojiStatus tL_emojiStatus = new TLRPC.TL_emojiStatus();
                        tL_channels_updateEmojiStatus.emoji_status = tL_emojiStatus;
                        tL_emojiStatus.document_id = documentId.longValue();
                    }
                    TLRPC.User user = MessagesController.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).getUser(Long.valueOf(UserConfig.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).getClientUserId()));
                    if (user != null) {
                        user.emoji_status = tL_channels_updateEmojiStatus.emoji_status;
                        MessagesController.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).updateEmojiStatusUntilUpdate(user.id, user.emoji_status);
                        NotificationCenter.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).postNotificationName(NotificationCenter.userEmojiStatusUpdated, new Object[]{user});
                    }
                } else {
                    tL_channels_updateEmojiStatus = new TLRPC.TL_channels_updateEmojiStatus();
                    ((TLRPC.TL_channels_updateEmojiStatus) tL_channels_updateEmojiStatus).channel = MessagesController.getInputChannel(ProfileActivity.this.currentChat);
                    if (documentId == null) {
                        ((TLRPC.TL_channels_updateEmojiStatus) tL_channels_updateEmojiStatus).emoji_status = new TLRPC.TL_emojiStatusEmpty();
                    } else if (until != null) {
                        TLRPC.TL_emojiStatusUntil tL_emojiStatusUntil2 = new TLRPC.TL_emojiStatusUntil();
                        ((TLRPC.TL_channels_updateEmojiStatus) tL_channels_updateEmojiStatus).emoji_status = tL_emojiStatusUntil2;
                        tL_emojiStatusUntil2.document_id = documentId.longValue();
                        ((TLRPC.TL_channels_updateEmojiStatus) tL_channels_updateEmojiStatus).emoji_status.until = until.intValue();
                    } else {
                        TLRPC.TL_emojiStatus tL_emojiStatus2 = new TLRPC.TL_emojiStatus();
                        ((TLRPC.TL_channels_updateEmojiStatus) tL_channels_updateEmojiStatus).emoji_status = tL_emojiStatus2;
                        tL_emojiStatus2.document_id = documentId.longValue();
                    }
                    if (ProfileActivity.this.currentChat != null) {
                        ProfileActivity.this.currentChat.emoji_status = ((TLRPC.TL_channels_updateEmojiStatus) tL_channels_updateEmojiStatus).emoji_status;
                        MessagesController.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).updateEmojiStatusUntilUpdate(-ProfileActivity.this.currentChat.id, ProfileActivity.this.currentChat.emoji_status);
                        NotificationCenter.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(MessagesController.UPDATE_MASK_EMOJI_STATUS)});
                    }
                }
                for (int i3 = 0; i3 < 2; i3++) {
                    if (ProfileActivity.this.emojiStatusDrawable[i3] != null) {
                        if (documentId == null && ProfileActivity.this.currentChat == null) {
                            ProfileActivity.this.emojiStatusDrawable[i3].set(ProfileActivity.this.getPremiumCrossfadeDrawable(i3), true);
                        } else if (documentId != null) {
                            ProfileActivity.this.emojiStatusDrawable[i3].set(documentId.longValue(), true);
                        } else {
                            ProfileActivity.this.emojiStatusDrawable[i3].set((Drawable) null, true);
                        }
                    }
                }
                if (documentId != null) {
                    ProfileActivity.this.animatedStatusView.animateChange(ReactionsLayoutInBubble.VisibleReaction.fromCustomEmoji(documentId));
                }
                ProfileActivity.this.updateEmojiStatusDrawableColor();
                ProfileActivity.this.updateEmojiStatusEffectPosition();
                ConnectionsManager.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).sendRequest(tL_channels_updateEmojiStatus, (RequestDelegate) null);
                if (selectAnimatedEmojiDialogWindowArr[0] != null) {
                    ProfileActivity.this.selectAnimatedEmojiDialog = null;
                    selectAnimatedEmojiDialogWindowArr[0].dismiss();
                }
            }
        };
        TLRPC.User user = getMessagesController().getUser(Long.valueOf(this.userId));
        if (user != null) {
            selectAnimatedEmojiDialog.setExpireDateHint(DialogObject.getEmojiStatusUntil(user.emoji_status));
        }
        AnimatedEmojiDrawable.SwapAnimatedEmojiDrawable[] swapAnimatedEmojiDrawableArr2 = this.emojiStatusDrawable;
        selectAnimatedEmojiDialog.setSelected((swapAnimatedEmojiDrawableArr2[1] == null || !(swapAnimatedEmojiDrawableArr2[1].getDrawable() instanceof AnimatedEmojiDrawable)) ? null : Long.valueOf(this.emojiStatusDrawable[1].getDrawable().getDocumentId()));
        selectAnimatedEmojiDialog.setSaveState(3);
        selectAnimatedEmojiDialog.setScrimDrawable(this.emojiStatusDrawable[1], this.nameTextView[1]);
        int i3 = -2;
        SelectAnimatedEmojiDialog.SelectAnimatedEmojiDialogWindow selectAnimatedEmojiDialogWindow = new SelectAnimatedEmojiDialog.SelectAnimatedEmojiDialogWindow(selectAnimatedEmojiDialog, i3, i3) {
            @Override
            public void dismiss() {
                super.dismiss();
                ProfileActivity.this.selectAnimatedEmojiDialog = null;
            }
        };
        this.selectAnimatedEmojiDialog = selectAnimatedEmojiDialogWindow;
        selectAnimatedEmojiDialogWindowArr[0] = selectAnimatedEmojiDialogWindow;
        int[] iArr = new int[2];
        SimpleTextView[] simpleTextViewArr = this.nameTextView;
        if (simpleTextViewArr[1] != null) {
            simpleTextViewArr[1].getLocationOnScreen(iArr);
        }
        selectAnimatedEmojiDialogWindowArr[0].showAsDropDown(((BaseFragment) this).fragmentView, clamp, dp, 51);
        selectAnimatedEmojiDialogWindowArr[0].dimBehind();
    }

    public TLRPC.Chat getCurrentChat() {
        return this.currentChat;
    }

    public TLRPC.UserFull getUserInfo() {
        return this.userInfo;
    }

    public boolean isFragmentOpened() {
        return this.isFragmentOpened;
    }

    public final void openAvatar() {
        TLRPC.Chat chat;
        TLRPC.ChatPhoto chatPhoto;
        ImageLocation imageLocation;
        if (this.listView.getScrollState() == 1) {
            return;
        }
        if (this.userId != 0) {
            TLRPC.User user = getMessagesController().getUser(Long.valueOf(this.userId));
            TLRPC.UserProfilePhoto userProfilePhoto = user.photo;
            if (userProfilePhoto == null || userProfilePhoto.photo_big == null) {
                return;
            }
            PhotoViewer.getInstance().setParentActivity(this);
            TLRPC.UserProfilePhoto userProfilePhoto2 = user.photo;
            int i = userProfilePhoto2.dc_id;
            if (i != 0) {
                userProfilePhoto2.photo_big.dc_id = i;
            }
            PhotoViewer.getInstance().openPhoto(user.photo.photo_big, this.provider);
            return;
        }
        if (this.chatId == 0 || (chatPhoto = (chat = getMessagesController().getChat(Long.valueOf(this.chatId))).photo) == null || chatPhoto.photo_big == null) {
            return;
        }
        PhotoViewer.getInstance().setParentActivity(this);
        TLRPC.ChatPhoto chatPhoto2 = chat.photo;
        int i2 = chatPhoto2.dc_id;
        if (i2 != 0) {
            chatPhoto2.photo_big.dc_id = i2;
        }
        TLRPC.ChatFull chatFull = this.chatInfo;
        if (chatFull != null) {
            TLRPC.Photo photo = chatFull.chat_photo;
            if ((photo instanceof TLRPC.TL_photo) && !photo.video_sizes.isEmpty()) {
                imageLocation = ImageLocation.getForPhoto((TLRPC.VideoSize) this.chatInfo.chat_photo.video_sizes.get(0), this.chatInfo.chat_photo);
                PhotoViewer.getInstance().openPhotoWithVideo(chat.photo.photo_big, imageLocation, this.provider);
            }
        }
        imageLocation = null;
        PhotoViewer.getInstance().openPhotoWithVideo(chat.photo.photo_big, imageLocation, this.provider);
    }

    public final void onWriteButtonClick() {
        if (this.userId != 0) {
            if (this.imageUpdater != null) {
                TLRPC.User user = getMessagesController().getUser(Long.valueOf(UserConfig.getInstance(((BaseFragment) this).currentAccount).getClientUserId()));
                if (user == null) {
                    user = UserConfig.getInstance(((BaseFragment) this).currentAccount).getCurrentUser();
                }
                if (user == null) {
                    return;
                }
                ImageUpdater imageUpdater = this.imageUpdater;
                TLRPC.UserProfilePhoto userProfilePhoto = user.photo;
                imageUpdater.openMenu((userProfilePhoto == null || userProfilePhoto.photo_big == null || (userProfilePhoto instanceof TLRPC.TL_userProfilePhotoEmpty)) ? false : true, new Runnable() {
                    @Override
                    public final void run() {
                        ProfileActivity.this.lambda$onWriteButtonClick$35();
                    }
                }, new DialogInterface.OnDismissListener() {
                    @Override
                    public final void onDismiss(DialogInterface dialogInterface) {
                        ProfileActivity.this.lambda$onWriteButtonClick$36(dialogInterface);
                    }
                }, 0);
                this.cameraDrawable.setCurrentFrame(0);
                this.cameraDrawable.setCustomEndFrame(43);
                this.cellCameraDrawable.setCurrentFrame(0);
                this.cellCameraDrawable.setCustomEndFrame(43);
                this.writeButton.playAnimation();
                TextCell textCell = this.setAvatarCell;
                if (textCell != null) {
                    textCell.getImageView().playAnimation();
                    return;
                }
                return;
            }
            if (this.playProfileAnimation != 0 && (((BaseFragment) this).parentLayout.getFragmentStack().get(((BaseFragment) this).parentLayout.getFragmentStack().size() - 2) instanceof ChatActivity)) {
                finishFragment();
                return;
            }
            TLRPC.User user2 = getMessagesController().getUser(Long.valueOf(this.userId));
            if (user2 == null || (user2 instanceof TLRPC.TL_userEmpty)) {
                return;
            }
            Bundle bundle = new Bundle();
            bundle.putLong("user_id", this.userId);
            if (getMessagesController().checkCanOpenChat(bundle, this)) {
                if (!PlusSettings.insideHidden && getMessagesController().hiddenDialogs.contains(Long.valueOf(this.userId)) && !PlusSettings.openHiddenDialogsWithoutPasscode && SharedConfig.hiddenPasscodeHash.length() > 0) {
                    NotificationCenter notificationCenter = getNotificationCenter();
                    int i = NotificationCenter.closeChats;
                    notificationCenter.removeObserver(this, i);
                    getNotificationCenter().postNotificationName(i, new Object[0]);
                    getNotificationCenter().postNotificationName(i, new Object[]{0L});
                    bundle.putLong("hidden_dialog", user2.id);
                    presentFragment(new DialogsActivity(bundle), true, true);
                    return;
                }
                boolean z = ((BaseFragment) this).arguments.getBoolean("removeFragmentOnChatOpen", true);
                if (!AndroidUtilities.isTablet() && z) {
                    NotificationCenter notificationCenter2 = getNotificationCenter();
                    int i2 = NotificationCenter.closeChats;
                    notificationCenter2.removeObserver(this, i2);
                    getNotificationCenter().postNotificationName(i2, new Object[0]);
                }
                int i3 = getArguments().getInt("nearby_distance", -1);
                if (i3 >= 0) {
                    bundle.putInt("nearby_distance", i3);
                }
                ChatActivity chatActivity = new ChatActivity(bundle);
                chatActivity.setPreloadedSticker(getMediaDataController().getGreetingsSticker(), false);
                presentFragment(chatActivity, z);
                if (AndroidUtilities.isTablet()) {
                    finishFragment();
                    return;
                }
                return;
            }
            return;
        }
        openDiscussion();
    }

    public void lambda$onWriteButtonClick$35() {
        getMessagesController().deleteUserPhoto((TLRPC.InputPhoto) null);
        this.cameraDrawable.setCurrentFrame(0);
        this.cellCameraDrawable.setCurrentFrame(0);
    }

    public void lambda$onWriteButtonClick$36(DialogInterface dialogInterface) {
        if (!this.imageUpdater.isUploadingImage()) {
            this.cameraDrawable.setCustomEndFrame(86);
            this.cellCameraDrawable.setCustomEndFrame(86);
            this.writeButton.playAnimation();
            TextCell textCell = this.setAvatarCell;
            if (textCell != null) {
                textCell.getImageView().playAnimation();
                return;
            }
            return;
        }
        this.cameraDrawable.setCurrentFrame(0, false);
        this.cellCameraDrawable.setCurrentFrame(0, false);
    }

    public final void openDiscussion() {
        TLRPC.ChatFull chatFull = this.chatInfo;
        if (chatFull == null || chatFull.linked_chat_id == 0) {
            return;
        }
        Bundle bundle = new Bundle();
        bundle.putLong("chat_id", this.chatInfo.linked_chat_id);
        if (getMessagesController().checkCanOpenChat(bundle, this)) {
            presentFragment(new ChatActivity(bundle));
        }
    }

    public boolean onMemberClick(TLRPC.ChatParticipant participant, boolean isLong, View view) {
        return onMemberClick(participant, isLong, false, view);
    }

    public boolean onMemberClick(final TLRPC.ChatParticipant participant, boolean isLong, boolean resultOnly, View view) {
        boolean z;
        TLRPC.ChannelParticipant channelParticipant;
        boolean z2;
        boolean z3;
        boolean z4;
        int i;
        String str;
        if (getParentActivity() == null) {
            return false;
        }
        if (isLong) {
            final TLRPC.User user = getMessagesController().getUser(Long.valueOf(participant.user_id));
            if (user != null) {
                getUserConfig().getClientUserId();
            }
            this.selectedUser = participant.user_id;
            UserObject.getFirstName(user);
            String str2 = user.username;
            if (ChatObject.isChannel(this.currentChat)) {
                TLRPC.ChannelParticipant channelParticipant2 = ((TLRPC.TL_chatChannelParticipant) participant).channelParticipant;
                boolean canAddAdmins = ChatObject.canAddAdmins(this.currentChat);
                if (canAddAdmins && ((channelParticipant2 instanceof TLRPC.TL_channelParticipantCreator) || ((channelParticipant2 instanceof TLRPC.TL_channelParticipantAdmin) && !channelParticipant2.can_edit))) {
                    canAddAdmins = false;
                }
                boolean z5 = ChatObject.canBlockUsers(this.currentChat) && (!((channelParticipant2 instanceof TLRPC.TL_channelParticipantAdmin) || (channelParticipant2 instanceof TLRPC.TL_channelParticipantCreator)) || channelParticipant2.can_edit);
                z = channelParticipant2 instanceof TLRPC.TL_channelParticipantAdmin;
                channelParticipant = channelParticipant2;
                z2 = canAddAdmins;
                z4 = z5;
                z3 = this.currentChat.gigagroup ? false : z5;
            } else {
                TLRPC.Chat chat = this.currentChat;
                boolean z6 = chat.creator || ((participant instanceof TLRPC.TL_chatParticipant) && (ChatObject.canBlockUsers(chat) || participant.inviter_id == getUserConfig().getClientUserId()));
                z = participant instanceof TLRPC.TL_chatParticipantAdmin;
                channelParticipant = null;
                z2 = this.currentChat.creator;
                z3 = z2;
                z4 = z6;
            }
            final boolean z7 = z;
            boolean z8 = z2 || z3 || z4;
            if (resultOnly) {
                return z8;
            }
            if (this.selectedUser == 0) {
                this.selectedUser = channelParticipant != null ? channelParticipant.user_id : getUserConfig().getClientUserId();
            }
            final TLRPC.ChannelParticipant channelParticipant3 = channelParticipant;
            final Utilities.Callback callback = new Utilities.Callback() {
                public final void run(Object obj) {
                    ProfileActivity.this.lambda$onMemberClick$37(channelParticipant3, user, participant, z7, (Integer) obj);
                }
            };
            ItemOptions scrimViewBackground = ItemOptions.makeOptions(this, view).setScrimViewBackground(new ColorDrawable(Theme.getColor(Theme.key_windowBackgroundWhite)));
            int i2 = R.drawable.msg_admins;
            if (z7) {
                i = R.string.EditAdminRights;
                str = "EditAdminRights";
            } else {
                i = R.string.SetAsAdmin;
                str = "SetAsAdmin";
            }
            ItemOptions addIf = scrimViewBackground.addIf(z2, i2, LocaleController.getString(str, i), new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.lambda$onMemberClick$38(callback);
                }
            });
            int i3 = R.drawable.msg_permissions;
            final TLRPC.ChannelParticipant channelParticipant4 = channelParticipant;
            final TLRPC.ChannelParticipant channelParticipant5 = channelParticipant;
            addIf.addIf(z3, i3, LocaleController.getString("ChangePermissions", R.string.ChangePermissions), new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$onMemberClick$40(channelParticipant4, participant, user, callback);
                }
            }).addIf(z4, R.drawable.msg_remove, LocaleController.getString("KickFromGroup", R.string.KickFromGroup), true, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$onMemberClick$41(user, participant);
                }
            }).addIf(!z3, i3, LocaleController.getString("UserRestrictions", R.string.UserRestrictions), new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$onMemberClick$42(channelParticipant5, participant, user);
                }
            }).addIf(z4 && UserObject.isDeleted(user) && this.deletedAccounts.size() > 0, R.drawable.actions_remove_user, LocaleController.formatString("DeleteFewChatsTitle", R.string.DeleteFewChatsTitle, new Object[]{LocaleController.formatPluralString("Members", this.deletedAccounts.size(), new Object[0])}), true, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$onMemberClick$44();
                }
            }).addIf(this.onlyId == 0 && this.onlyIdMedia == 0, R.drawable.msg_msgbubble2, LocaleController.getString("ShowUserMessages", R.string.ShowUserMessages), false, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$onMemberClick$45();
                }
            }).addIf(this.onlyId == 0 && this.onlyIdMedia == 0, R.drawable.files_gallery, LocaleController.getString("ShowUserMedia", R.string.ShowUserMedia), false, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$onMemberClick$46();
                }
            }).setMinWidth(190).show();
            return true;
        }
        long j = participant.user_id;
        getUserConfig().getClientUserId();
        Bundle bundle = new Bundle();
        bundle.putLong("user_id", participant.user_id);
        bundle.putBoolean("preload_messages", true);
        presentFragment(new ProfileActivity(bundle));
        return true;
    }

    public void lambda$onMemberClick$37(TLRPC.ChannelParticipant channelParticipant, TLRPC.User user, TLRPC.ChatParticipant chatParticipant, boolean z, Integer num) {
        if (channelParticipant != null) {
            openRightsEdit(num.intValue(), user, chatParticipant, channelParticipant.admin_rights, channelParticipant.banned_rights, channelParticipant.rank, z);
        } else {
            openRightsEdit(num.intValue(), user, chatParticipant, null, null, "", z);
        }
    }

    public static void lambda$onMemberClick$38(Utilities.Callback callback) {
        callback.run(0);
    }

    public void lambda$onMemberClick$40(TLRPC.ChannelParticipant channelParticipant, TLRPC.ChatParticipant chatParticipant, TLRPC.User user, final Utilities.Callback callback) {
        if ((channelParticipant instanceof TLRPC.TL_channelParticipantAdmin) || (chatParticipant instanceof TLRPC.TL_chatParticipantAdmin)) {
            showDialog(new AlertDialog.Builder(getParentActivity(), this.resourcesProvider).setTitle(LocaleController.getString("AppName", R.string.AppName)).setMessage(LocaleController.formatString("AdminWillBeRemoved", R.string.AdminWillBeRemoved, new Object[]{ContactsController.formatName(user.first_name, user.last_name)})).setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i) {
                    ProfileActivity.lambda$onMemberClick$39(callback, dialogInterface, i);
                }
            }).setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null).create());
        } else {
            callback.run(1);
        }
    }

    public static void lambda$onMemberClick$39(Utilities.Callback callback, DialogInterface dialogInterface, int i) {
        callback.run(1);
    }

    public void lambda$onMemberClick$41(TLRPC.User user, TLRPC.ChatParticipant chatParticipant) {
        if (this.deletedAccounts.size() > 0 && UserObject.isDeleted(user)) {
            this.deletedAccounts.remove(chatParticipant);
            this.deletedAccountsMap.remove(chatParticipant.user_id);
        }
        kickUser(this.selectedUser, chatParticipant);
    }

    public void lambda$onMemberClick$42(TLRPC.ChannelParticipant channelParticipant, TLRPC.ChatParticipant chatParticipant, TLRPC.User user) {
        String str;
        TLRPC.TL_chatAdminRights tL_chatAdminRights;
        TLRPC.TL_chatBannedRights tL_chatBannedRights;
        try {
            if ((channelParticipant instanceof TLRPC.TL_channelParticipantCreator) || (channelParticipant instanceof TLRPC.TL_channelParticipantAdmin) || (chatParticipant instanceof TLRPC.TL_chatParticipantCreator) || (chatParticipant instanceof TLRPC.TL_chatParticipantAdmin)) {
                if (channelParticipant != null) {
                    TLRPC.TL_chatAdminRights tL_chatAdminRights2 = channelParticipant.admin_rights;
                    TLRPC.TL_chatBannedRights tL_chatBannedRights2 = channelParticipant.banned_rights;
                    str = channelParticipant.rank;
                    tL_chatBannedRights = tL_chatBannedRights2;
                    tL_chatAdminRights = tL_chatAdminRights2;
                } else {
                    str = "";
                    tL_chatAdminRights = null;
                    tL_chatBannedRights = null;
                }
                long j = user.id;
                TLRPC.Chat chat = this.currentChat;
                presentFragment(new ChatRightsEditActivity(j, chat.id, tL_chatAdminRights, chat.default_banned_rights, tL_chatBannedRights, str, 0, false, false, null));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void lambda$onMemberClick$44() {
        final int size = this.deletedAccounts.size();
        AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
        builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
        builder.setMessage(LocaleController.formatString("DeleteFewChatsTitle", R.string.DeleteFewChatsTitle, new Object[]{LocaleController.formatPluralString("Members", size, new Object[0])}));
        builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                ProfileActivity.this.lambda$onMemberClick$43(size, dialogInterface, i);
            }
        });
        builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
        showDialog(builder.create());
    }

    public void lambda$onMemberClick$43(int i, DialogInterface dialogInterface, int i2) {
        if (this.chatInfo != null) {
            for (int i3 = 0; i3 < i; i3++) {
                TLRPC.ChatParticipant chatParticipant = this.deletedAccounts.get(i3);
                if (this.chatInfo.participants.participants.contains(chatParticipant)) {
                    getMessagesController().deleteParticipantFromChat(this.chatId, getMessagesController().getUser(Long.valueOf(chatParticipant.user_id)));
                    TLRPC.ChatFull chatFull = this.chatInfo;
                    chatFull.participants_count--;
                }
            }
            this.deletedAccounts.clear();
            this.deletedAccountsMap.clear();
            updateRowsIds();
            ListAdapter listAdapter = this.listAdapter;
            if (listAdapter != null) {
                listAdapter.notifyDataSetChanged();
            }
        }
    }

    public void lambda$onMemberClick$45() {
        showUserMsgs(this.selectedUser);
    }

    public void lambda$onMemberClick$46() {
        showUserMedia(this.selectedUser);
    }

    public final void openRightsEdit(final int action, final TLRPC.User user, final TLRPC.ChatParticipant participant, TLRPC.TL_chatAdminRights adminRights, TLRPC.TL_chatBannedRights bannedRights, String rank, final boolean editingAdmin) {
        final boolean[] zArr = new boolean[1];
        ChatRightsEditActivity chatRightsEditActivity = new ChatRightsEditActivity(user.id, this.chatId, adminRights, this.currentChat.default_banned_rights, bannedRights, rank, action, true, false, null) {
            public void onTransitionAnimationEnd(boolean isOpen, boolean backward) {
                if (!isOpen && backward && zArr[0] && BulletinFactory.canShowBulletin(ProfileActivity.this)) {
                    BulletinFactory.createPromoteToAdminBulletin(ProfileActivity.this, user.first_name).show();
                }
            }
        };
        chatRightsEditActivity.setDelegate(new ChatRightsEditActivity.ChatRightsEditActivityDelegate() {
            @Override
            public void didSetRights(int rights, TLRPC.TL_chatAdminRights rightsAdmin, TLRPC.TL_chatBannedRights rightsBanned, String rank2) {
                boolean z;
                TLRPC.TL_chatParticipantAdmin tL_chatParticipant;
                int i = action;
                int i2 = 0;
                if (i == 0) {
                    TLRPC.TL_chatChannelParticipant tL_chatChannelParticipant = participant;
                    if (tL_chatChannelParticipant instanceof TLRPC.TL_chatChannelParticipant) {
                        TLRPC.TL_chatChannelParticipant tL_chatChannelParticipant2 = tL_chatChannelParticipant;
                        if (rights == 1) {
                            TLRPC.TL_channelParticipantAdmin tL_channelParticipantAdmin = new TLRPC.TL_channelParticipantAdmin();
                            tL_chatChannelParticipant2.channelParticipant = tL_channelParticipantAdmin;
                            ((TLRPC.ChannelParticipant) tL_channelParticipantAdmin).flags |= 4;
                        } else {
                            tL_chatChannelParticipant2.channelParticipant = new TLRPC.TL_channelParticipant();
                        }
                        tL_chatChannelParticipant2.channelParticipant.inviter_id = ProfileActivity.this.getUserConfig().getClientUserId();
                        tL_chatChannelParticipant2.channelParticipant.peer = new TLRPC.TL_peerUser();
                        TLRPC.ChannelParticipant channelParticipant = tL_chatChannelParticipant2.channelParticipant;
                        TLRPC.Peer peer = channelParticipant.peer;
                        TLRPC.ChatParticipant chatParticipant = participant;
                        peer.user_id = chatParticipant.user_id;
                        channelParticipant.date = chatParticipant.date;
                        channelParticipant.banned_rights = rightsBanned;
                        channelParticipant.admin_rights = rightsAdmin;
                        channelParticipant.rank = rank2;
                    } else if (tL_chatChannelParticipant != null) {
                        if (rights == 1) {
                            tL_chatParticipant = new TLRPC.TL_chatParticipantAdmin();
                        } else {
                            tL_chatParticipant = new TLRPC.TL_chatParticipant();
                        }
                        TLRPC.ChatParticipant chatParticipant2 = participant;
                        ((TLRPC.ChatParticipant) tL_chatParticipant).user_id = chatParticipant2.user_id;
                        ((TLRPC.ChatParticipant) tL_chatParticipant).date = chatParticipant2.date;
                        ((TLRPC.ChatParticipant) tL_chatParticipant).inviter_id = chatParticipant2.inviter_id;
                        int indexOf = ProfileActivity.this.chatInfo.participants.participants.indexOf(participant);
                        if (indexOf >= 0) {
                            ProfileActivity.this.chatInfo.participants.participants.set(indexOf, tL_chatParticipant);
                        }
                    }
                    if (rights != 1 || editingAdmin) {
                        return;
                    }
                    zArr[0] = true;
                    return;
                }
                if (i == 1 && rights == 0 && ProfileActivity.this.currentChat.megagroup && ProfileActivity.this.chatInfo != null && ProfileActivity.this.chatInfo.participants != null) {
                    int i3 = 0;
                    while (true) {
                        if (i3 >= ProfileActivity.this.chatInfo.participants.participants.size()) {
                            z = false;
                            break;
                        } else {
                            if (MessageObject.getPeerId(((TLRPC.TL_chatChannelParticipant) ProfileActivity.this.chatInfo.participants.participants.get(i3)).channelParticipant.peer) == participant.user_id) {
                                ProfileActivity.this.chatInfo.participants_count--;
                                ProfileActivity.this.chatInfo.participants.participants.remove(i3);
                                z = true;
                                break;
                            }
                            i3++;
                        }
                    }
                    if (ProfileActivity.this.chatInfo != null && ProfileActivity.this.chatInfo.participants != null) {
                        while (true) {
                            if (i2 >= ProfileActivity.this.chatInfo.participants.participants.size()) {
                                break;
                            }
                            if (((TLRPC.ChatParticipant) ProfileActivity.this.chatInfo.participants.participants.get(i2)).user_id == participant.user_id) {
                                ProfileActivity.this.chatInfo.participants.participants.remove(i2);
                                z = true;
                                break;
                            }
                            i2++;
                        }
                    }
                    if (z) {
                        ProfileActivity.this.updateOnlineCount(true);
                        ProfileActivity.this.updateRowsIds();
                        ProfileActivity.this.listAdapter.notifyDataSetChanged();
                    }
                }
            }

            @Override
            public void didChangeOwner(TLRPC.User user2) {
                ProfileActivity.this.undoView.showWithAction(-ProfileActivity.this.chatId, ProfileActivity.this.currentChat.megagroup ? 10 : 9, user2);
            }
        });
        presentFragment(chatRightsEditActivity);
    }

    public final boolean processOnClickOrPress(final int position, final View view, final float x, final float y) {
        TLRPC.Chat chat;
        String publicUsername;
        final String sb;
        String str;
        int i;
        TLRPC.UserFull userFull;
        TLRPC.UserFull userFull2;
        final String str2;
        View view2 = view;
        if (position == this.usernameRow || position == this.setUsernameRow) {
            if (this.userId != 0) {
                TLRPC.User user = getMessagesController().getUser(Long.valueOf(this.userId));
                publicUsername = UserObject.getPublicUsername(user);
                if (user == null || publicUsername == null) {
                    return false;
                }
                DialogObject.findUsername(publicUsername, user);
            } else {
                if (this.chatId == 0 || (chat = getMessagesController().getChat(Long.valueOf(this.chatId))) == null || (this.topicId == 0 && !ChatObject.isPublic(chat))) {
                    return false;
                }
                publicUsername = ChatObject.getPublicUsername(chat);
                DialogObject.findUsername(publicUsername, chat);
            }
            try {
                if (this.userId != 0) {
                    sb = "@" + publicUsername;
                } else {
                    TLRPC.Chat chat2 = getMessagesController().getChat(Long.valueOf(this.chatId));
                    if (ChatObject.isPublic(chat2)) {
                        StringBuilder sb2 = new StringBuilder();
                        sb2.append("https://");
                        sb2.append(getMessagesController().linkPrefix);
                        sb2.append("/");
                        sb2.append(ChatObject.getPublicUsername(chat2));
                        sb2.append(this.topicId != 0 ? "/" + this.topicId : "");
                        sb = sb2.toString();
                    } else {
                        StringBuilder sb3 = new StringBuilder();
                        sb3.append("https://");
                        sb3.append(getMessagesController().linkPrefix);
                        sb3.append("/c/");
                        sb3.append(chat2.id);
                        sb3.append(this.topicId != 0 ? "/" + this.topicId : "");
                        sb = sb3.toString();
                    }
                }
                AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
                builder.setItems(new CharSequence[]{LocaleController.getString("BotShare", R.string.BotShare), LocaleController.getString("Copy", R.string.Copy), LocaleController.getString("DirectShare", R.string.DirectShare)}, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i2) {
                        if (i2 == 0) {
                            try {
                                Intent intent = new Intent("android.intent.action.SEND");
                                intent.setType("text/plain");
                                intent.putExtra("android.intent.extra.TEXT", sb);
                                ProfileActivity.this.getParentActivity().startActivityForResult(Intent.createChooser(intent, LocaleController.getString("BotShare", R.string.BotShare)), 500);
                                return;
                            } catch (Exception e) {
                                FileLog.e(e);
                                return;
                            }
                        }
                        if (i2 == 1) {
                            try {
                                ((ClipboardManager) ApplicationLoader.applicationContext.getSystemService("clipboard")).setPrimaryClip(ClipData.newPlainText("label", sb));
                                if (ProfileActivity.this.userId != 0) {
                                    BulletinFactory.of(ProfileActivity.this).createCopyBulletin(LocaleController.getString("UsernameCopied", R.string.UsernameCopied), ProfileActivity.this.resourcesProvider).show();
                                } else {
                                    BulletinFactory.of(ProfileActivity.this).createCopyLinkBulletin(LocaleController.getString("LinkCopied", R.string.LinkCopied), ProfileActivity.this.resourcesProvider).show();
                                }
                                return;
                            } catch (Exception e2) {
                                FileLog.e("tmessages", e2);
                                return;
                            }
                        }
                        ProfileActivity profileActivity = ProfileActivity.this;
                        Activity parentActivity = ProfileActivity.this.getParentActivity();
                        String str3 = sb;
                        profileActivity.showDialog(new AnonymousClass1(parentActivity, null, str3, false, str3, false));
                    }

                    public class AnonymousClass1 extends ShareAlert {
                        public AnonymousClass1(final Context context, ArrayList messages, final String text, boolean channel, final String copyLink, boolean fullScreen) {
                            super(context, messages, text, channel, copyLink, fullScreen);
                        }

                        public void onSend(final LongSparseArray<TLRPC.Dialog> dids, final int count, TLRPC.TL_forumTopic topic) {
                            AndroidUtilities.runOnUIThread(new Runnable() {
                                @Override
                                public final void run() {
                                    ProfileActivity.AnonymousClass42.AnonymousClass1.this.lambda$onSend$0(dids, count);
                                }
                            }, 250L);
                        }

                        public void lambda$onSend$0(LongSparseArray longSparseArray, int i) {
                            BulletinFactory.createInviteSentBulletin(ProfileActivity.this.getParentActivity(), ProfileActivity.this.contentView, longSparseArray.size(), longSparseArray.size() == 1 ? ((TLRPC.Dialog) longSparseArray.valueAt(0)).id : 0L, i, getThemedColor(Theme.key_undo_background), getThemedColor(Theme.key_undo_infoColor)).show();
                        }
                    }
                });
                showDialog(builder.create());
            } catch (Exception e) {
                FileLog.e(e);
            }
            return true;
        }
        if (position == this.phoneRow || position == this.numberRow) {
            if (editRow(view2, position)) {
                return true;
            }
            final TLRPC.User user2 = getMessagesController().getUser(Long.valueOf(this.userId));
            if (user2 == null || (str = user2.phone) == null || str.length() == 0 || getParentActivity() == null) {
                return false;
            }
            if (position == this.phoneRow && user2.phone.startsWith("888")) {
                TL_fragment.TL_inputCollectiblePhone tL_inputCollectiblePhone = new TL_fragment.TL_inputCollectiblePhone();
                final String str3 = user2.phone;
                tL_inputCollectiblePhone.phone = str3;
                TL_fragment.TL_getCollectibleInfo tL_getCollectibleInfo = new TL_fragment.TL_getCollectibleInfo();
                tL_getCollectibleInfo.collectible = tL_inputCollectiblePhone;
                getConnectionsManager().bindRequestToGuid(getConnectionsManager().sendRequest(tL_getCollectibleInfo, new RequestDelegate() {
                    public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                        ProfileActivity.this.lambda$processOnClickOrPress$48(str3, user2, tLObject, tL_error);
                    }
                }), getClassGuid());
                return true;
            }
            ArrayList arrayList = new ArrayList();
            ArrayList arrayList2 = new ArrayList();
            ArrayList arrayList3 = new ArrayList();
            if (position == this.phoneRow) {
                TLRPC.UserFull userFull3 = this.userInfo;
                if (userFull3 != null && userFull3.phone_calls_available) {
                    arrayList3.add(Integer.valueOf(R.drawable.msg_calls));
                    arrayList.add(LocaleController.getString("CallViaTelegram", R.string.CallViaTelegram));
                    arrayList2.add(2);
                    if (Build.VERSION.SDK_INT >= 18 && this.userInfo.video_calls_available) {
                        arrayList3.add(Integer.valueOf(R.drawable.msg_videocall));
                        arrayList.add(LocaleController.getString("VideoCallViaTelegram", R.string.VideoCallViaTelegram));
                        arrayList2.add(3);
                    }
                }
                if (!this.isFragmentPhoneNumber) {
                    arrayList3.add(Integer.valueOf(R.drawable.msg_calls_regular));
                    arrayList.add(LocaleController.getString("Call", R.string.Call));
                    arrayList2.add(0);
                }
            }
            arrayList3.add(Integer.valueOf(R.drawable.msg_copy));
            arrayList.add(LocaleController.getString("Copy", R.string.Copy));
            arrayList2.add(1);
            final AtomicReference atomicReference = new AtomicReference();
            ActionBarPopupWindow.ActionBarPopupWindowLayout actionBarPopupWindowLayout = new ActionBarPopupWindow.ActionBarPopupWindowLayout(this, getContext(), R.drawable.popup_fixed_alert, this.resourcesProvider) {
                public Path path = new Path();

                @Override
                public boolean drawChild(Canvas canvas, View child, long drawingTime) {
                    canvas.save();
                    this.path.rewind();
                    RectF rectF = AndroidUtilities.rectTmp;
                    rectF.set(child.getLeft(), child.getTop(), child.getRight(), child.getBottom());
                    this.path.addRoundRect(rectF, AndroidUtilities.dp(6.0f), AndroidUtilities.dp(6.0f), Path.Direction.CW);
                    canvas.clipPath(this.path);
                    boolean drawChild = super.drawChild(canvas, child, drawingTime);
                    canvas.restore();
                    return drawChild;
                }
            };
            actionBarPopupWindowLayout.setFitItems(true);
            for (int i2 = 0; i2 < arrayList3.size(); i2++) {
                final int intValue = ((Integer) arrayList2.get(i2)).intValue();
                ActionBarMenuItem.addItem(actionBarPopupWindowLayout, ((Integer) arrayList3.get(i2)).intValue(), (CharSequence) arrayList.get(i2), false, this.resourcesProvider).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view3) {
                        ProfileActivity.this.lambda$processOnClickOrPress$49(atomicReference, intValue, user2, view3);
                    }
                });
            }
            if (this.isFragmentPhoneNumber) {
                FrameLayout frameLayout = new FrameLayout(getContext());
                frameLayout.setBackgroundColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuSeparator, this.resourcesProvider));
                actionBarPopupWindowLayout.addView((View) frameLayout, LayoutHelper.createLinear(-1, 8));
                TextView textView = new TextView(getContext());
                textView.setPadding(AndroidUtilities.dp(13.0f), AndroidUtilities.dp(8.0f), AndroidUtilities.dp(13.0f), AndroidUtilities.dp(8.0f));
                textView.setTextSize(1, 13.0f);
                textView.setTextColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem, this.resourcesProvider));
                textView.setLinkTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteValueText, this.resourcesProvider));
                textView.setBackground(Theme.createRadSelectorDrawable(Theme.getColor(Theme.key_dialogButtonSelector, this.resourcesProvider), 0, 6));
                SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(AndroidUtilities.replaceTags(LocaleController.getString(R.string.AnonymousNumberNotice)));
                int indexOf = TextUtils.indexOf((CharSequence) spannableStringBuilder, '*');
                int lastIndexOf = TextUtils.lastIndexOf(spannableStringBuilder, '*');
                if (indexOf != -1 && lastIndexOf != -1 && indexOf != lastIndexOf) {
                    spannableStringBuilder.replace(lastIndexOf, lastIndexOf + 1, (CharSequence) "");
                    spannableStringBuilder.replace(indexOf, indexOf + 1, (CharSequence) "");
                    int i3 = lastIndexOf - 1;
                    spannableStringBuilder.setSpan(new TypefaceSpan(AndroidUtilities.bold()), indexOf, i3, 33);
                    spannableStringBuilder.setSpan(new ForegroundColorSpan(textView.getLinkTextColors().getDefaultColor()), indexOf, i3, 33);
                }
                textView.setText(spannableStringBuilder);
                textView.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view3) {
                        ProfileActivity.lambda$processOnClickOrPress$50(view3);
                    }
                });
                int i4 = R.id.fit_width_tag;
                frameLayout.setTag(i4, 1);
                textView.setTag(i4, 1);
                i = -2;
                actionBarPopupWindowLayout.addView((View) textView, LayoutHelper.createLinear(-2, -2));
            } else {
                i = -2;
            }
            ActionBarPopupWindow actionBarPopupWindow = new ActionBarPopupWindow(actionBarPopupWindowLayout, i, i);
            actionBarPopupWindow.setPauseNotifications(true);
            actionBarPopupWindow.setDismissAnimationDuration(220);
            actionBarPopupWindow.setOutsideTouchable(true);
            actionBarPopupWindow.setClippingEnabled(true);
            actionBarPopupWindow.setAnimationStyle(R.style.PopupContextAnimation);
            actionBarPopupWindow.setFocusable(true);
            actionBarPopupWindowLayout.measure(View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(1000.0f), Integer.MIN_VALUE), View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(1000.0f), Integer.MIN_VALUE));
            actionBarPopupWindow.setInputMethodMode(2);
            actionBarPopupWindow.getContentView().setFocusableInTouchMode(true);
            atomicReference.set(actionBarPopupWindow);
            float f = x;
            float f2 = y;
            for (View view3 = view; view3 != getFragmentView() && view3 != null; view3 = (View) view3.getParent()) {
                f += view3.getX();
                f2 += view3.getY();
            }
            if (AndroidUtilities.isTablet()) {
                ViewGroup view4 = ((BaseFragment) this).parentLayout.getView();
                f += view4.getX() + view4.getPaddingLeft();
                f2 += view4.getY() + view4.getPaddingTop();
            }
            actionBarPopupWindow.showAtLocation(getFragmentView(), 0, (int) (f - (actionBarPopupWindowLayout.getMeasuredWidth() / 2.0f)), (int) f2);
            actionBarPopupWindow.dimBehind();
            return true;
        }
        if (position == this.channelInfoRow || position == this.userInfoRow || position == this.locationRow || position == this.bioRow) {
            if (position == this.bioRow && ((userFull = this.userInfo) == null || TextUtils.isEmpty(userFull.about))) {
                return false;
            }
            if (editRow(view2, position)) {
                return true;
            }
            if ((view2 instanceof AboutLinkCell) && ((AboutLinkCell) view2).onClick()) {
                return false;
            }
            String str4 = null;
            if (position == this.locationRow) {
                TLRPC.ChatFull chatFull = this.chatInfo;
                if (chatFull != null) {
                    TLRPC.TL_channelLocation tL_channelLocation = chatFull.location;
                    if (tL_channelLocation instanceof TLRPC.TL_channelLocation) {
                        str4 = tL_channelLocation.address;
                    }
                }
            } else if (position == this.channelInfoRow) {
                TLRPC.ChatFull chatFull2 = this.chatInfo;
                if (chatFull2 != null) {
                    str4 = chatFull2.about;
                }
            } else {
                TLRPC.UserFull userFull4 = this.userInfo;
                if (userFull4 != null) {
                    str4 = userFull4.about;
                }
            }
            final String str5 = str4;
            if (TextUtils.isEmpty(str5)) {
                return false;
            }
            final String[] strArr = {"und"};
            final boolean isContextTranslateEnabled = MessagesController.getInstance(((BaseFragment) this).currentAccount).getTranslateController().isContextTranslateEnabled();
            final boolean[] zArr = new boolean[1];
            zArr[0] = position == this.bioRow || position == this.channelInfoRow || position == this.userInfoRow;
            final String language = LocaleController.getInstance().getCurrentLocale().getLanguage();
            final Runnable runnable = new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$processOnClickOrPress$53(zArr, str5, position, strArr, language, x, y, view);
                }
            };
            if (zArr[0]) {
                if (LanguageDetector.hasSupport()) {
                    LanguageDetector.detectLanguage(str5, new LanguageDetector.StringCallback() {
                        public final void run(String str6) {
                            ProfileActivity.this.lambda$processOnClickOrPress$54(strArr, zArr, language, isContextTranslateEnabled, runnable, str6);
                        }
                    }, new LanguageDetector.ExceptionCallback() {
                        public final void run(Exception exc) {
                            ProfileActivity.lambda$processOnClickOrPress$55(runnable, exc);
                        }
                    });
                } else {
                    runnable.run();
                }
            } else {
                runnable.run();
            }
            return true;
        }
        if ((position != this.bizHoursRow && position != this.bizLocationRow) || getParentActivity() == null || (userFull2 = this.userInfo) == null) {
            return false;
        }
        if (position == this.bizHoursRow) {
            TLRPC.TL_businessWorkHours tL_businessWorkHours = userFull2.business_work_hours;
            if (tL_businessWorkHours == null) {
                return false;
            }
            str2 = OpeningHoursActivity.toString(((BaseFragment) this).currentAccount, userFull2.user, tL_businessWorkHours);
        } else {
            if (position != this.bizLocationRow || editRow(view2, position)) {
                return true;
            }
            TLRPC.TL_businessLocation tL_businessLocation = this.userInfo.business_location;
            if (tL_businessLocation == null) {
                return false;
            }
            str2 = tL_businessLocation.address;
        }
        final AtomicReference atomicReference2 = new AtomicReference();
        ActionBarPopupWindow.ActionBarPopupWindowLayout actionBarPopupWindowLayout2 = new ActionBarPopupWindow.ActionBarPopupWindowLayout(this, getContext(), R.drawable.popup_fixed_alert, this.resourcesProvider) {
            public Path path = new Path();

            @Override
            public boolean drawChild(Canvas canvas, View child, long drawingTime) {
                canvas.save();
                this.path.rewind();
                RectF rectF = AndroidUtilities.rectTmp;
                rectF.set(child.getLeft(), child.getTop(), child.getRight(), child.getBottom());
                this.path.addRoundRect(rectF, AndroidUtilities.dp(6.0f), AndroidUtilities.dp(6.0f), Path.Direction.CW);
                canvas.clipPath(this.path);
                boolean drawChild = super.drawChild(canvas, child, drawingTime);
                canvas.restore();
                return drawChild;
            }
        };
        actionBarPopupWindowLayout2.setFitItems(true);
        ActionBarMenuItem.addItem(actionBarPopupWindowLayout2, R.drawable.msg_copy, LocaleController.getString(R.string.Copy), false, this.resourcesProvider).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view5) {
                ProfileActivity.this.lambda$processOnClickOrPress$56(atomicReference2, str2, position, view5);
            }
        });
        ActionBarPopupWindow actionBarPopupWindow2 = new ActionBarPopupWindow(actionBarPopupWindowLayout2, -2, -2);
        actionBarPopupWindow2.setPauseNotifications(true);
        actionBarPopupWindow2.setDismissAnimationDuration(220);
        actionBarPopupWindow2.setOutsideTouchable(true);
        actionBarPopupWindow2.setClippingEnabled(true);
        actionBarPopupWindow2.setAnimationStyle(R.style.PopupContextAnimation);
        actionBarPopupWindow2.setFocusable(true);
        actionBarPopupWindowLayout2.measure(View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(1000.0f), Integer.MIN_VALUE), View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(1000.0f), Integer.MIN_VALUE));
        actionBarPopupWindow2.setInputMethodMode(2);
        actionBarPopupWindow2.getContentView().setFocusableInTouchMode(true);
        atomicReference2.set(actionBarPopupWindow2);
        float f3 = x;
        float f4 = y;
        while (view2 != getFragmentView()) {
            f3 += view2.getX();
            f4 += view2.getY();
            view2 = (View) view2.getParent();
        }
        if (AndroidUtilities.isTablet()) {
            ViewGroup view5 = ((BaseFragment) this).parentLayout.getView();
            f3 += view5.getX() + view5.getPaddingLeft();
            f4 += view5.getY() + view5.getPaddingTop();
        }
        actionBarPopupWindow2.showAtLocation(getFragmentView(), 0, (int) (f3 - (actionBarPopupWindowLayout2.getMeasuredWidth() / 2.0f)), (int) f4);
        actionBarPopupWindow2.dimBehind();
        return true;
    }

    public void lambda$processOnClickOrPress$48(final String str, final TLRPC.User user, final TLObject tLObject, final TLRPC.TL_error tL_error) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$processOnClickOrPress$47(tLObject, str, user, tL_error);
            }
        });
    }

    public void lambda$processOnClickOrPress$47(TLObject tLObject, String str, TLRPC.User user, TLRPC.TL_error tL_error) {
        if (tLObject instanceof TL_fragment.TL_collectibleInfo) {
            FragmentUsernameBottomSheet.open(getContext(), 1, str, user, (TL_fragment.TL_collectibleInfo) tLObject, getResourceProvider());
        } else {
            BulletinFactory.showError(tL_error);
        }
    }

    public void lambda$processOnClickOrPress$49(AtomicReference atomicReference, int i, TLRPC.User user, View view) {
        ((ActionBarPopupWindow) atomicReference.get()).dismiss();
        if (i == 0) {
            try {
                Intent intent = new Intent("android.intent.action.DIAL", Uri.parse("tel:+" + user.phone));
                intent.addFlags(268435456);
                getParentActivity().startActivityForResult(intent, 500);
                return;
            } catch (Exception e) {
                FileLog.e(e);
                return;
            }
        }
        if (i == 1) {
            try {
                ((ClipboardManager) ApplicationLoader.applicationContext.getSystemService("clipboard")).setPrimaryClip(ClipData.newPlainText("label", "+" + user.phone));
                if (AndroidUtilities.shouldShowClipboardToast()) {
                    BulletinFactory.of(this).createCopyBulletin(LocaleController.getString("PhoneCopied", R.string.PhoneCopied)).show();
                    return;
                }
                return;
            } catch (Exception e2) {
                FileLog.e(e2);
                return;
            }
        }
        if ((i == 2 || i == 3) && getParentActivity() != null) {
            boolean z = i == 3;
            TLRPC.UserFull userFull = this.userInfo;
            VoIPHelper.startCall(user, z, userFull != null && userFull.video_calls_available, getParentActivity(), this.userInfo, getAccountInstance());
        }
    }

    public static void lambda$processOnClickOrPress$50(View view) {
        try {
            view.getContext().startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://fragment.com")));
        } catch (ActivityNotFoundException e) {
            FileLog.e(e);
        }
    }

    public void lambda$processOnClickOrPress$53(boolean[] zArr, final String str, final int i, final String[] strArr, final String str2, float f, float f2, View view) {
        if (getParentActivity() == null) {
            return;
        }
        boolean z = false;
        CharSequence[] charSequenceArr = zArr[0] ? new CharSequence[]{LocaleController.getString("Copy", R.string.Copy), LocaleController.getString("TranslateMessage", R.string.TranslateMessage)} : new CharSequence[]{LocaleController.getString("Copy", R.string.Copy)};
        int[] iArr = zArr[0] ? new int[]{R.drawable.msg_copy, R.drawable.msg_translate} : new int[]{R.drawable.msg_copy};
        final AtomicReference atomicReference = new AtomicReference();
        ActionBarPopupWindow.ActionBarPopupWindowLayout actionBarPopupWindowLayout = new ActionBarPopupWindow.ActionBarPopupWindowLayout(this, getContext(), R.drawable.popup_fixed_alert, this.resourcesProvider) {
            public Path path = new Path();

            @Override
            public boolean drawChild(Canvas canvas, View child, long drawingTime) {
                canvas.save();
                this.path.rewind();
                RectF rectF = AndroidUtilities.rectTmp;
                rectF.set(child.getLeft(), child.getTop(), child.getRight(), child.getBottom());
                this.path.addRoundRect(rectF, AndroidUtilities.dp(6.0f), AndroidUtilities.dp(6.0f), Path.Direction.CW);
                canvas.clipPath(this.path);
                boolean drawChild = super.drawChild(canvas, child, drawingTime);
                canvas.restore();
                return drawChild;
            }
        };
        actionBarPopupWindowLayout.setFitItems(true);
        int i2 = 0;
        while (i2 < iArr.length) {
            final int i3 = i2;
            ActionBarMenuItem.addItem(actionBarPopupWindowLayout, iArr[i2], charSequenceArr[i2], z, this.resourcesProvider).setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    ProfileActivity.this.lambda$processOnClickOrPress$52(atomicReference, i3, str, i, strArr, str2, view2);
                }
            });
            i2++;
            z = false;
        }
        ActionBarPopupWindow actionBarPopupWindow = new ActionBarPopupWindow(actionBarPopupWindowLayout, -2, -2);
        actionBarPopupWindow.setPauseNotifications(true);
        actionBarPopupWindow.setDismissAnimationDuration(220);
        actionBarPopupWindow.setOutsideTouchable(true);
        actionBarPopupWindow.setClippingEnabled(true);
        actionBarPopupWindow.setAnimationStyle(R.style.PopupContextAnimation);
        actionBarPopupWindow.setFocusable(true);
        actionBarPopupWindowLayout.measure(View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(1000.0f), Integer.MIN_VALUE), View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(1000.0f), Integer.MIN_VALUE));
        actionBarPopupWindow.setInputMethodMode(2);
        actionBarPopupWindow.getContentView().setFocusableInTouchMode(true);
        atomicReference.set(actionBarPopupWindow);
        float f3 = f;
        float f4 = f2;
        for (View view2 = view; view2 != getFragmentView(); view2 = (View) view2.getParent()) {
            f3 += view2.getX();
            f4 += view2.getY();
        }
        if (AndroidUtilities.isTablet()) {
            ViewGroup view3 = ((BaseFragment) this).parentLayout.getView();
            f3 += view3.getX() + view3.getPaddingLeft();
            f4 += view3.getY() + view3.getPaddingTop();
        }
        actionBarPopupWindow.showAtLocation(getFragmentView(), 0, (int) (f3 - (actionBarPopupWindowLayout.getMeasuredWidth() / 2.0f)), (int) f4);
        actionBarPopupWindow.dimBehind();
    }

    public void lambda$processOnClickOrPress$52(AtomicReference atomicReference, int i, String str, int i2, String[] strArr, String str2, View view) {
        ((ActionBarPopupWindow) atomicReference.get()).dismiss();
        try {
            if (i == 0) {
                AndroidUtilities.addToClipboard(str);
                if (i2 == this.bioRow) {
                    BulletinFactory.of(this).createCopyBulletin(LocaleController.getString("BioCopied", R.string.BioCopied)).show();
                } else {
                    BulletinFactory.of(this).createCopyBulletin(LocaleController.getString("TextCopied", R.string.TextCopied)).show();
                }
            } else if (i != 1) {
            } else {
                TranslateAlert2.showAlert(((BaseFragment) this).fragmentView.getContext(), this, ((BaseFragment) this).currentAccount, strArr[0], str2, str, (ArrayList) null, false, new Utilities.CallbackReturn() {
                    public final Object run(Object obj) {
                        Boolean lambda$processOnClickOrPress$51;
                        lambda$processOnClickOrPress$51 = ProfileActivity.this.lambda$processOnClickOrPress$51((URLSpan) obj);
                        return lambda$processOnClickOrPress$51;
                    }
                }, (Runnable) null);
            }
        } catch (Exception e) {
            FileLog.e(e);
        }
    }

    public Boolean lambda$processOnClickOrPress$51(URLSpan uRLSpan) {
        if (uRLSpan != null) {
            openUrl(uRLSpan.getURL(), null);
            return Boolean.TRUE;
        }
        return Boolean.FALSE;
    }

    public void lambda$processOnClickOrPress$54(String[] strArr, boolean[] zArr, String str, boolean z, Runnable runnable, String str2) {
        TLRPC.Chat chat;
        strArr[0] = str2;
        zArr[0] = str2 != null && (!str2.equals(str) || str2.equals("und")) && ((z && !RestrictedLanguagesSelectActivity.getRestrictedLanguages().contains(str2)) || ((chat = this.currentChat) != null && ((chat.has_link || ChatObject.isPublic(chat)) && ("uk".equals(str2) || "ru".equals(str2)))));
        runnable.run();
    }

    public static void lambda$processOnClickOrPress$55(Runnable runnable, Exception exc) {
        FileLog.e("mlkit: failed to detect language in selection", exc);
        runnable.run();
    }

    public void lambda$processOnClickOrPress$56(AtomicReference atomicReference, String str, int i, View view) {
        ((ActionBarPopupWindow) atomicReference.get()).dismiss();
        try {
            AndroidUtilities.addToClipboard(str);
            if (i == this.bizHoursRow) {
                BulletinFactory.of(this).createCopyBulletin(LocaleController.getString(R.string.BusinessHoursCopied)).show();
            } else {
                BulletinFactory.of(this).createCopyBulletin(LocaleController.getString(R.string.BusinessLocationCopied)).show();
            }
        } catch (Exception e) {
            FileLog.e(e);
        }
    }

    public final void leaveChatPressed() {
        boolean isForum = ChatObject.isForum(this.currentChat);
        AlertsCreator.createClearOrDeleteDialogAlert(this, false, this.currentChat, (TLRPC.User) null, false, isForum, !isForum, new MessagesStorage.BooleanCallback() {
            public final void run(boolean z) {
                ProfileActivity.this.lambda$leaveChatPressed$57(z);
            }
        }, this.resourcesProvider);
    }

    public void lambda$leaveChatPressed$57(boolean z) {
        this.playProfileAnimation = 0;
        NotificationCenter notificationCenter = getNotificationCenter();
        int i = NotificationCenter.closeChats;
        notificationCenter.removeObserver(this, i);
        getNotificationCenter().postNotificationName(i, new Object[0]);
        finishFragment();
        getNotificationCenter().postNotificationName(NotificationCenter.needDeleteDialog, new Object[]{Long.valueOf(-this.currentChat.id), null, this.currentChat, Boolean.valueOf(z)});
    }

    public final void getChannelParticipants(boolean reload) {
        LongSparseArray<TLRPC.ChatParticipant> longSparseArray;
        if (this.loadingUsers || (longSparseArray = this.participantsMap) == null || this.chatInfo == null) {
            return;
        }
        this.loadingUsers = true;
        this.countEnd = false;
        final int i = (longSparseArray.size() == 0 || !reload || this.filterType == 3) ? 0 : 300;
        final TLRPC.TL_channels_getParticipants tL_channels_getParticipants = new TLRPC.TL_channels_getParticipants();
        tL_channels_getParticipants.channel = getMessagesController().getInputChannel(this.chatId);
        tL_channels_getParticipants.filter = new TLRPC.TL_channelParticipantsRecent();
        int i2 = this.filterType;
        if (i2 != 0) {
            if (i2 == 1) {
                tL_channels_getParticipants.filter = new TLRPC.TL_channelParticipantsAdmins();
            } else if (i2 == 2) {
                tL_channels_getParticipants.filter = new TLRPC.TL_channelParticipantsBots();
            }
            int i3 = this.filterType;
            if (i3 != 3) {
                tL_channels_getParticipants.filter.q = "";
            }
            if (i3 == 3) {
                if (this.participantsMap.size() == this.chatInfo.participants_count) {
                    reload = false;
                }
                AlertDialog alertDialog = this.progressDialog;
                if (alertDialog == null) {
                    AlertDialog alertDialog2 = new AlertDialog(getParentActivity(), 1);
                    this.progressDialog = alertDialog2;
                    alertDialog2.setOnCancelListener(new DialogInterface.OnCancelListener() {
                        @Override
                        public final void onCancel(DialogInterface dialogInterface) {
                            ProfileActivity.this.lambda$getChannelParticipants$58(dialogInterface);
                        }
                    });
                    try {
                        AlertDialog alertDialog3 = this.progressDialog;
                        if (alertDialog3 != null) {
                            alertDialog3.show();
                        }
                    } catch (Exception e) {
                        FileLog.e(e);
                    }
                } else if (alertDialog != null) {
                    try {
                        this.progressDialog.setMessage(this.count + " / " + Math.min(10000, this.chatInfo.participants_count) + " (" + ((this.count * 100) / Math.min(10000, this.chatInfo.participants_count)) + "%)");
                    } catch (Exception e2) {
                        FileLog.e(e2);
                    }
                }
            }
        }
        tL_channels_getParticipants.offset = reload ? 0 : this.participantsMap.size();
        tL_channels_getParticipants.limit = 200;
        getConnectionsManager().bindRequestToGuid(getConnectionsManager().sendRequest(tL_channels_getParticipants, new RequestDelegate() {
            public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                ProfileActivity.this.lambda$getChannelParticipants$61(tL_channels_getParticipants, i, tLObject, tL_error);
            }
        }), ((BaseFragment) this).classGuid);
    }

    public void lambda$getChannelParticipants$58(DialogInterface dialogInterface) {
        this.progressDialog = null;
    }

    public void lambda$getChannelParticipants$60(final TLRPC.TL_error tL_error, final TLObject tLObject, final TLRPC.TL_channels_getParticipants tL_channels_getParticipants) {
        getNotificationCenter().doOnIdle(new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$getChannelParticipants$59(tL_error, tLObject, tL_channels_getParticipants);
            }
        });
    }

    public void lambda$getChannelParticipants$61(final TLRPC.TL_channels_getParticipants tL_channels_getParticipants, int i, final TLObject tLObject, final TLRPC.TL_error tL_error) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$getChannelParticipants$60(tL_error, tLObject, tL_channels_getParticipants);
            }
        }, i);
    }

    public void lambda$getChannelParticipants$59(TLRPC.TL_error tL_error, TLObject tLObject, TLRPC.TL_channels_getParticipants tL_channels_getParticipants) {
        AlertDialog alertDialog;
        if (tL_error == null) {
            TLRPC.TL_channels_channelParticipants tL_channels_channelParticipants = (TLRPC.TL_channels_channelParticipants) tLObject;
            getMessagesController().putUsers(((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).users, false);
            getMessagesController().putChats(((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).chats, false);
            if (((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).users.size() < 200) {
                this.usersEndReached = true;
            }
            if (tL_channels_getParticipants.offset == 0) {
                this.participantsMap.clear();
                this.chatInfo.participants = new TLRPC.TL_chatParticipants();
                getMessagesStorage().putUsersAndChats(((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).users, ((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).chats, true, true);
                getMessagesStorage().updateChannelUsers(this.chatId, ((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).participants);
            }
            for (int i = 0; i < ((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).participants.size(); i++) {
                TLRPC.ChatParticipant tL_chatChannelParticipant = new TLRPC.TL_chatChannelParticipant();
                TLRPC.ChannelParticipant channelParticipant = (TLRPC.ChannelParticipant) ((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).participants.get(i);
                ((TLRPC.TL_chatChannelParticipant) tL_chatChannelParticipant).channelParticipant = channelParticipant;
                tL_chatChannelParticipant.inviter_id = channelParticipant.inviter_id;
                long peerId = MessageObject.getPeerId(channelParticipant.peer);
                tL_chatChannelParticipant.user_id = peerId;
                tL_chatChannelParticipant.date = ((TLRPC.TL_chatChannelParticipant) tL_chatChannelParticipant).channelParticipant.date;
                if (this.participantsMap.indexOfKey(peerId) < 0) {
                    TLRPC.ChatFull chatFull = this.chatInfo;
                    if (chatFull.participants == null) {
                        chatFull.participants = new TLRPC.TL_chatParticipants();
                    }
                    this.chatInfo.participants.participants.add(tL_chatChannelParticipant);
                    this.participantsMap.put(tL_chatChannelParticipant.user_id, tL_chatChannelParticipant);
                    if (UserObject.isDeleted(getMessagesController().getUser(Long.valueOf(tL_chatChannelParticipant.user_id))) && this.deletedAccountsMap.indexOfKey(tL_chatChannelParticipant.user_id) < 0) {
                        this.deletedAccounts.add(tL_chatChannelParticipant);
                        this.deletedAccountsMap.put(tL_chatChannelParticipant.user_id, tL_chatChannelParticipant);
                    } else if (this.filterType == 3) {
                        this.chatInfo.participants.participants.remove(tL_chatChannelParticipant);
                    }
                }
            }
        } else {
            AlertsCreator.processError(((BaseFragment) this).currentAccount, tL_error, this, tL_channels_getParticipants, new Object[0]);
        }
        this.loadingUsers = false;
        saveScrollPosition();
        updateListAnimated(true);
        if (this.filterType == 3) {
            ArrayList<TLRPC.ChatParticipant> arrayList = this.chatInfo.participants.participants;
            ArrayList<TLRPC.ChatParticipant> arrayList2 = this.deletedAccounts;
            if (arrayList != arrayList2) {
                if (arrayList2.size() > 0) {
                    this.chatInfo.participants.participants = new ArrayList(this.deletedAccounts);
                } else {
                    this.chatInfo.participants.participants.clear();
                    if (this.count <= 0) {
                        updateRowsIds();
                        ListAdapter listAdapter = this.listAdapter;
                        if (listAdapter != null) {
                            listAdapter.notifyDataSetChanged();
                        }
                    }
                }
            }
            if (this.count < this.participantsMap.size()) {
                this.count = Math.min(this.participantsMap.size(), this.chatInfo.participants_count);
                if (this.usersEndReached && this.participantsMap.size() <= 200 && this.chatInfo.participants_count > 200) {
                    this.usersEndReached = false;
                }
                if (!this.usersEndReached && this.count < this.chatInfo.participants_count) {
                    getChannelParticipants(false);
                }
            }
            if (this.usersEndReached && (alertDialog = this.progressDialog) != null && alertDialog.isShowing()) {
                this.progressDialog.dismiss();
                this.progressDialog = null;
            }
        }
        updateRowsIds();
        ListAdapter listAdapter2 = this.listAdapter;
        if (listAdapter2 != null) {
            listAdapter2.notifyDataSetChanged();
        }
    }

    public final void setMediaHeaderVisible(boolean visible) {
        if (this.mediaHeaderVisible == visible) {
            return;
        }
        this.mediaHeaderVisible = visible;
        AnimatorSet animatorSet = this.headerAnimatorSet;
        if (animatorSet != null) {
            animatorSet.cancel();
        }
        AnimatorSet animatorSet2 = this.headerShadowAnimatorSet;
        if (animatorSet2 != null) {
            animatorSet2.cancel();
        }
        final ActionBarMenuItem searchItem = this.sharedMediaLayout.getSearchItem();
        RLottieImageView searchOptionsItem = this.sharedMediaLayout.getSearchOptionsItem();
        if (!this.mediaHeaderVisible) {
            if (this.callItemVisible) {
                this.callItem.setVisibility(0);
            }
            if (this.videoCallItemVisible) {
                this.videoCallItem.setVisibility(0);
            }
            if (this.editItemVisible) {
                this.editItem.setVisibility(0);
            }
            this.otherItem.setVisibility(0);
            if (searchOptionsItem != null) {
                searchOptionsItem.setVisibility(8);
            }
        } else {
            if (this.sharedMediaLayout.isSearchItemVisible()) {
                searchItem.setVisibility(0);
            }
            if (searchOptionsItem != null) {
                searchOptionsItem.setVisibility(0);
            }
            if (this.sharedMediaLayout.isCalendarItemVisible()) {
                this.sharedMediaLayout.photoVideoOptionsItem.setVisibility(0);
                this.sharedMediaLayout.animateSearchToOptions(true, false);
            } else {
                this.sharedMediaLayout.photoVideoOptionsItem.setVisibility(4);
                this.sharedMediaLayout.animateSearchToOptions(false, false);
            }
        }
        updateStoriesViewBounds(false);
        ActionBar actionBar = ((BaseFragment) this).actionBar;
        if (actionBar != null) {
            actionBar.createMenu().requestLayout();
        }
        ArrayList arrayList = new ArrayList();
        ActionBarMenuItem actionBarMenuItem = this.callItem;
        Property property = View.ALPHA;
        float[] fArr = new float[1];
        fArr[0] = visible ? 0.0f : 1.0f;
        arrayList.add(ObjectAnimator.ofFloat(actionBarMenuItem, (Property<ActionBarMenuItem, Float>) property, fArr));
        ActionBarMenuItem actionBarMenuItem2 = this.videoCallItem;
        Property property2 = View.ALPHA;
        float[] fArr2 = new float[1];
        fArr2[0] = visible ? 0.0f : 1.0f;
        arrayList.add(ObjectAnimator.ofFloat(actionBarMenuItem2, (Property<ActionBarMenuItem, Float>) property2, fArr2));
        ActionBarMenuItem actionBarMenuItem3 = this.otherItem;
        Property property3 = View.ALPHA;
        float[] fArr3 = new float[1];
        fArr3[0] = visible ? 0.0f : 1.0f;
        arrayList.add(ObjectAnimator.ofFloat(actionBarMenuItem3, (Property<ActionBarMenuItem, Float>) property3, fArr3));
        ActionBarMenuItem actionBarMenuItem4 = this.editItem;
        Property property4 = View.ALPHA;
        float[] fArr4 = new float[1];
        fArr4[0] = visible ? 0.0f : 1.0f;
        arrayList.add(ObjectAnimator.ofFloat(actionBarMenuItem4, (Property<ActionBarMenuItem, Float>) property4, fArr4));
        ActionBarMenuItem actionBarMenuItem5 = this.callItem;
        Property property5 = View.TRANSLATION_Y;
        float[] fArr5 = new float[1];
        fArr5[0] = visible ? -AndroidUtilities.dp(10.0f) : 0.0f;
        arrayList.add(ObjectAnimator.ofFloat(actionBarMenuItem5, (Property<ActionBarMenuItem, Float>) property5, fArr5));
        ActionBarMenuItem actionBarMenuItem6 = this.videoCallItem;
        Property property6 = View.TRANSLATION_Y;
        float[] fArr6 = new float[1];
        fArr6[0] = visible ? -AndroidUtilities.dp(10.0f) : 0.0f;
        arrayList.add(ObjectAnimator.ofFloat(actionBarMenuItem6, (Property<ActionBarMenuItem, Float>) property6, fArr6));
        ActionBarMenuItem actionBarMenuItem7 = this.otherItem;
        Property property7 = View.TRANSLATION_Y;
        float[] fArr7 = new float[1];
        fArr7[0] = visible ? -AndroidUtilities.dp(10.0f) : 0.0f;
        arrayList.add(ObjectAnimator.ofFloat(actionBarMenuItem7, (Property<ActionBarMenuItem, Float>) property7, fArr7));
        ActionBarMenuItem actionBarMenuItem8 = this.editItem;
        Property property8 = View.TRANSLATION_Y;
        float[] fArr8 = new float[1];
        fArr8[0] = visible ? -AndroidUtilities.dp(10.0f) : 0.0f;
        arrayList.add(ObjectAnimator.ofFloat(actionBarMenuItem8, (Property<ActionBarMenuItem, Float>) property8, fArr8));
        Property property9 = View.ALPHA;
        float[] fArr9 = new float[1];
        fArr9[0] = visible ? 1.0f : 0.0f;
        arrayList.add(ObjectAnimator.ofFloat(searchItem, (Property<ActionBarMenuItem, Float>) property9, fArr9));
        Property property10 = View.TRANSLATION_Y;
        float[] fArr10 = new float[1];
        fArr10[0] = visible ? 0.0f : AndroidUtilities.dp(10.0f);
        arrayList.add(ObjectAnimator.ofFloat(searchItem, (Property<ActionBarMenuItem, Float>) property10, fArr10));
        ImageView imageView = this.sharedMediaLayout.photoVideoOptionsItem;
        Property property11 = View.ALPHA;
        float[] fArr11 = new float[1];
        fArr11[0] = visible ? 1.0f : 0.0f;
        arrayList.add(ObjectAnimator.ofFloat(imageView, (Property<ImageView, Float>) property11, fArr11));
        ImageView imageView2 = this.sharedMediaLayout.photoVideoOptionsItem;
        Property property12 = View.TRANSLATION_Y;
        float[] fArr12 = new float[1];
        fArr12[0] = visible ? 0.0f : AndroidUtilities.dp(10.0f);
        arrayList.add(ObjectAnimator.ofFloat(imageView2, (Property<ImageView, Float>) property12, fArr12));
        ActionBar actionBar2 = ((BaseFragment) this).actionBar;
        Property<ActionBar, Float> property13 = this.ACTIONBAR_HEADER_PROGRESS;
        float[] fArr13 = new float[1];
        fArr13[0] = visible ? 1.0f : 0.0f;
        arrayList.add(ObjectAnimator.ofFloat(actionBar2, property13, fArr13));
        SimpleTextView simpleTextView = this.onlineTextView[1];
        Property property14 = View.ALPHA;
        float[] fArr14 = new float[1];
        fArr14[0] = visible ? 0.0f : 1.0f;
        arrayList.add(ObjectAnimator.ofFloat(simpleTextView, (Property<SimpleTextView, Float>) property14, fArr14));
        AudioPlayerAlert.ClippingTextViewSwitcher clippingTextViewSwitcher = this.mediaCounterTextView;
        Property property15 = View.ALPHA;
        float[] fArr15 = new float[1];
        fArr15[0] = visible ? 1.0f : 0.0f;
        arrayList.add(ObjectAnimator.ofFloat(clippingTextViewSwitcher, (Property<AudioPlayerAlert.ClippingTextViewSwitcher, Float>) property15, fArr15));
        if (visible) {
            arrayList.add(ObjectAnimator.ofFloat(this, this.HEADER_SHADOW, 0.0f));
        }
        if (this.storyView != null) {
            ValueAnimator ofFloat = ValueAnimator.ofFloat(0.0f, 1.0f);
            ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                @Override
                public final void onAnimationUpdate(ValueAnimator valueAnimator) {
                    ProfileActivity.this.lambda$setMediaHeaderVisible$62(valueAnimator);
                }
            });
            arrayList.add(ofFloat);
        }
        AnimatorSet animatorSet3 = new AnimatorSet();
        this.headerAnimatorSet = animatorSet3;
        animatorSet3.playTogether(arrayList);
        this.headerAnimatorSet.setInterpolator(CubicBezierInterpolator.DEFAULT);
        this.headerAnimatorSet.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                if (ProfileActivity.this.headerAnimatorSet != null) {
                    if (ProfileActivity.this.mediaHeaderVisible) {
                        if (ProfileActivity.this.callItemVisible) {
                            ProfileActivity.this.callItem.setVisibility(8);
                        }
                        if (ProfileActivity.this.videoCallItemVisible) {
                            ProfileActivity.this.videoCallItem.setVisibility(8);
                        }
                        if (ProfileActivity.this.editItemVisible) {
                            ProfileActivity.this.editItem.setVisibility(8);
                            ProfileActivity.this.adminsItem.setVisibility(8);
                            if (ProfileActivity.this.showRecentActions) {
                                ProfileActivity.this.recentActionsItem.setVisibility(8);
                            }
                            ProfileActivity.this.permissionsItem.setVisibility(8);
                            ProfileActivity.this.removedUsersItem.setVisibility(8);
                        }
                        ProfileActivity.this.otherItem.setVisibility(8);
                    } else {
                        if (ProfileActivity.this.sharedMediaLayout.isSearchItemVisible()) {
                            searchItem.setVisibility(0);
                        }
                        ProfileActivity.this.sharedMediaLayout.photoVideoOptionsItem.setVisibility(4);
                        ProfileActivity.this.headerShadowAnimatorSet = new AnimatorSet();
                        AnimatorSet animatorSet4 = ProfileActivity.this.headerShadowAnimatorSet;
                        ProfileActivity profileActivity = ProfileActivity.this;
                        animatorSet4.playTogether(ObjectAnimator.ofFloat(profileActivity, (Property<ProfileActivity, Float>) profileActivity.HEADER_SHADOW, 1.0f));
                        ProfileActivity.this.headerShadowAnimatorSet.setDuration(100L);
                        ProfileActivity.this.headerShadowAnimatorSet.addListener(new AnimatorListenerAdapter() {
                            @Override
                            public void onAnimationEnd(Animator animation2) {
                                ProfileActivity.this.headerShadowAnimatorSet = null;
                            }
                        });
                        ProfileActivity.this.headerShadowAnimatorSet.start();
                    }
                }
                ProfileActivity.this.updateStoriesViewBounds(false);
                ProfileActivity.this.headerAnimatorSet = null;
            }

            @Override
            public void onAnimationCancel(Animator animation) {
                ProfileActivity.this.headerAnimatorSet = null;
            }
        });
        this.headerAnimatorSet.setDuration(150L);
        this.headerAnimatorSet.start();
        NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needCheckSystemBarColors, new Object[]{Boolean.TRUE});
    }

    public void lambda$setMediaHeaderVisible$62(ValueAnimator valueAnimator) {
        updateStoriesViewBounds(true);
    }

    public final void openAddMember() {
        Bundle bundle = new Bundle();
        bundle.putBoolean("addToGroup", true);
        bundle.putLong("chatId", this.currentChat.id);
        GroupCreateActivity groupCreateActivity = new GroupCreateActivity(bundle);
        groupCreateActivity.setInfo(this.chatInfo);
        TLRPC.ChatFull chatFull = this.chatInfo;
        if (chatFull != null && chatFull.participants != null) {
            LongSparseArray<TLObject> longSparseArray = new LongSparseArray<>();
            for (int i = 0; i < this.chatInfo.participants.participants.size(); i++) {
                longSparseArray.put(((TLRPC.ChatParticipant) this.chatInfo.participants.participants.get(i)).user_id, (Object) null);
            }
            groupCreateActivity.setIgnoreUsers(longSparseArray);
        }
        groupCreateActivity.setDelegate2(new GroupCreateActivity.ContactsAddActivityDelegate() {
            @Override
            public final void didSelectUsers(ArrayList arrayList, int i2) {
                ProfileActivity.this.lambda$openAddMember$66(arrayList, i2);
            }

            @Override
            public void needAddBot(TLRPC.User user) {
                GroupCreateActivity.ContactsAddActivityDelegate.CC.$default$needAddBot(this, user);
            }
        });
        presentFragment(groupCreateActivity);
    }

    public void lambda$openAddMember$66(ArrayList arrayList, int i) {
        TLRPC.ChatParticipants chatParticipants;
        final HashSet hashSet = new HashSet();
        final ArrayList arrayList2 = new ArrayList();
        TLRPC.ChatFull chatFull = this.chatInfo;
        if (chatFull != null && (chatParticipants = chatFull.participants) != null && chatParticipants.participants != null) {
            for (int i2 = 0; i2 < this.chatInfo.participants.participants.size(); i2++) {
                hashSet.add(Long.valueOf(((TLRPC.ChatParticipant) this.chatInfo.participants.participants.get(i2)).user_id));
            }
        }
        getMessagesController().addUsersToChat(this.currentChat, this, arrayList, i, new androidx.core.util.Consumer() {
            public final void accept(Object obj) {
                arrayList2.add((TLRPC.User) obj);
            }
        }, new androidx.core.util.Consumer() {
            public final void accept(Object obj) {
                ProfileActivity.this.lambda$openAddMember$64((TLRPC.User) obj);
            }
        }, new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$openAddMember$65(arrayList2, hashSet);
            }
        });
    }

    public void lambda$openAddMember$64(TLRPC.User user) {
        for (int i = 0; i < this.chatInfo.participants.participants.size(); i++) {
            if (((TLRPC.ChatParticipant) this.chatInfo.participants.participants.get(i)).user_id == user.id) {
                this.chatInfo.participants.participants.remove(i);
                updateListAnimated(true);
                return;
            }
        }
    }

    public void lambda$openAddMember$65(ArrayList arrayList, HashSet hashSet) {
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            TLRPC.User user = (TLRPC.User) arrayList.get(i);
            if (!hashSet.contains(Long.valueOf(user.id))) {
                TLRPC.ChatFull chatFull = this.chatInfo;
                if (chatFull.participants == null) {
                    chatFull.participants = new TLRPC.TL_chatParticipants();
                }
                if (ChatObject.isChannel(this.currentChat)) {
                    TLRPC.TL_chatChannelParticipant tL_chatChannelParticipant = new TLRPC.TL_chatChannelParticipant();
                    TLRPC.TL_channelParticipant tL_channelParticipant = new TLRPC.TL_channelParticipant();
                    tL_chatChannelParticipant.channelParticipant = tL_channelParticipant;
                    ((TLRPC.ChannelParticipant) tL_channelParticipant).inviter_id = getUserConfig().getClientUserId();
                    tL_chatChannelParticipant.channelParticipant.peer = new TLRPC.TL_peerUser();
                    TLRPC.ChannelParticipant channelParticipant = tL_chatChannelParticipant.channelParticipant;
                    channelParticipant.peer.user_id = user.id;
                    channelParticipant.date = getConnectionsManager().getCurrentTime();
                    ((TLRPC.ChatParticipant) tL_chatChannelParticipant).user_id = user.id;
                    this.chatInfo.participants.participants.add(tL_chatChannelParticipant);
                } else {
                    TLRPC.TL_chatParticipant tL_chatParticipant = new TLRPC.TL_chatParticipant();
                    ((TLRPC.ChatParticipant) tL_chatParticipant).user_id = user.id;
                    ((TLRPC.ChatParticipant) tL_chatParticipant).inviter_id = getAccountInstance().getUserConfig().clientUserId;
                    this.chatInfo.participants.participants.add(tL_chatParticipant);
                }
                this.chatInfo.participants_count++;
                getMessagesController().putUser(user, false);
            }
        }
        updateListAnimated(true);
    }

    public final void checkListViewScroll() {
        View view;
        if (this.listView.getVisibility() != 0) {
            return;
        }
        if (this.sharedMediaLayoutAttached) {
            this.sharedMediaLayout.setVisibleHeight(this.listView.getMeasuredHeight() - this.sharedMediaLayout.getTop());
        }
        if (this.listView.getChildCount() <= 0 || this.openAnimationInProgress) {
            return;
        }
        int i = 0;
        while (true) {
            if (i >= this.listView.getChildCount()) {
                view = null;
                break;
            }
            RecyclerListView recyclerListView = this.listView;
            if (recyclerListView.getChildAdapterPosition(recyclerListView.getChildAt(i)) == 0) {
                view = this.listView.getChildAt(i);
                break;
            }
            i++;
        }
        RecyclerListView.Holder findContainingViewHolder = view != null ? this.listView.findContainingViewHolder(view) : null;
        int top = view == null ? 0 : view.getTop();
        int adapterPosition = findContainingViewHolder != null ? findContainingViewHolder.getAdapterPosition() : -1;
        if (top < 0 || adapterPosition != 0) {
            top = 0;
        }
        boolean z = this.imageUpdater == null && ((BaseFragment) this).actionBar.isSearchFieldVisible();
        int i2 = this.sharedMediaRow;
        if (i2 != -1 && !z) {
            RecyclerListView.Holder findViewHolderForAdapterPosition = this.listView.findViewHolderForAdapterPosition(i2);
            z = findViewHolderForAdapterPosition != null && ((RecyclerView.ViewHolder) findViewHolderForAdapterPosition).itemView.getTop() <= 0;
        }
        setMediaHeaderVisible(z);
        float f = top;
        if (this.extraHeight == f || this.transitionAnimationInProress) {
            return;
        }
        this.extraHeight = f;
        this.topView.invalidate();
        if (this.playProfileAnimation != 0) {
            this.allowProfileAnimation = this.extraHeight != 0.0f;
        }
        needLayout(true);
    }

    public void updateSelectedMediaTabText() {
        SharedMediaLayout sharedMediaLayout = this.sharedMediaLayout;
        if (sharedMediaLayout == null || this.mediaCounterTextView == null) {
            return;
        }
        int closestTab = sharedMediaLayout.getClosestTab();
        int[] lastMediaCount = this.sharedMediaPreloader.getLastMediaCount();
        if (closestTab == 0) {
            if (lastMediaCount[7] <= 0 && lastMediaCount[6] <= 0) {
                if (lastMediaCount[0] <= 0) {
                    this.mediaCounterTextView.setText(LocaleController.getString(R.string.SharedMedia));
                    return;
                } else {
                    this.mediaCounterTextView.setText(LocaleController.formatPluralString("Media", lastMediaCount[0], new Object[0]));
                    return;
                }
            }
            if (this.sharedMediaLayout.getPhotosVideosTypeFilter() == 1 || lastMediaCount[7] <= 0) {
                this.mediaCounterTextView.setText(LocaleController.formatPluralString("Photos", lastMediaCount[6], new Object[0]));
                return;
            } else if (this.sharedMediaLayout.getPhotosVideosTypeFilter() == 2 || lastMediaCount[6] <= 0) {
                this.mediaCounterTextView.setText(LocaleController.formatPluralString("Videos", lastMediaCount[7], new Object[0]));
                return;
            } else {
                this.mediaCounterTextView.setText(String.format("%s, %s", LocaleController.formatPluralString("Photos", lastMediaCount[6], new Object[0]), LocaleController.formatPluralString("Videos", lastMediaCount[7], new Object[0])));
                return;
            }
        }
        if (closestTab == 1) {
            if (lastMediaCount[1] <= 0) {
                this.mediaCounterTextView.setText(LocaleController.getString(R.string.Files));
                return;
            } else {
                this.mediaCounterTextView.setText(LocaleController.formatPluralString("Files", lastMediaCount[1], new Object[0]));
                return;
            }
        }
        if (closestTab == 2) {
            if (lastMediaCount[2] <= 0) {
                this.mediaCounterTextView.setText(LocaleController.getString(R.string.Voice));
                return;
            } else {
                this.mediaCounterTextView.setText(LocaleController.formatPluralString("Voice", lastMediaCount[2], new Object[0]));
                return;
            }
        }
        if (closestTab == 3) {
            if (lastMediaCount[3] <= 0) {
                this.mediaCounterTextView.setText(LocaleController.getString(R.string.SharedLinks));
                return;
            } else {
                this.mediaCounterTextView.setText(LocaleController.formatPluralString("Links", lastMediaCount[3], new Object[0]));
                return;
            }
        }
        if (closestTab == 4) {
            if (lastMediaCount[4] <= 0) {
                this.mediaCounterTextView.setText(LocaleController.getString(R.string.Music));
                return;
            } else {
                this.mediaCounterTextView.setText(LocaleController.formatPluralString("MusicFiles", lastMediaCount[4], new Object[0]));
                return;
            }
        }
        if (closestTab == 5) {
            if (lastMediaCount[5] <= 0) {
                this.mediaCounterTextView.setText(LocaleController.getString(R.string.AccDescrGIFs));
                return;
            } else {
                this.mediaCounterTextView.setText(LocaleController.formatPluralString("GIFs", lastMediaCount[5], new Object[0]));
                return;
            }
        }
        if (closestTab == 6) {
            this.mediaCounterTextView.setText(LocaleController.formatPluralString("CommonGroups", this.userInfo.common_chats_count, new Object[0]));
            return;
        }
        if (closestTab == 7) {
            this.mediaCounterTextView.setText(this.onlineTextView[1].getText());
            return;
        }
        if (closestTab == 8) {
            this.mediaCounterTextView.setText(LocaleController.formatPluralString("ProfileStoriesCount", this.sharedMediaLayout.getStoriesCount(closestTab), new Object[0]));
            return;
        }
        if (closestTab == 9) {
            this.mediaCounterTextView.setText(LocaleController.formatPluralString("ProfileStoriesArchiveCount", this.sharedMediaLayout.getStoriesCount(closestTab), new Object[0]));
            return;
        }
        if (closestTab == 10) {
            MessagesController.ChannelRecommendations channelRecommendations = MessagesController.getInstance(((BaseFragment) this).currentAccount).getChannelRecommendations(this.chatId);
            this.mediaCounterTextView.setText(LocaleController.formatPluralString("Channels", channelRecommendations == null ? 0 : channelRecommendations.chats.size() + channelRecommendations.more, new Object[0]));
        } else if (closestTab == 12) {
            this.mediaCounterTextView.setText(LocaleController.formatPluralString("SavedMessagesCount", Math.max(1, getMessagesController().getSavedMessagesController().getMessagesCount(getDialogId())), new Object[0]));
        }
    }

    public final void needLayout(boolean r23) {
        throw new UnsupportedOperationException("Method not decompiled: org.telegram.ui.ProfileActivity.needLayout(boolean):void");
    }

    public void updateQrItemVisibility(boolean animated) {
        if (this.qrItem == null) {
            return;
        }
        boolean z = isQrNeedVisible() && Math.min(1.0f, this.extraHeight / ((float) AndroidUtilities.dp(88.0f))) > 0.5f && this.searchTransitionProgress > 0.5f;
        if (animated) {
            if (z != this.isQrItemVisible) {
                this.isQrItemVisible = z;
                AnimatorSet animatorSet = this.qrItemAnimation;
                if (animatorSet != null) {
                    animatorSet.cancel();
                    this.qrItemAnimation = null;
                }
                this.qrItem.setClickable(this.isQrItemVisible);
                this.qrItemAnimation = new AnimatorSet();
                if (this.qrItem.getVisibility() != 8 || z) {
                    this.qrItem.setVisibility(0);
                }
                if (z) {
                    this.qrItemAnimation.setInterpolator(new DecelerateInterpolator());
                    this.qrItemAnimation.playTogether(ObjectAnimator.ofFloat(this.qrItem, (Property<ActionBarMenuItem, Float>) View.ALPHA, 1.0f), ObjectAnimator.ofFloat(this.qrItem, (Property<ActionBarMenuItem, Float>) View.SCALE_Y, 1.0f), ObjectAnimator.ofFloat(this.avatarsViewPagerIndicatorView, (Property<PagerIndicatorView, Float>) View.TRANSLATION_X, -AndroidUtilities.dp(48.0f)));
                } else {
                    this.qrItemAnimation.setInterpolator(new AccelerateInterpolator());
                    this.qrItemAnimation.playTogether(ObjectAnimator.ofFloat(this.qrItem, (Property<ActionBarMenuItem, Float>) View.ALPHA, 0.0f), ObjectAnimator.ofFloat(this.qrItem, (Property<ActionBarMenuItem, Float>) View.SCALE_Y, 0.0f), ObjectAnimator.ofFloat(this.avatarsViewPagerIndicatorView, (Property<PagerIndicatorView, Float>) View.TRANSLATION_X, 0.0f));
                }
                this.qrItemAnimation.setDuration(150L);
                this.qrItemAnimation.addListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        ProfileActivity.this.qrItemAnimation = null;
                    }
                });
                this.qrItemAnimation.start();
                return;
            }
            return;
        }
        AnimatorSet animatorSet2 = this.qrItemAnimation;
        if (animatorSet2 != null) {
            animatorSet2.cancel();
            this.qrItemAnimation = null;
        }
        this.isQrItemVisible = z;
        this.qrItem.setClickable(z);
        this.qrItem.setAlpha(z ? 1.0f : 0.0f);
        this.qrItem.setVisibility(z ? 0 : 8);
    }

    public final void setForegroundImage(boolean secondParent) {
        Drawable drawable = this.avatarImage.getImageReceiver().getDrawable();
        String str = null;
        if (drawable instanceof VectorAvatarThumbDrawable) {
            this.avatarImage.setForegroundImage(null, null, drawable);
            return;
        }
        if (drawable instanceof AnimatedFileDrawable) {
            Drawable drawable2 = (AnimatedFileDrawable) drawable;
            this.avatarImage.setForegroundImage(null, null, drawable2);
            if (secondParent) {
                drawable2.addSecondParentView(this.avatarImage);
                return;
            }
            return;
        }
        ImageLocation imageLocation = this.avatarsViewPager.getImageLocation(0);
        if (imageLocation != null && imageLocation.imageType == 2) {
            str = "avatar";
        }
        this.avatarImage.setForegroundImage(imageLocation, str, drawable);
    }

    public final void refreshNameAndOnlineXY() {
        this.nameX = AndroidUtilities.dp(-21.0f) + (this.avatarContainer.getMeasuredWidth() * (this.avatarScale - 1.4285715f));
        this.nameY = ((float) Math.floor(this.avatarY)) + AndroidUtilities.dp(1.3f) + AndroidUtilities.dp(7.0f) + ((this.avatarContainer.getMeasuredHeight() * (this.avatarScale - 1.4285715f)) / 2.0f);
        this.onlineX = AndroidUtilities.dp(-21.0f) + (this.avatarContainer.getMeasuredWidth() * (this.avatarScale - 1.4285715f));
        this.onlineY = ((float) Math.floor(this.avatarY)) + AndroidUtilities.dp(24.0f) + ((float) Math.floor(AndroidUtilities.density * 11.0f)) + ((this.avatarContainer.getMeasuredHeight() * (this.avatarScale - 1.4285715f)) / 2.0f);
        this.adminTextView.setTranslationX(this.nameX);
        this.adminTextView.setTranslationY(((float) Math.floor(this.avatarY)) + AndroidUtilities.dp(32.0f) + ((float) Math.floor(AndroidUtilities.density * 22.0f)) + ((this.avatarImage.getMeasuredHeight() * (this.avatarScale - 1.4285715f)) / 2.0f));
    }

    public RecyclerListView getListView() {
        return this.listView;
    }

    public final void needLayoutText(float diff) {
        float scaleX = this.nameTextView[1].getScaleX();
        float f = this.extraHeight > ((float) AndroidUtilities.dp(88.0f)) ? 1.67f : 1.12f;
        if (this.extraHeight <= AndroidUtilities.dp(88.0f) || scaleX == f) {
            if (this.editItem != null) {
                int realCount = this.avatarsViewPager.getRealCount();
                if (this.avatarScale > 1.25f && !this.myProfile) {
                    if (this.editItemVisible) {
                        this.removedUsersItem.setVisibility(0);
                        if (this.showRecentActions) {
                            this.recentActionsItem.setVisibility(0);
                        }
                    }
                    ActionBarMenuItem actionBarMenuItem = this.adminsItem;
                    if (actionBarMenuItem != null) {
                        actionBarMenuItem.setVisibility(((this.canSearchMembers || this.showMoreButtons || this.editItemVisible) && (realCount <= 20 || !this.isPulledDown)) ? 0 : 8);
                        this.permissionsItem.setVisibility(((this.canSearchMembers || this.showMoreButtons || this.editItemVisible) && (realCount <= 20 || !this.isPulledDown) && (!ChatObject.isChannel(this.chatId, ((BaseFragment) this).currentAccount) || this.currentChat.megagroup)) ? 0 : 8);
                        ActionBarMenuItem actionBarMenuItem2 = this.membersItem;
                        if (!this.editItemVisible && ((this.canSearchMembers || this.showMoreButtons) && (realCount <= 20 || !this.isPulledDown))) {
                            r7 = 0;
                        }
                        actionBarMenuItem2.setVisibility(r7);
                    }
                } else if (this.editItemVisible || this.callItemVisible) {
                    this.removedUsersItem.setVisibility(8);
                    if (this.showRecentActions) {
                        this.recentActionsItem.setVisibility(8);
                    }
                    this.adminsItem.setVisibility(8);
                    this.permissionsItem.setVisibility(8);
                    this.membersItem.setVisibility(8);
                } else {
                    ActionBarMenuItem actionBarMenuItem3 = this.adminsItem;
                    if (actionBarMenuItem3 != null) {
                        actionBarMenuItem3.setVisibility(!this.canSearchMembers ? 8 : 4);
                        this.permissionsItem.setVisibility(!this.canSearchMembers ? 8 : 4);
                        this.membersItem.setVisibility(this.canSearchMembers ? 4 : 8);
                    }
                }
            }
            int dp = AndroidUtilities.isTablet() ? AndroidUtilities.dp(490.0f) : AndroidUtilities.displaySize.x;
            this.avatarsViewPagerIndicatorView.getSecondaryMenuItem();
            int i = this.editItemVisible ? 48 : 0;
            if (this.callItemVisible) {
                i += 48;
            }
            if (this.videoCallItemVisible) {
                i += 48;
            }
            if (this.searchItem != null) {
                i += 48;
            }
            int dp2 = AndroidUtilities.dp((i * (1.0f - this.mediaHeaderAnimationProgress)) + 40.0f + 126.0f);
            int i2 = dp - dp2;
            float f2 = dp;
            int max = (int) ((f2 - (dp2 * Math.max(0.0f, 1.0f - (diff != 1.0f ? (0.15f * diff) / (1.0f - diff) : 1.0f)))) - this.nameTextView[1].getTranslationX());
            float measureText = (this.nameTextView[1].getPaint().measureText(this.nameTextView[1].getText().toString()) * scaleX) + this.nameTextView[1].getSideDrawablesSize();
            FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) this.nameTextView[1].getLayoutParams();
            int i3 = layoutParams.width;
            float f3 = max;
            if (f3 < measureText) {
                layoutParams.width = Math.max(i2, (int) Math.ceil((max - AndroidUtilities.dp(24.0f)) / (((f - scaleX) * 7.0f) + scaleX)));
            } else {
                layoutParams.width = (int) Math.ceil(measureText);
            }
            int min = (int) Math.min(((f2 - this.nameTextView[1].getX()) / scaleX) - AndroidUtilities.dp(8.0f), layoutParams.width);
            layoutParams.width = min;
            if (min != i3) {
                this.nameTextView[1].requestLayout();
            }
            float measureText2 = this.onlineTextView[1].getPaint().measureText(this.onlineTextView[1].getText().toString()) + this.onlineTextView[1].getRightDrawableWidth();
            FrameLayout.LayoutParams layoutParams2 = (FrameLayout.LayoutParams) this.onlineTextView[1].getLayoutParams();
            FrameLayout.LayoutParams layoutParams3 = (FrameLayout.LayoutParams) this.mediaCounterTextView.getLayoutParams();
            int i4 = layoutParams2.width;
            int ceil = (int) Math.ceil(this.onlineTextView[1].getTranslationX() + AndroidUtilities.dp(8.0f) + (AndroidUtilities.dp(40.0f) * (1.0f - diff)));
            layoutParams2.rightMargin = ceil;
            layoutParams3.rightMargin = ceil;
            if (f3 < measureText2) {
                int ceil2 = (int) Math.ceil(max);
                layoutParams2.width = ceil2;
                layoutParams3.width = ceil2;
            } else {
                layoutParams2.width = -2;
                layoutParams3.width = -2;
            }
            if (i4 != layoutParams2.width) {
                this.onlineTextView[2].getLayoutParams().width = layoutParams2.width;
                this.onlineTextView[2].requestLayout();
                this.onlineTextView[3].getLayoutParams().width = layoutParams2.width;
                this.onlineTextView[3].requestLayout();
                this.onlineTextView[1].requestLayout();
                this.mediaCounterTextView.requestLayout();
            }
        }
    }

    public final void fixLayout() {
        View view = ((BaseFragment) this).fragmentView;
        if (view == null) {
            return;
        }
        view.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
            @Override
            public boolean onPreDraw() {
                ProfileActivity profileActivity = ProfileActivity.this;
                if (((BaseFragment) profileActivity).fragmentView != null) {
                    profileActivity.checkListViewScroll();
                    ProfileActivity.this.needLayout(true);
                    ((BaseFragment) ProfileActivity.this).fragmentView.getViewTreeObserver().removeOnPreDrawListener(this);
                }
                return true;
            }
        });
    }

    public void onConfigurationChanged(Configuration newConfig) {
        View findViewByPosition;
        super.onConfigurationChanged(newConfig);
        SharedMediaLayout sharedMediaLayout = this.sharedMediaLayout;
        if (sharedMediaLayout != null) {
            sharedMediaLayout.onConfigurationChanged(newConfig);
        }
        invalidateIsInLandscapeMode();
        if (this.isInLandscapeMode && this.isPulledDown && (findViewByPosition = this.layoutManager.findViewByPosition(0)) != null) {
            this.listView.scrollBy(0, findViewByPosition.getTop() - AndroidUtilities.dp(88.0f));
        }
        fixLayout();
    }

    public final void invalidateIsInLandscapeMode() {
        Point point = new Point();
        getParentActivity().getWindowManager().getDefaultDisplay().getSize(point);
        this.isInLandscapeMode = point.x > point.y;
    }

    public void didReceivedNotification(int i, int i2, final Object... objArr) {
        ListAdapter listAdapter;
        TLRPC.ChatFull chatFull;
        TLRPC.ChatFull chatFull2;
        TLRPC.TL_inputGroupCall tL_inputGroupCall;
        TLRPC.Chat chat;
        RecyclerListView recyclerListView;
        RecyclerListView recyclerListView2;
        RecyclerView.ViewHolder viewHolder;
        if (i == NotificationCenter.uploadStoryEnd || i == NotificationCenter.chatWasBoostedByUser) {
            checkCanSendStoryForPosting();
            return;
        }
        r2 = 0;
        char c = 0;
        if (i == NotificationCenter.updateInterfaces) {
            int intValue = ((Integer) objArr[0]).intValue();
            boolean z = ((MessagesController.UPDATE_MASK_AVATAR & intValue) == 0 && (MessagesController.UPDATE_MASK_NAME & intValue) == 0 && (MessagesController.UPDATE_MASK_STATUS & intValue) == 0 && (MessagesController.UPDATE_MASK_EMOJI_STATUS & intValue) == 0) ? false : true;
            if (this.userId != 0) {
                if (z) {
                    updateProfileData(true);
                }
                if ((intValue & MessagesController.UPDATE_MASK_PHONE) == 0 || (recyclerListView2 = this.listView) == null || (viewHolder = (RecyclerListView.Holder) recyclerListView2.findViewHolderForPosition(this.phoneRow)) == null) {
                    return;
                }
                this.listAdapter.onBindViewHolder(viewHolder, this.phoneRow);
                return;
            }
            if (this.chatId != 0) {
                if ((MessagesController.UPDATE_MASK_CHAT & intValue) != 0 || (MessagesController.UPDATE_MASK_CHAT_AVATAR & intValue) != 0 || (MessagesController.UPDATE_MASK_CHAT_NAME & intValue) != 0 || (MessagesController.UPDATE_MASK_CHAT_MEMBERS & intValue) != 0 || (MessagesController.UPDATE_MASK_STATUS & intValue) != 0 || (MessagesController.UPDATE_MASK_EMOJI_STATUS & intValue) != 0) {
                    if ((MessagesController.UPDATE_MASK_CHAT & intValue) != 0) {
                        updateListAnimated(true);
                    } else {
                        updateOnlineCount(true);
                    }
                    updateProfileData(true);
                }
                if (!z || (recyclerListView = this.listView) == null) {
                    return;
                }
                int childCount = recyclerListView.getChildCount();
                for (int i3 = 0; i3 < childCount; i3++) {
                    View childAt = this.listView.getChildAt(i3);
                    if (childAt instanceof UserCell) {
                        ((UserCell) childAt).update(intValue);
                    }
                }
                return;
            }
            return;
        }
        if (i == NotificationCenter.chatOnlineCountDidLoad) {
            Long l = (Long) objArr[0];
            if (this.chatInfo == null || (chat = this.currentChat) == null || chat.id != l.longValue()) {
                return;
            }
            this.chatInfo.online_count = ((Integer) objArr[1]).intValue();
            updateOnlineCount(true);
            updateProfileData(false);
            return;
        }
        if (i == NotificationCenter.contactsDidLoad || i == NotificationCenter.channelRightsUpdated) {
            createActionBarMenu(true);
            return;
        }
        if (i == NotificationCenter.encryptedChatCreated) {
            if (this.creatingChat) {
                AndroidUtilities.runOnUIThread(new Runnable() {
                    @Override
                    public final void run() {
                        ProfileActivity.this.lambda$didReceivedNotification$67(objArr);
                    }
                });
                return;
            }
            return;
        }
        if (i == NotificationCenter.encryptedChatUpdated) {
            TLRPC.EncryptedChat encryptedChat = (TLRPC.EncryptedChat) objArr[0];
            TLRPC.EncryptedChat encryptedChat2 = this.currentEncryptedChat;
            if (encryptedChat2 == null || encryptedChat.id != encryptedChat2.id) {
                return;
            }
            this.currentEncryptedChat = encryptedChat;
            updateListAnimated(false);
            FlagSecureReason flagSecureReason = this.flagSecure;
            if (flagSecureReason != null) {
                flagSecureReason.invalidate();
                return;
            }
            return;
        }
        if (i == NotificationCenter.blockedUsersDidLoad) {
            boolean z2 = this.userBlocked;
            boolean z3 = getMessagesController().blockePeers.indexOfKey(this.userId) >= 0;
            this.userBlocked = z3;
            if (z2 != z3) {
                createActionBarMenu(true);
                updateListAnimated(false);
                return;
            }
            return;
        }
        if (i == NotificationCenter.groupCallUpdated) {
            Long l2 = (Long) objArr[0];
            if (this.currentChat != null) {
                long longValue = l2.longValue();
                TLRPC.Chat chat2 = this.currentChat;
                if (longValue == chat2.id && ChatObject.canManageCalls(chat2)) {
                    TLRPC.ChatFull chatFull3 = getMessagesController().getChatFull(l2.longValue());
                    if (chatFull3 != null) {
                        TLRPC.ChatFull chatFull4 = this.chatInfo;
                        if (chatFull4 != null) {
                            chatFull3.participants = chatFull4.participants;
                        }
                        this.chatInfo = chatFull3;
                    }
                    SharedMediaLayout sharedMediaLayout = this.sharedMediaLayout;
                    if (sharedMediaLayout != null) {
                        sharedMediaLayout.setChatInfo(this.chatInfo);
                    }
                    TLRPC.ChatFull chatFull5 = this.chatInfo;
                    if (chatFull5 != null && (((tL_inputGroupCall = chatFull5.call) == null && !this.hasVoiceChatItem) || (tL_inputGroupCall != null && this.hasVoiceChatItem))) {
                        createActionBarMenu(false);
                    }
                    ProfileStoriesView profileStoriesView = this.storyView;
                    if (profileStoriesView != null && (chatFull2 = this.chatInfo) != null) {
                        profileStoriesView.setStories(chatFull2.stories);
                    }
                    AvatarImageView avatarImageView = this.avatarImage;
                    if (avatarImageView != null) {
                        avatarImageView.setHasStories(needInsetForStories());
                        return;
                    }
                    return;
                }
                return;
            }
            return;
        }
        if (i == NotificationCenter.chatInfoDidLoad) {
            TLRPC.ChatFull chatFull6 = (TLRPC.ChatFull) objArr[0];
            if (chatFull6.id == this.chatId) {
                boolean booleanValue = ((Boolean) objArr[2]).booleanValue();
                TLRPC.ChatFull chatFull7 = this.chatInfo;
                if ((chatFull7 instanceof TLRPC.TL_channelFull) && chatFull6.participants == null) {
                    chatFull6.participants = chatFull7.participants;
                }
                if (chatFull7 == null && (chatFull6 instanceof TLRPC.TL_channelFull)) {
                    c = 1;
                }
                this.chatInfo = chatFull6;
                if (this.filterType == 3) {
                    chatFull6.participants.participants.clear();
                    if (this.deletedAccounts.size() > 0) {
                        this.chatInfo.participants.participants = new ArrayList(this.deletedAccounts);
                    }
                }
                if (this.mergeDialogId == 0) {
                    long j = this.chatInfo.migrated_from_chat_id;
                    if (j != 0) {
                        this.mergeDialogId = -j;
                        getMediaDataController().getMediaCount(this.mergeDialogId, this.topicId, 0, ((BaseFragment) this).classGuid, true);
                    }
                }
                fetchUsersFromChannelInfo();
                ProfileGalleryView profileGalleryView = this.avatarsViewPager;
                if (profileGalleryView != null && !this.isTopic) {
                    profileGalleryView.setChatInfo(this.chatInfo);
                }
                updateListAnimated(true);
                TLRPC.Chat chat3 = getMessagesController().getChat(Long.valueOf(this.chatId));
                if (chat3 != null) {
                    this.currentChat = chat3;
                    createActionBarMenu(true);
                }
                FlagSecureReason flagSecureReason2 = this.flagSecure;
                if (flagSecureReason2 != null) {
                    flagSecureReason2.invalidate();
                }
                if (this.currentChat.megagroup && (c != 0 || !booleanValue)) {
                    getChannelParticipants(true);
                }
                updateAutoDeleteItem();
                updateTtlIcon();
                ProfileStoriesView profileStoriesView2 = this.storyView;
                if (profileStoriesView2 != null && (chatFull = this.chatInfo) != null) {
                    profileStoriesView2.setStories(chatFull.stories);
                }
                AvatarImageView avatarImageView2 = this.avatarImage;
                if (avatarImageView2 != null) {
                    avatarImageView2.setHasStories(needInsetForStories());
                }
                SharedMediaLayout sharedMediaLayout2 = this.sharedMediaLayout;
                if (sharedMediaLayout2 != null) {
                    sharedMediaLayout2.setChatInfo(this.chatInfo);
                    return;
                }
                return;
            }
            return;
        }
        if (i == NotificationCenter.closeChats) {
            removeSelfFromStack(true);
            return;
        }
        if (i == NotificationCenter.botInfoDidLoad) {
            TLRPC.BotInfo botInfo = (TLRPC.BotInfo) objArr[0];
            if (botInfo.user_id == this.userId) {
                this.botInfo = botInfo;
                updateListAnimated(false);
                return;
            }
            return;
        }
        if (i == NotificationCenter.userInfoDidLoad) {
            if (((Long) objArr[0]).longValue() == this.userId) {
                TLRPC.UserFull userFull = (TLRPC.UserFull) objArr[1];
                this.userInfo = userFull;
                ProfileStoriesView profileStoriesView3 = this.storyView;
                if (profileStoriesView3 != null) {
                    profileStoriesView3.setStories(userFull.stories);
                }
                AvatarImageView avatarImageView3 = this.avatarImage;
                if (avatarImageView3 != null) {
                    avatarImageView3.setHasStories(needInsetForStories());
                }
                SharedMediaLayout sharedMediaLayout3 = this.sharedMediaLayout;
                if (sharedMediaLayout3 != null) {
                    sharedMediaLayout3.setUserInfo(this.userInfo);
                }
                if (this.imageUpdater != null) {
                    if (this.listAdapter != null && !TextUtils.equals(this.userInfo.about, this.currentBio)) {
                        this.listAdapter.notifyItemChanged(this.bioRow);
                    }
                } else {
                    if (!this.openAnimationInProgress && !this.callItemVisible) {
                        createActionBarMenu(true);
                    } else {
                        this.recreateMenuAfterAnimation = true;
                    }
                    updateListAnimated(false);
                    SharedMediaLayout sharedMediaLayout4 = this.sharedMediaLayout;
                    if (sharedMediaLayout4 != null) {
                        sharedMediaLayout4.setCommonGroupsCount(this.userInfo.common_chats_count);
                        updateSelectedMediaTabText();
                        SharedMediaLayout.SharedMediaPreloader sharedMediaPreloader = this.sharedMediaPreloader;
                        if (sharedMediaPreloader == null || sharedMediaPreloader.isMediaWasLoaded()) {
                            resumeDelayedFragmentAnimation();
                            needLayout(true);
                        }
                    }
                }
                updateAutoDeleteItem();
                updateTtlIcon();
                if (this.profileChannelMessageFetcher == null && !isSettings()) {
                    ProfileChannelCell.ChannelMessageFetcher channelMessageFetcher = new ProfileChannelCell.ChannelMessageFetcher(((BaseFragment) this).currentAccount);
                    this.profileChannelMessageFetcher = channelMessageFetcher;
                    channelMessageFetcher.subscribe(new Runnable() {
                        @Override
                        public final void run() {
                            ProfileActivity.this.lambda$didReceivedNotification$68();
                        }
                    });
                    this.profileChannelMessageFetcher.fetch(this.userInfo);
                }
                if (isSettings()) {
                    return;
                }
                ProfileBirthdayEffect.BirthdayEffectFetcher birthdayEffectFetcher = this.birthdayFetcher;
                ProfileBirthdayEffect.BirthdayEffectFetcher of = ProfileBirthdayEffect.BirthdayEffectFetcher.of(((BaseFragment) this).currentAccount, this.userInfo, birthdayEffectFetcher);
                this.birthdayFetcher = of;
                this.createdBirthdayFetcher = of != birthdayEffectFetcher;
                if (of != null) {
                    of.subscribe(new ProfileActivity$$ExternalSyntheticLambda49(this));
                    return;
                }
                return;
            }
            return;
        }
        if (i == NotificationCenter.privacyRulesUpdated) {
            if (this.qrItem != null) {
                updateQrItemVisibility(true);
                return;
            }
            return;
        }
        if (i == NotificationCenter.didReceiveNewMessages) {
            if (((Boolean) objArr[2]).booleanValue()) {
                return;
            }
            long dialogId = getDialogId();
            if (dialogId == ((Long) objArr[0]).longValue()) {
                DialogObject.isEncryptedDialog(dialogId);
                ArrayList arrayList = (ArrayList) objArr[1];
                for (int i4 = 0; i4 < arrayList.size(); i4++) {
                    MessageObject messageObject = (MessageObject) arrayList.get(i4);
                    if (this.currentEncryptedChat != null) {
                        TLRPC.MessageAction messageAction = messageObject.messageOwner.action;
                        if ((messageAction instanceof TLRPC.TL_messageEncryptedAction) && (messageAction.encryptedAction instanceof TLRPC.TL_decryptedMessageActionSetMessageTTL) && (listAdapter = this.listAdapter) != null) {
                            listAdapter.notifyDataSetChanged();
                        }
                    }
                }
                return;
            }
            return;
        }
        if (i == NotificationCenter.emojiLoaded) {
            RecyclerListView recyclerListView3 = this.listView;
            if (recyclerListView3 != null) {
                recyclerListView3.invalidateViews();
                return;
            }
            return;
        }
        if (i == NotificationCenter.reloadInterface) {
            updateListAnimated(false);
            return;
        }
        if (i == NotificationCenter.newSuggestionsAvailable) {
            int i5 = this.passwordSuggestionRow;
            int i6 = this.phoneSuggestionRow;
            updateRowsIds();
            if (i5 == this.passwordSuggestionRow && i6 == this.phoneSuggestionRow) {
                return;
            }
            this.listAdapter.notifyDataSetChanged();
            return;
        }
        if (i == NotificationCenter.topicsDidLoaded) {
            if (this.isTopic) {
                updateProfileData(false);
                return;
            }
            return;
        }
        if (i == NotificationCenter.updateSearchSettings) {
            SearchAdapter searchAdapter = this.searchAdapter;
            if (searchAdapter != null) {
                searchAdapter.searchArray = searchAdapter.onCreateSearchArray();
                this.searchAdapter.recentSearches.clear();
                this.searchAdapter.updateSearchArray();
                SearchAdapter searchAdapter2 = this.searchAdapter;
                searchAdapter2.search(searchAdapter2.lastSearchString);
                return;
            }
            return;
        }
        if (i == NotificationCenter.reloadDialogPhotos) {
            updateProfileData(false);
            return;
        }
        if (i == NotificationCenter.storiesUpdated || i == NotificationCenter.storiesReadUpdated) {
            AvatarImageView avatarImageView4 = this.avatarImage;
            if (avatarImageView4 != null) {
                avatarImageView4.setHasStories(needInsetForStories());
                updateAvatarRoundRadius();
            }
            TLRPC.UserFull userFull2 = this.userInfo;
            if (userFull2 != null) {
                this.storyView.setStories(userFull2.stories);
                return;
            }
            TLRPC.ChatFull chatFull8 = this.chatInfo;
            if (chatFull8 != null) {
                this.storyView.setStories(chatFull8.stories);
                return;
            }
            return;
        }
        if (i == NotificationCenter.userIsPremiumBlockedUpadted) {
            ActionBarMenuItem actionBarMenuItem = this.otherItem;
            if (actionBarMenuItem != null) {
                actionBarMenuItem.setSubItemShown(20, !getMessagesController().isUserPremiumBlocked(this.userId));
            }
            updateEditColorIcon();
            return;
        }
        if (i == NotificationCenter.currentUserPremiumStatusChanged) {
            updateEditColorIcon();
        } else if (i == NotificationCenter.starBalanceUpdated) {
            updateListAnimated(false);
        }
    }

    public void lambda$didReceivedNotification$67(Object[] objArr) {
        NotificationCenter notificationCenter = getNotificationCenter();
        int i = NotificationCenter.closeChats;
        notificationCenter.removeObserver(this, i);
        getNotificationCenter().postNotificationName(i, new Object[0]);
        TLRPC.EncryptedChat encryptedChat = (TLRPC.EncryptedChat) objArr[0];
        Bundle bundle = new Bundle();
        bundle.putInt("enc_id", encryptedChat.id);
        presentFragment(new ChatActivity(bundle), true);
    }

    public void lambda$didReceivedNotification$68() {
        updateListAnimated(false);
    }

    public final void updateAutoDeleteItem() {
        if (this.autoDeleteItem == null || this.autoDeletePopupWrapper == null) {
            return;
        }
        int i = 0;
        TLRPC.UserFull userFull = this.userInfo;
        if (userFull != null || this.chatInfo != null) {
            i = userFull != null ? userFull.ttl_period : this.chatInfo.ttl_period;
        }
        this.autoDeleteItemDrawable.setTime(i);
        this.autoDeletePopupWrapper.updateItems(i);
    }

    public final void updateTimeItem() {
        TimerDrawable timerDrawable = this.timerDrawable;
        if (timerDrawable == null) {
            return;
        }
        TLRPC.EncryptedChat encryptedChat = this.currentEncryptedChat;
        if (encryptedChat != null) {
            timerDrawable.setTime(encryptedChat.ttl);
            this.timeItem.setTag(1);
            this.timeItem.setVisibility(0);
            return;
        }
        TLRPC.UserFull userFull = this.userInfo;
        if (userFull != null) {
            timerDrawable.setTime(userFull.ttl_period);
            if (this.needTimerImage && this.userInfo.ttl_period != 0) {
                this.timeItem.setTag(1);
                this.timeItem.setVisibility(0);
                return;
            } else {
                this.timeItem.setTag(null);
                this.timeItem.setVisibility(8);
                return;
            }
        }
        TLRPC.ChatFull chatFull = this.chatInfo;
        if (chatFull != null) {
            timerDrawable.setTime(chatFull.ttl_period);
            if (this.needTimerImage && this.chatInfo.ttl_period != 0) {
                this.timeItem.setTag(1);
                this.timeItem.setVisibility(0);
                return;
            } else {
                this.timeItem.setTag(null);
                this.timeItem.setVisibility(8);
                return;
            }
        }
        this.timeItem.setTag(null);
        this.timeItem.setVisibility(8);
    }

    public boolean needDelayOpenAnimation() {
        return this.playProfileAnimation == 0;
    }

    public void mediaCountUpdated() {
        SharedMediaLayout.SharedMediaPreloader sharedMediaPreloader;
        SharedMediaLayout sharedMediaLayout = this.sharedMediaLayout;
        if (sharedMediaLayout != null && (sharedMediaPreloader = this.sharedMediaPreloader) != null) {
            sharedMediaLayout.setNewMediaCounts(sharedMediaPreloader.getLastMediaCount());
        }
        updateSharedMediaRows();
        updateSelectedMediaTabText();
        if (this.userInfo != null) {
            resumeDelayedFragmentAnimation();
        }
    }

    public void onResume() {
        TLRPC.User user;
        View view;
        super.onResume();
        SharedMediaLayout sharedMediaLayout = this.sharedMediaLayout;
        if (sharedMediaLayout != null) {
            sharedMediaLayout.onResume();
        }
        invalidateIsInLandscapeMode();
        ListAdapter listAdapter = this.listAdapter;
        if (listAdapter != null) {
            this.firstLayout = true;
            listAdapter.notifyDataSetChanged();
        }
        if (!((BaseFragment) this).parentLayout.isInPreviewMode() && (view = this.blurredView) != null && view.getVisibility() == 0) {
            this.blurredView.setVisibility(8);
            this.blurredView.setBackground(null);
        }
        ImageUpdater imageUpdater = this.imageUpdater;
        if (imageUpdater != null) {
            imageUpdater.onResume();
            setParentActivityTitle(LocaleController.getString("Settings", R.string.Settings));
        }
        updateProfileData(true);
        fixLayout();
        SimpleTextView[] simpleTextViewArr = this.nameTextView;
        if (simpleTextViewArr[1] != null) {
            setParentActivityTitle(simpleTextViewArr[1].getText());
        }
        if (this.userId != 0 && (user = getMessagesController().getUser(Long.valueOf(this.userId))) != null && user.photo == null && this.extraHeight >= AndroidUtilities.dp(88.0f)) {
            this.expandAnimator.cancel();
            float[] fArr = this.expandAnimatorValues;
            fArr[0] = 1.0f;
            fArr[1] = 0.0f;
            setAvatarExpandProgress(1.0f);
            this.avatarsViewPager.setVisibility(8);
            this.extraHeight = AndroidUtilities.dp(88.0f);
            this.allowPullingDown = false;
            this.layoutManager.scrollToPositionWithOffset(0, AndroidUtilities.dp(88.0f) - this.listView.getPaddingTop());
        }
        FlagSecureReason flagSecureReason = this.flagSecure;
        if (flagSecureReason != null) {
            flagSecureReason.attach();
        }
        updateItemsUsername();
    }

    public void onPause() {
        super.onPause();
        UndoView undoView = this.undoView;
        if (undoView != null) {
            undoView.hide(true, 0);
        }
        ImageUpdater imageUpdater = this.imageUpdater;
        if (imageUpdater != null) {
            imageUpdater.onPause();
        }
        FlagSecureReason flagSecureReason = this.flagSecure;
        if (flagSecureReason != null) {
            flagSecureReason.detach();
        }
        SharedMediaLayout sharedMediaLayout = this.sharedMediaLayout;
        if (sharedMediaLayout != null) {
            sharedMediaLayout.onPause();
        }
    }

    public boolean isSwipeBackEnabled(MotionEvent event) {
        SharedMediaLayout sharedMediaLayout;
        ProfileGalleryView profileGalleryView = this.avatarsViewPager;
        if (profileGalleryView != null && profileGalleryView.getVisibility() == 0 && this.avatarsViewPager.getRealCount() > 1) {
            this.avatarsViewPager.getHitRect(this.rect);
            if (event != null && this.rect.contains((int) event.getX(), ((int) event.getY()) - ((BaseFragment) this).actionBar.getMeasuredHeight())) {
                return false;
            }
        }
        if (this.sharedMediaRow == -1 || (sharedMediaLayout = this.sharedMediaLayout) == null) {
            return true;
        }
        if (!sharedMediaLayout.isSwipeBackEnabled()) {
            return false;
        }
        this.sharedMediaLayout.getHitRect(this.rect);
        if (this.rect.contains((int) event.getX(), ((int) event.getY()) - ((BaseFragment) this).actionBar.getMeasuredHeight())) {
            return this.sharedMediaLayout.isCurrentTabFirst();
        }
        return true;
    }

    public boolean canBeginSlide() {
        if (this.sharedMediaLayout.isSwipeBackEnabled()) {
            return super.canBeginSlide();
        }
        return false;
    }

    public UndoView getUndoView() {
        return this.undoView;
    }

    public boolean onBackPressed() {
        SharedMediaLayout sharedMediaLayout;
        if (!closeStoryViewer() && ((BaseFragment) this).actionBar.isEnabled()) {
            return this.sharedMediaRow == -1 || (sharedMediaLayout = this.sharedMediaLayout) == null || !sharedMediaLayout.closeActionMode();
        }
        return false;
    }

    public boolean isSettings() {
        return (this.imageUpdater == null || this.myProfile) ? false : true;
    }

    public void onBecomeFullyHidden() {
        UndoView undoView = this.undoView;
        if (undoView != null) {
            undoView.hide(true, 0);
        }
        super.onBecomeFullyHidden();
        this.fullyVisible = false;
    }

    public void setPlayProfileAnimation(int type) {
        SharedPreferences globalMainSettings = MessagesController.getGlobalMainSettings();
        if (AndroidUtilities.isTablet()) {
            return;
        }
        this.needTimerImage = type != 0;
        if (globalMainSettings.getBoolean("view_animations", true)) {
            this.playProfileAnimation = type;
        } else if (type == 2) {
            this.expandPhoto = true;
        }
    }

    public final void updateSharedMediaRows() {
        if (this.listAdapter == null) {
            return;
        }
        updateListAnimated(false);
    }

    public void onTransitionAnimationStart(boolean isOpen, boolean backward) {
        super.onTransitionAnimationStart(isOpen, backward);
        this.isFragmentOpened = isOpen;
        if (((!isOpen && backward) || (isOpen && !backward)) && this.playProfileAnimation != 0 && this.allowProfileAnimation && !this.isPulledDown) {
            this.openAnimationInProgress = true;
        }
        if (isOpen) {
            if (this.imageUpdater != null) {
                this.transitionIndex = getNotificationCenter().setAnimationInProgress(this.transitionIndex, new int[]{NotificationCenter.dialogsNeedReload, NotificationCenter.closeChats, NotificationCenter.mediaCountDidLoad, NotificationCenter.mediaCountsDidLoad, NotificationCenter.userInfoDidLoad, NotificationCenter.needCheckSystemBarColors});
            } else {
                this.transitionIndex = getNotificationCenter().setAnimationInProgress(this.transitionIndex, new int[]{NotificationCenter.dialogsNeedReload, NotificationCenter.closeChats, NotificationCenter.mediaCountDidLoad, NotificationCenter.mediaCountsDidLoad, NotificationCenter.needCheckSystemBarColors});
            }
            if (Build.VERSION.SDK_INT >= 21 && !backward && getParentActivity() != null) {
                this.navigationBarAnimationColorFrom = getParentActivity().getWindow().getNavigationBarColor();
            }
        }
        this.transitionAnimationInProress = true;
        checkPhotoDescriptionAlpha();
    }

    public void onTransitionAnimationEnd(boolean isOpen, boolean backward) {
        SharedMediaLayout sharedMediaLayout;
        if (isOpen) {
            if (!backward) {
                int i = this.playProfileAnimation;
                if (i != 0 && this.allowProfileAnimation) {
                    if (i == 1) {
                        this.currentExpandAnimatorValue = 0.0f;
                    }
                    this.openAnimationInProgress = false;
                    checkListViewScroll();
                    if (this.recreateMenuAfterAnimation) {
                        createActionBarMenu(true);
                    }
                }
                if (!this.fragmentOpened) {
                    this.fragmentOpened = true;
                    this.invalidateScroll = true;
                    ((BaseFragment) this).fragmentView.requestLayout();
                }
            }
            getNotificationCenter().onAnimationFinish(this.transitionIndex);
            View view = this.blurredView;
            if (view != null && view.getVisibility() == 0) {
                this.blurredView.setVisibility(8);
                this.blurredView.setBackground(null);
            }
            if (this.fromMain && (sharedMediaLayout = this.sharedMediaLayout) != null) {
                sharedMediaLayout.selectFirstTab();
            }
        }
        this.transitionAnimationInProress = false;
        checkPhotoDescriptionAlpha();
    }

    @Keep
    public float getAvatarAnimationProgress() {
        return this.avatarAnimationProgress;
    }

    @Keep
    public void setAvatarAnimationProgress(float progress) {
        int profileBackColorForId;
        int profileTextColorForId;
        this.currentExpandAnimatorValue = progress;
        this.avatarAnimationProgress = progress;
        checkPhotoDescriptionAlpha();
        if (this.playProfileAnimation == 2) {
            this.avatarImage.setProgressToExpand(progress);
        }
        this.listView.setAlpha(progress);
        this.listView.setTranslationX(AndroidUtilities.dp(48.0f) - (AndroidUtilities.dp(48.0f) * progress));
        long j = 5;
        if (this.playProfileAnimation != 2 || (profileBackColorForId = this.avatarColor) == 0) {
            profileBackColorForId = AvatarDrawable.getProfileBackColorForId((this.userId != 0 || (ChatObject.isChannel(this.chatId, ((BaseFragment) this).currentAccount) && !this.currentChat.megagroup)) ? 5L : this.chatId, this.resourcesProvider);
        }
        int i = this.actionBarAnimationColorFrom;
        if (i == 0) {
            i = getThemedColor(Theme.key_actionBarDefault);
        }
        int alphaComponent = SharedConfig.chatBlurEnabled() ? ColorUtils.setAlphaComponent(i, 0) : i;
        if (!Theme.usePlusTheme) {
            this.topView.setBackgroundColor(ColorUtils.blendARGB(alphaComponent, profileBackColorForId, progress));
        }
        this.timerDrawable.setBackgroundColor(ColorUtils.blendARGB(i, profileBackColorForId, progress));
        ((BaseFragment) this).actionBar.setItemsColor(ColorUtils.blendARGB(Theme.usePlusTheme ? Theme.profileActionbarIconsColor : this.peerColor != null ? -1 : getThemedColor(Theme.key_actionBarDefaultIcon), AvatarDrawable.getIconColorForId((this.userId != 0 || (ChatObject.isChannel(this.chatId, ((BaseFragment) this).currentAccount) && !this.currentChat.megagroup)) ? 5L : this.chatId, this.resourcesProvider), this.avatarAnimationProgress), false);
        int themedColor = getThemedColor(Theme.key_profile_title);
        int themedColor2 = getThemedColor(Theme.key_actionBarDefaultTitle);
        for (int i2 = 0; i2 < 2; i2++) {
            SimpleTextView[] simpleTextViewArr = this.nameTextView;
            if (simpleTextViewArr[i2] != null && ((i2 != 1 || this.playProfileAnimation != 2) && !Theme.usePlusTheme)) {
                simpleTextViewArr[i2].setTextColor(ColorUtils.blendARGB(themedColor2, themedColor, progress));
            }
        }
        if (this.isOnline[0]) {
            profileTextColorForId = getThemedColor(Theme.key_profile_status);
        } else {
            if (this.userId == 0 && (!ChatObject.isChannel(this.chatId, ((BaseFragment) this).currentAccount) || this.currentChat.megagroup)) {
                j = this.chatId;
            }
            profileTextColorForId = AvatarDrawable.getProfileTextColorForId(j, this.resourcesProvider);
        }
        int themedColor3 = getThemedColor(this.isOnline[0] ? Theme.key_chat_status : Theme.key_actionBarDefaultSubtitle);
        int i3 = 0;
        while (i3 < 3) {
            SimpleTextView[] simpleTextViewArr2 = this.onlineTextView;
            if (simpleTextViewArr2[i3] != null && i3 != 1 && ((i3 != 2 || this.playProfileAnimation != 2) && !Theme.usePlusTheme)) {
                simpleTextViewArr2[i3].setTextColor(ColorUtils.blendARGB(i3 == 0 ? themedColor3 : applyPeerColor(themedColor3, true, Boolean.valueOf(this.isOnline[0])), i3 == 0 ? profileTextColorForId : applyPeerColor(profileTextColorForId, true, Boolean.valueOf(this.isOnline[0])), progress));
            }
            i3++;
        }
        this.extraHeight = this.initialAnimationExtraHeight * progress;
        long j2 = this.userId;
        if (j2 == 0) {
            j2 = this.chatId;
        }
        int profileColorForId = AvatarDrawable.getProfileColorForId(j2, this.resourcesProvider);
        long j3 = this.userId;
        if (j3 == 0) {
            j3 = this.chatId;
        }
        int colorForId = AvatarDrawable.getColorForId(j3);
        if (profileColorForId != colorForId) {
            if (!Theme.usePlusTheme) {
                this.avatarDrawable.setColor(ColorUtils.blendARGB(colorForId, profileColorForId, progress));
            }
            this.avatarImage.invalidate();
        }
        int i4 = this.navigationBarAnimationColorFrom;
        if (i4 != 0) {
            setNavigationBarColor(ColorUtils.blendARGB(i4, getNavigationBarColor(), progress));
        }
        this.topView.invalidate();
        needLayout(true);
        View view = ((BaseFragment) this).fragmentView;
        if (view != null) {
            view.invalidate();
        }
        AboutLinkCell aboutLinkCell = this.aboutLinkCell;
        if (aboutLinkCell != null) {
            aboutLinkCell.invalidate();
        }
        if (getDialogId() > 0) {
            AvatarImageView avatarImageView = this.avatarImage;
            if (avatarImageView != null) {
                avatarImageView.setProgressToStoriesInsets(this.avatarAnimationProgress);
            }
            ProfileStoriesView profileStoriesView = this.storyView;
            if (profileStoriesView != null) {
                profileStoriesView.setProgressToStoriesInsets(this.avatarAnimationProgress);
            }
        }
    }

    public android.animation.AnimatorSet onCustomTransitionAnimation(final boolean r18, final java.lang.Runnable r19) {
        throw new UnsupportedOperationException("Method not decompiled: org.telegram.ui.ProfileActivity.onCustomTransitionAnimation(boolean, java.lang.Runnable):android.animation.AnimatorSet");
    }

    public void lambda$onCustomTransitionAnimation$69(ValueAnimator valueAnimator) {
        View view = ((BaseFragment) this).fragmentView;
        if (view != null) {
            view.invalidate();
        }
        updateStoriesViewBounds(true);
    }

    public final int getAverageColor(ImageReceiver imageReceiver) {
        if (imageReceiver.getDrawable() instanceof VectorAvatarThumbDrawable) {
            return imageReceiver.getDrawable().gradientTools.getAverageColor();
        }
        return AndroidUtilities.calcBitmapColor(this.avatarImage.getImageReceiver().getBitmap());
    }

    public final void updateOnlineCount(boolean notify) {
        TLRPC.UserStatus userStatus;
        this.onlineCount = 0;
        final int currentTime = getConnectionsManager().getCurrentTime();
        this.sortedUsers.clear();
        if (this.filterType == 3) {
            return;
        }
        TLRPC.ChatFull chatFull = this.chatInfo;
        if ((chatFull instanceof TLRPC.TL_chatFull) || ((chatFull instanceof TLRPC.TL_channelFull) && chatFull.participants_count <= 200 && chatFull.participants != null)) {
            for (int i = 0; i < this.chatInfo.participants.participants.size(); i++) {
                TLRPC.User user = getMessagesController().getUser(Long.valueOf(((TLRPC.ChatParticipant) this.chatInfo.participants.participants.get(i)).user_id));
                if (user != null && (userStatus = user.status) != null && ((userStatus.expires > currentTime || user.id == getUserConfig().getClientUserId()) && user.status.expires > 10000)) {
                    this.onlineCount++;
                }
                this.sortedUsers.add(Integer.valueOf(i));
            }
            try {
                if (this.sortIndex == 0) {
                    Collections.sort(this.sortedUsers, Comparator.-EL.reversed(Comparator.-CC.comparingInt(new ToIntFunction() {
                        public final int applyAsInt(Object obj) {
                            int lambda$updateOnlineCount$70;
                            lambda$updateOnlineCount$70 = ProfileActivity.this.lambda$updateOnlineCount$70(currentTime, obj);
                            return lambda$updateOnlineCount$70;
                        }
                    })));
                }
            } catch (Exception e) {
                FileLog.e(e);
            }
            if (notify && this.listAdapter != null && this.membersStartRow > 0) {
                AndroidUtilities.updateVisibleRows(this.listView);
            }
            if (this.sharedMediaLayout == null || this.sharedMediaRow == -1) {
                return;
            }
            if ((this.sortedUsers.size() > 5 || this.usersForceShowingIn == 2) && this.usersForceShowingIn != 1) {
                this.sharedMediaLayout.setChatUsers(this.sortedUsers, this.chatInfo);
                return;
            }
            return;
        }
        if (!(chatFull instanceof TLRPC.TL_channelFull) || chatFull.participants_count <= 200) {
            return;
        }
        this.onlineCount = chatFull.online_count;
    }

    public int lambda$updateOnlineCount$70(int i, Object obj) {
        TLRPC.User user = getMessagesController().getUser(Long.valueOf(((TLRPC.ChatParticipant) this.chatInfo.participants.participants.get(((Integer) obj).intValue())).user_id));
        if (user == null) {
            return Integer.MIN_VALUE;
        }
        if (user.bot) {
            return -110;
        }
        if (user.self) {
            return i + 50000;
        }
        TLRPC.UserStatus userStatus = user.status;
        if (userStatus != null) {
            return userStatus.expires;
        }
        if (user.id == this.creatorID) {
            return (getConnectionsManager().getCurrentTime() + 50000) - 100;
        }
        return Integer.MIN_VALUE;
    }

    public void setChatInfo(TLRPC.ChatFull value) {
        TLRPC.ChatFull chatFull;
        this.chatInfo = value;
        if (value != null) {
            long j = value.migrated_from_chat_id;
            if (j != 0 && this.mergeDialogId == 0) {
                this.mergeDialogId = -j;
                getMediaDataController().getMediaCounts(this.mergeDialogId, this.topicId, ((BaseFragment) this).classGuid);
            }
        }
        SharedMediaLayout sharedMediaLayout = this.sharedMediaLayout;
        if (sharedMediaLayout != null) {
            sharedMediaLayout.setChatInfo(this.chatInfo);
        }
        ProfileGalleryView profileGalleryView = this.avatarsViewPager;
        if (profileGalleryView != null && !this.isTopic) {
            profileGalleryView.setChatInfo(this.chatInfo);
        }
        ProfileStoriesView profileStoriesView = this.storyView;
        if (profileStoriesView != null && (chatFull = this.chatInfo) != null) {
            profileStoriesView.setStories(chatFull.stories);
        }
        AvatarImageView avatarImageView = this.avatarImage;
        if (avatarImageView != null) {
            avatarImageView.setHasStories(needInsetForStories());
        }
        fetchUsersFromChannelInfo();
    }

    public final boolean needInsetForStories() {
        return getMessagesController().getStoriesController().hasStories(getDialogId()) && !this.isTopic;
    }

    public void setUserInfo(TLRPC.UserFull value, ProfileChannelCell.ChannelMessageFetcher channelMessageFetcher, ProfileBirthdayEffect.BirthdayEffectFetcher birthdayAssetsFetcher) {
        this.userInfo = value;
        ProfileStoriesView profileStoriesView = this.storyView;
        if (profileStoriesView != null) {
            profileStoriesView.setStories(value.stories);
        }
        AvatarImageView avatarImageView = this.avatarImage;
        if (avatarImageView != null) {
            avatarImageView.setHasStories(needInsetForStories());
        }
        SharedMediaLayout sharedMediaLayout = this.sharedMediaLayout;
        if (sharedMediaLayout != null) {
            sharedMediaLayout.setUserInfo(this.userInfo);
        }
        if (this.profileChannelMessageFetcher == null) {
            this.profileChannelMessageFetcher = channelMessageFetcher;
        }
        if (this.profileChannelMessageFetcher == null) {
            this.profileChannelMessageFetcher = new ProfileChannelCell.ChannelMessageFetcher(((BaseFragment) this).currentAccount);
        }
        this.profileChannelMessageFetcher.subscribe(new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$setUserInfo$71();
            }
        });
        this.profileChannelMessageFetcher.fetch(this.userInfo);
        if (this.birthdayFetcher == null) {
            this.birthdayFetcher = birthdayAssetsFetcher;
        }
        ProfileBirthdayEffect.BirthdayEffectFetcher birthdayEffectFetcher = this.birthdayFetcher;
        if (birthdayEffectFetcher == null) {
            ProfileBirthdayEffect.BirthdayEffectFetcher of = ProfileBirthdayEffect.BirthdayEffectFetcher.of(((BaseFragment) this).currentAccount, this.userInfo, birthdayEffectFetcher);
            this.birthdayFetcher = of;
            this.createdBirthdayFetcher = of != null;
        }
        ProfileBirthdayEffect.BirthdayEffectFetcher birthdayEffectFetcher2 = this.birthdayFetcher;
        if (birthdayEffectFetcher2 != null) {
            birthdayEffectFetcher2.subscribe(new ProfileActivity$$ExternalSyntheticLambda49(this));
        }
        ActionBarMenuItem actionBarMenuItem = this.otherItem;
        if (actionBarMenuItem != null) {
            actionBarMenuItem.setSubItemShown(20, true ^ getMessagesController().isUserPremiumBlocked(this.userId));
        }
    }

    public void lambda$setUserInfo$71() {
        updateListAnimated(false);
    }

    public boolean canSearchMembers() {
        return this.canSearchMembers;
    }

    public final void fetchUsersFromChannelInfo() {
        TLRPC.Chat chat = this.currentChat;
        if (chat == null || !chat.megagroup || this.filterType == 3) {
            return;
        }
        TLRPC.ChatFull chatFull = this.chatInfo;
        if (!(chatFull instanceof TLRPC.TL_channelFull) || chatFull.participants == null) {
            return;
        }
        for (int i = 0; i < this.chatInfo.participants.participants.size(); i++) {
            TLRPC.TL_chatChannelParticipant tL_chatChannelParticipant = (TLRPC.ChatParticipant) this.chatInfo.participants.participants.get(i);
            this.participantsMap.put(((TLRPC.ChatParticipant) tL_chatChannelParticipant).user_id, tL_chatChannelParticipant);
            if (this.creatorID == 0 && (tL_chatChannelParticipant.channelParticipant instanceof TLRPC.TL_channelParticipantCreator)) {
                this.creatorID = ((TLRPC.ChatParticipant) tL_chatChannelParticipant).user_id;
                updateCreatorName();
            }
        }
    }

    public final void kickUser(long uid, TLRPC.ChatParticipant participant) {
        if (uid != 0) {
            TLRPC.User user = getMessagesController().getUser(Long.valueOf(uid));
            getMessagesController().deleteParticipantFromChat(this.chatId, user);
            if (this.currentChat != null && user != null && BulletinFactory.canShowBulletin(this)) {
                BulletinFactory.createRemoveFromChatBulletin(this, user, this.currentChat.title).show();
            }
            if (this.chatInfo.participants.participants.remove(participant)) {
                updateListAnimated(true);
                return;
            }
            return;
        }
        NotificationCenter notificationCenter = getNotificationCenter();
        int i = NotificationCenter.closeChats;
        notificationCenter.removeObserver(this, i);
        if (AndroidUtilities.isTablet()) {
            getNotificationCenter().postNotificationName(i, new Object[]{Long.valueOf(-this.chatId)});
        } else {
            getNotificationCenter().postNotificationName(i, new Object[0]);
        }
        getMessagesController().deleteParticipantFromChat(this.chatId, getMessagesController().getUser(Long.valueOf(getUserConfig().getClientUserId())));
        this.playProfileAnimation = 0;
        finishFragment();
    }

    public boolean isChat() {
        return this.chatId != 0;
    }

    public final void updateRowsIds() {
        throw new UnsupportedOperationException("Method not decompiled: org.telegram.ui.ProfileActivity.updateRowsIds():void");
    }

    public final Drawable getScamDrawable(int type) {
        if (this.scamDrawable == null) {
            ScamDrawable scamDrawable = new ScamDrawable(11, type);
            this.scamDrawable = scamDrawable;
            scamDrawable.setColor(getThemedColor(Theme.key_avatar_subtitleInProfileBlue));
        }
        return this.scamDrawable;
    }

    public final Drawable getLockIconDrawable() {
        if (this.lockIconDrawable == null) {
            this.lockIconDrawable = Theme.chat_lockIconDrawable.getConstantState().newDrawable().mutate();
        }
        return this.lockIconDrawable;
    }

    public final Drawable getVerifiedCrossfadeDrawable(int a) {
        MessagesController.PeerColor peerColor;
        if (this.verifiedCrossfadeDrawable[a] == null) {
            this.verifiedDrawable[a] = Theme.profile_verifiedDrawable.getConstantState().newDrawable().mutate();
            this.verifiedCheckDrawable[a] = Theme.profile_verifiedCheckDrawable.getConstantState().newDrawable().mutate();
            if (a == 1 && (peerColor = this.peerColor) != null) {
                this.verifiedDrawable[1].setColorFilter(AndroidUtilities.getOffsetColor(Theme.adaptHSV(peerColor.hasColor6(Theme.isCurrentThemeDark()) ? this.peerColor.getColor5() : this.peerColor.getColor3(), 0.1f, Theme.isCurrentThemeDark() ? -0.1f : -0.08f), getThemedColor(Theme.key_player_actionBarTitle), this.mediaHeaderAnimationProgress, 1.0f), PorterDuff.Mode.MULTIPLY);
                this.verifiedCheckDrawable[1].setColorFilter(AndroidUtilities.getOffsetColor(-1, getThemedColor(Theme.key_windowBackgroundWhite), this.mediaHeaderAnimationProgress, 1.0f), PorterDuff.Mode.MULTIPLY);
            }
            this.verifiedCrossfadeDrawable[a] = new CrossfadeDrawable(new CombinedDrawable(this.verifiedDrawable[a], this.verifiedCheckDrawable[a]), ContextCompat.getDrawable(getParentActivity(), R.drawable.verified_profile));
        }
        return this.verifiedCrossfadeDrawable[a];
    }

    public final Drawable getPremiumCrossfadeDrawable(int a) {
        if (this.premiumCrossfadeDrawable[a] == null) {
            this.premiumStarDrawable[a] = ContextCompat.getDrawable(getParentActivity(), R.drawable.msg_premium_liststar).mutate();
            int themedColor = getThemedColor(Theme.key_profile_verifiedBackground);
            if (a == 1) {
                themedColor = applyPeerColor(themedColor);
            }
            this.premiumStarDrawable[a].setColorFilter(themedColor, PorterDuff.Mode.MULTIPLY);
            this.premiumCrossfadeDrawable[a] = new CrossfadeDrawable(this.premiumStarDrawable[a], ContextCompat.getDrawable(getParentActivity(), R.drawable.msg_premium_prolfilestar).mutate());
        }
        return this.premiumCrossfadeDrawable[a];
    }

    public final Drawable getEmojiStatusDrawable(TLRPC.EmojiStatus emojiStatus, boolean switchable, boolean animated, int a) {
        AnimatedEmojiDrawable.SwapAnimatedEmojiDrawable[] swapAnimatedEmojiDrawableArr = this.emojiStatusDrawable;
        if (swapAnimatedEmojiDrawableArr[a] == null) {
            swapAnimatedEmojiDrawableArr[a] = new AnimatedEmojiDrawable.SwapAnimatedEmojiDrawable(this.nameTextView[a], AndroidUtilities.dp(24.0f), a == 0 ? 7 : 2);
            if (this.fragmentViewAttached) {
                this.emojiStatusDrawable[a].attach();
            }
        }
        if (emojiStatus instanceof TLRPC.TL_emojiStatus) {
            this.emojiStatusDrawable[a].set(((TLRPC.TL_emojiStatus) emojiStatus).document_id, animated);
        } else {
            if (emojiStatus instanceof TLRPC.TL_emojiStatusUntil) {
                TLRPC.TL_emojiStatusUntil tL_emojiStatusUntil = (TLRPC.TL_emojiStatusUntil) emojiStatus;
                if (tL_emojiStatusUntil.until > ((int) (System.currentTimeMillis() / 1000)) && !this.reportSpam) {
                    this.emojiStatusDrawable[a].set(tL_emojiStatusUntil.document_id, animated);
                }
            }
            this.emojiStatusDrawable[a].set(getPremiumCrossfadeDrawable(a), animated);
        }
        updateEmojiStatusDrawableColor();
        return this.emojiStatusDrawable[a];
    }

    public final void updateEmojiStatusDrawableColor() {
        updateEmojiStatusDrawableColor(this.lastEmojiStatusProgress);
    }

    public final void updateEmojiStatusDrawableColor(float progress) {
        int offsetColor;
        for (int i = 0; i < 2; i++) {
            MessagesController.PeerColor peerColor = this.peerColor;
            if (peerColor != null && i == 1) {
                offsetColor = ColorUtils.blendARGB(peerColor.getColor2(), this.peerColor.hasColor6(Theme.isCurrentThemeDark()) ? this.peerColor.getColor5() : this.peerColor.getColor3(), 0.5f);
            } else {
                offsetColor = AndroidUtilities.getOffsetColor(getThemedColor(Theme.key_profile_verifiedBackground), getThemedColor(Theme.key_player_actionBarTitle), this.mediaHeaderAnimationProgress, 1.0f);
            }
            int blendARGB = ColorUtils.blendARGB(ColorUtils.blendARGB(offsetColor, -1, progress), getThemedColor(Theme.key_player_actionBarTitle), this.mediaHeaderAnimationProgress);
            AnimatedEmojiDrawable.SwapAnimatedEmojiDrawable[] swapAnimatedEmojiDrawableArr = this.emojiStatusDrawable;
            if (swapAnimatedEmojiDrawableArr[i] != null) {
                swapAnimatedEmojiDrawableArr[i].setColor(Integer.valueOf(blendARGB));
            }
            if (i == 1) {
                this.animatedStatusView.setColor(blendARGB);
            }
        }
        this.lastEmojiStatusProgress = progress;
    }

    public final void updateEmojiStatusEffectPosition() {
        this.animatedStatusView.setScaleX(this.nameTextView[1].getScaleX());
        this.animatedStatusView.setScaleY(this.nameTextView[1].getScaleY());
        this.animatedStatusView.translate(this.nameTextView[1].getX() + (this.nameTextView[1].getRightDrawableX() * this.nameTextView[1].getScaleX()), this.nameTextView[1].getY() + (this.nameTextView[1].getHeight() - ((this.nameTextView[1].getHeight() - this.nameTextView[1].getRightDrawableY()) * this.nameTextView[1].getScaleY())));
    }

    public final void updatePicDate() {
        if (!PlusSettings.showProfilePicDateInsteadOfStatus || this.updatingDate) {
            return;
        }
        this.updatingDate = true;
        updateProfileData(false);
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$updatePicDate$72();
            }
        }, 200L);
    }

    public void lambda$updatePicDate$72() {
        this.updatingDate = false;
    }

    public final void updateProfileData(boolean r38) {
        throw new UnsupportedOperationException("Method not decompiled: org.telegram.ui.ProfileActivity.updateProfileData(boolean):void");
    }

    public void lambda$updateProfileData$74(View view) {
        MessagePrivateSeenView.showSheet(getContext(), ((BaseFragment) this).currentAccount, this.dialogId, true, (Runnable) null, new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$updateProfileData$73();
            }
        }, this.resourcesProvider);
    }

    public void lambda$updateProfileData$73() {
        getMessagesController().reloadUser(this.dialogId);
    }

    public void lambda$updateProfileData$75(View view) {
        showStatusSelect();
    }

    public void lambda$updateProfileData$76(TLRPC.User user, SimpleTextView simpleTextView, View view) {
        ImageLocation forDocument;
        ?? premiumPreviewBottomSheet = new PremiumPreviewBottomSheet(this, ((BaseFragment) this).currentAccount, user, this.resourcesProvider);
        simpleTextView.getLocationOnScreen(new int[2]);
        premiumPreviewBottomSheet.startEnterFromX = simpleTextView.rightDrawableX;
        premiumPreviewBottomSheet.startEnterFromY = simpleTextView.rightDrawableY;
        premiumPreviewBottomSheet.startEnterFromScale = simpleTextView.getScaleX();
        premiumPreviewBottomSheet.startEnterFromX1 = simpleTextView.getLeft();
        premiumPreviewBottomSheet.startEnterFromY1 = simpleTextView.getTop();
        premiumPreviewBottomSheet.startEnterFromView = simpleTextView;
        AnimatedEmojiDrawable.SwapAnimatedEmojiDrawable rightDrawable = simpleTextView.getRightDrawable();
        AnimatedEmojiDrawable.SwapAnimatedEmojiDrawable[] swapAnimatedEmojiDrawableArr = this.emojiStatusDrawable;
        if (rightDrawable == swapAnimatedEmojiDrawableArr[1] && swapAnimatedEmojiDrawableArr[1] != null && (swapAnimatedEmojiDrawableArr[1].getDrawable() instanceof AnimatedEmojiDrawable)) {
            premiumPreviewBottomSheet.startEnterFromScale *= 0.98f;
            TLRPC.Document document = this.emojiStatusDrawable[1].getDrawable().getDocument();
            if (document != null) {
                BackupImageView backupImageView = new BackupImageView(getContext());
                String str = "160_160";
                SvgHelper.SvgDrawable svgThumb = DocumentObject.getSvgThumb(document.thumbs, Theme.key_windowBackgroundWhiteGrayIcon, 0.2f);
                TLRPC.PhotoSize closestPhotoSizeWithSize = FileLoader.getClosestPhotoSizeWithSize(document.thumbs, 90);
                if ("video/webm".equals(document.mime_type)) {
                    forDocument = ImageLocation.getForDocument(document);
                    str = "160_160_g";
                    if (svgThumb != null) {
                        svgThumb.overrideWidthAndHeight(512, 512);
                    }
                } else {
                    if (svgThumb != null && MessageObject.isAnimatedStickerDocument(document, false)) {
                        svgThumb.overrideWidthAndHeight(512, 512);
                    }
                    forDocument = ImageLocation.getForDocument(document);
                }
                String str2 = str;
                backupImageView.setLayerNum(7);
                backupImageView.setRoundRadius(AndroidUtilities.dp(4.0f));
                backupImageView.setImage(forDocument, str2, ImageLocation.getForDocument(closestPhotoSizeWithSize, document), "140_140", svgThumb, document);
                if (this.emojiStatusDrawable[1].getDrawable().canOverrideColor()) {
                    backupImageView.setColorFilter(new PorterDuffColorFilter(getThemedColor(Theme.key_windowBackgroundWhiteBlueIcon), PorterDuff.Mode.SRC_IN));
                    premiumPreviewBottomSheet.statusStickerSet = MessageObject.getInputStickerSet(document);
                } else {
                    premiumPreviewBottomSheet.statusStickerSet = MessageObject.getInputStickerSet(document);
                }
                premiumPreviewBottomSheet.overrideTitleIcon = backupImageView;
                premiumPreviewBottomSheet.isEmojiStatus = true;
            }
        }
        showDialog((Dialog) premiumPreviewBottomSheet);
    }

    public void lambda$updateProfileData$77(View view) {
        showStatusSelect();
    }

    public void lambda$updateProfileData$78(View view) {
        goToForum();
    }

    public class AnonymousClass55 implements View.OnLongClickListener {
        public AnonymousClass55() {
        }

        @Override
        public boolean onLongClick(View v) {
            int i;
            BottomSheet.Builder builder = new BottomSheet.Builder(ProfileActivity.this.getParentActivity(), true, ProfileActivity.this.resourcesProvider);
            long j = ProfileActivity.this.userId;
            ProfileActivity profileActivity = ProfileActivity.this;
            final long j2 = j != 0 ? profileActivity.userId : profileActivity.chatId;
            int i2 = -1;
            String str = "id: " + j2;
            try {
                if (ProfileActivity.this.currentChat != null) {
                    if (ProfileActivity.this.currentChat.photo != null && ProfileActivity.this.currentChat.photo.dc_id != 0 && BuildVars.BETA_2) {
                        i2 = ProfileActivity.this.currentChat.photo.dc_id;
                    }
                } else if (ProfileActivity.this.userId != 0) {
                    TLRPC.User user = ProfileActivity.this.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.userId));
                    TLRPC.UserProfilePhoto userProfilePhoto = user.photo;
                    if (userProfilePhoto != null && (i = userProfilePhoto.dc_id) != 0) {
                        i2 = i;
                    } else if (UserObject.isUserSelf(user) && ProfileActivity.this.getMessagesController().thisDc > 0) {
                        i2 = ProfileActivity.this.getMessagesController().thisDc;
                    }
                }
                if (i2 != 0 && BuildVars.BETA_2) {
                    str = "id: " + j2 + " Data Center: " + i2 + " (" + ProfileActivity.this.getDCInfo(i2) + ")";
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            builder.setTitle(str);
            ArrayList arrayList = new ArrayList();
            ArrayList arrayList2 = new ArrayList();
            final ArrayList arrayList3 = new ArrayList();
            arrayList.add(LocaleController.getString("Copy", R.string.Copy) + " " + j2);
            arrayList2.add(Integer.valueOf(R.drawable.msg_copy));
            arrayList3.add(0);
            if (ProfileActivity.this.creatorID > 0) {
                arrayList.add(LocaleController.getString("OpenProfile", R.string.OpenProfile));
                arrayList2.add(Integer.valueOf(R.drawable.msg_openprofile));
                arrayList3.add(1);
            }
            builder.setItems((CharSequence[]) arrayList.toArray(new CharSequence[0]), AndroidUtilities.toIntArray(arrayList2), new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i3) {
                    ProfileActivity.AnonymousClass55.this.lambda$onLongClick$0(arrayList3, j2, dialogInterface, i3);
                }
            });
            ProfileActivity.this.showDialog(builder.create());
            return true;
        }

        public void lambda$onLongClick$0(ArrayList arrayList, long j, DialogInterface dialogInterface, int i) {
            int intValue = ((Integer) arrayList.get(i)).intValue();
            if (intValue != 0) {
                if (intValue == 1) {
                    ProfileActivity profileActivity = ProfileActivity.this;
                    profileActivity.openProfile(profileActivity.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.creatorID)));
                    return;
                }
                return;
            }
            AndroidUtilities.addToClipboard(j + "");
            BulletinFactory.of(ProfileActivity.this).createCopyBulletin(LocaleController.getString("TextCopied", R.string.TextCopied)).show();
        }
    }

    public final void openProfile(TLRPC.User user) {
        if (user != null) {
            Bundle bundle = new Bundle();
            bundle.putLong("user_id", user.id);
            if (UserObject.isUserSelf(user)) {
                bundle.putBoolean("my_profile", true);
            }
            ProfileActivity profileActivity = new ProfileActivity(bundle);
            AndroidUtilities.setAdjustResizeToNothing(getParentActivity(), ((BaseFragment) this).classGuid);
            presentFragment(profileActivity);
        }
    }

    public final void updateCreatorName() {
        SimpleTextView simpleTextView;
        if (this.creatorID == 0 || (simpleTextView = this.adminTextView) == null) {
            return;
        }
        simpleTextView.setText(LocaleController.getString("ChannelCreator", R.string.ChannelCreator) + ": " + UserObject.getUserName(getMessagesController().getUser(Long.valueOf(this.creatorID))));
    }

    public final void updateListBG() {
        GradientDrawable.Orientation orientation;
        int i = Theme.profileRowGradientList;
        if (i > 0) {
            if (i == 2) {
                orientation = GradientDrawable.Orientation.LEFT_RIGHT;
            } else if (i == 3) {
                orientation = GradientDrawable.Orientation.TL_BR;
            } else if (i == 4) {
                orientation = GradientDrawable.Orientation.BL_TR;
            } else {
                orientation = GradientDrawable.Orientation.TOP_BOTTOM;
            }
            this.listView.setBackgroundDrawable(new GradientDrawable(orientation, new int[]{Theme.profileRowColor, Theme.profileRowGradientColor}));
            return;
        }
        this.listView.setBackgroundColor(Theme.profileRowColor);
    }

    public final void updatedPeerColor() {
        SharedMediaLayout.ScrollSlidingTextTabStripInner scrollSlidingTextTabStripInner;
        TextView textView;
        int themedColor;
        int themedColor2;
        this.adaptedColors.clear();
        TopView topView = this.topView;
        if (topView != null) {
            topView.setBackgroundColorId(this.peerColor, true);
        }
        SimpleTextView[] simpleTextViewArr = this.onlineTextView;
        if (simpleTextViewArr[1] != null) {
            if (simpleTextViewArr[1].getTag() instanceof Integer) {
                themedColor2 = getThemedColor(((Integer) this.onlineTextView[1].getTag()).intValue());
            } else {
                themedColor2 = getThemedColor(Theme.key_avatar_subtitleInProfileBlue);
            }
            this.onlineTextView[1].setTextColor(ColorUtils.blendARGB(applyPeerColor(themedColor2, true, Boolean.valueOf(this.isOnline[0])), -1275068417, this.currentExpandAnimatorValue));
        }
        ShowDrawable showDrawable = this.showStatusButton;
        if (showDrawable != null) {
            showDrawable.setBackgroundColor(ColorUtils.blendARGB(Theme.multAlpha(Theme.adaptHSV(this.actionBarBackgroundColor, 0.18f, -0.1f), 0.5f), 603979775, this.currentExpandAnimatorValue));
        }
        ActionBar actionBar = ((BaseFragment) this).actionBar;
        if (actionBar != null) {
            actionBar.setItemsBackgroundColor(this.peerColor != null ? 553648127 : getThemedColor(Theme.key_avatar_actionBarSelectorBlue), false);
            ((BaseFragment) this).actionBar.setItemsColor(ColorUtils.blendARGB(this.peerColor != null ? -1 : getThemedColor(Theme.key_actionBarDefaultIcon), AvatarDrawable.getIconColorForId((this.userId != 0 || (ChatObject.isChannel(this.chatId, ((BaseFragment) this).currentAccount) && !this.currentChat.megagroup)) ? 5L : this.chatId, this.resourcesProvider), this.avatarAnimationProgress), false);
        }
        if (this.verifiedDrawable[1] != null) {
            MessagesController.PeerColor peerColor = this.peerColor;
            if (peerColor != null) {
                themedColor = Theme.adaptHSV(ColorUtils.blendARGB(peerColor.getColor2(), this.peerColor.hasColor6(Theme.isCurrentThemeDark()) ? this.peerColor.getColor5() : this.peerColor.getColor3(), 0.4f), 0.1f, Theme.isCurrentThemeDark() ? -0.1f : -0.08f);
            } else {
                themedColor = getThemedColor(Theme.key_profile_verifiedBackground);
            }
            this.verifiedDrawable[1].setColorFilter(AndroidUtilities.getOffsetColor(themedColor, getThemedColor(Theme.key_player_actionBarTitle), this.mediaHeaderAnimationProgress, 1.0f), PorterDuff.Mode.MULTIPLY);
        }
        if (this.verifiedCheckDrawable[1] != null) {
            this.verifiedCheckDrawable[1].setColorFilter(AndroidUtilities.getOffsetColor(this.peerColor != null ? -1 : applyPeerColor(getThemedColor(Theme.key_profile_verifiedCheck)), getThemedColor(Theme.key_windowBackgroundWhite), this.mediaHeaderAnimationProgress, 1.0f), PorterDuff.Mode.MULTIPLY);
        }
        SimpleTextView[] simpleTextViewArr2 = this.nameTextView;
        if (simpleTextViewArr2[1] != null) {
            simpleTextViewArr2[1].setTextColor(ColorUtils.blendARGB(this.peerColor != null ? -1 : getThemedColor(Theme.key_profile_title), -1, this.currentExpandAnimatorValue));
        }
        AutoDeletePopupWrapper autoDeletePopupWrapper = this.autoDeletePopupWrapper;
        if (autoDeletePopupWrapper != null && (textView = autoDeletePopupWrapper.textView) != null) {
            textView.invalidate();
        }
        AndroidUtilities.forEachViews(this.listView, new com.google.android.exoplayer2.util.Consumer() {
            public final void accept(Object obj) {
                ProfileActivity.this.lambda$updatedPeerColor$79((View) obj);
            }
        });
        SharedMediaLayout sharedMediaLayout = this.sharedMediaLayout;
        if (sharedMediaLayout != null && (scrollSlidingTextTabStripInner = sharedMediaLayout.scrollSlidingTextTabStrip) != null) {
            scrollSlidingTextTabStripInner.updateColors();
        }
        writeButtonSetBackground();
        updateEmojiStatusDrawableColor();
    }

    public void lambda$updatedPeerColor$79(View view) {
        if (view instanceof HeaderCell) {
            ((HeaderCell) view).setTextColor(applyPeerColor(getThemedColor(Theme.key_windowBackgroundWhiteBlueHeader), false));
            return;
        }
        if (view instanceof TextDetailCell) {
            ((TextDetailCell) view).updateColors();
            return;
        }
        if (view instanceof TextCell) {
            ((TextCell) view).updateColors();
            return;
        }
        if (view instanceof AboutLinkCell) {
            ((AboutLinkCell) view).updateColors();
            return;
        }
        if (view instanceof NotificationsCheckCell) {
            ((NotificationsCheckCell) view).getCheckBox().invalidate();
        } else if (view instanceof ProfileHoursCell) {
            ((ProfileHoursCell) view).updateColors();
        } else if (view instanceof ProfileChannelCell) {
            ((ProfileChannelCell) view).updateColors();
        }
    }

    public final int applyPeerColor(int color) {
        return applyPeerColor(color, true, null);
    }

    public final int applyPeerColor(int color, boolean actionBar) {
        return applyPeerColor(color, actionBar, null);
    }

    public final int applyPeerColor(int color, boolean actionBar, Boolean online) {
        if ((!actionBar && isSettings()) || this.peerColor == null) {
            return color;
        }
        if (!actionBar) {
            int indexOfKey = this.adaptedColors.indexOfKey(color);
            if (indexOfKey < 0) {
                int adapt = OKLCH.adapt(color, Theme.adaptHSV(this.peerColor.getBgColor1(Theme.isCurrentThemeDark()), Theme.isCurrentThemeDark() ? 0.0f : 0.05f, Theme.isCurrentThemeDark() ? -0.1f : -0.04f));
                this.adaptedColors.put(color, adapt);
                return adapt;
            }
            return this.adaptedColors.valueAt(indexOfKey);
        }
        int themedColor = getThemedColor(actionBar ? Theme.key_actionBarDefault : Theme.key_windowBackgroundWhiteBlueIcon);
        int blendARGB = ColorUtils.blendARGB(this.peerColor.getStoryColor1(Theme.isCurrentThemeDark()), this.peerColor.getStoryColor2(Theme.isCurrentThemeDark()), 0.5f);
        int bgColor1 = actionBar ? blendARGB : this.peerColor.getBgColor1(Theme.isCurrentThemeDark());
        if (!Theme.hasHue(themedColor)) {
            return (online == null || online.booleanValue()) ? blendARGB : Theme.adaptHSV(Theme.multAlpha(blendARGB, 0.7f), -0.2f, 0.2f);
        }
        boolean isCurrentThemeDark = Theme.isCurrentThemeDark();
        if (online != null && !online.booleanValue()) {
            blendARGB = Theme.multAlpha(blendARGB, 0.7f);
        }
        return Theme.changeColorAccent(themedColor, bgColor1, color, isCurrentThemeDark, blendARGB);
    }

    public final int applyPeerColor2(int color) {
        MessagesController.PeerColor peerColor = this.peerColor;
        if (peerColor == null) {
            return color;
        }
        int bgColor2 = peerColor.getBgColor2(Theme.isCurrentThemeDark());
        return Theme.changeColorAccent(getThemedColor(Theme.key_windowBackgroundWhiteBlueIcon), bgColor2, color, Theme.isCurrentThemeDark(), bgColor2);
    }

    public final void createActionBarMenu(boolean r16) {
        throw new UnsupportedOperationException("Method not decompiled: org.telegram.ui.ProfileActivity.createActionBarMenu(boolean):void");
    }

    public final void createAutoDeleteItem(Context context) {
        int i;
        this.autoDeletePopupWrapper = new AutoDeletePopupWrapper(context, this.otherItem.getPopupLayout().getSwipeBack(), new AutoDeletePopupWrapper.Callback() {
            public void dismiss() {
                ProfileActivity.this.otherItem.toggleSubMenu();
            }

            public void setAutoDeleteHistory(int time, int action) {
                ProfileActivity.this.setAutoDeleteHistory(time, action);
            }

            public void showGlobalAutoDeleteScreen() {
                ProfileActivity.this.presentFragment(new AutoDeleteMessagesActivity());
                dismiss();
            }
        }, false, 0, this.resourcesProvider);
        if (this.dialogId > 0 || this.userId > 0) {
            this.autoDeletePopupWrapper.allowExtendedHint(applyPeerColor(getThemedColor(Theme.key_windowBackgroundWhiteBlueText), false));
        }
        TLRPC.UserFull userFull = this.userInfo;
        if (userFull == null && this.chatInfo == null) {
            i = 0;
        } else {
            i = userFull != null ? userFull.ttl_period : this.chatInfo.ttl_period;
        }
        Drawable ttlIcon = TimerDrawable.getTtlIcon(i);
        this.autoDeleteItemDrawable = ttlIcon;
        this.autoDeleteItem = this.otherItem.addSwipeBackItem(0, ttlIcon, LocaleController.getString("AutoDeletePopupTitle", R.string.AutoDeletePopupTitle), this.autoDeletePopupWrapper.windowLayout);
        this.otherItem.addColoredGap();
        updateAutoDeleteItem();
    }

    public Theme.ResourcesProvider getResourceProvider() {
        return this.resourcesProvider;
    }

    public int getThemedColor(int key) {
        return Theme.getColor(key, this.resourcesProvider);
    }

    public Drawable getThemedDrawable(String drawableKey) {
        Theme.ResourcesProvider resourcesProvider = this.resourcesProvider;
        Drawable drawable = resourcesProvider != null ? resourcesProvider.getDrawable(drawableKey) : null;
        return drawable != null ? drawable : super.getThemedDrawable(drawableKey);
    }

    public final void setAutoDeleteHistory(int time, int action) {
        long dialogId = getDialogId();
        getMessagesController().setDialogHistoryTTL(dialogId, time);
        if (this.userInfo == null && this.chatInfo == null) {
            return;
        }
        UndoView undoView = this.undoView;
        TLRPC.User user = getMessagesController().getUser(Long.valueOf(dialogId));
        TLRPC.UserFull userFull = this.userInfo;
        undoView.showWithAction(dialogId, action, user, Integer.valueOf(userFull != null ? userFull.ttl_period : this.chatInfo.ttl_period), (Runnable) null, (Runnable) null);
    }

    public void onDialogDismiss(Dialog dialog) {
        RecyclerListView recyclerListView = this.listView;
        if (recyclerListView != null) {
            recyclerListView.invalidateViews();
        }
    }

    @Override
    public boolean didSelectDialogs(DialogsActivity fragment, ArrayList<MessagesStorage.TopicKey> dids, CharSequence message, boolean param, TopicsFragment topicsFragment) {
        long j = dids.get(0).dialogId;
        Bundle bundle = new Bundle();
        bundle.putBoolean("scrollToTopOnResume", true);
        if (DialogObject.isEncryptedDialog(j)) {
            bundle.putInt("enc_id", DialogObject.getEncryptedChatId(j));
        } else if (DialogObject.isUserDialog(j)) {
            bundle.putLong("user_id", j);
        } else if (DialogObject.isChatDialog(j)) {
            bundle.putLong("chat_id", -j);
        }
        if (!getMessagesController().checkCanOpenChat(bundle, fragment)) {
            return false;
        }
        NotificationCenter notificationCenter = getNotificationCenter();
        int i = NotificationCenter.closeChats;
        notificationCenter.removeObserver(this, i);
        getNotificationCenter().postNotificationName(i, new Object[0]);
        presentFragment(new ChatActivity(bundle), true);
        removeSelfFromStack();
        getSendMessagesHelper().sendMessage(SendMessagesHelper.SendMessageParams.of(getMessagesController().getUser(Long.valueOf(this.userId)), j, (MessageObject) null, (MessageObject) null, (TLRPC.ReplyMarkup) null, (HashMap) null, true, 0));
        if (!TextUtils.isEmpty(message)) {
            SendMessagesHelper.prepareSendingText(AccountInstance.getInstance(((BaseFragment) this).currentAccount), message.toString(), j, true, 0, 0L);
        }
        return true;
    }

    public void onRequestPermissionsResultFragment(int requestCode, String[] permissions, int[] grantResults) {
        boolean z;
        boolean z2;
        ImageUpdater imageUpdater = this.imageUpdater;
        if (imageUpdater != null) {
            imageUpdater.onRequestPermissionsResultFragment(requestCode, permissions, grantResults);
        }
        if (requestCode == 101 || requestCode == 102) {
            TLRPC.User user = getMessagesController().getUser(Long.valueOf(this.userId));
            if (user == null) {
                return;
            }
            int i = 0;
            while (true) {
                if (i >= grantResults.length) {
                    z = true;
                    break;
                } else {
                    if (grantResults[i] != 0) {
                        z = false;
                        break;
                    }
                    i++;
                }
            }
            if (grantResults.length > 0 && z) {
                boolean z3 = requestCode == 102;
                TLRPC.UserFull userFull = this.userInfo;
                VoIPHelper.startCall(user, z3, userFull != null && userFull.video_calls_available, getParentActivity(), this.userInfo, getAccountInstance());
                return;
            }
            VoIPHelper.permissionDenied(getParentActivity(), (Runnable) null, requestCode);
            return;
        }
        if (requestCode != 103 || this.currentChat == null) {
            return;
        }
        int i2 = 0;
        while (true) {
            if (i2 >= grantResults.length) {
                z2 = true;
                break;
            } else {
                if (grantResults[i2] != 0) {
                    z2 = false;
                    break;
                }
                i2++;
            }
        }
        if (grantResults.length > 0 && z2) {
            VoIPHelper.startCall(this.currentChat, (TLRPC.InputPeer) null, (String) null, getMessagesController().getGroupCall(this.chatId, false) == null, getParentActivity(), this, getAccountInstance());
        } else {
            VoIPHelper.permissionDenied(getParentActivity(), (Runnable) null, requestCode);
        }
    }

    public void dismissCurrentDialog() {
        ImageUpdater imageUpdater = this.imageUpdater;
        if (imageUpdater == null || !imageUpdater.dismissCurrentDialog(((BaseFragment) this).visibleDialog)) {
            super.dismissCurrentDialog();
        }
    }

    public boolean dismissDialogOnPause(Dialog dialog) {
        ImageUpdater imageUpdater = this.imageUpdater;
        return (imageUpdater == null || imageUpdater.dismissDialogOnPause(dialog)) && super.dismissDialogOnPause(dialog);
    }

    public final Animator searchExpandTransition(final boolean enter) {
        if (enter) {
            AndroidUtilities.requestAdjustResize(getParentActivity(), ((BaseFragment) this).classGuid);
            AndroidUtilities.setAdjustResizeToNothing(getParentActivity(), ((BaseFragment) this).classGuid);
        }
        Animator animator = this.searchViewTransition;
        if (animator != null) {
            animator.removeAllListeners();
            this.searchViewTransition.cancel();
        }
        float[] fArr = new float[2];
        fArr[0] = this.searchTransitionProgress;
        fArr[1] = enter ? 0.0f : 1.0f;
        final ValueAnimator ofFloat = ValueAnimator.ofFloat(fArr);
        final float f = this.extraHeight;
        this.searchListView.setTranslationY(f);
        this.searchListView.setVisibility(0);
        this.searchItem.setVisibility(0);
        this.listView.setVisibility(0);
        needLayout(true);
        this.avatarContainer.setVisibility(0);
        this.nameTextView[1].setVisibility(0);
        this.onlineTextView[1].setVisibility(0);
        this.onlineTextView[3].setVisibility(0);
        ((BaseFragment) this).actionBar.onSearchFieldVisibilityChanged(this.searchTransitionProgress > 0.5f);
        int i = this.searchTransitionProgress > 0.5f ? 0 : 8;
        ActionBarMenuItem actionBarMenuItem = this.otherItem;
        if (actionBarMenuItem != null) {
            actionBarMenuItem.setVisibility(i);
        }
        if (this.qrItem != null) {
            updateQrItemVisibility(false);
        }
        this.searchItem.setVisibility(i);
        this.searchItem.getSearchContainer().setVisibility(this.searchTransitionProgress <= 0.5f ? 0 : 8);
        this.searchListView.setEmptyView(this.emptyView);
        this.avatarContainer.setClickable(false);
        ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public final void onAnimationUpdate(ValueAnimator valueAnimator) {
                ProfileActivity.this.lambda$searchExpandTransition$80(ofFloat, f, enter, valueAnimator);
            }
        });
        ofFloat.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                ProfileActivity.this.updateSearchViewState(enter);
                ProfileActivity.this.avatarContainer.setClickable(true);
                if (enter) {
                    ProfileActivity.this.searchItem.requestFocusOnSearchView();
                }
                ProfileActivity.this.needLayout(true);
                ProfileActivity.this.searchViewTransition = null;
                ((BaseFragment) ProfileActivity.this).fragmentView.invalidate();
                if (enter) {
                    ProfileActivity.this.invalidateScroll = true;
                    ProfileActivity.this.saveScrollPosition();
                    AndroidUtilities.requestAdjustResize(ProfileActivity.this.getParentActivity(), ((BaseFragment) ProfileActivity.this).classGuid);
                    ProfileActivity.this.emptyView.setPreventMoving(false);
                }
            }
        });
        if (!enter) {
            this.invalidateScroll = true;
            saveScrollPosition();
            AndroidUtilities.requestAdjustNothing(getParentActivity(), ((BaseFragment) this).classGuid);
            this.emptyView.setPreventMoving(true);
        }
        ofFloat.setDuration(220L);
        ofFloat.setInterpolator(CubicBezierInterpolator.DEFAULT);
        this.searchViewTransition = ofFloat;
        return ofFloat;
    }

    public void lambda$searchExpandTransition$80(ValueAnimator valueAnimator, float f, boolean z, ValueAnimator valueAnimator2) {
        float floatValue = ((Float) valueAnimator.getAnimatedValue()).floatValue();
        this.searchTransitionProgress = floatValue;
        float f2 = (floatValue - 0.5f) / 0.5f;
        float f3 = (0.5f - floatValue) / 0.5f;
        if (f2 < 0.0f) {
            f2 = 0.0f;
        }
        if (f3 < 0.0f) {
            f3 = 0.0f;
        }
        float f4 = -f;
        this.searchTransitionOffset = (int) ((1.0f - floatValue) * f4);
        this.searchListView.setTranslationY(floatValue * f);
        this.emptyView.setTranslationY(f * this.searchTransitionProgress);
        this.listView.setTranslationY(f4 * (1.0f - this.searchTransitionProgress));
        this.listView.setScaleX(1.0f - ((1.0f - this.searchTransitionProgress) * 0.01f));
        this.listView.setScaleY(1.0f - ((1.0f - this.searchTransitionProgress) * 0.01f));
        this.listView.setAlpha(this.searchTransitionProgress);
        needLayout(true);
        this.listView.setAlpha(f2);
        this.searchListView.setAlpha(1.0f - this.searchTransitionProgress);
        this.searchListView.setScaleX((this.searchTransitionProgress * 0.05f) + 1.0f);
        this.searchListView.setScaleY((this.searchTransitionProgress * 0.05f) + 1.0f);
        this.emptyView.setAlpha(1.0f - f2);
        this.avatarContainer.setAlpha(f2);
        ProfileStoriesView profileStoriesView = this.storyView;
        if (profileStoriesView != null) {
            profileStoriesView.setAlpha(f2);
        }
        this.nameTextView[1].setAlpha(f2);
        this.onlineTextView[1].setAlpha(f2);
        this.onlineTextView[3].setAlpha(f2);
        this.searchItem.getSearchField().setAlpha(f3);
        if (z && this.searchTransitionProgress < 0.7f) {
            this.searchItem.requestFocusOnSearchView();
        }
        this.searchItem.getSearchContainer().setVisibility(this.searchTransitionProgress < 0.5f ? 0 : 8);
        int i = this.searchTransitionProgress > 0.5f ? 0 : 8;
        ActionBarMenuItem actionBarMenuItem = this.otherItem;
        if (actionBarMenuItem != null) {
            actionBarMenuItem.setVisibility(i);
            this.otherItem.setAlpha(f2);
        }
        ActionBarMenuItem actionBarMenuItem2 = this.qrItem;
        if (actionBarMenuItem2 != null) {
            actionBarMenuItem2.setAlpha(f2);
            updateQrItemVisibility(false);
        }
        this.searchItem.setVisibility(i);
        ((BaseFragment) this).actionBar.onSearchFieldVisibilityChanged(this.searchTransitionProgress < 0.5f);
        ActionBarMenuItem actionBarMenuItem3 = this.otherItem;
        if (actionBarMenuItem3 != null) {
            actionBarMenuItem3.setAlpha(f2);
        }
        ActionBarMenuItem actionBarMenuItem4 = this.qrItem;
        if (actionBarMenuItem4 != null) {
            actionBarMenuItem4.setAlpha(f2);
        }
        this.searchItem.setAlpha(f2);
        this.topView.invalidate();
        ((BaseFragment) this).fragmentView.invalidate();
    }

    public final void updateSearchViewState(boolean enter) {
        int i = enter ? 8 : 0;
        this.listView.setVisibility(i);
        this.searchListView.setVisibility(enter ? 0 : 8);
        this.searchItem.getSearchContainer().setVisibility(enter ? 0 : 8);
        ((BaseFragment) this).actionBar.onSearchFieldVisibilityChanged(enter);
        this.avatarContainer.setVisibility(i);
        ProfileStoriesView profileStoriesView = this.storyView;
        if (profileStoriesView != null) {
            profileStoriesView.setVisibility(i);
        }
        this.nameTextView[1].setVisibility(i);
        this.onlineTextView[1].setVisibility(i);
        this.onlineTextView[3].setVisibility(i);
        ActionBarMenuItem actionBarMenuItem = this.otherItem;
        if (actionBarMenuItem != null) {
            actionBarMenuItem.setAlpha(1.0f);
            this.otherItem.setVisibility(i);
        }
        ActionBarMenuItem actionBarMenuItem2 = this.qrItem;
        if (actionBarMenuItem2 != null) {
            actionBarMenuItem2.setAlpha(1.0f);
            this.qrItem.setVisibility((enter || !isQrNeedVisible()) ? 8 : 0);
        }
        this.searchItem.setVisibility(i);
        this.avatarContainer.setAlpha(1.0f);
        ProfileStoriesView profileStoriesView2 = this.storyView;
        if (profileStoriesView2 != null) {
            profileStoriesView2.setAlpha(1.0f);
        }
        this.nameTextView[1].setAlpha(1.0f);
        this.onlineTextView[1].setAlpha(1.0f);
        this.searchItem.setAlpha(1.0f);
        this.listView.setAlpha(1.0f);
        this.searchListView.setAlpha(1.0f);
        this.emptyView.setAlpha(1.0f);
        if (enter) {
            this.searchListView.setEmptyView(this.emptyView);
        } else {
            this.emptyView.setVisibility(8);
        }
    }

    public void onUploadProgressChanged(float progress) {
        RadialProgressView radialProgressView = this.avatarProgressView;
        if (radialProgressView == null) {
            return;
        }
        radialProgressView.setProgress(progress);
        this.avatarsViewPager.setUploadProgress(this.uploadingImageLocation, progress);
    }

    public void didStartUpload(boolean isVideo) {
        RadialProgressView radialProgressView = this.avatarProgressView;
        if (radialProgressView == null) {
            return;
        }
        radialProgressView.setProgress(0.0f);
    }

    public void didUploadPhoto(final TLRPC.InputFile photo, final TLRPC.InputFile video, final double videoStartTimestamp, final String videoPath, final TLRPC.PhotoSize bigSize, final TLRPC.PhotoSize smallSize, boolean isVideo, final TLRPC.VideoSize emojiMarkup) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$didUploadPhoto$83(photo, video, emojiMarkup, videoStartTimestamp, videoPath, smallSize, bigSize);
            }
        });
    }

    public void lambda$didUploadPhoto$82(final String str, final TLObject tLObject, final TLRPC.TL_error tL_error) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$didUploadPhoto$81(tL_error, tLObject, str);
            }
        });
    }

    public void lambda$didUploadPhoto$81(TLRPC.TL_error tL_error, TLObject tLObject, String str) {
        if (tL_error == null) {
            TLRPC.User user = getMessagesController().getUser(Long.valueOf(getUserConfig().getClientUserId()));
            if (user == null) {
                user = getUserConfig().getCurrentUser();
                if (user == null) {
                    return;
                } else {
                    getMessagesController().putUser(user, false);
                }
            } else {
                getUserConfig().setCurrentUser(user);
            }
            TLRPC.TL_photos_photo tL_photos_photo = (TLRPC.TL_photos_photo) tLObject;
            ArrayList arrayList = tL_photos_photo.photo.sizes;
            TLRPC.PhotoSize closestPhotoSizeWithSize = FileLoader.getClosestPhotoSizeWithSize(arrayList, 150);
            TLRPC.PhotoSize closestPhotoSizeWithSize2 = FileLoader.getClosestPhotoSizeWithSize(arrayList, 800);
            TLObject closestVideoSizeWithSize = tL_photos_photo.photo.video_sizes.isEmpty() ? null : FileLoader.getClosestVideoSizeWithSize(tL_photos_photo.photo.video_sizes, 1000);
            TLRPC.TL_userProfilePhoto tL_userProfilePhoto = new TLRPC.TL_userProfilePhoto();
            user.photo = tL_userProfilePhoto;
            ((TLRPC.UserProfilePhoto) tL_userProfilePhoto).photo_id = tL_photos_photo.photo.id;
            if (closestPhotoSizeWithSize != null) {
                ((TLRPC.UserProfilePhoto) tL_userProfilePhoto).photo_small = closestPhotoSizeWithSize.location;
            }
            if (closestPhotoSizeWithSize2 != null) {
                ((TLRPC.UserProfilePhoto) tL_userProfilePhoto).photo_big = closestPhotoSizeWithSize2.location;
            }
            if (closestPhotoSizeWithSize != null && this.avatar != null) {
                FileLoader.getInstance(((BaseFragment) this).currentAccount).getPathToAttach(this.avatar, true).renameTo(FileLoader.getInstance(((BaseFragment) this).currentAccount).getPathToAttach(closestPhotoSizeWithSize, true));
                ImageLoader.getInstance().replaceImageInCache(this.avatar.volume_id + "_" + this.avatar.local_id + "@50_50", closestPhotoSizeWithSize.location.volume_id + "_" + closestPhotoSizeWithSize.location.local_id + "@50_50", ImageLocation.getForUserOrChat(user, 1), false);
            }
            if (closestVideoSizeWithSize != null && str != null) {
                new File(str).renameTo(FileLoader.getInstance(((BaseFragment) this).currentAccount).getPathToAttach(closestVideoSizeWithSize, "mp4", true));
            } else if (closestPhotoSizeWithSize2 != null && this.avatarBig != null) {
                FileLoader.getInstance(((BaseFragment) this).currentAccount).getPathToAttach(this.avatarBig, true).renameTo(FileLoader.getInstance(((BaseFragment) this).currentAccount).getPathToAttach(closestPhotoSizeWithSize2, true));
            }
            getMessagesController().getDialogPhotos(user.id).addPhotoAtStart(tL_photos_photo.photo);
            ArrayList arrayList2 = new ArrayList();
            arrayList2.add(user);
            getMessagesStorage().putUsersAndChats(arrayList2, (List) null, false, true);
            TLRPC.UserFull userFull = getMessagesController().getUserFull(this.userId);
            if (userFull != null) {
                userFull.profile_photo = tL_photos_photo.photo;
                getMessagesStorage().updateUserInfo(userFull, false);
            }
        }
        this.allowPullingDown = (AndroidUtilities.isTablet() || this.isInLandscapeMode || !this.avatarImage.getImageReceiver().hasNotThumb() || AndroidUtilities.isAccessibilityScreenReaderEnabled()) ? false : true;
        this.avatar = null;
        this.avatarBig = null;
        ProfileGalleryView profileGalleryView = this.avatarsViewPager;
        profileGalleryView.scrolledByUser = true;
        profileGalleryView.removeUploadingImage(this.uploadingImageLocation);
        this.avatarsViewPager.setCreateThumbFromParent(false);
        updateProfileData(true);
        showAvatarProgress(false, true);
        getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(MessagesController.UPDATE_MASK_ALL)});
        getNotificationCenter().postNotificationName(NotificationCenter.mainUserInfoChanged, new Object[0]);
        getUserConfig().saveConfig(true);
    }

    public void lambda$didUploadPhoto$83(TLRPC.InputFile inputFile, TLRPC.InputFile inputFile2, TLRPC.VideoSize videoSize, double d, final String str, TLRPC.PhotoSize photoSize, TLRPC.PhotoSize photoSize2) {
        if (inputFile != null || inputFile2 != null || videoSize != null) {
            if (this.avatar == null) {
                return;
            }
            TLRPC.TL_photos_uploadProfilePhoto tL_photos_uploadProfilePhoto = new TLRPC.TL_photos_uploadProfilePhoto();
            if (inputFile != null) {
                tL_photos_uploadProfilePhoto.file = inputFile;
                tL_photos_uploadProfilePhoto.flags |= 1;
            }
            if (inputFile2 != null) {
                tL_photos_uploadProfilePhoto.video = inputFile2;
                int i = tL_photos_uploadProfilePhoto.flags | 2;
                tL_photos_uploadProfilePhoto.flags = i;
                tL_photos_uploadProfilePhoto.video_start_ts = d;
                tL_photos_uploadProfilePhoto.flags = i | 4;
            }
            if (videoSize != null) {
                tL_photos_uploadProfilePhoto.video_emoji_markup = videoSize;
                tL_photos_uploadProfilePhoto.flags |= 16;
            }
            this.avatarUploadingRequest = getConnectionsManager().sendRequest(tL_photos_uploadProfilePhoto, new RequestDelegate() {
                public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                    ProfileActivity.this.lambda$didUploadPhoto$82(str, tLObject, tL_error);
                }
            });
        } else {
            TLRPC.FileLocation fileLocation = photoSize.location;
            this.avatar = fileLocation;
            this.avatarBig = photoSize2.location;
            this.avatarImage.setImage(ImageLocation.getForLocal(fileLocation), "50_50", this.avatarDrawable, (Object) null);
            if (this.setAvatarRow != -1) {
                updateRowsIds();
                ListAdapter listAdapter = this.listAdapter;
                if (listAdapter != null) {
                    listAdapter.notifyDataSetChanged();
                }
                needLayout(true);
            }
            ProfileGalleryView profileGalleryView = this.avatarsViewPager;
            ImageLocation forLocal = ImageLocation.getForLocal(this.avatarBig);
            this.uploadingImageLocation = forLocal;
            profileGalleryView.addUploadingImage(forLocal, ImageLocation.getForLocal(this.avatar));
            showAvatarProgress(true, false);
        }
        ((BaseFragment) this).actionBar.createMenu().requestLayout();
    }

    public final void showAvatarProgress(final boolean show, boolean animated) {
        if (this.avatarProgressView == null) {
            return;
        }
        AnimatorSet animatorSet = this.avatarAnimation;
        if (animatorSet != null) {
            animatorSet.cancel();
            this.avatarAnimation = null;
        }
        if (!animated) {
            if (show) {
                this.avatarProgressView.setAlpha(1.0f);
                this.avatarProgressView.setVisibility(0);
                return;
            } else {
                this.avatarProgressView.setAlpha(0.0f);
                this.avatarProgressView.setVisibility(4);
                return;
            }
        }
        AnimatorSet animatorSet2 = new AnimatorSet();
        this.avatarAnimation = animatorSet2;
        if (show) {
            this.avatarProgressView.setVisibility(0);
            this.avatarAnimation.playTogether(ObjectAnimator.ofFloat(this.avatarProgressView, (Property<RadialProgressView, Float>) View.ALPHA, 1.0f));
        } else {
            animatorSet2.playTogether(ObjectAnimator.ofFloat(this.avatarProgressView, (Property<RadialProgressView, Float>) View.ALPHA, 0.0f));
        }
        this.avatarAnimation.setDuration(180L);
        this.avatarAnimation.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                if (ProfileActivity.this.avatarAnimation == null || ProfileActivity.this.avatarProgressView == null) {
                    return;
                }
                if (!show) {
                    ProfileActivity.this.avatarProgressView.setVisibility(4);
                }
                ProfileActivity.this.avatarAnimation = null;
            }

            @Override
            public void onAnimationCancel(Animator animation) {
                ProfileActivity.this.avatarAnimation = null;
            }
        });
        this.avatarAnimation.start();
    }

    public void onActivityResultFragment(int requestCode, int resultCode, Intent data) {
        ImageUpdater imageUpdater = this.imageUpdater;
        if (imageUpdater != null) {
            imageUpdater.onActivityResult(requestCode, resultCode, data);
        }
    }

    public void saveSelfArgs(Bundle args) {
        String str;
        ImageUpdater imageUpdater = this.imageUpdater;
        if (imageUpdater == null || (str = imageUpdater.currentPicturePath) == null) {
            return;
        }
        args.putString("path", str);
    }

    public void restoreSelfArgs(Bundle args) {
        ImageUpdater imageUpdater = this.imageUpdater;
        if (imageUpdater != null) {
            imageUpdater.currentPicturePath = args.getString("path");
        }
    }

    public static void sendLogs(final Activity activity, final boolean last) {
        if (activity == null) {
            return;
        }
        final AlertDialog alertDialog = new AlertDialog(activity, 3);
        alertDialog.setCanCancel(false);
        alertDialog.show();
        Utilities.globalQueue.postRunnable(new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.lambda$sendLogs$85(AlertDialog.this, last, activity);
            }
        });
    }

    public static void lambda$sendLogs$85(final org.telegram.ui.ActionBar.AlertDialog r20, boolean r21, final android.app.Activity r22) {
        throw new UnsupportedOperationException("Method not decompiled: org.telegram.ui.ProfileActivity.lambda$sendLogs$85(org.telegram.ui.ActionBar.AlertDialog, boolean, android.app.Activity):void");
    }

    public static void lambda$sendLogs$84(AlertDialog alertDialog, boolean[] zArr, Activity activity, File file) {
        Uri fromFile;
        try {
            alertDialog.dismiss();
        } catch (Exception unused) {
        }
        if (!zArr[0]) {
            if (activity != null) {
                Toast.makeText(activity, LocaleController.getString("ErrorOccurred", R.string.ErrorOccurred), 0).show();
                return;
            }
            return;
        }
        int i = Build.VERSION.SDK_INT;
        if (i >= 24) {
            fromFile = FileProvider.getUriForFile(activity, ApplicationLoader.getApplicationId() + ".provider", file);
        } else {
            fromFile = Uri.fromFile(file);
        }
        Intent intent = new Intent("android.intent.action.SEND");
        if (i >= 24) {
            intent.addFlags(1);
        }
        intent.setType("message/rfc822");
        intent.putExtra("android.intent.extra.EMAIL", "");
        intent.putExtra("android.intent.extra.SUBJECT", "Logs from " + LocaleController.getInstance().formatterStats.format(System.currentTimeMillis()));
        intent.putExtra("android.intent.extra.STREAM", fromFile);
        if (activity != null) {
            try {
                activity.startActivityForResult(Intent.createChooser(intent, "Select email application."), 500);
            } catch (Exception e) {
                FileLog.e(e);
            }
        }
    }

    public class ListAdapter extends RecyclerListView.SelectionAdapter {
        public Context mContext;
        public final HashMap<TLRPC.TL_username, ClickableSpan> usernameSpans = new HashMap<>();

        public ListAdapter(Context context) {
            this.mContext = context;
        }

        public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            SharedMediaLayout headerCell;
            switch (viewType) {
                case 1:
                    headerCell = new HeaderCell(this.mContext, 23, ProfileActivity.this.resourcesProvider);
                    headerCell.setBackgroundColor(Theme.usePlusTheme ? Theme.profileRowColor : ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite));
                    break;
                case 2:
                case 19:
                    headerCell = new TextDetailCell(this.mContext, ProfileActivity.this.resourcesProvider, viewType == 19) {
                        @Override
                        public int processColor(int color) {
                            return ProfileActivity.this.applyPeerColor(color, false);
                        }
                    };
                    headerCell.setContentDescriptionValueFirst(true);
                    headerCell.setBackgroundColor(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite));
                    if (Theme.usePlusTheme) {
                        headerCell.setTextColor(Theme.profileRowTitleColor);
                        headerCell.setValueColor(Theme.profileRowStatusColor);
                        headerCell.setBackgroundColor(Theme.profileRowColor);
                        break;
                    }
                    break;
                case 3:
                    ProfileActivity profileActivity = ProfileActivity.this;
                    Context context = this.mContext;
                    ProfileActivity profileActivity2 = ProfileActivity.this;
                    SharedMediaLayout sharedMediaLayout = new AboutLinkCell(context, profileActivity2, profileActivity2.resourcesProvider) {
                        @Override
                        public void didPressUrl(String url, Browser.Progress progress) {
                            ProfileActivity.this.openUrl(url, progress);
                        }

                        @Override
                        public void didResizeEnd() {
                            ProfileActivity.this.layoutManager.mIgnoreTopPadding = false;
                        }

                        @Override
                        public void didResizeStart() {
                            ProfileActivity.this.layoutManager.mIgnoreTopPadding = true;
                        }

                        @Override
                        public int processColor(int color) {
                            return ProfileActivity.this.applyPeerColor(color, false);
                        }
                    };
                    profileActivity.aboutLinkCell = sharedMediaLayout;
                    sharedMediaLayout.setBackgroundColor(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite));
                    headerCell = sharedMediaLayout;
                    break;
                case 4:
                    headerCell = new TextCell(this.mContext, ProfileActivity.this.resourcesProvider) {
                        @Override
                        public int processColor(int color) {
                            return ProfileActivity.this.applyPeerColor(color, false);
                        }
                    };
                    headerCell.setBackgroundColor(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite));
                    if (Theme.usePlusTheme) {
                        headerCell.setBackgroundColor(Theme.profileRowColor);
                        headerCell.setTextColor(Theme.profileRowTitleColor);
                        break;
                    }
                    break;
                case 5:
                    headerCell = new DividerCell(this.mContext, ProfileActivity.this.resourcesProvider);
                    headerCell.setBackgroundColor(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite));
                    headerCell.setPadding(AndroidUtilities.dp(20.0f), AndroidUtilities.dp(4.0f), 0, 0);
                    if (Theme.usePlusTheme) {
                        headerCell.setBackgroundColor(0);
                        break;
                    }
                    break;
                case 6:
                    headerCell = new NotificationsCheckCell(this.mContext, 23, 70, false, ProfileActivity.this.resourcesProvider) {
                        @Override
                        public int processColor(int color) {
                            return ProfileActivity.this.applyPeerColor(color, false);
                        }
                    };
                    headerCell.setBackgroundColor(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite));
                    break;
                case 7:
                    headerCell = new ShadowSectionCell(this.mContext, ProfileActivity.this.resourcesProvider);
                    if (Theme.usePlusTheme && (Theme.profileRowColor != -1 || Theme.profileRowGradientList > 0)) {
                        headerCell.setBackgroundColor(0);
                        break;
                    }
                    break;
                case 8:
                    headerCell = new UserCell(this.mContext, ProfileActivity.this.addMemberRow == -1 ? 9 : 6, 0, true, ProfileActivity.this.resourcesProvider);
                    headerCell.setBackgroundColor(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite));
                    if (Theme.usePlusTheme) {
                        headerCell.setBackgroundColor(Theme.profileRowColor);
                        headerCell.setTag("Profile");
                        break;
                    }
                    break;
                case 9:
                case 10:
                case 14:
                case 16:
                default:
                    SharedMediaLayout textInfoPrivacyCell = new TextInfoPrivacyCell(this.mContext, 10, ProfileActivity.this.resourcesProvider);
                    textInfoPrivacyCell.getTextView().setGravity(1);
                    textInfoPrivacyCell.getTextView().setTextColor(Theme.usePlusTheme ? Theme.prefSummaryColor : ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhiteGrayText3));
                    textInfoPrivacyCell.getTextView().setMovementMethod(null);
                    try {
                        PackageInfo packageInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0);
                        int i = packageInfo.versionCode;
                        StringBuilder sb = new StringBuilder();
                        String str = Build.CPU_ABI;
                        sb.append(str);
                        sb.append(" ");
                        String str2 = Build.CPU_ABI2;
                        sb.append(str2);
                        String sb2 = sb.toString();
                        String str3 = "";
                        switch (packageInfo.versionCode % 10) {
                            case 0:
                                if (ApplicationLoader.isStandaloneBuild()) {
                                    str3 = "direct " + str + " " + str2;
                                    break;
                                } else {
                                    str3 = "universal " + str + " " + str2;
                                    break;
                                }
                            case 1:
                                str3 = "direct " + sb2;
                                break;
                            case 2:
                                str3 = "store bundled " + str + " " + str2;
                                break;
                            case 3:
                                str3 = "arm-v7a";
                                break;
                            case 5:
                            case 7:
                                str3 = "PS beta " + sb2;
                                break;
                            case 6:
                                str3 = "x86_64";
                                break;
                            case 8:
                                str3 = "direct beta " + sb2;
                                break;
                            case 9:
                                str3 = "beta " + sb2;
                                break;
                        }
                        textInfoPrivacyCell.setText(LocaleController.formatString("TelegramVersion", R.string.TelegramVersion, new Object[]{String.format(Locale.US, "\nv%s (%d) %s", packageInfo.versionName, Integer.valueOf(i), str3)}));
                    } catch (Exception e) {
                        FileLog.e(e);
                    }
                    textInfoPrivacyCell.getTextView().setPadding(0, AndroidUtilities.dp(14.0f), 0, AndroidUtilities.dp(14.0f));
                    textInfoPrivacyCell.setBackgroundDrawable(Theme.getThemedDrawable(this.mContext, R.drawable.greydivider_bottom, ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundGrayShadow)));
                    headerCell = textInfoPrivacyCell;
                    break;
                case 11:
                    headerCell = new View(this, this.mContext) {
                        @Override
                        public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
                            super.onMeasure(View.MeasureSpec.makeMeasureSpec(View.MeasureSpec.getSize(widthMeasureSpec), 1073741824), View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(32.0f), 1073741824));
                        }
                    };
                    if (Theme.usePlusTheme) {
                        headerCell.setBackgroundColor(Theme.profileRowColor);
                        break;
                    }
                    break;
                case 12:
                    headerCell = new View(this.mContext) {
                        public int lastPaddingHeight = 0;
                        public int lastListViewHeight = 0;

                        @Override
                        public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
                            if (this.lastListViewHeight != ProfileActivity.this.listView.getMeasuredHeight()) {
                                this.lastPaddingHeight = 0;
                            }
                            this.lastListViewHeight = ProfileActivity.this.listView.getMeasuredHeight();
                            int childCount = ProfileActivity.this.listView.getChildCount();
                            if (childCount == ProfileActivity.this.listAdapter.getItemCount()) {
                                int i2 = 0;
                                for (int i3 = 0; i3 < childCount; i3++) {
                                    int childAdapterPosition = ProfileActivity.this.listView.getChildAdapterPosition(ProfileActivity.this.listView.getChildAt(i3));
                                    if (childAdapterPosition >= 0 && childAdapterPosition != ProfileActivity.this.bottomPaddingRow) {
                                        i2 += ProfileActivity.this.listView.getChildAt(i3).getMeasuredHeight();
                                    }
                                }
                                View view = ((BaseFragment) ProfileActivity.this).fragmentView;
                                int measuredHeight = (((view == null ? 0 : view.getMeasuredHeight()) - ActionBar.getCurrentActionBarHeight()) - AndroidUtilities.statusBarHeight) - i2;
                                if (measuredHeight > AndroidUtilities.dp(88.0f)) {
                                    measuredHeight = 0;
                                }
                                int i4 = measuredHeight > 0 ? measuredHeight : 0;
                                int measuredWidth = ProfileActivity.this.listView.getMeasuredWidth();
                                this.lastPaddingHeight = i4;
                                setMeasuredDimension(measuredWidth, i4);
                                return;
                            }
                            setMeasuredDimension(ProfileActivity.this.listView.getMeasuredWidth(), this.lastPaddingHeight);
                        }
                    };
                    headerCell.setBackground(new ColorDrawable(0));
                    break;
                case 13:
                    if (ProfileActivity.this.sharedMediaLayout.getParent() != null) {
                        ((ViewGroup) ProfileActivity.this.sharedMediaLayout.getParent()).removeView(ProfileActivity.this.sharedMediaLayout);
                    }
                    headerCell = ProfileActivity.this.sharedMediaLayout;
                    break;
                case 15:
                    headerCell = new SettingsSuggestionCell(this.mContext, ProfileActivity.this.resourcesProvider) {
                        @Override
                        public void onYesClick(int type) {
                            NotificationCenter notificationCenter = ProfileActivity.this.getNotificationCenter();
                            ProfileActivity profileActivity3 = ProfileActivity.this;
                            int i2 = NotificationCenter.newSuggestionsAvailable;
                            notificationCenter.removeObserver(profileActivity3, i2);
                            if (type == 2) {
                                Browser.openUrl(getContext(), ProfileActivity.this.getMessagesController().premiumManageSubscriptionUrl);
                                ProfileActivity.this.getMessagesController().removeSuggestion(0L, "PREMIUM_GRACE");
                                ProfileActivity.this.updateListAnimated(false);
                            } else {
                                ProfileActivity.this.getMessagesController().removeSuggestion(0L, type == 0 ? "VALIDATE_PHONE_NUMBER" : "VALIDATE_PASSWORD");
                                ProfileActivity.this.updateListAnimated(false);
                            }
                            ProfileActivity.this.getNotificationCenter().addObserver(ProfileActivity.this, i2);
                        }

                        @Override
                        public void onNoClick(int type) {
                            if (type == 0) {
                                ProfileActivity.this.presentFragment(new ActionIntroActivity(3));
                            } else {
                                ProfileActivity.this.presentFragment(new TwoStepVerificationSetupActivity(8, null));
                            }
                        }
                    };
                    break;
                case 17:
                    headerCell = new TextInfoPrivacyCell(this.mContext, ProfileActivity.this.resourcesProvider);
                    headerCell.setBackgroundColor(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite));
                    break;
                case 18:
                case 24:
                    headerCell = new ProfilePremiumCell(this.mContext, viewType == 18 ? 0 : 1, ProfileActivity.this.resourcesProvider);
                    headerCell.setBackgroundColor(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite));
                    break;
                case 20:
                    headerCell = new TextCheckCell(this.mContext, ProfileActivity.this.resourcesProvider);
                    headerCell.setBackgroundColor(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite));
                    break;
                case 21:
                    headerCell = new ProfileLocationCell(this.mContext, ProfileActivity.this.resourcesProvider);
                    headerCell.setBackgroundColor(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite));
                    break;
                case 22:
                    headerCell = new ProfileHoursCell(this.mContext, ProfileActivity.this.resourcesProvider) {
                        @Override
                        public int processColor(int color) {
                            return ProfileActivity.this.applyPeerColor(color, false);
                        }
                    };
                    headerCell.setBackgroundColor(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite));
                    break;
                case 23:
                    headerCell = new ProfileChannelCell(ProfileActivity.this) {
                        @Override
                        public int processColor(int color) {
                            return ProfileActivity.this.applyPeerColor(color, false);
                        }
                    };
                    headerCell.setBackgroundColor(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhite));
                    break;
            }
            if (viewType != 13) {
                if (headerCell == null) {
                    headerCell = new View(this.mContext);
                }
                headerCell.setLayoutParams(new RecyclerView.LayoutParams(-1, -2));
            }
            return new RecyclerListView.Holder(headerCell);
        }

        public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) {
            if (holder.itemView == ProfileActivity.this.sharedMediaLayout) {
                ProfileActivity.this.sharedMediaLayoutAttached = true;
            }
            View view = holder.itemView;
            if (view instanceof TextDetailCell) {
                ((TextDetailCell) view).textView.setLoading(ProfileActivity.this.loadingSpan);
                ((TextDetailCell) holder.itemView).valueTextView.setLoading(ProfileActivity.this.loadingSpan);
            }
        }

        public void onViewDetachedFromWindow(RecyclerView.ViewHolder holder) {
            if (holder.itemView == ProfileActivity.this.sharedMediaLayout) {
                ProfileActivity.this.sharedMediaLayoutAttached = false;
            }
        }

        public void onBindViewHolder(final androidx.recyclerview.widget.RecyclerView.ViewHolder r25, final int r26) {
            throw new UnsupportedOperationException("Method not decompiled: org.telegram.ui.ProfileActivity.ListAdapter.onBindViewHolder(androidx.recyclerview.widget.RecyclerView$ViewHolder, int):void");
        }

        public void lambda$onBindViewHolder$0(RecyclerView.ViewHolder viewHolder, int i) {
            if (viewHolder.getAdapterPosition() == i && ProfileActivity.this.birthdayRow == i && viewHolder.getItemViewType() == 2) {
                onBindViewHolder(viewHolder, i);
            }
        }

        public void lambda$onBindViewHolder$3(int i, AboutLinkCell aboutLinkCell, View view) {
            ProfileActivity.this.processOnClickOrPress(i, aboutLinkCell, aboutLinkCell.getWidth() / 2.0f, (int) (aboutLinkCell.getHeight() * 0.75f));
        }

        public void lambda$onBindViewHolder$4(View view) {
            ProfileActivity.this.hoursShownMine = !r0.hoursShownMine;
            if (!ProfileActivity.this.hoursExpanded) {
                ProfileActivity.this.hoursExpanded = true;
            }
            ProfileActivity.this.saveScrollPosition();
            view.requestLayout();
            ProfileActivity.this.listAdapter.notifyItemChanged(ProfileActivity.this.bizHoursRow);
            ProfileActivity profileActivity = ProfileActivity.this;
            if (profileActivity.savedScrollPosition >= 0) {
                LinearLayoutManager linearLayoutManager = profileActivity.layoutManager;
                ProfileActivity profileActivity2 = ProfileActivity.this;
                linearLayoutManager.scrollToPositionWithOffset(profileActivity2.savedScrollPosition, profileActivity2.savedScrollOffset - profileActivity2.listView.getPaddingTop());
            }
        }

        public final CharSequence alsoUsernamesString(String str, ArrayList<TLRPC.TL_username> arrayList, CharSequence charSequence) {
            if (arrayList == null) {
                return charSequence;
            }
            ArrayList arrayList2 = new ArrayList(arrayList);
            int i = 0;
            while (i < arrayList2.size()) {
                if (!((TLRPC.TL_username) arrayList2.get(i)).active || (str != null && str.equals(((TLRPC.TL_username) arrayList2.get(i)).username))) {
                    arrayList2.remove(i);
                    i--;
                }
                i++;
            }
            CharSequence charSequence2 = charSequence;
            if (arrayList2.size() > 0) {
                SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
                for (int i2 = 0; i2 < arrayList2.size(); i2++) {
                    TLRPC.TL_username tL_username = (TLRPC.TL_username) arrayList2.get(i2);
                    SpannableString spannableString = new SpannableString("@" + tL_username.username);
                    spannableString.setSpan(makeUsernameLinkSpan(tL_username), 0, spannableString.length(), 33);
                    ProfileActivity profileActivity = ProfileActivity.this;
                    spannableString.setSpan(new ForegroundColorSpan(profileActivity.applyPeerColor(profileActivity.getThemedColor(Theme.key_chat_messageLinkIn), false)), 0, spannableString.length(), 33);
                    spannableStringBuilder.append((CharSequence) spannableString);
                    if (i2 < arrayList2.size() - 1) {
                        spannableStringBuilder.append((CharSequence) ", ");
                    }
                }
                String string = LocaleController.getString("UsernameAlso", R.string.UsernameAlso);
                SpannableStringBuilder spannableStringBuilder2 = new SpannableStringBuilder(string);
                int indexOf = string.indexOf("%1$s");
                charSequence2 = spannableStringBuilder2;
                if (indexOf >= 0) {
                    spannableStringBuilder2.replace(indexOf, indexOf + 4, (CharSequence) spannableStringBuilder);
                    charSequence2 = spannableStringBuilder2;
                }
            }
            return charSequence2;
        }

        public ClickableSpan makeUsernameLinkSpan(TLRPC.TL_username usernameObj) {
            ClickableSpan clickableSpan = this.usernameSpans.get(usernameObj);
            if (clickableSpan != null) {
                return clickableSpan;
            }
            AnonymousClass10 anonymousClass10 = new AnonymousClass10(usernameObj, usernameObj.username);
            this.usernameSpans.put(usernameObj, anonymousClass10);
            return anonymousClass10;
        }

        public class AnonymousClass10 extends ClickableSpan {
            public final TLRPC.TL_username val$usernameObj;
            public final String val$usernameRaw;

            public AnonymousClass10(final TLRPC.TL_username val$usernameObj, final String val$usernameRaw) {
                this.val$usernameObj = val$usernameObj;
                this.val$usernameRaw = val$usernameRaw;
            }

            @Override
            public void onClick(View view) {
                if (!this.val$usernameObj.editable) {
                    if (ProfileActivity.this.loadingSpan == this) {
                        return;
                    }
                    ProfileActivity.this.setLoadingSpan(this);
                    TL_fragment.TL_getCollectibleInfo tL_getCollectibleInfo = new TL_fragment.TL_getCollectibleInfo();
                    TL_fragment.TL_inputCollectibleUsername tL_inputCollectibleUsername = new TL_fragment.TL_inputCollectibleUsername();
                    tL_inputCollectibleUsername.username = this.val$usernameObj.username;
                    tL_getCollectibleInfo.collectible = tL_inputCollectibleUsername;
                    ConnectionsManager connectionsManager = ProfileActivity.this.getConnectionsManager();
                    final TLRPC.TL_username tL_username = this.val$usernameObj;
                    ProfileActivity.this.getConnectionsManager().bindRequestToGuid(connectionsManager.sendRequest(tL_getCollectibleInfo, new RequestDelegate() {
                        public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                            ProfileActivity.ListAdapter.AnonymousClass10.this.lambda$onClick$1(tL_username, tLObject, tL_error);
                        }
                    }), ProfileActivity.this.getClassGuid());
                    return;
                }
                ProfileActivity.this.setLoadingSpan(null);
                String str = ProfileActivity.this.getMessagesController().linkPrefix + "/" + this.val$usernameRaw;
                if (ProfileActivity.this.currentChat == null || !ProfileActivity.this.currentChat.noforwards) {
                    AndroidUtilities.addToClipboard(str);
                    ProfileActivity.this.undoView.showWithAction(0L, 56, (Runnable) null);
                }
            }

            public void lambda$onClick$1(final TLRPC.TL_username tL_username, final TLObject tLObject, final TLRPC.TL_error tL_error) {
                AndroidUtilities.runOnUIThread(new Runnable() {
                    @Override
                    public final void run() {
                        ProfileActivity.ListAdapter.AnonymousClass10.this.lambda$onClick$0(tLObject, tL_username, tL_error);
                    }
                });
            }

            public void lambda$onClick$0(TLObject tLObject, TLRPC.TL_username tL_username, TLRPC.TL_error tL_error) {
                TLRPC.User chat;
                ProfileActivity.this.setLoadingSpan(null);
                if (tLObject instanceof TL_fragment.TL_collectibleInfo) {
                    if (ProfileActivity.this.userId != 0) {
                        chat = ProfileActivity.this.getMessagesController().getUser(Long.valueOf(ProfileActivity.this.userId));
                    } else {
                        chat = ProfileActivity.this.getMessagesController().getChat(Long.valueOf(ProfileActivity.this.chatId));
                    }
                    TLRPC.User user = chat;
                    if (ProfileActivity.this.getContext() == null) {
                        return;
                    }
                    FragmentUsernameBottomSheet.open(ProfileActivity.this.getContext(), 0, tL_username.username, user, (TL_fragment.TL_collectibleInfo) tLObject, ProfileActivity.this.getResourceProvider());
                    return;
                }
                BulletinFactory.showError(tL_error);
            }

            @Override
            public void updateDrawState(TextPaint ds) {
                ds.setUnderlineText(false);
                ds.setColor(ds.linkColor);
            }
        }

        public void onViewRecycled(RecyclerView.ViewHolder holder) {
            if (holder.getAdapterPosition() == ProfileActivity.this.setAvatarRow) {
                ProfileActivity.this.setAvatarCell = null;
            }
        }

        public final String getRestrictionReason(ArrayList<TLRPC.TL_restrictionReason> reasons) {
            if (reasons.isEmpty() || reasons.size() <= 0) {
                return null;
            }
            TLRPC.TL_restrictionReason tL_restrictionReason = reasons.get(0);
            return tL_restrictionReason.reason + "-" + tL_restrictionReason.platform + ": " + tL_restrictionReason.text;
        }

        public boolean isEnabled(RecyclerView.ViewHolder holder) {
            if (ProfileActivity.this.notificationRow != -1) {
                int adapterPosition = holder.getAdapterPosition();
                if (adapterPosition != ProfileActivity.this.notificationRow && adapterPosition != ProfileActivity.this.numberRow && adapterPosition != ProfileActivity.this.privacyRow && adapterPosition != ProfileActivity.this.languageRow && adapterPosition != ProfileActivity.this.setUsernameRow && adapterPosition != ProfileActivity.this.bioRow && adapterPosition != ProfileActivity.this.versionRow && adapterPosition != ProfileActivity.this.dataRow && adapterPosition != ProfileActivity.this.chatRow && adapterPosition != ProfileActivity.this.questionRow && adapterPosition != ProfileActivity.this.devicesRow && adapterPosition != ProfileActivity.this.filtersRow && adapterPosition != ProfileActivity.this.stickersRow && adapterPosition != ProfileActivity.this.faqRow && adapterPosition != ProfileActivity.this.policyRow && adapterPosition != ProfileActivity.this.sendLogsRow && adapterPosition != ProfileActivity.this.sendLastLogsRow && adapterPosition != ProfileActivity.this.clearLogsRow && adapterPosition != ProfileActivity.this.switchBackendRow && adapterPosition != ProfileActivity.this.setAvatarRow && adapterPosition != ProfileActivity.this.addToGroupButtonRow && adapterPosition != ProfileActivity.this.premiumRow && adapterPosition != ProfileActivity.this.premiumGiftingRow && adapterPosition != ProfileActivity.this.businessRow && adapterPosition != ProfileActivity.this.liteModeRow) {
                    ProfileActivity profileActivity = ProfileActivity.this;
                    if (adapterPosition != profileActivity.birthdayRow && adapterPosition != profileActivity.channelRow && adapterPosition != ProfileActivity.this.starsRow) {
                        return false;
                    }
                }
                return true;
            }
            View view = holder.itemView;
            if (view instanceof UserCell) {
                Object currentObject = ((UserCell) view).getCurrentObject();
                if ((currentObject instanceof TLRPC.User) && UserObject.isUserSelf((TLRPC.User) currentObject)) {
                    return false;
                }
            }
            int itemViewType = holder.getItemViewType();
            return (itemViewType == 1 || itemViewType == 5 || itemViewType == 7 || itemViewType == 11 || itemViewType == 12 || itemViewType == 13 || itemViewType == 9 || itemViewType == 10) ? false : true;
        }

        public int getItemCount() {
            return ProfileActivity.this.rowCount;
        }

        public int getItemViewType(int position) {
            if (position == ProfileActivity.this.infoHeaderRow || position == ProfileActivity.this.membersHeaderRow || position == ProfileActivity.this.settingsSectionRow2 || position == ProfileActivity.this.numberSectionRow || position == ProfileActivity.this.helpHeaderRow || position == ProfileActivity.this.debugHeaderRow || position == ProfileActivity.this.restrictionHeaderRow) {
                return 1;
            }
            if (position == ProfileActivity.this.phoneRow || position == ProfileActivity.this.locationRow || position == ProfileActivity.this.numberRow) {
                return 2;
            }
            ProfileActivity profileActivity = ProfileActivity.this;
            if (position == profileActivity.birthdayRow) {
                return 2;
            }
            if (position == profileActivity.usernameRow || position == ProfileActivity.this.setUsernameRow) {
                return 19;
            }
            if (position == ProfileActivity.this.userInfoRow || position == ProfileActivity.this.channelInfoRow || position == ProfileActivity.this.bioRow || position == ProfileActivity.this.restrictionRow) {
                return 3;
            }
            if (position == ProfileActivity.this.settingsTimerRow || position == ProfileActivity.this.settingsKeyRow || position == ProfileActivity.this.reportRow || position == ProfileActivity.this.reportReactionRow || position == ProfileActivity.this.subscribersRow || position == ProfileActivity.this.subscribersRequestsRow || position == ProfileActivity.this.administratorsRow || position == ProfileActivity.this.settingsRow || position == ProfileActivity.this.blockedUsersRow || position == ProfileActivity.this.addMemberRow || position == ProfileActivity.this.joinRow || position == ProfileActivity.this.unblockRow || position == ProfileActivity.this.sendMessageRow || position == ProfileActivity.this.notificationRow || position == ProfileActivity.this.privacyRow || position == ProfileActivity.this.languageRow || position == ProfileActivity.this.dataRow || position == ProfileActivity.this.chatRow || position == ProfileActivity.this.questionRow || position == ProfileActivity.this.devicesRow || position == ProfileActivity.this.filtersRow || position == ProfileActivity.this.stickersRow || position == ProfileActivity.this.faqRow || position == ProfileActivity.this.policyRow || position == ProfileActivity.this.sendLogsRow || position == ProfileActivity.this.sendLastLogsRow || position == ProfileActivity.this.clearLogsRow || position == ProfileActivity.this.switchBackendRow || position == ProfileActivity.this.setAvatarRow || position == ProfileActivity.this.addToGroupButtonRow || position == ProfileActivity.this.addToContactsRow || position == ProfileActivity.this.liteModeRow || position == ProfileActivity.this.premiumGiftingRow || position == ProfileActivity.this.businessRow || position == ProfileActivity.this.membersFilterRow || position == ProfileActivity.this.photosRow || position == ProfileActivity.this.filesRow || position == ProfileActivity.this.linksRow || position == ProfileActivity.this.audioRow || position == ProfileActivity.this.voiceRow || position == ProfileActivity.this.sharedPhotosRow || position == ProfileActivity.this.sharedVideosRow || position == ProfileActivity.this.sharedGifsRow) {
                return 4;
            }
            if (position == ProfileActivity.this.notificationsDividerRow) {
                return 5;
            }
            if (position == ProfileActivity.this.notificationsRow) {
                return 6;
            }
            if (position == ProfileActivity.this.notificationsSimpleRow) {
                return 20;
            }
            if (position == ProfileActivity.this.infoSectionRow || position == ProfileActivity.this.lastSectionRow || position == ProfileActivity.this.membersSectionRow || position == ProfileActivity.this.secretSettingsSectionRow || position == ProfileActivity.this.settingsSectionRow || position == ProfileActivity.this.devicesSectionRow || position == ProfileActivity.this.helpSectionCell || position == ProfileActivity.this.setAvatarSectionRow || position == ProfileActivity.this.passwordSuggestionSectionRow || position == ProfileActivity.this.phoneSuggestionSectionRow || position == ProfileActivity.this.premiumSectionsRow || position == ProfileActivity.this.reportDividerRow || position == ProfileActivity.this.channelDividerRow || position == ProfileActivity.this.graceSuggestionSectionRow) {
                return 7;
            }
            if (position >= ProfileActivity.this.membersStartRow && position < ProfileActivity.this.membersEndRow) {
                return 8;
            }
            if (position == ProfileActivity.this.emptyRow) {
                return 11;
            }
            if (position == ProfileActivity.this.bottomPaddingRow) {
                return 12;
            }
            if (position == ProfileActivity.this.sharedMediaRow) {
                return 13;
            }
            if (position == ProfileActivity.this.versionRow) {
                return 14;
            }
            if (position == ProfileActivity.this.passwordSuggestionRow || position == ProfileActivity.this.phoneSuggestionRow || position == ProfileActivity.this.graceSuggestionRow) {
                return 15;
            }
            if (position == ProfileActivity.this.addToGroupInfoRow) {
                return 17;
            }
            if (position == ProfileActivity.this.premiumRow) {
                return 18;
            }
            if (position == ProfileActivity.this.starsRow) {
                return 24;
            }
            if (position == ProfileActivity.this.bizLocationRow) {
                return 21;
            }
            if (position == ProfileActivity.this.bizHoursRow) {
                return 22;
            }
            return position == ProfileActivity.this.channelRow ? 23 : 0;
        }
    }

    public class SearchAdapter extends RecyclerListView.SelectionAdapter {
        public TLRPC.WebPage faqWebPage;
        public String lastSearchString;
        public boolean loadingFaqPage;
        public Context mContext;
        public Runnable searchRunnable;
        public boolean searchWas;
        public SearchResult[] searchArray = onCreateSearchArray();
        public ArrayList<MessagesController.FaqSearchResult> faqSearchArray = new ArrayList<>();
        public ArrayList<CharSequence> resultNames = new ArrayList<>();
        public ArrayList<SearchResult> searchResults = new ArrayList<>();
        public ArrayList<MessagesController.FaqSearchResult> faqSearchResults = new ArrayList<>();
        public ArrayList<Object> recentSearches = new ArrayList<>();

        public class SearchResult {
            public int guid;
            public int iconResId;
            public int num;
            public Runnable openRunnable;
            public String[] path;
            public String rowName;
            public String searchTitle;

            public SearchResult(final SearchAdapter this$1, int g, String search, int icon, Runnable open) {
                this(g, search, null, null, null, icon, open);
            }

            public SearchResult(final SearchAdapter this$1, int g, String search, String pathArg1, int icon, Runnable open) {
                this(g, search, null, pathArg1, null, icon, open);
            }

            public SearchResult(final SearchAdapter this$1, int g, String search, String row, String pathArg1, int icon, Runnable open) {
                this(g, search, row, pathArg1, null, icon, open);
            }

            public SearchResult(int g, String search, String row, String pathArg1, String pathArg2, int icon, Runnable open) {
                this.guid = g;
                this.searchTitle = search;
                this.rowName = row;
                this.openRunnable = open;
                this.iconResId = icon;
                if (pathArg1 != null && pathArg2 != null) {
                    this.path = new String[]{pathArg1, pathArg2};
                } else if (pathArg1 != null) {
                    this.path = new String[]{pathArg1};
                }
            }

            public boolean equals(Object obj) {
                return (obj instanceof SearchResult) && this.guid == ((SearchResult) obj).guid;
            }

            public String toString() {
                SerializedData serializedData = new SerializedData();
                serializedData.writeInt32(this.num);
                serializedData.writeInt32(1);
                serializedData.writeInt32(this.guid);
                return Utilities.bytesToHex(serializedData.toByteArray());
            }

            public final void open() {
                this.openRunnable.run();
                AndroidUtilities.scrollToFragmentRow(((BaseFragment) ProfileActivity.this).parentLayout, this.rowName);
            }
        }

        public SearchAdapter(Context context) {
            this.mContext = context;
            updateSearchArray();
        }

        public final void updateSearchArray() {
            String[] strArr;
            SearchResult searchResult;
            HashMap hashMap = new HashMap();
            int i = 0;
            while (true) {
                SearchResult[] searchResultArr = this.searchArray;
                if (i >= searchResultArr.length) {
                    break;
                }
                if (searchResultArr[i] != null) {
                    hashMap.put(Integer.valueOf(searchResultArr[i].guid), this.searchArray[i]);
                }
                i++;
            }
            Set<String> stringSet = MessagesController.getGlobalMainSettings().getStringSet("settingsSearchRecent2", null);
            if (stringSet != null) {
                Iterator<String> it = stringSet.iterator();
                while (it.hasNext()) {
                    try {
                        SerializedData serializedData = new SerializedData(Utilities.hexToBytes(it.next()));
                        int readInt32 = serializedData.readInt32(false);
                        int readInt322 = serializedData.readInt32(false);
                        if (readInt322 == 0) {
                            String readString = serializedData.readString(false);
                            int readInt323 = serializedData.readInt32(false);
                            if (readInt323 > 0) {
                                strArr = new String[readInt323];
                                for (int i2 = 0; i2 < readInt323; i2++) {
                                    strArr[i2] = serializedData.readString(false);
                                }
                            } else {
                                strArr = null;
                            }
                            MessagesController.FaqSearchResult faqSearchResult = new MessagesController.FaqSearchResult(readString, strArr, serializedData.readString(false));
                            faqSearchResult.num = readInt32;
                            this.recentSearches.add(faqSearchResult);
                        } else if (readInt322 == 1 && (searchResult = (SearchResult) hashMap.get(Integer.valueOf(serializedData.readInt32(false)))) != null) {
                            searchResult.num = readInt32;
                            this.recentSearches.add(searchResult);
                        }
                    } catch (Exception unused) {
                    }
                }
            }
            Collections.sort(this.recentSearches, new java.util.Comparator() {
                @Override
                public final int compare(Object obj, Object obj2) {
                    int lambda$updateSearchArray$0;
                    lambda$updateSearchArray$0 = ProfileActivity.SearchAdapter.this.lambda$updateSearchArray$0(obj, obj2);
                    return lambda$updateSearchArray$0;
                }
            });
        }

        public int lambda$updateSearchArray$0(Object obj, Object obj2) {
            int num = getNum(obj);
            int num2 = getNum(obj2);
            if (num < num2) {
                return -1;
            }
            return num > num2 ? 1 : 0;
        }

        public final SearchResult[] onCreateSearchArray() {
            SearchResult[] searchResultArr = new SearchResult[143];
            searchResultArr[0] = new SearchResult(this, 500, LocaleController.getString("EditName", R.string.EditName), 0, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$1();
                }
            });
            searchResultArr[1] = new SearchResult(this, 501, LocaleController.getString("ChangePhoneNumber", R.string.ChangePhoneNumber), 0, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$2();
                }
            });
            searchResultArr[2] = new SearchResult(this, 502, LocaleController.getString("AddAnotherAccount", R.string.AddAnotherAccount), 0, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$3();
                }
            });
            searchResultArr[3] = new SearchResult(this, 503, LocaleController.getString("UserBio", R.string.UserBio), 0, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$4();
                }
            });
            String string = LocaleController.getString(R.string.AddPhoto);
            final ProfileActivity profileActivity = ProfileActivity.this;
            searchResultArr[4] = new SearchResult(this, 504, string, 0, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.m7883$$Nest$monWriteButtonClick(ProfileActivity.this);
                }
            });
            int i = R.string.NotificationsAndSounds;
            String string2 = LocaleController.getString("NotificationsAndSounds", i);
            int i2 = R.drawable.msg_notifications;
            searchResultArr[5] = new SearchResult(this, 1, string2, i2, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$6();
                }
            });
            searchResultArr[6] = new SearchResult(this, 2, LocaleController.getString("NotificationsPrivateChats", R.string.NotificationsPrivateChats), LocaleController.getString("NotificationsAndSounds", i), i2, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$7();
                }
            });
            searchResultArr[7] = new SearchResult(this, 3, LocaleController.getString("NotificationsGroups", R.string.NotificationsGroups), LocaleController.getString("NotificationsAndSounds", i), i2, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$8();
                }
            });
            searchResultArr[8] = new SearchResult(this, 4, LocaleController.getString("NotificationsChannels", R.string.NotificationsChannels), LocaleController.getString("NotificationsAndSounds", i), i2, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$9();
                }
            });
            searchResultArr[9] = new SearchResult(this, 5, LocaleController.getString("VoipNotificationSettings", R.string.VoipNotificationSettings), "callsSectionRow", LocaleController.getString("NotificationsAndSounds", i), i2, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$10();
                }
            });
            searchResultArr[10] = new SearchResult(this, 6, LocaleController.getString("BadgeNumber", R.string.BadgeNumber), "badgeNumberSection", LocaleController.getString("NotificationsAndSounds", i), i2, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$11();
                }
            });
            searchResultArr[11] = new SearchResult(this, 7, LocaleController.getString("InAppNotifications", R.string.InAppNotifications), "inappSectionRow", LocaleController.getString("NotificationsAndSounds", i), i2, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$12();
                }
            });
            searchResultArr[12] = new SearchResult(this, 8, LocaleController.getString("ContactJoined", R.string.ContactJoined), "contactJoinedRow", LocaleController.getString("NotificationsAndSounds", i), i2, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$13();
                }
            });
            searchResultArr[13] = new SearchResult(this, 9, LocaleController.getString("PinnedMessages", R.string.PinnedMessages), "pinnedMessageRow", LocaleController.getString("NotificationsAndSounds", i), i2, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$14();
                }
            });
            searchResultArr[14] = new SearchResult(this, 10, LocaleController.getString("ResetAllNotifications", R.string.ResetAllNotifications), "resetNotificationsRow", LocaleController.getString("NotificationsAndSounds", i), i2, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$15();
                }
            });
            searchResultArr[15] = new SearchResult(this, 11, LocaleController.getString(R.string.NotificationsService), "notificationsServiceRow", LocaleController.getString("NotificationsAndSounds", i), i2, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$16();
                }
            });
            searchResultArr[16] = new SearchResult(this, 12, LocaleController.getString(R.string.NotificationsServiceConnection), "notificationsServiceConnectionRow", LocaleController.getString("NotificationsAndSounds", i), i2, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$17();
                }
            });
            searchResultArr[17] = new SearchResult(this, 13, LocaleController.getString(R.string.RepeatNotifications), "repeatRow", LocaleController.getString("NotificationsAndSounds", i), i2, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$18();
                }
            });
            int i3 = R.string.PrivacySettings;
            String string3 = LocaleController.getString("PrivacySettings", i3);
            int i4 = R.drawable.msg_secret;
            searchResultArr[18] = new SearchResult(this, 100, string3, i4, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$19();
                }
            });
            String string4 = LocaleController.getString("TwoStepVerification", R.string.TwoStepVerification);
            String string5 = LocaleController.getString("PrivacySettings", i3);
            int i5 = R.drawable.msg2_secret;
            searchResultArr[19] = new SearchResult(this, 109, string4, string5, i5, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$20();
                }
            });
            searchResultArr[20] = new SearchResult(this, 124, LocaleController.getString(R.string.AutoDeleteMessages), LocaleController.getString(i3), i5, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$21();
                }
            });
            searchResultArr[21] = new SearchResult(this, 108, LocaleController.getString("Passcode", R.string.Passcode), LocaleController.getString("PrivacySettings", i3), i5, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$22();
                }
            });
            searchResultArr[22] = SharedConfig.hasEmailLogin ? new SearchResult(this, 125, LocaleController.getString(R.string.EmailLogin), "emailLoginRow", LocaleController.getString("PrivacySettings", i3), i5, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$23();
                }
            }) : null;
            searchResultArr[23] = new SearchResult(this, 101, LocaleController.getString("BlockedUsers", R.string.BlockedUsers), LocaleController.getString("PrivacySettings", i3), i4, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$24();
                }
            });
            searchResultArr[24] = new SearchResult(this, 110, LocaleController.getString("SessionsTitle", R.string.SessionsTitle), i5, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$25();
                }
            });
            searchResultArr[25] = new SearchResult(this, 105, LocaleController.getString("PrivacyPhone", R.string.PrivacyPhone), LocaleController.getString("PrivacySettings", i3), i4, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$26();
                }
            });
            searchResultArr[26] = new SearchResult(this, 102, LocaleController.getString("PrivacyLastSeen", R.string.PrivacyLastSeen), LocaleController.getString("PrivacySettings", i3), i4, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$27();
                }
            });
            searchResultArr[27] = new SearchResult(this, 103, LocaleController.getString("PrivacyProfilePhoto", R.string.PrivacyProfilePhoto), LocaleController.getString("PrivacySettings", i3), i4, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$28();
                }
            });
            searchResultArr[28] = new SearchResult(this, 104, LocaleController.getString("PrivacyForwards", R.string.PrivacyForwards), LocaleController.getString("PrivacySettings", i3), i4, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$29();
                }
            });
            searchResultArr[29] = new SearchResult(this, 122, LocaleController.getString("PrivacyP2P", R.string.PrivacyP2P), LocaleController.getString("PrivacySettings", i3), i4, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$30();
                }
            });
            int i6 = R.string.Calls;
            searchResultArr[30] = new SearchResult(this, 106, LocaleController.getString("Calls", i6), LocaleController.getString("PrivacySettings", i3), i4, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$31();
                }
            });
            searchResultArr[31] = new SearchResult(this, 107, LocaleController.getString("PrivacyInvites", R.string.PrivacyInvites), LocaleController.getString("PrivacySettings", i3), i4, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$32();
                }
            });
            searchResultArr[32] = new SearchResult(this, 123, LocaleController.getString("PrivacyVoiceMessages", R.string.PrivacyVoiceMessages), LocaleController.getString("PrivacySettings", i3), i4, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$33();
                }
            });
            searchResultArr[33] = ProfileActivity.this.getMessagesController().autoarchiveAvailable ? new SearchResult(this, 121, LocaleController.getString("ArchiveAndMute", R.string.ArchiveAndMute), "newChatsRow", LocaleController.getString("PrivacySettings", i3), i5, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$34();
                }
            }) : null;
            searchResultArr[34] = new SearchResult(this, 112, LocaleController.getString("DeleteAccountIfAwayFor2", R.string.DeleteAccountIfAwayFor2), "deleteAccountRow", LocaleController.getString("PrivacySettings", i3), i5, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$35();
                }
            });
            searchResultArr[35] = new SearchResult(this, 113, LocaleController.getString("PrivacyPaymentsClear", R.string.PrivacyPaymentsClear), "paymentsClearRow", LocaleController.getString("PrivacySettings", i3), i5, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$36();
                }
            });
            searchResultArr[36] = new SearchResult(this, 114, LocaleController.getString("WebSessionsTitle", R.string.WebSessionsTitle), LocaleController.getString("PrivacySettings", i3), i5, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$37();
                }
            });
            searchResultArr[37] = new SearchResult(this, 115, LocaleController.getString("SyncContactsDelete", R.string.SyncContactsDelete), "contactsDeleteRow", LocaleController.getString("PrivacySettings", i3), i5, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$38();
                }
            });
            searchResultArr[38] = new SearchResult(this, 116, LocaleController.getString("SyncContacts", R.string.SyncContacts), "contactsSyncRow", LocaleController.getString("PrivacySettings", i3), i5, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$39();
                }
            });
            searchResultArr[39] = new SearchResult(this, 117, LocaleController.getString("SuggestContacts", R.string.SuggestContacts), "contactsSuggestRow", LocaleController.getString("PrivacySettings", i3), i5, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$40();
                }
            });
            searchResultArr[40] = new SearchResult(this, 118, LocaleController.getString("MapPreviewProvider", R.string.MapPreviewProvider), "secretMapRow", LocaleController.getString("PrivacySettings", i3), i5, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$41();
                }
            });
            searchResultArr[41] = new SearchResult(this, 119, LocaleController.getString("SecretWebPage", R.string.SecretWebPage), "secretWebpageRow", LocaleController.getString("PrivacySettings", i3), i5, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$42();
                }
            });
            int i7 = R.string.Devices;
            String string6 = LocaleController.getString(i7);
            int i8 = R.drawable.msg2_devices;
            searchResultArr[42] = new SearchResult(this, 120, string6, i8, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$43();
                }
            });
            searchResultArr[43] = new SearchResult(this, 121, LocaleController.getString(R.string.TerminateAllSessions), "terminateAllSessionsRow", LocaleController.getString(i7), i8, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$44();
                }
            });
            searchResultArr[44] = new SearchResult(this, 122, LocaleController.getString(R.string.LinkDesktopDevice), LocaleController.getString(i7), i8, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$45();
                }
            });
            int i9 = R.string.DataSettings;
            String string7 = LocaleController.getString("DataSettings", i9);
            int i10 = R.drawable.msg2_data;
            searchResultArr[45] = new SearchResult(this, 200, string7, i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$46();
                }
            });
            searchResultArr[46] = new SearchResult(this, 201, LocaleController.getString("DataUsage", R.string.DataUsage), "usageSectionRow", LocaleController.getString("DataSettings", i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$47();
                }
            });
            int i11 = R.string.StorageUsage;
            searchResultArr[47] = new SearchResult(this, 202, LocaleController.getString("StorageUsage", i11), LocaleController.getString("DataSettings", i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$48();
                }
            });
            searchResultArr[48] = new SearchResult(203, LocaleController.getString("KeepMedia", R.string.KeepMedia), "keepMediaRow", LocaleController.getString("DataSettings", i9), LocaleController.getString("StorageUsage", i11), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$49();
                }
            });
            searchResultArr[49] = new SearchResult(204, LocaleController.getString("ClearMediaCache", R.string.ClearMediaCache), "cacheRow", LocaleController.getString("DataSettings", i9), LocaleController.getString("StorageUsage", i11), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$50();
                }
            });
            searchResultArr[50] = new SearchResult(205, LocaleController.getString("LocalDatabase", R.string.LocalDatabase), "databaseRow", LocaleController.getString("DataSettings", i9), LocaleController.getString("StorageUsage", i11), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$51();
                }
            });
            searchResultArr[51] = new SearchResult(this, 206, LocaleController.getString("NetworkUsage", R.string.NetworkUsage), LocaleController.getString("DataSettings", i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$52();
                }
            });
            searchResultArr[52] = new SearchResult(this, 207, LocaleController.getString("AutomaticMediaDownload", R.string.AutomaticMediaDownload), "mediaDownloadSectionRow", LocaleController.getString("DataSettings", i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$53();
                }
            });
            searchResultArr[53] = new SearchResult(this, 208, LocaleController.getString("WhenUsingMobileData", R.string.WhenUsingMobileData), LocaleController.getString("DataSettings", i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$54();
                }
            });
            searchResultArr[54] = new SearchResult(this, 209, LocaleController.getString("WhenConnectedOnWiFi", R.string.WhenConnectedOnWiFi), LocaleController.getString("DataSettings", i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$55();
                }
            });
            searchResultArr[55] = new SearchResult(this, 210, LocaleController.getString("WhenRoaming", R.string.WhenRoaming), LocaleController.getString("DataSettings", i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$56();
                }
            });
            searchResultArr[56] = new SearchResult(this, 211, LocaleController.getString("ResetAutomaticMediaDownload", R.string.ResetAutomaticMediaDownload), "resetDownloadRow", LocaleController.getString("DataSettings", i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$57();
                }
            });
            searchResultArr[57] = new SearchResult(this, 215, LocaleController.getString("Streaming", R.string.Streaming), "streamSectionRow", LocaleController.getString("DataSettings", i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$58();
                }
            });
            searchResultArr[58] = new SearchResult(this, 216, LocaleController.getString("EnableStreaming", R.string.EnableStreaming), "enableStreamRow", LocaleController.getString("DataSettings", i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$59();
                }
            });
            searchResultArr[59] = new SearchResult(this, 217, LocaleController.getString("Calls", i6), "callsSectionRow", LocaleController.getString("DataSettings", i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$60();
                }
            });
            searchResultArr[60] = new SearchResult(this, 218, LocaleController.getString("VoipUseLessData", R.string.VoipUseLessData), "useLessDataForCallsRow", LocaleController.getString("DataSettings", i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$61();
                }
            });
            searchResultArr[61] = new SearchResult(this, 219, LocaleController.getString("VoipQuickReplies", R.string.VoipQuickReplies), "quickRepliesRow", LocaleController.getString("DataSettings", i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$62();
                }
            });
            int i12 = R.string.ProxySettings;
            searchResultArr[62] = new SearchResult(this, 220, LocaleController.getString("ProxySettings", i12), LocaleController.getString("DataSettings", i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$63();
                }
            });
            searchResultArr[63] = new SearchResult(221, LocaleController.getString("UseProxyForCalls", R.string.UseProxyForCalls), "callsRow", LocaleController.getString("DataSettings", i9), LocaleController.getString("ProxySettings", i12), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$64();
                }
            });
            searchResultArr[64] = new SearchResult(this, 111, LocaleController.getString("PrivacyDeleteCloudDrafts", R.string.PrivacyDeleteCloudDrafts), "clearDraftsRow", LocaleController.getString("DataSettings", i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$65();
                }
            });
            int i13 = R.string.SaveToGallery;
            searchResultArr[65] = new SearchResult(this, 222, LocaleController.getString(i13), "saveToGallerySectionRow", LocaleController.getString(i9), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$66();
                }
            });
            searchResultArr[66] = new SearchResult(223, LocaleController.getString(R.string.SaveToGalleryPrivate), "saveToGalleryPeerRow", LocaleController.getString(i9), LocaleController.getString(i13), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$67();
                }
            });
            searchResultArr[67] = new SearchResult(224, LocaleController.getString(R.string.SaveToGalleryGroups), "saveToGalleryGroupsRow", LocaleController.getString(i9), LocaleController.getString(i13), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$68();
                }
            });
            searchResultArr[68] = new SearchResult(225, LocaleController.getString(R.string.SaveToGalleryChannels), "saveToGalleryChannelsRow", LocaleController.getString(i9), LocaleController.getString(i13), i10, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$69();
                }
            });
            int i14 = R.string.ChatSettings;
            String string8 = LocaleController.getString("ChatSettings", i14);
            int i15 = R.drawable.msg2_discussion;
            searchResultArr[69] = new SearchResult(this, 300, string8, i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$70();
                }
            });
            searchResultArr[70] = new SearchResult(this, 301, LocaleController.getString("TextSizeHeader", R.string.TextSizeHeader), "textSizeHeaderRow", LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$71();
                }
            });
            searchResultArr[71] = new SearchResult(this, 302, LocaleController.getString(R.string.ChangeChatBackground), LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$72();
                }
            });
            String string9 = LocaleController.getString("SetColor", R.string.SetColor);
            String string10 = LocaleController.getString("ChatSettings", i14);
            int i16 = R.string.ChatBackground;
            searchResultArr[72] = new SearchResult(303, string9, null, string10, LocaleController.getString("ChatBackground", i16), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$73();
                }
            });
            searchResultArr[73] = new SearchResult(304, LocaleController.getString("ResetChatBackgrounds", R.string.ResetChatBackgrounds), "resetRow", LocaleController.getString("ChatSettings", i14), LocaleController.getString("ChatBackground", i16), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$74();
                }
            });
            searchResultArr[74] = new SearchResult(this, 306, LocaleController.getString("ColorTheme", R.string.ColorTheme), "themeHeaderRow", LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$75();
                }
            });
            int i17 = R.string.BrowseThemes;
            searchResultArr[75] = new SearchResult(this, 319, LocaleController.getString(i17), null, LocaleController.getString(i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$76();
                }
            });
            searchResultArr[76] = new SearchResult(320, LocaleController.getString(R.string.CreateNewTheme), "createNewThemeRow", LocaleController.getString(i14), LocaleController.getString(i17), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$77();
                }
            });
            searchResultArr[77] = new SearchResult(this, 321, LocaleController.getString(R.string.BubbleRadius), "bubbleRadiusHeaderRow", LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$78();
                }
            });
            searchResultArr[78] = new SearchResult(this, 322, LocaleController.getString(R.string.ChatList), "chatListHeaderRow", LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$79();
                }
            });
            searchResultArr[79] = new SearchResult(this, 323, LocaleController.getString(R.string.ChatListSwipeGesture), "swipeGestureHeaderRow", LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$80();
                }
            });
            searchResultArr[80] = new SearchResult(this, 324, LocaleController.getString(R.string.AppIcon), "appIconHeaderRow", LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$81();
                }
            });
            searchResultArr[81] = new SearchResult(this, 305, LocaleController.getString("AutoNightTheme", R.string.AutoNightTheme), LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$82();
                }
            });
            searchResultArr[82] = new SearchResult(this, 307, LocaleController.getString("ChromeCustomTabs", R.string.ChromeCustomTabs), "customTabsRow", LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$83();
                }
            });
            searchResultArr[83] = new SearchResult(this, 328, LocaleController.getString(R.string.NextMediaTap), "nextMediaTapRow", LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$84();
                }
            });
            searchResultArr[84] = new SearchResult(this, 327, LocaleController.getString(R.string.RaiseToListen), "raiseToListenRow", LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$85();
                }
            });
            searchResultArr[85] = new SearchResult(this, 310, LocaleController.getString("RaiseToSpeak", R.string.RaiseToSpeak), "raiseToSpeakRow", LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$86();
                }
            });
            searchResultArr[86] = new SearchResult(this, 326, LocaleController.getString(R.string.PauseMusicOnMedia), "pauseOnMediaRow", LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$87();
                }
            });
            searchResultArr[87] = new SearchResult(this, 325, LocaleController.getString(R.string.MicrophoneForVoiceMessages), "bluetoothScoRow", LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$88();
                }
            });
            searchResultArr[88] = new SearchResult(this, 308, LocaleController.getString("DirectShare", R.string.DirectShare), "directShareRow", LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$89();
                }
            });
            searchResultArr[89] = new SearchResult(this, 311, LocaleController.getString("SendByEnter", R.string.SendByEnter), "sendByEnterRow", LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$90();
                }
            });
            searchResultArr[90] = new SearchResult(this, 318, LocaleController.getString("DistanceUnits", R.string.DistanceUnits), "distanceRow", LocaleController.getString("ChatSettings", i14), i15, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$91();
                }
            });
            int i18 = R.string.StickersName;
            String string11 = LocaleController.getString(i18);
            int i19 = R.drawable.msg2_sticker;
            searchResultArr[91] = new SearchResult(this, 600, string11, i19, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$92();
                }
            });
            searchResultArr[92] = new SearchResult(this, 601, LocaleController.getString("SuggestStickers", R.string.SuggestStickers), "suggestRow", LocaleController.getString(i18), i19, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$93();
                }
            });
            searchResultArr[93] = new SearchResult(this, 602, LocaleController.getString("FeaturedStickers", R.string.FeaturedStickers), "featuredStickersHeaderRow", LocaleController.getString(i18), i19, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$94();
                }
            });
            searchResultArr[94] = new SearchResult(this, 603, LocaleController.getString("Masks", R.string.Masks), null, LocaleController.getString(i18), i19, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$95();
                }
            });
            searchResultArr[95] = new SearchResult(this, 604, LocaleController.getString("ArchivedStickers", R.string.ArchivedStickers), null, LocaleController.getString(i18), i19, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$96();
                }
            });
            searchResultArr[96] = new SearchResult(this, 605, LocaleController.getString("ArchivedMasks", R.string.ArchivedMasks), null, LocaleController.getString(i18), i19, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$97();
                }
            });
            searchResultArr[97] = new SearchResult(this, 606, LocaleController.getString(R.string.LargeEmoji), "largeEmojiRow", LocaleController.getString(i18), i19, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$98();
                }
            });
            searchResultArr[98] = new SearchResult(this, 607, LocaleController.getString(R.string.LoopAnimatedStickers), "loopRow", LocaleController.getString(i18), i19, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$99();
                }
            });
            int i20 = R.string.Emoji;
            String string12 = LocaleController.getString(i20);
            String string13 = LocaleController.getString(i18);
            int i21 = R.drawable.input_smile;
            searchResultArr[99] = new SearchResult(this, 608, string12, null, string13, i21, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$100();
                }
            });
            searchResultArr[100] = new SearchResult(609, LocaleController.getString(R.string.SuggestAnimatedEmoji), "suggestAnimatedEmojiRow", LocaleController.getString(i18), LocaleController.getString(i20), i21, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$101();
                }
            });
            searchResultArr[101] = new SearchResult(610, LocaleController.getString(R.string.FeaturedEmojiPacks), "featuredStickersHeaderRow", LocaleController.getString(i18), LocaleController.getString(i20), i21, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$102();
                }
            });
            searchResultArr[102] = new SearchResult(this, 611, LocaleController.getString(R.string.DoubleTapSetting), null, LocaleController.getString(i18), i19, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$103();
                }
            });
            int i22 = R.string.Filters;
            String string14 = LocaleController.getString(i22);
            int i23 = R.drawable.msg2_folder;
            searchResultArr[103] = new SearchResult(this, 700, string14, null, i23, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$104();
                }
            });
            searchResultArr[104] = new SearchResult(this, 701, LocaleController.getString(R.string.CreateNewFilter), "createFilterRow", LocaleController.getString(i22), i23, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$105();
                }
            });
            searchResultArr[105] = isPremiumFeatureAvailable(-1) ? new SearchResult(this, 800, LocaleController.getString(R.string.TelegramPremium), R.drawable.msg_settings_premium, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$106();
                }
            }) : null;
            searchResultArr[106] = isPremiumFeatureAvailable(0) ? new SearchResult(this, 801, LocaleController.getString(R.string.PremiumPreviewLimits), LocaleController.getString(R.string.TelegramPremium), R.drawable.msg_settings_premium, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$107();
                }
            }) : null;
            searchResultArr[107] = isPremiumFeatureAvailable(11) ? new SearchResult(this, 802, LocaleController.getString(R.string.PremiumPreviewEmoji), LocaleController.getString(R.string.TelegramPremium), R.drawable.msg_settings_premium, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$108();
                }
            }) : null;
            searchResultArr[108] = isPremiumFeatureAvailable(1) ? new SearchResult(this, 803, LocaleController.getString(R.string.PremiumPreviewUploads), LocaleController.getString(R.string.TelegramPremium), R.drawable.msg_settings_premium, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$109();
                }
            }) : null;
            searchResultArr[109] = isPremiumFeatureAvailable(2) ? new SearchResult(this, 804, LocaleController.getString(R.string.PremiumPreviewDownloadSpeed), LocaleController.getString(R.string.TelegramPremium), R.drawable.msg_settings_premium, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$110();
                }
            }) : null;
            searchResultArr[110] = isPremiumFeatureAvailable(8) ? new SearchResult(this, 805, LocaleController.getString(R.string.PremiumPreviewVoiceToText), LocaleController.getString(R.string.TelegramPremium), R.drawable.msg_settings_premium, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$111();
                }
            }) : null;
            searchResultArr[111] = isPremiumFeatureAvailable(3) ? new SearchResult(this, 806, LocaleController.getString(R.string.PremiumPreviewNoAds), LocaleController.getString(R.string.TelegramPremium), R.drawable.msg_settings_premium, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$112();
                }
            }) : null;
            searchResultArr[112] = isPremiumFeatureAvailable(4) ? new SearchResult(this, 807, LocaleController.getString(R.string.PremiumPreviewReactions), LocaleController.getString(R.string.TelegramPremium), R.drawable.msg_settings_premium, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$113();
                }
            }) : null;
            searchResultArr[113] = isPremiumFeatureAvailable(5) ? new SearchResult(this, 808, LocaleController.getString(R.string.PremiumPreviewStickers), LocaleController.getString(R.string.TelegramPremium), R.drawable.msg_settings_premium, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$114();
                }
            }) : null;
            searchResultArr[114] = isPremiumFeatureAvailable(9) ? new SearchResult(this, 809, LocaleController.getString(R.string.PremiumPreviewAdvancedChatManagement), LocaleController.getString(R.string.TelegramPremium), R.drawable.msg_settings_premium, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$115();
                }
            }) : null;
            searchResultArr[115] = isPremiumFeatureAvailable(6) ? new SearchResult(this, 810, LocaleController.getString(R.string.PremiumPreviewProfileBadge), LocaleController.getString(R.string.TelegramPremium), R.drawable.msg_settings_premium, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$116();
                }
            }) : null;
            searchResultArr[116] = isPremiumFeatureAvailable(7) ? new SearchResult(this, 811, LocaleController.getString(R.string.PremiumPreviewAnimatedProfiles), LocaleController.getString(R.string.TelegramPremium), R.drawable.msg_settings_premium, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$117();
                }
            }) : null;
            searchResultArr[117] = isPremiumFeatureAvailable(10) ? new SearchResult(this, 812, LocaleController.getString(R.string.PremiumPreviewAppIcon), LocaleController.getString(R.string.TelegramPremium), R.drawable.msg_settings_premium, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$118();
                }
            }) : null;
            searchResultArr[118] = isPremiumFeatureAvailable(12) ? new SearchResult(this, 813, LocaleController.getString(R.string.PremiumPreviewEmojiStatus), LocaleController.getString(R.string.TelegramPremium), R.drawable.msg_settings_premium, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$119();
                }
            }) : null;
            int i24 = R.string.PowerUsage;
            String string15 = LocaleController.getString(i24);
            int i25 = R.drawable.msg2_battery;
            searchResultArr[119] = new SearchResult(this, 900, string15, null, i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$120();
                }
            });
            int i26 = R.string.LiteOptionsStickers;
            searchResultArr[120] = new SearchResult(this, 901, LocaleController.getString(i26), LocaleController.getString(i24), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$121();
                }
            });
            int i27 = R.string.LiteOptionsAutoplayKeyboard;
            searchResultArr[121] = new SearchResult(902, LocaleController.getString(i27), null, LocaleController.getString(i24), LocaleController.getString(i26), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$122();
                }
            });
            int i28 = R.string.LiteOptionsAutoplayChat;
            searchResultArr[122] = new SearchResult(903, LocaleController.getString(i28), null, LocaleController.getString(i24), LocaleController.getString(i26), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$123();
                }
            });
            int i29 = R.string.LiteOptionsEmoji;
            searchResultArr[123] = new SearchResult(this, 904, LocaleController.getString(i29), LocaleController.getString(i24), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$124();
                }
            });
            searchResultArr[124] = new SearchResult(905, LocaleController.getString(i27), null, LocaleController.getString(i24), LocaleController.getString(i29), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$125();
                }
            });
            searchResultArr[125] = new SearchResult(906, LocaleController.getString(R.string.LiteOptionsAutoplayReactions), null, LocaleController.getString(i24), LocaleController.getString(i29), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$126();
                }
            });
            searchResultArr[126] = new SearchResult(907, LocaleController.getString(i28), null, LocaleController.getString(i24), LocaleController.getString(i29), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$127();
                }
            });
            int i30 = R.string.LiteOptionsChat;
            searchResultArr[127] = new SearchResult(this, 908, LocaleController.getString(i30), LocaleController.getString(i24), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$128();
                }
            });
            searchResultArr[128] = new SearchResult(909, LocaleController.getString(R.string.LiteOptionsBackground), null, LocaleController.getString(i24), LocaleController.getString(i30), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$129();
                }
            });
            searchResultArr[129] = new SearchResult(910, LocaleController.getString(R.string.LiteOptionsTopics), null, LocaleController.getString(i24), LocaleController.getString(i30), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$130();
                }
            });
            searchResultArr[130] = new SearchResult(911, LocaleController.getString(R.string.LiteOptionsSpoiler), null, LocaleController.getString(i24), LocaleController.getString(i30), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$131();
                }
            });
            searchResultArr[131] = SharedConfig.getDevicePerformanceClass() >= 1 ? new SearchResult(326, LocaleController.getString(R.string.LiteOptionsBlur), null, LocaleController.getString(i24), LocaleController.getString(i30), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$132();
                }
            }) : null;
            searchResultArr[132] = new SearchResult(912, LocaleController.getString(R.string.LiteOptionsScale), null, LocaleController.getString(i24), LocaleController.getString(i30), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$133();
                }
            });
            searchResultArr[133] = new SearchResult(this, 913, LocaleController.getString(R.string.LiteOptionsCalls), LocaleController.getString(i24), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$134();
                }
            });
            searchResultArr[134] = new SearchResult(this, 214, LocaleController.getString(R.string.LiteOptionsAutoplayVideo), LocaleController.getString(i24), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$135();
                }
            });
            searchResultArr[135] = new SearchResult(this, 213, LocaleController.getString(R.string.LiteOptionsAutoplayGifs), LocaleController.getString(i24), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$136();
                }
            });
            searchResultArr[136] = new SearchResult(this, 914, LocaleController.getString(R.string.LiteSmoothTransitions), LocaleController.getString(i24), i25, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$137();
                }
            });
            int i31 = R.string.Language;
            String string16 = LocaleController.getString("Language", i31);
            int i32 = R.drawable.msg2_language;
            searchResultArr[137] = new SearchResult(this, 400, string16, i32, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$138();
                }
            });
            searchResultArr[138] = new SearchResult(this, 405, LocaleController.getString(R.string.ShowTranslateButton), LocaleController.getString(i31), i32, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$139();
                }
            });
            searchResultArr[139] = MessagesController.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).getTranslateController().isContextTranslateEnabled() ? new SearchResult(this, 406, LocaleController.getString(R.string.DoNotTranslate), LocaleController.getString(i31), i32, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$140();
                }
            }) : null;
            String string17 = LocaleController.getString("AskAQuestion", R.string.AskAQuestion);
            int i33 = R.string.SettingsHelp;
            String string18 = LocaleController.getString("SettingsHelp", i33);
            int i34 = R.drawable.msg2_help;
            searchResultArr[140] = new SearchResult(this, 402, string17, string18, i34, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$141();
                }
            });
            searchResultArr[141] = new SearchResult(this, 403, LocaleController.getString("TelegramFAQ", R.string.TelegramFAQ), LocaleController.getString("SettingsHelp", i33), i34, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$142();
                }
            });
            searchResultArr[142] = new SearchResult(this, 404, LocaleController.getString("PrivacyPolicy", R.string.PrivacyPolicy), LocaleController.getString("SettingsHelp", i33), i34, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$onCreateSearchArray$143();
                }
            });
            return searchResultArr;
        }

        public void lambda$onCreateSearchArray$1() {
            ProfileActivity profileActivity = ProfileActivity.this;
            profileActivity.presentFragment(new ChangeNameActivity(profileActivity.resourcesProvider));
        }

        public void lambda$onCreateSearchArray$2() {
            ProfileActivity.this.presentFragment(new ActionIntroActivity(3));
        }

        public void lambda$onCreateSearchArray$3() {
            int i = 0;
            while (true) {
                if (i >= UserConfig.MAX_ACCOUNT_COUNT) {
                    i = -1;
                    break;
                } else if (!UserConfig.getInstance(i).isClientActivated()) {
                    break;
                } else {
                    i++;
                }
            }
            if (i >= 0) {
                ProfileActivity.this.presentFragment(new LoginActivity(i));
            }
        }

        public void lambda$onCreateSearchArray$4() {
            if (ProfileActivity.this.userInfo != null) {
                ProfileActivity.this.presentFragment(new ChangeBioActivity());
            }
        }

        public void lambda$onCreateSearchArray$6() {
            ProfileActivity.this.presentFragment(new NotificationsSettingsActivity());
        }

        public void lambda$onCreateSearchArray$7() {
            ProfileActivity.this.presentFragment(new NotificationsCustomSettingsActivity(1, new ArrayList(), null, true));
        }

        public void lambda$onCreateSearchArray$8() {
            ProfileActivity.this.presentFragment(new NotificationsCustomSettingsActivity(0, new ArrayList(), null, true));
        }

        public void lambda$onCreateSearchArray$9() {
            ProfileActivity.this.presentFragment(new NotificationsCustomSettingsActivity(2, new ArrayList(), null, true));
        }

        public void lambda$onCreateSearchArray$10() {
            ProfileActivity.this.presentFragment(new NotificationsSettingsActivity());
        }

        public void lambda$onCreateSearchArray$11() {
            ProfileActivity.this.presentFragment(new NotificationsSettingsActivity());
        }

        public void lambda$onCreateSearchArray$12() {
            ProfileActivity.this.presentFragment(new NotificationsSettingsActivity());
        }

        public void lambda$onCreateSearchArray$13() {
            ProfileActivity.this.presentFragment(new NotificationsSettingsActivity());
        }

        public void lambda$onCreateSearchArray$14() {
            ProfileActivity.this.presentFragment(new NotificationsSettingsActivity());
        }

        public void lambda$onCreateSearchArray$15() {
            ProfileActivity.this.presentFragment(new NotificationsSettingsActivity());
        }

        public void lambda$onCreateSearchArray$16() {
            ProfileActivity.this.presentFragment(new NotificationsSettingsActivity());
        }

        public void lambda$onCreateSearchArray$17() {
            ProfileActivity.this.presentFragment(new NotificationsSettingsActivity());
        }

        public void lambda$onCreateSearchArray$18() {
            ProfileActivity.this.presentFragment(new NotificationsSettingsActivity());
        }

        public void lambda$onCreateSearchArray$19() {
            ProfileActivity.this.presentFragment(new PrivacySettingsActivity());
        }

        public void lambda$onCreateSearchArray$20() {
            ProfileActivity.this.presentFragment(new TwoStepVerificationActivity());
        }

        public void lambda$onCreateSearchArray$21() {
            if (ProfileActivity.this.getUserConfig().getGlobalTTl() >= 0) {
                ProfileActivity.this.presentFragment(new AutoDeleteMessagesActivity());
            }
        }

        public void lambda$onCreateSearchArray$22() {
            ProfileActivity.this.presentFragment(PasscodeActivity.determineOpenFragment());
        }

        public void lambda$onCreateSearchArray$23() {
            ProfileActivity.this.presentFragment(new PrivacySettingsActivity());
        }

        public void lambda$onCreateSearchArray$24() {
            ProfileActivity.this.presentFragment(new PrivacyUsersActivity().loadBlocked());
        }

        public void lambda$onCreateSearchArray$25() {
            ProfileActivity.this.presentFragment(new SessionsActivity(0));
        }

        public void lambda$onCreateSearchArray$26() {
            ProfileActivity.this.presentFragment(new PrivacyControlActivity(6, true));
        }

        public void lambda$onCreateSearchArray$27() {
            ProfileActivity.this.presentFragment(new PrivacyControlActivity(0, true));
        }

        public void lambda$onCreateSearchArray$28() {
            ProfileActivity.this.presentFragment(new PrivacyControlActivity(4, true));
        }

        public void lambda$onCreateSearchArray$29() {
            ProfileActivity.this.presentFragment(new PrivacyControlActivity(5, true));
        }

        public void lambda$onCreateSearchArray$30() {
            ProfileActivity.this.presentFragment(new PrivacyControlActivity(3, true));
        }

        public void lambda$onCreateSearchArray$31() {
            ProfileActivity.this.presentFragment(new PrivacyControlActivity(2, true));
        }

        public void lambda$onCreateSearchArray$32() {
            ProfileActivity.this.presentFragment(new PrivacyControlActivity(1, true));
        }

        public void lambda$onCreateSearchArray$33() {
            if (!ProfileActivity.this.getUserConfig().isPremium()) {
                try {
                    ((BaseFragment) ProfileActivity.this).fragmentView.performHapticFeedback(3, 2);
                } catch (Exception e) {
                    FileLog.e(e);
                }
                BulletinFactory.of(ProfileActivity.this).createRestrictVoiceMessagesPremiumBulletin().show();
                return;
            }
            ProfileActivity.this.presentFragment(new PrivacyControlActivity(8, true));
        }

        public void lambda$onCreateSearchArray$34() {
            ProfileActivity.this.presentFragment(new PrivacySettingsActivity());
        }

        public void lambda$onCreateSearchArray$35() {
            ProfileActivity.this.presentFragment(new PrivacySettingsActivity());
        }

        public void lambda$onCreateSearchArray$36() {
            ProfileActivity.this.presentFragment(new PrivacySettingsActivity());
        }

        public void lambda$onCreateSearchArray$37() {
            ProfileActivity.this.presentFragment(new SessionsActivity(1));
        }

        public void lambda$onCreateSearchArray$38() {
            ProfileActivity.this.presentFragment(new PrivacySettingsActivity());
        }

        public void lambda$onCreateSearchArray$39() {
            ProfileActivity.this.presentFragment(new PrivacySettingsActivity());
        }

        public void lambda$onCreateSearchArray$40() {
            ProfileActivity.this.presentFragment(new PrivacySettingsActivity());
        }

        public void lambda$onCreateSearchArray$41() {
            ProfileActivity.this.presentFragment(new PrivacySettingsActivity());
        }

        public void lambda$onCreateSearchArray$42() {
            ProfileActivity.this.presentFragment(new PrivacySettingsActivity());
        }

        public void lambda$onCreateSearchArray$43() {
            ProfileActivity.this.presentFragment(new SessionsActivity(0));
        }

        public void lambda$onCreateSearchArray$44() {
            ProfileActivity.this.presentFragment(new SessionsActivity(0));
        }

        public void lambda$onCreateSearchArray$45() {
            ProfileActivity.this.presentFragment(new SessionsActivity(0).setHighlightLinkDesktopDevice());
        }

        public void lambda$onCreateSearchArray$46() {
            ProfileActivity.this.presentFragment(new DataSettingsActivity());
        }

        public void lambda$onCreateSearchArray$47() {
            ProfileActivity.this.presentFragment(new DataSettingsActivity());
        }

        public void lambda$onCreateSearchArray$48() {
            ProfileActivity.this.presentFragment(new CacheControlActivity());
        }

        public void lambda$onCreateSearchArray$49() {
            ProfileActivity.this.presentFragment(new CacheControlActivity());
        }

        public void lambda$onCreateSearchArray$50() {
            ProfileActivity.this.presentFragment(new CacheControlActivity());
        }

        public void lambda$onCreateSearchArray$51() {
            ProfileActivity.this.presentFragment(new CacheControlActivity());
        }

        public void lambda$onCreateSearchArray$52() {
            ProfileActivity.this.presentFragment(new DataUsage2Activity());
        }

        public void lambda$onCreateSearchArray$53() {
            ProfileActivity.this.presentFragment(new DataSettingsActivity());
        }

        public void lambda$onCreateSearchArray$54() {
            ProfileActivity.this.presentFragment(new DataAutoDownloadActivity(0));
        }

        public void lambda$onCreateSearchArray$55() {
            ProfileActivity.this.presentFragment(new DataAutoDownloadActivity(1));
        }

        public void lambda$onCreateSearchArray$56() {
            ProfileActivity.this.presentFragment(new DataAutoDownloadActivity(2));
        }

        public void lambda$onCreateSearchArray$57() {
            ProfileActivity.this.presentFragment(new DataSettingsActivity());
        }

        public void lambda$onCreateSearchArray$58() {
            ProfileActivity.this.presentFragment(new DataSettingsActivity());
        }

        public void lambda$onCreateSearchArray$59() {
            ProfileActivity.this.presentFragment(new DataSettingsActivity());
        }

        public void lambda$onCreateSearchArray$60() {
            ProfileActivity.this.presentFragment(new DataSettingsActivity());
        }

        public void lambda$onCreateSearchArray$61() {
            ProfileActivity.this.presentFragment(new DataSettingsActivity());
        }

        public void lambda$onCreateSearchArray$62() {
            ProfileActivity.this.presentFragment(new DataSettingsActivity());
        }

        public void lambda$onCreateSearchArray$63() {
            ProfileActivity.this.presentFragment(new ProxyListActivity());
        }

        public void lambda$onCreateSearchArray$64() {
            ProfileActivity.this.presentFragment(new ProxyListActivity());
        }

        public void lambda$onCreateSearchArray$65() {
            ProfileActivity.this.presentFragment(new DataSettingsActivity());
        }

        public void lambda$onCreateSearchArray$66() {
            ProfileActivity.this.presentFragment(new DataSettingsActivity());
        }

        public void lambda$onCreateSearchArray$67() {
            ProfileActivity.this.presentFragment(new DataSettingsActivity());
        }

        public void lambda$onCreateSearchArray$68() {
            ProfileActivity.this.presentFragment(new DataSettingsActivity());
        }

        public void lambda$onCreateSearchArray$69() {
            ProfileActivity.this.presentFragment(new DataSettingsActivity());
        }

        public void lambda$onCreateSearchArray$70() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$71() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$72() {
            ProfileActivity.this.presentFragment(new WallpapersListActivity(0));
        }

        public void lambda$onCreateSearchArray$73() {
            ProfileActivity.this.presentFragment(new WallpapersListActivity(1));
        }

        public void lambda$onCreateSearchArray$74() {
            ProfileActivity.this.presentFragment(new WallpapersListActivity(0));
        }

        public void lambda$onCreateSearchArray$75() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$76() {
            ProfileActivity.this.presentFragment(new ThemeActivity(3));
        }

        public void lambda$onCreateSearchArray$77() {
            ProfileActivity.this.presentFragment(new ThemeActivity(3));
        }

        public void lambda$onCreateSearchArray$78() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$79() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$80() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$81() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$82() {
            ProfileActivity.this.presentFragment(new ThemeActivity(1));
        }

        public void lambda$onCreateSearchArray$83() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$84() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$85() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$86() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$87() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$88() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$89() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$90() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$91() {
            ProfileActivity.this.presentFragment(new ThemeActivity(0));
        }

        public void lambda$onCreateSearchArray$92() {
            ProfileActivity.this.presentFragment(new StickersActivity(0, null));
        }

        public void lambda$onCreateSearchArray$93() {
            ProfileActivity.this.presentFragment(new StickersActivity(0, null));
        }

        public void lambda$onCreateSearchArray$94() {
            ProfileActivity.this.presentFragment(new StickersActivity(0, null));
        }

        public void lambda$onCreateSearchArray$95() {
            ProfileActivity.this.presentFragment(new StickersActivity(1, null));
        }

        public void lambda$onCreateSearchArray$96() {
            ProfileActivity.this.presentFragment(new ArchivedStickersActivity(0));
        }

        public void lambda$onCreateSearchArray$97() {
            ProfileActivity.this.presentFragment(new ArchivedStickersActivity(1));
        }

        public void lambda$onCreateSearchArray$98() {
            ProfileActivity.this.presentFragment(new StickersActivity(0, null));
        }

        public void lambda$onCreateSearchArray$99() {
            ProfileActivity.this.presentFragment(new StickersActivity(0, null));
        }

        public void lambda$onCreateSearchArray$100() {
            ProfileActivity.this.presentFragment(new StickersActivity(5, null));
        }

        public void lambda$onCreateSearchArray$101() {
            ProfileActivity.this.presentFragment(new StickersActivity(5, null));
        }

        public void lambda$onCreateSearchArray$102() {
            ProfileActivity.this.presentFragment(new StickersActivity(5, null));
        }

        public void lambda$onCreateSearchArray$103() {
            ProfileActivity.this.presentFragment(new ReactionsDoubleTapManageActivity());
        }

        public void lambda$onCreateSearchArray$104() {
            ProfileActivity.this.presentFragment(new FiltersSetupActivity());
        }

        public void lambda$onCreateSearchArray$105() {
            ProfileActivity.this.presentFragment(new FiltersSetupActivity());
        }

        public void lambda$onCreateSearchArray$106() {
            ProfileActivity.this.presentFragment(new PremiumPreviewFragment("settings"));
        }

        public void lambda$onCreateSearchArray$107() {
            ProfileActivity.this.showDialog(new PremiumFeatureBottomSheet(ProfileActivity.this, 0, false).setForceAbout());
        }

        public void lambda$onCreateSearchArray$108() {
            ProfileActivity.this.showDialog(new PremiumFeatureBottomSheet(ProfileActivity.this, 11, false).setForceAbout());
        }

        public void lambda$onCreateSearchArray$109() {
            ProfileActivity.this.showDialog(new PremiumFeatureBottomSheet(ProfileActivity.this, 1, false).setForceAbout());
        }

        public void lambda$onCreateSearchArray$110() {
            ProfileActivity.this.showDialog(new PremiumFeatureBottomSheet(ProfileActivity.this, 2, false).setForceAbout());
        }

        public void lambda$onCreateSearchArray$111() {
            ProfileActivity.this.showDialog(new PremiumFeatureBottomSheet(ProfileActivity.this, 8, false).setForceAbout());
        }

        public void lambda$onCreateSearchArray$112() {
            ProfileActivity.this.showDialog(new PremiumFeatureBottomSheet(ProfileActivity.this, 3, false).setForceAbout());
        }

        public void lambda$onCreateSearchArray$113() {
            ProfileActivity.this.showDialog(new PremiumFeatureBottomSheet(ProfileActivity.this, 4, false).setForceAbout());
        }

        public void lambda$onCreateSearchArray$114() {
            ProfileActivity.this.showDialog(new PremiumFeatureBottomSheet(ProfileActivity.this, 5, false).setForceAbout());
        }

        public void lambda$onCreateSearchArray$115() {
            ProfileActivity.this.showDialog(new PremiumFeatureBottomSheet(ProfileActivity.this, 9, false).setForceAbout());
        }

        public void lambda$onCreateSearchArray$116() {
            ProfileActivity.this.showDialog(new PremiumFeatureBottomSheet(ProfileActivity.this, 6, false).setForceAbout());
        }

        public void lambda$onCreateSearchArray$117() {
            ProfileActivity.this.showDialog(new PremiumFeatureBottomSheet(ProfileActivity.this, 7, false).setForceAbout());
        }

        public void lambda$onCreateSearchArray$118() {
            ProfileActivity.this.showDialog(new PremiumFeatureBottomSheet(ProfileActivity.this, 10, false).setForceAbout());
        }

        public void lambda$onCreateSearchArray$119() {
            ProfileActivity.this.showDialog(new PremiumFeatureBottomSheet(ProfileActivity.this, 12, false).setForceAbout());
        }

        public void lambda$onCreateSearchArray$120() {
            ProfileActivity.this.presentFragment(new LiteModeSettingsActivity());
        }

        public void lambda$onCreateSearchArray$121() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.scrollToFlags(3);
        }

        public void lambda$onCreateSearchArray$122() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.setExpanded(3, true);
            liteModeSettingsActivity.scrollToFlags(1);
        }

        public void lambda$onCreateSearchArray$123() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.setExpanded(3, true);
            liteModeSettingsActivity.scrollToFlags(2);
        }

        public void lambda$onCreateSearchArray$124() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.scrollToFlags(28700);
        }

        public void lambda$onCreateSearchArray$125() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.setExpanded(28700, true);
            liteModeSettingsActivity.scrollToFlags(16388);
        }

        public void lambda$onCreateSearchArray$126() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.setExpanded(28700, true);
            liteModeSettingsActivity.scrollToFlags(8200);
        }

        public void lambda$onCreateSearchArray$127() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.setExpanded(28700, true);
            liteModeSettingsActivity.scrollToFlags(4112);
        }

        public void lambda$onCreateSearchArray$128() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.scrollToFlags(98784);
        }

        public void lambda$onCreateSearchArray$129() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.setExpanded(98784, true);
            liteModeSettingsActivity.scrollToFlags(32);
        }

        public void lambda$onCreateSearchArray$130() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.setExpanded(98784, true);
            liteModeSettingsActivity.scrollToFlags(64);
        }

        public void lambda$onCreateSearchArray$131() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.setExpanded(98784, true);
            liteModeSettingsActivity.scrollToFlags(128);
        }

        public void lambda$onCreateSearchArray$132() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.setExpanded(98784, true);
            liteModeSettingsActivity.scrollToFlags(256);
        }

        public void lambda$onCreateSearchArray$133() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.setExpanded(98784, true);
            liteModeSettingsActivity.scrollToFlags(32768);
        }

        public void lambda$onCreateSearchArray$134() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.scrollToFlags(512);
        }

        public void lambda$onCreateSearchArray$135() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.scrollToFlags(1024);
        }

        public void lambda$onCreateSearchArray$136() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.scrollToFlags(2048);
        }

        public void lambda$onCreateSearchArray$137() {
            LiteModeSettingsActivity liteModeSettingsActivity = new LiteModeSettingsActivity();
            ProfileActivity.this.presentFragment(liteModeSettingsActivity);
            liteModeSettingsActivity.scrollToType(1);
        }

        public void lambda$onCreateSearchArray$138() {
            ProfileActivity.this.presentFragment(new LanguageSelectActivity());
        }

        public void lambda$onCreateSearchArray$139() {
            ProfileActivity.this.presentFragment(new LanguageSelectActivity());
        }

        public void lambda$onCreateSearchArray$140() {
            ProfileActivity.this.presentFragment(new LanguageSelectActivity());
        }

        public void lambda$onCreateSearchArray$141() {
            ProfileActivity profileActivity = ProfileActivity.this;
            profileActivity.showDialog(AlertsCreator.createSupportAlert(profileActivity, (Theme.ResourcesProvider) null));
        }

        public void lambda$onCreateSearchArray$142() {
            Browser.openUrl(ProfileActivity.this.getParentActivity(), LocaleController.getString("TelegramFaqUrl", R.string.TelegramFaqUrl));
        }

        public void lambda$onCreateSearchArray$143() {
            Browser.openUrl(ProfileActivity.this.getParentActivity(), LocaleController.getString("PrivacyPolicyUrl", R.string.PrivacyPolicyUrl));
        }

        public final boolean isPremiumFeatureAvailable(int feature) {
            if (!ProfileActivity.this.getMessagesController().premiumFeaturesBlocked() || ProfileActivity.this.getUserConfig().isPremium()) {
                return feature == -1 || ProfileActivity.this.getMessagesController().premiumFeaturesTypesToPosition.get(feature, -1) != -1;
            }
            return false;
        }

        public final void loadFaqWebPage() {
            TLRPC.WebPage webPage = ProfileActivity.this.getMessagesController().faqWebPage;
            this.faqWebPage = webPage;
            if (webPage != null) {
                this.faqSearchArray.addAll(ProfileActivity.this.getMessagesController().faqSearchArray);
            }
            if (this.faqWebPage != null || this.loadingFaqPage) {
                return;
            }
            if (ProfileActivity.this.getUserConfig().getCurrentUser() == null || !ProfileActivity.this.getUserConfig().getCurrentUser().bot) {
                this.loadingFaqPage = true;
                TLRPC.TL_messages_getWebPage tL_messages_getWebPage = new TLRPC.TL_messages_getWebPage();
                tL_messages_getWebPage.url = LocaleController.getString("TelegramFaqUrl", R.string.TelegramFaqUrl);
                tL_messages_getWebPage.hash = 0;
                ProfileActivity.this.getConnectionsManager().sendRequest(tL_messages_getWebPage, new RequestDelegate() {
                    public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                        ProfileActivity.SearchAdapter.this.lambda$loadFaqWebPage$145(tLObject, tL_error);
                    }
                });
            }
        }

        public void lambda$loadFaqWebPage$145(TLObject tLObject, TLRPC.TL_error tL_error) {
            if (tLObject instanceof TLRPC.TL_messages_webPage) {
                TLRPC.TL_messages_webPage tL_messages_webPage = (TLRPC.TL_messages_webPage) tLObject;
                MessagesController.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).putUsers(tL_messages_webPage.users, false);
                MessagesController.getInstance(((BaseFragment) ProfileActivity.this).currentAccount).putChats(tL_messages_webPage.chats, false);
                tLObject = tL_messages_webPage.webpage;
            }
            if (tLObject instanceof TLRPC.WebPage) {
                final ArrayList arrayList = new ArrayList();
                TLRPC.WebPage webPage = (TLRPC.WebPage) tLObject;
                TLRPC.Page page = webPage.cached_page;
                if (page != null) {
                    int size = page.blocks.size();
                    for (int i = 0; i < size; i++) {
                        TLRPC.TL_pageBlockList tL_pageBlockList = (TLRPC.PageBlock) webPage.cached_page.blocks.get(i);
                        if (tL_pageBlockList instanceof TLRPC.TL_pageBlockList) {
                            String str = null;
                            if (i != 0) {
                                TLRPC.TL_pageBlockParagraph tL_pageBlockParagraph = (TLRPC.PageBlock) webPage.cached_page.blocks.get(i - 1);
                                if (tL_pageBlockParagraph instanceof TLRPC.TL_pageBlockParagraph) {
                                    str = ArticleViewer.getPlainText(tL_pageBlockParagraph.text).toString();
                                }
                            }
                            TLRPC.TL_pageBlockList tL_pageBlockList2 = tL_pageBlockList;
                            int size2 = tL_pageBlockList2.items.size();
                            for (int i2 = 0; i2 < size2; i2++) {
                                TLRPC.TL_pageListItemText tL_pageListItemText = (TLRPC.PageListItem) tL_pageBlockList2.items.get(i2);
                                if (tL_pageListItemText instanceof TLRPC.TL_pageListItemText) {
                                    TLRPC.TL_pageListItemText tL_pageListItemText2 = tL_pageListItemText;
                                    String url = ArticleViewer.getUrl(tL_pageListItemText2.text);
                                    String charSequence = ArticleViewer.getPlainText(tL_pageListItemText2.text).toString();
                                    if (!TextUtils.isEmpty(url) && !TextUtils.isEmpty(charSequence)) {
                                        arrayList.add(new MessagesController.FaqSearchResult(charSequence, str != null ? new String[]{LocaleController.getString("SettingsSearchFaq", R.string.SettingsSearchFaq), str} : new String[]{LocaleController.getString("SettingsSearchFaq", R.string.SettingsSearchFaq)}, url));
                                    }
                                }
                            }
                        } else if (tL_pageBlockList instanceof TLRPC.TL_pageBlockAnchor) {
                            break;
                        }
                    }
                    this.faqWebPage = webPage;
                }
                AndroidUtilities.runOnUIThread(new Runnable() {
                    @Override
                    public final void run() {
                        ProfileActivity.SearchAdapter.this.lambda$loadFaqWebPage$144(arrayList);
                    }
                });
            }
            this.loadingFaqPage = false;
        }

        public void lambda$loadFaqWebPage$144(ArrayList arrayList) {
            this.faqSearchArray.addAll(arrayList);
            ProfileActivity.this.getMessagesController().faqSearchArray = arrayList;
            ProfileActivity.this.getMessagesController().faqWebPage = this.faqWebPage;
            if (this.searchWas) {
                return;
            }
            notifyDataSetChanged();
        }

        public int getItemCount() {
            if (this.searchWas) {
                return this.searchResults.size() + (this.faqSearchResults.isEmpty() ? 0 : this.faqSearchResults.size() + 1);
            }
            return (this.recentSearches.isEmpty() ? 0 : this.recentSearches.size() + 1) + (this.faqSearchArray.isEmpty() ? 0 : this.faqSearchArray.size() + 1);
        }

        public boolean isEnabled(RecyclerView.ViewHolder holder) {
            return holder.getItemViewType() == 0;
        }

        public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
            int itemViewType = holder.getItemViewType();
            if (itemViewType != 0) {
                if (itemViewType == 1) {
                    ((GraySectionCell) holder.itemView).setText(LocaleController.getString("SettingsFaqSearchTitle", R.string.SettingsFaqSearchTitle));
                    return;
                } else {
                    if (itemViewType != 2) {
                        return;
                    }
                    ((HeaderCell) holder.itemView).setText(LocaleController.getString("SettingsRecent", R.string.SettingsRecent));
                    return;
                }
            }
            SettingsSearchCell settingsSearchCell = (SettingsSearchCell) holder.itemView;
            if (this.searchWas) {
                if (position < this.searchResults.size()) {
                    SearchResult searchResult = this.searchResults.get(position);
                    SearchResult searchResult2 = position > 0 ? this.searchResults.get(position - 1) : null;
                    settingsSearchCell.setTextAndValueAndIcon(this.resultNames.get(position), searchResult.path, (searchResult2 == null || searchResult2.iconResId != searchResult.iconResId) ? searchResult.iconResId : 0, position < this.searchResults.size() - 1);
                    return;
                } else {
                    int size = position - (this.searchResults.size() + 1);
                    settingsSearchCell.setTextAndValue(this.resultNames.get(this.searchResults.size() + size), this.faqSearchResults.get(size).path, true, size < this.searchResults.size() - 1);
                    return;
                }
            }
            if (!this.recentSearches.isEmpty()) {
                position--;
            }
            if (position < this.recentSearches.size()) {
                Object obj = this.recentSearches.get(position);
                if (obj instanceof SearchResult) {
                    SearchResult searchResult3 = (SearchResult) obj;
                    settingsSearchCell.setTextAndValue(searchResult3.searchTitle, searchResult3.path, false, position < this.recentSearches.size() - 1);
                    return;
                } else {
                    if (obj instanceof MessagesController.FaqSearchResult) {
                        MessagesController.FaqSearchResult faqSearchResult = (MessagesController.FaqSearchResult) obj;
                        settingsSearchCell.setTextAndValue(faqSearchResult.title, faqSearchResult.path, true, position < this.recentSearches.size() - 1);
                        return;
                    }
                    return;
                }
            }
            int size2 = position - (this.recentSearches.size() + 1);
            MessagesController.FaqSearchResult faqSearchResult2 = this.faqSearchArray.get(size2);
            settingsSearchCell.setTextAndValue(faqSearchResult2.title, faqSearchResult2.path, true, size2 < this.recentSearches.size() - 1);
        }

        public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View settingsSearchCell;
            if (viewType == 0) {
                settingsSearchCell = new SettingsSearchCell(this.mContext);
            } else if (viewType == 1) {
                settingsSearchCell = new GraySectionCell(this.mContext);
            } else {
                settingsSearchCell = new HeaderCell(this.mContext, 16);
            }
            settingsSearchCell.setLayoutParams(new RecyclerView.LayoutParams(-1, -2));
            return new RecyclerListView.Holder(settingsSearchCell);
        }

        public int getItemViewType(int position) {
            if (this.searchWas) {
                if (position >= this.searchResults.size() && position == this.searchResults.size()) {
                    return 1;
                }
            } else {
                if (position == 0) {
                    return !this.recentSearches.isEmpty() ? 2 : 1;
                }
                if (!this.recentSearches.isEmpty() && position == this.recentSearches.size() + 1) {
                    return 1;
                }
            }
            return 0;
        }

        public void addRecent(Object object) {
            int indexOf = this.recentSearches.indexOf(object);
            if (indexOf >= 0) {
                this.recentSearches.remove(indexOf);
            }
            this.recentSearches.add(0, object);
            if (!this.searchWas) {
                notifyDataSetChanged();
            }
            if (this.recentSearches.size() > 20) {
                this.recentSearches.remove(r5.size() - 1);
            }
            LinkedHashSet linkedHashSet = new LinkedHashSet();
            int size = this.recentSearches.size();
            for (int i = 0; i < size; i++) {
                Object obj = this.recentSearches.get(i);
                if (obj instanceof SearchResult) {
                    ((SearchResult) obj).num = i;
                } else if (obj instanceof MessagesController.FaqSearchResult) {
                    ((MessagesController.FaqSearchResult) obj).num = i;
                }
                linkedHashSet.add(obj.toString());
            }
            MessagesController.getGlobalMainSettings().edit().putStringSet("settingsSearchRecent2", linkedHashSet).commit();
        }

        public void clearRecent() {
            this.recentSearches.clear();
            MessagesController.getGlobalMainSettings().edit().remove("settingsSearchRecent2").commit();
            notifyDataSetChanged();
        }

        public final int getNum(Object o) {
            if (o instanceof SearchResult) {
                return ((SearchResult) o).num;
            }
            if (o instanceof MessagesController.FaqSearchResult) {
                return ((MessagesController.FaqSearchResult) o).num;
            }
            return 0;
        }

        public void search(final String text) {
            this.lastSearchString = text;
            if (this.searchRunnable != null) {
                Utilities.searchQueue.cancelRunnable(this.searchRunnable);
                this.searchRunnable = null;
            }
            if (TextUtils.isEmpty(text)) {
                this.searchWas = false;
                this.searchResults.clear();
                this.faqSearchResults.clear();
                this.resultNames.clear();
                ProfileActivity.this.emptyView.stickerView.getImageReceiver().startAnimation();
                ProfileActivity.this.emptyView.title.setText(LocaleController.getString("SettingsNoRecent", R.string.SettingsNoRecent));
                notifyDataSetChanged();
                return;
            }
            DispatchQueue dispatchQueue = Utilities.searchQueue;
            Runnable runnable = new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$search$147(text);
                }
            };
            this.searchRunnable = runnable;
            dispatchQueue.postRunnable(runnable, 300L);
        }

        public void lambda$search$147(final String str) {
            SpannableStringBuilder spannableStringBuilder;
            String str2;
            int i;
            String str3;
            final ArrayList arrayList = new ArrayList();
            final ArrayList arrayList2 = new ArrayList();
            final ArrayList arrayList3 = new ArrayList();
            String str4 = " ";
            String[] split = str.split(" ");
            String[] strArr = new String[split.length];
            int i2 = 0;
            while (true) {
                spannableStringBuilder = null;
                if (i2 >= split.length) {
                    break;
                }
                strArr[i2] = LocaleController.getInstance().getTranslitString(split[i2]);
                if (strArr[i2].equals(split[i2])) {
                    strArr[i2] = null;
                }
                i2++;
            }
            int i3 = 0;
            while (true) {
                SearchResult[] searchResultArr = this.searchArray;
                if (i3 >= searchResultArr.length) {
                    break;
                }
                SearchResult searchResult = searchResultArr[i3];
                if (searchResult != null) {
                    String str5 = " " + searchResult.searchTitle.toLowerCase();
                    SpannableStringBuilder spannableStringBuilder2 = spannableStringBuilder;
                    int i4 = 0;
                    while (i4 < split.length) {
                        if (split[i4].length() != 0) {
                            String str6 = split[i4];
                            int indexOf = str5.indexOf(" " + str6);
                            if (indexOf < 0 && strArr[i4] != null) {
                                str6 = strArr[i4];
                                indexOf = str5.indexOf(" " + str6);
                            }
                            if (indexOf >= 0) {
                                if (spannableStringBuilder2 == null) {
                                    spannableStringBuilder2 = new SpannableStringBuilder(searchResult.searchTitle);
                                }
                                str3 = str5;
                                spannableStringBuilder2.setSpan(new ForegroundColorSpan(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhiteBlueText4)), indexOf, str6.length() + indexOf, 33);
                            }
                        } else {
                            str3 = str5;
                        }
                        if (spannableStringBuilder2 != null && i4 == split.length - 1) {
                            if (searchResult.guid == 502) {
                                int i5 = -1;
                                int i6 = 0;
                                while (true) {
                                    if (i6 >= UserConfig.MAX_ACCOUNT_COUNT) {
                                        break;
                                    }
                                    if (!UserConfig.getInstance(i6).isClientActivated()) {
                                        i5 = i6;
                                        break;
                                    }
                                    i6++;
                                }
                                if (i5 < 0) {
                                }
                            }
                            arrayList.add(searchResult);
                            arrayList3.add(spannableStringBuilder2);
                        }
                        i4++;
                        str5 = str3;
                    }
                }
                i3++;
                spannableStringBuilder = null;
            }
            if (this.faqWebPage != null) {
                int size = this.faqSearchArray.size();
                int i7 = 0;
                while (i7 < size) {
                    MessagesController.FaqSearchResult faqSearchResult = this.faqSearchArray.get(i7);
                    String str7 = str4 + faqSearchResult.title.toLowerCase();
                    int i8 = 0;
                    SpannableStringBuilder spannableStringBuilder3 = null;
                    while (i8 < split.length) {
                        if (split[i8].length() != 0) {
                            String str8 = split[i8];
                            int indexOf2 = str7.indexOf(str4 + str8);
                            if (indexOf2 < 0 && strArr[i8] != null) {
                                str8 = strArr[i8];
                                indexOf2 = str7.indexOf(str4 + str8);
                            }
                            if (indexOf2 >= 0) {
                                if (spannableStringBuilder3 == null) {
                                    spannableStringBuilder3 = new SpannableStringBuilder(faqSearchResult.title);
                                }
                                str2 = str4;
                                i = size;
                                spannableStringBuilder3.setSpan(new ForegroundColorSpan(ProfileActivity.this.getThemedColor(Theme.key_windowBackgroundWhiteBlueText4)), indexOf2, str8.length() + indexOf2, 33);
                            }
                        } else {
                            str2 = str4;
                            i = size;
                        }
                        if (spannableStringBuilder3 != null && i8 == split.length - 1) {
                            arrayList2.add(faqSearchResult);
                            arrayList3.add(spannableStringBuilder3);
                        }
                        i8++;
                        str4 = str2;
                        size = i;
                    }
                    i7++;
                    str4 = str4;
                    size = size;
                }
            }
            AndroidUtilities.runOnUIThread(new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.SearchAdapter.this.lambda$search$146(str, arrayList, arrayList2, arrayList3);
                }
            });
        }

        public void lambda$search$146(String str, ArrayList arrayList, ArrayList arrayList2, ArrayList arrayList3) {
            if (str.equals(this.lastSearchString)) {
                if (!this.searchWas) {
                    ProfileActivity.this.emptyView.stickerView.getImageReceiver().startAnimation();
                    ProfileActivity.this.emptyView.title.setText(LocaleController.getString("SettingsNoResults", R.string.SettingsNoResults));
                }
                this.searchWas = true;
                this.searchResults = arrayList;
                this.faqSearchResults = arrayList2;
                this.resultNames = arrayList3;
                notifyDataSetChanged();
                ProfileActivity.this.emptyView.stickerView.getImageReceiver().startAnimation();
            }
        }

        public boolean isSearchWas() {
            return this.searchWas;
        }
    }

    public final void openUrl(String url, Browser.Progress progress) {
        if (url.startsWith("@")) {
            getMessagesController().openByUserName(url.substring(1), this, 0, progress);
            return;
        }
        if (url.startsWith("#")) {
            DialogsActivity dialogsActivity = new DialogsActivity(null);
            dialogsActivity.setSearchString(url);
            presentFragment(dialogsActivity);
        } else {
            if (!url.startsWith("/") || ((BaseFragment) this).parentLayout.getFragmentStack().size() <= 1) {
                return;
            }
            BaseFragment baseFragment = ((BaseFragment) this).parentLayout.getFragmentStack().get(((BaseFragment) this).parentLayout.getFragmentStack().size() - 2);
            if (baseFragment instanceof ChatActivity) {
                finishFragment();
                ((ChatActivity) baseFragment).chatActivityEnterView.setCommand((MessageObject) null, url, false, false);
            }
        }
    }

    public final void dimBehindView(View view, float value) {
        this.scrimView = view;
        dimBehindView(value);
    }

    public final void dimBehindView(boolean enable) {
        dimBehindView(enable ? 0.2f : 0.0f);
    }

    public final void dimBehindView(float value) {
        ValueAnimator ofFloat;
        boolean z = value > 0.0f;
        ((BaseFragment) this).fragmentView.invalidate();
        AnimatorSet animatorSet = this.scrimAnimatorSet;
        if (animatorSet != null) {
            animatorSet.cancel();
        }
        this.scrimAnimatorSet = new AnimatorSet();
        ArrayList arrayList = new ArrayList();
        if (z) {
            ofFloat = ValueAnimator.ofFloat(0.0f, value);
            arrayList.add(ofFloat);
        } else {
            ofFloat = ValueAnimator.ofFloat(this.scrimPaint.getAlpha() / 255.0f, 0.0f);
            arrayList.add(ofFloat);
        }
        ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public final void onAnimationUpdate(ValueAnimator valueAnimator) {
                ProfileActivity.this.lambda$dimBehindView$86(valueAnimator);
            }
        });
        this.scrimAnimatorSet.playTogether(arrayList);
        this.scrimAnimatorSet.setDuration(z ? 150L : 220L);
        if (!z) {
            this.scrimAnimatorSet.addListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    ProfileActivity.this.scrimView = null;
                    ((BaseFragment) ProfileActivity.this).fragmentView.invalidate();
                }
            });
        }
        this.scrimAnimatorSet.start();
    }

    public void lambda$dimBehindView$86(ValueAnimator valueAnimator) {
        this.scrimPaint.setAlpha((int) (((Float) valueAnimator.getAnimatedValue()).floatValue() * 255.0f));
    }

    public ArrayList<ThemeDescription> getThemeDescriptions() {
        if (this.resourcesProvider != null) {
            return null;
        }
        ThemeDescription.ThemeDescriptionDelegate themeDescriptionDelegate = new ThemeDescription.ThemeDescriptionDelegate() {
            @Override
            public final void didSetColor() {
                ProfileActivity.this.lambda$getThemeDescriptions$87();
            }

            @Override
            public void onAnimationProgress(float f) {
                ThemeDescription.ThemeDescriptionDelegate.CC.$default$onAnimationProgress(this, f);
            }
        };
        ArrayList<ThemeDescription> arrayList = new ArrayList<>();
        SharedMediaLayout sharedMediaLayout = this.sharedMediaLayout;
        if (sharedMediaLayout != null) {
            arrayList.addAll(sharedMediaLayout.getThemeDescriptions());
        }
        RecyclerListView recyclerListView = this.listView;
        int i = Theme.key_windowBackgroundWhite;
        arrayList.add(new ThemeDescription(recyclerListView, 0, null, null, null, null, i));
        arrayList.add(new ThemeDescription(this.searchListView, 0, null, null, null, null, i));
        arrayList.add(new ThemeDescription(this.listView, 0, null, null, null, null, Theme.key_windowBackgroundGray));
        arrayList.add(new ThemeDescription(((BaseFragment) this).actionBar, ThemeDescription.FLAG_AB_SUBMENUBACKGROUND, null, null, null, null, Theme.key_actionBarDefaultSubmenuBackground));
        arrayList.add(new ThemeDescription(((BaseFragment) this).actionBar, ThemeDescription.FLAG_AB_SUBMENUITEM, null, null, null, null, Theme.key_actionBarDefaultSubmenuItem));
        arrayList.add(new ThemeDescription(((BaseFragment) this).actionBar, ThemeDescription.FLAG_AB_SUBMENUITEM | ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_actionBarDefaultSubmenuItemIcon));
        arrayList.add(new ThemeDescription(null, 0, null, null, null, themeDescriptionDelegate, Theme.key_actionBarDefaultIcon));
        arrayList.add(new ThemeDescription(null, 0, null, null, null, themeDescriptionDelegate, Theme.key_avatar_actionBarSelectorBlue));
        arrayList.add(new ThemeDescription(null, 0, null, null, null, themeDescriptionDelegate, Theme.key_chat_lockIcon));
        int i2 = Theme.key_avatar_subtitleInProfileBlue;
        arrayList.add(new ThemeDescription(null, 0, null, null, null, themeDescriptionDelegate, i2));
        int i3 = Theme.key_avatar_backgroundActionBarBlue;
        arrayList.add(new ThemeDescription(null, 0, null, null, null, themeDescriptionDelegate, i3));
        arrayList.add(new ThemeDescription(null, 0, null, null, null, themeDescriptionDelegate, Theme.key_profile_title));
        arrayList.add(new ThemeDescription(null, 0, null, null, null, themeDescriptionDelegate, Theme.key_profile_status));
        arrayList.add(new ThemeDescription(null, 0, null, null, null, themeDescriptionDelegate, i2));
        if (this.mediaCounterTextView != null) {
            TextView textView = this.mediaCounterTextView.getTextView();
            int i4 = ThemeDescription.FLAG_TEXTCOLOR;
            int i5 = Theme.key_player_actionBarSubtitle;
            arrayList.add(new ThemeDescription(textView, i4, null, null, null, themeDescriptionDelegate, i5));
            arrayList.add(new ThemeDescription(this.mediaCounterTextView.getNextTextView(), ThemeDescription.FLAG_TEXTCOLOR, null, null, null, themeDescriptionDelegate, i5));
        }
        arrayList.add(new ThemeDescription(this.topView, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, i3));
        arrayList.add(new ThemeDescription(this.listView, ThemeDescription.FLAG_SELECTOR, null, null, null, null, Theme.key_listSelector));
        arrayList.add(new ThemeDescription(this.listView, 0, new Class[]{View.class}, Theme.dividerPaint, null, null, Theme.key_divider));
        BackupImageView backupImageView = this.avatarImage;
        Drawable[] drawableArr = Theme.avatarDrawables;
        int i6 = Theme.key_avatar_text;
        arrayList.add(new ThemeDescription(backupImageView, 0, null, null, drawableArr, null, i6));
        arrayList.add(new ThemeDescription(this.avatarImage, 0, null, null, new Drawable[]{this.avatarDrawable}, null, Theme.key_avatar_backgroundInProfileBlue));
        arrayList.add(new ThemeDescription(this.writeButton, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_profile_actionIcon));
        arrayList.add(new ThemeDescription(this.writeButton, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_profile_actionBackground));
        arrayList.add(new ThemeDescription(this.writeButton, ThemeDescription.FLAG_BACKGROUNDFILTER | ThemeDescription.FLAG_DRAWABLESELECTEDSTATE, null, null, null, null, Theme.key_profile_actionPressedBackground));
        int i7 = Theme.key_windowBackgroundWhiteBlackText;
        arrayList.add(new ThemeDescription((View) this.listView, ThemeDescription.FLAG_CHECKTAG, new Class[]{TextCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i7));
        arrayList.add(new ThemeDescription((View) this.listView, ThemeDescription.FLAG_CHECKTAG, new Class[]{TextCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_windowBackgroundWhiteGreenText2));
        arrayList.add(new ThemeDescription((View) this.listView, ThemeDescription.FLAG_CHECKTAG, new Class[]{TextCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_text_RedRegular));
        arrayList.add(new ThemeDescription((View) this.listView, ThemeDescription.FLAG_CHECKTAG, new Class[]{TextCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_windowBackgroundWhiteBlueText2));
        arrayList.add(new ThemeDescription((View) this.listView, ThemeDescription.FLAG_CHECKTAG, new Class[]{TextCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_windowBackgroundWhiteBlueButton));
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{TextCell.class}, new String[]{"valueTextView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_windowBackgroundWhiteValueText));
        int i8 = Theme.key_windowBackgroundWhiteGrayIcon;
        arrayList.add(new ThemeDescription((View) this.listView, ThemeDescription.FLAG_CHECKTAG, new Class[]{TextCell.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i8));
        arrayList.add(new ThemeDescription((View) this.listView, ThemeDescription.FLAG_CHECKTAG, new Class[]{TextCell.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_windowBackgroundWhiteBlueIcon));
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{TextDetailCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i7));
        int i9 = Theme.key_windowBackgroundWhiteGrayText2;
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{TextDetailCell.class}, new String[]{"valueTextView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i9));
        int i10 = Theme.key_windowBackgroundWhiteBlueHeader;
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{HeaderCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i10));
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{SettingsSuggestionCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i10));
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{SettingsSuggestionCell.class}, new String[]{"detailTextView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i9));
        int i11 = Theme.key_windowBackgroundWhiteLinkText;
        arrayList.add(new ThemeDescription((View) this.listView, ThemeDescription.FLAG_LINKCOLOR, new Class[]{SettingsSuggestionCell.class}, new String[]{"detailTextView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i11));
        int i12 = Theme.key_featuredStickers_buttonText;
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{SettingsSuggestionCell.class}, new String[]{"yesButton"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i12));
        int i13 = Theme.key_featuredStickers_addButton;
        arrayList.add(new ThemeDescription((View) this.listView, ThemeDescription.FLAG_USEBACKGROUNDDRAWABLE, new Class[]{SettingsSuggestionCell.class}, new String[]{"yesButton"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i13));
        int i14 = Theme.key_featuredStickers_addButtonPressed;
        arrayList.add(new ThemeDescription((View) this.listView, ThemeDescription.FLAG_USEBACKGROUNDDRAWABLE | ThemeDescription.FLAG_DRAWABLESELECTEDSTATE, new Class[]{SettingsSuggestionCell.class}, new String[]{"yesButton"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i14));
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{SettingsSuggestionCell.class}, new String[]{"noButton"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i12));
        arrayList.add(new ThemeDescription((View) this.listView, ThemeDescription.FLAG_USEBACKGROUNDDRAWABLE, new Class[]{SettingsSuggestionCell.class}, new String[]{"noButton"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i13));
        arrayList.add(new ThemeDescription((View) this.listView, ThemeDescription.FLAG_USEBACKGROUNDDRAWABLE | ThemeDescription.FLAG_DRAWABLESELECTEDSTATE, new Class[]{SettingsSuggestionCell.class}, new String[]{"noButton"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i14));
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{NotificationsCheckCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i7));
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{NotificationsCheckCell.class}, new String[]{"valueTextView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i9));
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{NotificationsCheckCell.class}, new String[]{"checkBox"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_switchTrack));
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{NotificationsCheckCell.class}, new String[]{"checkBox"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_switchTrackChecked));
        arrayList.add(new ThemeDescription((View) this.listView, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{UserCell.class}, new String[]{"adminTextView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_profile_creatorIcon));
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{UserCell.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i8));
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{UserCell.class}, new String[]{"nameTextView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i7));
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{UserCell.class}, new String[]{"statusColor"}, (Paint[]) null, (Drawable[]) null, themeDescriptionDelegate, Theme.key_windowBackgroundWhiteGrayText));
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{UserCell.class}, new String[]{"statusOnlineColor"}, (Paint[]) null, (Drawable[]) null, themeDescriptionDelegate, Theme.key_windowBackgroundWhiteBlueText));
        arrayList.add(new ThemeDescription(this.listView, 0, new Class[]{UserCell.class}, null, Theme.avatarDrawables, null, i6));
        arrayList.add(new ThemeDescription(null, 0, null, null, null, themeDescriptionDelegate, Theme.key_avatar_backgroundRed));
        arrayList.add(new ThemeDescription(null, 0, null, null, null, themeDescriptionDelegate, Theme.key_avatar_backgroundOrange));
        arrayList.add(new ThemeDescription(null, 0, null, null, null, themeDescriptionDelegate, Theme.key_avatar_backgroundViolet));
        arrayList.add(new ThemeDescription(null, 0, null, null, null, themeDescriptionDelegate, Theme.key_avatar_backgroundGreen));
        arrayList.add(new ThemeDescription(null, 0, null, null, null, themeDescriptionDelegate, Theme.key_avatar_backgroundCyan));
        arrayList.add(new ThemeDescription(null, 0, null, null, null, themeDescriptionDelegate, Theme.key_avatar_backgroundBlue));
        arrayList.add(new ThemeDescription(null, 0, null, null, null, themeDescriptionDelegate, Theme.key_avatar_backgroundPink));
        arrayList.add(new ThemeDescription(this.undoView, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_undo_background));
        int i15 = Theme.key_undo_cancelColor;
        arrayList.add(new ThemeDescription((View) this.undoView, 0, new Class[]{UndoView.class}, new String[]{"undoImageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i15));
        arrayList.add(new ThemeDescription((View) this.undoView, 0, new Class[]{UndoView.class}, new String[]{"undoTextView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i15));
        int i16 = Theme.key_undo_infoColor;
        arrayList.add(new ThemeDescription((View) this.undoView, 0, new Class[]{UndoView.class}, new String[]{"infoTextView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i16));
        arrayList.add(new ThemeDescription((View) this.undoView, 0, new Class[]{UndoView.class}, new String[]{"textPaint"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i16));
        arrayList.add(new ThemeDescription((View) this.undoView, 0, new Class[]{UndoView.class}, new String[]{"progressPaint"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i16));
        arrayList.add(new ThemeDescription((View) this.undoView, ThemeDescription.FLAG_IMAGECOLOR, new Class[]{UndoView.class}, new String[]{"leftImageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i16));
        arrayList.add(new ThemeDescription(this.listView, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{AboutLinkCell.class}, Theme.profile_aboutTextPaint, null, null, i7));
        arrayList.add(new ThemeDescription(this.listView, ThemeDescription.FLAG_LINKCOLOR, new Class[]{AboutLinkCell.class}, Theme.profile_aboutTextPaint, null, null, i11));
        arrayList.add(new ThemeDescription(this.listView, 0, new Class[]{AboutLinkCell.class}, Theme.linkSelectionPaint, null, null, Theme.key_windowBackgroundWhiteLinkSelection));
        int i17 = Theme.key_windowBackgroundGrayShadow;
        arrayList.add(new ThemeDescription(this.listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[]{ShadowSectionCell.class}, null, null, null, i17));
        arrayList.add(new ThemeDescription(this.listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[]{TextInfoPrivacyCell.class}, null, null, null, i17));
        arrayList.add(new ThemeDescription((View) this.listView, 0, new Class[]{TextInfoPrivacyCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_windowBackgroundWhiteGrayText4));
        arrayList.add(new ThemeDescription((View) this.searchListView, 0, new Class[]{HeaderCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i10));
        arrayList.add(new ThemeDescription((View) this.searchListView, 0, new Class[]{GraySectionCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_graySectionText));
        arrayList.add(new ThemeDescription(this.searchListView, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR, new Class[]{GraySectionCell.class}, null, null, null, Theme.key_graySection));
        arrayList.add(new ThemeDescription((View) this.searchListView, 0, new Class[]{SettingsSearchCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i7));
        arrayList.add(new ThemeDescription((View) this.searchListView, 0, new Class[]{SettingsSearchCell.class}, new String[]{"valueTextView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i9));
        arrayList.add(new ThemeDescription((View) this.searchListView, 0, new Class[]{SettingsSearchCell.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i8));
        if (this.mediaHeaderVisible) {
            arrayList.add(new ThemeDescription(this.nameTextView[1], 0, null, null, this.verifiedCheckDrawable, null, Theme.key_player_actionBarTitle));
            arrayList.add(new ThemeDescription(this.nameTextView[1], 0, null, null, this.verifiedDrawable, null, i));
        } else {
            arrayList.add(new ThemeDescription(this.nameTextView[1], 0, null, null, this.verifiedCheckDrawable, null, Theme.key_profile_verifiedCheck));
            arrayList.add(new ThemeDescription(this.nameTextView[1], 0, null, null, this.verifiedDrawable, null, Theme.key_profile_verifiedBackground));
        }
        return arrayList;
    }

    public void lambda$getThemeDescriptions$87() {
        RecyclerListView recyclerListView = this.listView;
        if (recyclerListView != null) {
            int childCount = recyclerListView.getChildCount();
            for (int i = 0; i < childCount; i++) {
                View childAt = this.listView.getChildAt(i);
                if (childAt instanceof UserCell) {
                    ((UserCell) childAt).update(0);
                }
            }
        }
        if (!this.isPulledDown) {
            SimpleTextView[] simpleTextViewArr = this.onlineTextView;
            if (simpleTextViewArr[1] != null) {
                Object tag = simpleTextViewArr[1].getTag();
                for (int i2 = 0; i2 < 2; i2++) {
                    if (tag instanceof Integer) {
                        this.onlineTextView[i2 + 1].setTextColor(applyPeerColor(getThemedColor(((Integer) tag).intValue()), true, Boolean.valueOf(this.isOnline[0])));
                    } else {
                        this.onlineTextView[i2 + 1].setTextColor(applyPeerColor(getThemedColor(Theme.key_avatar_subtitleInProfileBlue), true, Boolean.TRUE));
                    }
                }
            }
            Drawable drawable = this.lockIconDrawable;
            if (drawable != null) {
                drawable.setColorFilter(getThemedColor(Theme.key_chat_lockIcon), PorterDuff.Mode.MULTIPLY);
            }
            ScamDrawable scamDrawable = this.scamDrawable;
            if (scamDrawable != null) {
                scamDrawable.setColor(getThemedColor(Theme.key_avatar_subtitleInProfileBlue));
            }
            SimpleTextView[] simpleTextViewArr2 = this.nameTextView;
            if (simpleTextViewArr2[1] != null) {
                simpleTextViewArr2[1].setTextColor(getThemedColor(Theme.key_profile_title));
            }
            ActionBar actionBar = ((BaseFragment) this).actionBar;
            if (actionBar != null) {
                actionBar.setItemsColor(this.peerColor != null ? -1 : getThemedColor(Theme.key_actionBarDefaultIcon), false);
                ((BaseFragment) this).actionBar.setItemsBackgroundColor(this.peerColor != null ? 553648127 : getThemedColor(Theme.key_avatar_actionBarSelectorBlue), false);
            }
        }
        updateEmojiStatusDrawableColor();
    }

    public void updateListAnimated(boolean updateOnlineCount) {
        if (this.listAdapter == null) {
            if (updateOnlineCount) {
                updateOnlineCount(false);
            }
            updateRowsIds();
            return;
        }
        DiffCallback diffCallback = new DiffCallback();
        diffCallback.oldRowCount = this.rowCount;
        diffCallback.fillPositions(diffCallback.oldPositionToItem);
        diffCallback.oldChatParticipant.clear();
        diffCallback.oldChatParticipantSorted.clear();
        diffCallback.oldChatParticipant.addAll(this.visibleChatParticipants);
        diffCallback.oldChatParticipantSorted.addAll(this.visibleSortedUsers);
        diffCallback.oldMembersStartRow = this.membersStartRow;
        diffCallback.oldMembersEndRow = this.membersEndRow;
        if (updateOnlineCount) {
            updateOnlineCount(false);
        }
        saveScrollPosition();
        updateRowsIds();
        diffCallback.fillPositions(diffCallback.newPositionToItem);
        try {
            DiffUtil.calculateDiff(diffCallback).dispatchUpdatesTo(this.listAdapter);
        } catch (Exception unused) {
            this.listAdapter.notifyDataSetChanged();
        }
        int i = this.savedScrollPosition;
        if (i >= 0) {
            this.layoutManager.scrollToPositionWithOffset(i, this.savedScrollOffset - this.listView.getPaddingTop());
        }
        AndroidUtilities.updateVisibleRows(this.listView);
    }

    public final void saveScrollPosition() {
        RecyclerListView recyclerListView = this.listView;
        if (recyclerListView == null || this.layoutManager == null || recyclerListView.getChildCount() <= 0 || this.savedScrollToSharedMedia) {
            return;
        }
        View view = null;
        int i = Integer.MAX_VALUE;
        int i2 = -1;
        for (int i3 = 0; i3 < this.listView.getChildCount(); i3++) {
            RecyclerListView recyclerListView2 = this.listView;
            int childAdapterPosition = recyclerListView2.getChildAdapterPosition(recyclerListView2.getChildAt(i3));
            View childAt = this.listView.getChildAt(i3);
            if (childAdapterPosition != -1 && childAt.getTop() < i) {
                i = childAt.getTop();
                i2 = childAdapterPosition;
                view = childAt;
            }
        }
        if (view != null) {
            this.savedScrollPosition = i2;
            int top = view.getTop();
            this.savedScrollOffset = top;
            if (this.savedScrollPosition == 0 && !this.allowPullingDown && top > AndroidUtilities.dp(88.0f)) {
                this.savedScrollOffset = AndroidUtilities.dp(88.0f);
            }
            this.layoutManager.scrollToPositionWithOffset(i2, view.getTop() - this.listView.getPaddingTop());
        }
    }

    public void scrollToSharedMedia() {
        this.layoutManager.scrollToPositionWithOffset(this.sharedMediaRow, -this.listView.getPaddingTop());
    }

    public final void onTextDetailCellImageClicked(View view) {
        View view2 = (View) view.getParent();
        if (view2.getTag() != null && ((Integer) view2.getTag()).intValue() == this.usernameRow) {
            Bundle bundle = new Bundle();
            bundle.putLong("chat_id", this.chatId);
            bundle.putLong("user_id", this.userId);
            presentFragment(new QrActivity(bundle));
            return;
        }
        if (view2.getTag() == null || ((Integer) view2.getTag()).intValue() != this.birthdayRow) {
            return;
        }
        if (this.userId == getUserConfig().getClientUserId()) {
            presentFragment(new PremiumPreviewFragment("my_profile_gift"));
            return;
        }
        final TLRPC.User user = getMessagesController().getUser(Long.valueOf(this.userId));
        if (user == null || this.userInfo == null) {
            return;
        }
        if (new ArrayList(this.userInfo.premium_gifts).isEmpty()) {
            if (getVisibleDialog() != null) {
                return;
            }
            final AlertDialog alertDialog = new AlertDialog(getContext(), 3);
            final int loadGiftOptions = BoostRepository.loadGiftOptions(null, new Utilities.Callback() {
                public final void run(Object obj) {
                    ProfileActivity.this.lambda$onTextDetailCellImageClicked$88(alertDialog, user, (List) obj);
                }
            });
            alertDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
                @Override
                public final void onCancel(DialogInterface dialogInterface) {
                    ProfileActivity.this.lambda$onTextDetailCellImageClicked$89(loadGiftOptions, dialogInterface);
                }
            });
            alertDialog.showDelayed(500L);
            return;
        }
        showDialog(new GiftPremiumBottomSheet(this, user));
    }

    public void lambda$onTextDetailCellImageClicked$88(AlertDialog alertDialog, TLRPC.User user, List list) {
        alertDialog.dismiss();
        if (getVisibleDialog() != null) {
            return;
        }
        List<TLRPC.TL_premiumGiftCodeOption> filterGiftOptionsByBilling = BoostRepository.filterGiftOptionsByBilling(BoostRepository.filterGiftOptions(list, 1));
        ArrayList arrayList = new ArrayList();
        arrayList.add(user);
        PremiumPreviewGiftToUsersBottomSheet.show(arrayList, filterGiftOptionsByBilling);
    }

    public void lambda$onTextDetailCellImageClicked$89(int i, DialogInterface dialogInterface) {
        getConnectionsManager().cancelRequest(i, true);
    }

    public void onBecomeFullyVisible() {
        super.onBecomeFullyVisible();
        writeButtonSetBackground();
        this.fullyVisible = true;
        createBirthdayEffect();
    }

    public final void writeButtonSetBackground() {
        if (this.writeButton == null) {
            return;
        }
        try {
            Drawable mutate = ((BaseFragment) this).fragmentView.getContext().getResources().getDrawable(R.drawable.floating_shadow_profile).mutate();
            mutate.setColorFilter(new PorterDuffColorFilter(-16777216, PorterDuff.Mode.MULTIPLY));
            int themedColor = getThemedColor(Theme.key_profile_actionBackground);
            int themedColor2 = getThemedColor(Theme.key_profile_actionPressedBackground);
            int themedColor3 = getThemedColor(Theme.key_profile_actionIcon);
            if (this.peerColor != null && Theme.hasHue(themedColor)) {
                themedColor = Theme.adaptHSV(this.peerColor.getBgColor1(false), 0.05f, -0.04f);
                themedColor2 = applyPeerColor2(themedColor2);
                themedColor3 = -1;
            }
            Drawable combinedDrawable = new CombinedDrawable(mutate, Theme.createSimpleSelectorCircleDrawable(AndroidUtilities.dp(56.0f), themedColor, themedColor2), 0, 0);
            combinedDrawable.setIconSize(AndroidUtilities.dp(56.0f), AndroidUtilities.dp(56.0f));
            this.writeButton.setBackground(combinedDrawable);
            this.writeButton.setColorFilter(new PorterDuffColorFilter(themedColor3, PorterDuff.Mode.MULTIPLY));
        } catch (Exception unused) {
        }
    }

    @SuppressLint({"NotifyDataSetChanged"})
    public final void openAddToContact(final TLRPC.User user, Bundle args) {
        ContactAddActivity contactAddActivity = new ContactAddActivity(args, this.resourcesProvider);
        contactAddActivity.setDelegate(new ContactAddActivity.ContactAddActivityDelegate() {
            @Override
            public final void didAddToContacts() {
                ProfileActivity.this.lambda$openAddToContact$90(user);
            }
        });
        presentFragment(contactAddActivity);
    }

    public void lambda$openAddToContact$90(TLRPC.User user) {
        if (this.addToContactsRow >= 0) {
            if (this.sharedMediaRow == -1) {
                updateRowsIds();
                this.listAdapter.notifyDataSetChanged();
            } else {
                updateListAnimated(false);
            }
        }
        if (this.sharedMediaRow == -1) {
            if (this.isInLandscapeMode || AndroidUtilities.isTablet()) {
                this.listView.setPadding(0, AndroidUtilities.dp(88.0f), 0, 0);
                this.expandAnimator.cancel();
                float[] fArr = this.expandAnimatorValues;
                fArr[0] = 1.0f;
                fArr[1] = 0.0f;
                setAvatarExpandProgress(1.0f);
                this.extraHeight = AndroidUtilities.dp(88.0f);
            } else {
                int currentActionBarHeight = ActionBar.getCurrentActionBarHeight() + (((BaseFragment) this).actionBar.getOccupyStatusBar() ? AndroidUtilities.statusBarHeight : 0);
                int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(this.listView.getMeasuredWidth(), 1073741824);
                int makeMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(this.listView.getMeasuredHeight(), 0);
                int i = 0;
                for (int i2 = 0; i2 < this.listAdapter.getItemCount(); i2++) {
                    ListAdapter listAdapter = this.listAdapter;
                    RecyclerView.ViewHolder createViewHolder = listAdapter.createViewHolder((ViewGroup) null, listAdapter.getItemViewType(i2));
                    this.listAdapter.onBindViewHolder(createViewHolder, i2);
                    createViewHolder.itemView.measure(makeMeasureSpec, makeMeasureSpec2);
                    i += createViewHolder.itemView.getMeasuredHeight();
                }
                int max = Math.max(0, ((BaseFragment) this).fragmentView.getMeasuredHeight() - ((i + AndroidUtilities.dp(88.0f)) + currentActionBarHeight));
                RecyclerListView recyclerListView = this.listView;
                recyclerListView.setPadding(0, recyclerListView.getPaddingTop(), 0, max);
            }
        }
        this.undoView.showWithAction(this.dialogId, 8, user);
    }

    public class DiffCallback extends DiffUtil.Callback {
        public SparseIntArray newPositionToItem;
        public ArrayList<TLRPC.ChatParticipant> oldChatParticipant;
        public ArrayList<Integer> oldChatParticipantSorted;
        public int oldMembersEndRow;
        public int oldMembersStartRow;
        public SparseIntArray oldPositionToItem;
        public int oldRowCount;

        public DiffCallback() {
            this.oldPositionToItem = new SparseIntArray();
            this.newPositionToItem = new SparseIntArray();
            this.oldChatParticipant = new ArrayList<>();
            this.oldChatParticipantSorted = new ArrayList<>();
        }

        public int getOldListSize() {
            return this.oldRowCount;
        }

        public int getNewListSize() {
            return ProfileActivity.this.rowCount;
        }

        public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
            TLRPC.ChatParticipant chatParticipant;
            TLRPC.ChatParticipant chatParticipant2;
            if (newItemPosition >= ProfileActivity.this.membersStartRow && newItemPosition < ProfileActivity.this.membersEndRow && oldItemPosition >= this.oldMembersStartRow && oldItemPosition < this.oldMembersEndRow) {
                if (!this.oldChatParticipantSorted.isEmpty()) {
                    chatParticipant = this.oldChatParticipant.get(this.oldChatParticipantSorted.get(oldItemPosition - this.oldMembersStartRow).intValue());
                } else {
                    chatParticipant = this.oldChatParticipant.get(oldItemPosition - this.oldMembersStartRow);
                }
                if (!ProfileActivity.this.sortedUsers.isEmpty()) {
                    chatParticipant2 = (TLRPC.ChatParticipant) ProfileActivity.this.visibleChatParticipants.get(((Integer) ProfileActivity.this.visibleSortedUsers.get(newItemPosition - ProfileActivity.this.membersStartRow)).intValue());
                } else {
                    chatParticipant2 = (TLRPC.ChatParticipant) ProfileActivity.this.visibleChatParticipants.get(newItemPosition - ProfileActivity.this.membersStartRow);
                }
                return chatParticipant.user_id == chatParticipant2.user_id;
            }
            int i = this.oldPositionToItem.get(oldItemPosition, -1);
            return i == this.newPositionToItem.get(newItemPosition, -1) && i >= 0;
        }

        public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
            return areItemsTheSame(oldItemPosition, newItemPosition);
        }

        public void fillPositions(SparseIntArray sparseIntArray) {
            sparseIntArray.clear();
            put(1, ProfileActivity.this.setAvatarRow, sparseIntArray);
            put(2, ProfileActivity.this.setAvatarSectionRow, sparseIntArray);
            put(3, ProfileActivity.this.numberSectionRow, sparseIntArray);
            put(4, ProfileActivity.this.numberRow, sparseIntArray);
            put(5, ProfileActivity.this.setUsernameRow, sparseIntArray);
            put(6, ProfileActivity.this.bioRow, sparseIntArray);
            put(7, ProfileActivity.this.phoneSuggestionRow, sparseIntArray);
            put(8, ProfileActivity.this.phoneSuggestionSectionRow, sparseIntArray);
            put(9, ProfileActivity.this.passwordSuggestionRow, sparseIntArray);
            put(10, ProfileActivity.this.passwordSuggestionSectionRow, sparseIntArray);
            put(11, ProfileActivity.this.graceSuggestionRow, sparseIntArray);
            put(12, ProfileActivity.this.graceSuggestionSectionRow, sparseIntArray);
            put(13, ProfileActivity.this.settingsSectionRow, sparseIntArray);
            put(14, ProfileActivity.this.settingsSectionRow2, sparseIntArray);
            put(15, ProfileActivity.this.notificationRow, sparseIntArray);
            put(16, ProfileActivity.this.languageRow, sparseIntArray);
            put(17, ProfileActivity.this.premiumRow, sparseIntArray);
            put(18, ProfileActivity.this.starsRow, sparseIntArray);
            put(19, ProfileActivity.this.businessRow, sparseIntArray);
            put(20, ProfileActivity.this.premiumSectionsRow, sparseIntArray);
            put(21, ProfileActivity.this.premiumGiftingRow, sparseIntArray);
            put(22, ProfileActivity.this.privacyRow, sparseIntArray);
            put(23, ProfileActivity.this.dataRow, sparseIntArray);
            put(24, ProfileActivity.this.liteModeRow, sparseIntArray);
            put(25, ProfileActivity.this.chatRow, sparseIntArray);
            put(26, ProfileActivity.this.filtersRow, sparseIntArray);
            put(27, ProfileActivity.this.stickersRow, sparseIntArray);
            put(28, ProfileActivity.this.devicesRow, sparseIntArray);
            put(29, ProfileActivity.this.devicesSectionRow, sparseIntArray);
            put(30, ProfileActivity.this.helpHeaderRow, sparseIntArray);
            put(31, ProfileActivity.this.questionRow, sparseIntArray);
            put(32, ProfileActivity.this.faqRow, sparseIntArray);
            put(33, ProfileActivity.this.policyRow, sparseIntArray);
            put(34, ProfileActivity.this.helpSectionCell, sparseIntArray);
            put(35, ProfileActivity.this.debugHeaderRow, sparseIntArray);
            put(36, ProfileActivity.this.sendLogsRow, sparseIntArray);
            put(37, ProfileActivity.this.sendLastLogsRow, sparseIntArray);
            put(38, ProfileActivity.this.clearLogsRow, sparseIntArray);
            put(39, ProfileActivity.this.switchBackendRow, sparseIntArray);
            put(40, ProfileActivity.this.versionRow, sparseIntArray);
            put(41, ProfileActivity.this.emptyRow, sparseIntArray);
            put(42, ProfileActivity.this.bottomPaddingRow, sparseIntArray);
            put(43, ProfileActivity.this.infoHeaderRow, sparseIntArray);
            put(44, ProfileActivity.this.phoneRow, sparseIntArray);
            put(45, ProfileActivity.this.locationRow, sparseIntArray);
            put(46, ProfileActivity.this.userInfoRow, sparseIntArray);
            put(47, ProfileActivity.this.channelInfoRow, sparseIntArray);
            put(48, ProfileActivity.this.usernameRow, sparseIntArray);
            put(49, ProfileActivity.this.notificationsDividerRow, sparseIntArray);
            put(50, ProfileActivity.this.reportDividerRow, sparseIntArray);
            put(51, ProfileActivity.this.notificationsRow, sparseIntArray);
            put(52, ProfileActivity.this.infoSectionRow, sparseIntArray);
            put(53, ProfileActivity.this.sendMessageRow, sparseIntArray);
            put(54, ProfileActivity.this.reportRow, sparseIntArray);
            put(55, ProfileActivity.this.reportReactionRow, sparseIntArray);
            put(56, ProfileActivity.this.addToContactsRow, sparseIntArray);
            put(57, ProfileActivity.this.settingsTimerRow, sparseIntArray);
            put(58, ProfileActivity.this.settingsKeyRow, sparseIntArray);
            put(59, ProfileActivity.this.secretSettingsSectionRow, sparseIntArray);
            put(60, ProfileActivity.this.membersHeaderRow, sparseIntArray);
            put(61, ProfileActivity.this.addMemberRow, sparseIntArray);
            put(62, ProfileActivity.this.subscribersRow, sparseIntArray);
            put(63, ProfileActivity.this.subscribersRequestsRow, sparseIntArray);
            put(64, ProfileActivity.this.administratorsRow, sparseIntArray);
            put(65, ProfileActivity.this.settingsRow, sparseIntArray);
            put(66, ProfileActivity.this.blockedUsersRow, sparseIntArray);
            put(67, ProfileActivity.this.membersSectionRow, sparseIntArray);
            put(68, ProfileActivity.this.sharedMediaRow, sparseIntArray);
            put(69, ProfileActivity.this.unblockRow, sparseIntArray);
            put(70, ProfileActivity.this.addToGroupButtonRow, sparseIntArray);
            put(71, ProfileActivity.this.addToGroupInfoRow, sparseIntArray);
            put(72, ProfileActivity.this.joinRow, sparseIntArray);
            put(73, ProfileActivity.this.lastSectionRow, sparseIntArray);
            put(74, ProfileActivity.this.notificationsSimpleRow, sparseIntArray);
            put(75, ProfileActivity.this.bizHoursRow, sparseIntArray);
            put(76, ProfileActivity.this.bizLocationRow, sparseIntArray);
            put(77, ProfileActivity.this.birthdayRow, sparseIntArray);
            put(78, ProfileActivity.this.channelRow, sparseIntArray);
        }

        public final void put(int id, int position, SparseIntArray sparseIntArray) {
            if (position >= 0) {
                sparseIntArray.put(position, id);
            }
        }
    }

    public boolean isLightStatusBar() {
        int themedColor;
        if (this.isPulledDown) {
            return false;
        }
        if (((BaseFragment) this).actionBar.isActionModeShowed()) {
            themedColor = getThemedColor(Theme.key_actionBarActionModeDefault);
        } else if (this.mediaHeaderVisible) {
            themedColor = getThemedColor(Theme.key_windowBackgroundWhite);
        } else {
            MessagesController.PeerColor peerColor = this.peerColor;
            if (peerColor != null) {
                themedColor = peerColor.getBgColor2(Theme.isCurrentThemeDark());
            } else {
                themedColor = getThemedColor(Theme.key_actionBarDefault);
            }
        }
        return ColorUtils.calculateLuminance(themedColor) > 0.699999988079071d;
    }

    public final void checkPhotoDescriptionAlpha() {
        int i = this.playProfileAnimation;
        if (i == 1 && (!this.fragmentOpened || this.openAnimationInProgress)) {
            this.photoDescriptionProgress = 0.0f;
        } else {
            if (i == 2 && (!this.fragmentOpened || this.openAnimationInProgress)) {
                SimpleTextView[] simpleTextViewArr = this.onlineTextView;
                if (simpleTextViewArr[1] != null) {
                    this.photoDescriptionProgress = simpleTextViewArr[1] == null ? 0.0f : simpleTextViewArr[1].getAlpha();
                }
            }
            if (this.userId == UserConfig.getInstance(((BaseFragment) this).currentAccount).clientUserId) {
                this.photoDescriptionProgress = this.currentExpandAnimatorValue * (1.0f - this.customAvatarProgress);
            } else {
                this.photoDescriptionProgress = this.currentExpandAnimatorValue * this.customAvatarProgress;
            }
        }
        if (this.userId == UserConfig.getInstance(((BaseFragment) this).currentAccount).clientUserId) {
            if (this.hasFallbackPhoto) {
                this.customPhotoOffset = AndroidUtilities.dp(28.0f) * this.photoDescriptionProgress;
                SimpleTextView[] simpleTextViewArr2 = this.onlineTextView;
                if (simpleTextViewArr2[2] != null) {
                    simpleTextViewArr2[2].setAlpha(this.currentExpandAnimatorValue);
                    this.onlineTextView[3].setAlpha(1.0f - this.currentExpandAnimatorValue);
                    this.onlineTextView[1].setTranslationX(this.onlineX + this.customPhotoOffset);
                    this.avatarContainer2.invalidate();
                    return;
                }
                return;
            }
            SimpleTextView[] simpleTextViewArr3 = this.onlineTextView;
            if (simpleTextViewArr3[2] != null) {
                simpleTextViewArr3[2].setAlpha(0.0f);
                this.onlineTextView[3].setAlpha(0.0f);
                return;
            }
            return;
        }
        if (this.hasCustomPhoto) {
            SimpleTextView[] simpleTextViewArr4 = this.onlineTextView;
            if (simpleTextViewArr4[2] != null) {
                simpleTextViewArr4[2].setAlpha(this.photoDescriptionProgress);
                return;
            }
            return;
        }
        SimpleTextView[] simpleTextViewArr5 = this.onlineTextView;
        if (simpleTextViewArr5[2] != null) {
            simpleTextViewArr5[2].setAlpha(0.0f);
        }
    }

    public final void updateStoriesViewBounds(boolean animated) {
        ActionBar actionBar;
        if (this.storyView == null || (actionBar = ((BaseFragment) this).actionBar) == null) {
            return;
        }
        float f = actionBar.getOccupyStatusBar() ? AndroidUtilities.statusBarHeight : 0.0f;
        float width = ((BaseFragment) this).actionBar.getWidth();
        float max = ((BaseFragment) this).actionBar.getBackButton() != null ? Math.max(0.0f, ((BaseFragment) this).actionBar.getBackButton().getRight()) : 0.0f;
        if (((BaseFragment) this).actionBar.menu != null) {
            for (int i = 0; i < ((BaseFragment) this).actionBar.menu.getChildCount(); i++) {
                View childAt = ((BaseFragment) this).actionBar.menu.getChildAt(i);
                if (childAt.getAlpha() > 0.0f && childAt.getVisibility() == 0) {
                    float left = ((BaseFragment) this).actionBar.menu.getLeft() + ((int) childAt.getX());
                    if (left < width) {
                        width = AndroidUtilities.lerp(width, left, childAt.getAlpha());
                    }
                }
            }
        }
        this.storyView.setBounds(max, width, f + ((((BaseFragment) this).actionBar.getHeight() - f) / 2.0f), !animated);
    }

    public class ClippedListView extends RecyclerListView implements StoriesListPlaceProvider.ClippedView {
        public ClippedListView(Context context) {
            super(context);
        }

        public void updateClip(int[] clip) {
            clip[0] = ((BaseFragment) ProfileActivity.this).actionBar.getMeasuredHeight();
            clip[1] = getMeasuredHeight() - getPaddingBottom();
        }
    }

    public final void listCodecs(String type, StringBuilder info) {
        String[] supportedTypes;
        boolean z;
        if (Build.VERSION.SDK_INT < 23) {
            return;
        }
        try {
            int codecCount = MediaCodecList.getCodecCount();
            ArrayList arrayList = new ArrayList();
            ArrayList arrayList2 = new ArrayList();
            for (int i = 0; i < codecCount; i++) {
                MediaCodecInfo codecInfoAt = MediaCodecList.getCodecInfoAt(i);
                if (codecInfoAt != null && (supportedTypes = codecInfoAt.getSupportedTypes()) != null) {
                    int i2 = 0;
                    while (true) {
                        if (i2 >= supportedTypes.length) {
                            z = false;
                            break;
                        } else {
                            if (supportedTypes[i2].equals(type)) {
                                z = true;
                                break;
                            }
                            i2++;
                        }
                    }
                    if (z) {
                        (codecInfoAt.isEncoder() ? arrayList2 : arrayList).add(Integer.valueOf(i));
                    }
                }
            }
            if (arrayList.isEmpty() && arrayList2.isEmpty()) {
                return;
            }
            info.append("\n");
            info.append(arrayList.size());
            info.append("+");
            info.append(arrayList2.size());
            info.append(" ");
            info.append(type.substring(6));
            info.append(" codecs:\n");
            for (int i3 = 0; i3 < arrayList.size(); i3++) {
                if (i3 > 0) {
                    info.append("\n");
                }
                MediaCodecInfo codecInfoAt2 = MediaCodecList.getCodecInfoAt(((Integer) arrayList.get(i3)).intValue());
                info.append("{d} ");
                info.append(codecInfoAt2.getName());
                info.append(" (");
                if (Build.VERSION.SDK_INT >= 29) {
                    if (codecInfoAt2.isHardwareAccelerated()) {
                        info.append("gpu");
                    }
                    if (codecInfoAt2.isSoftwareOnly()) {
                        info.append("cpu");
                    }
                    if (codecInfoAt2.isVendor()) {
                        info.append(", v");
                    }
                }
                MediaCodecInfo.CodecCapabilities capabilitiesForType = codecInfoAt2.getCapabilitiesForType(type);
                info.append("; mi=");
                info.append(capabilitiesForType.getMaxSupportedInstances());
                info.append(")");
            }
            for (int i4 = 0; i4 < arrayList2.size(); i4++) {
                if (i4 > 0 || !arrayList.isEmpty()) {
                    info.append("\n");
                }
                MediaCodecInfo codecInfoAt3 = MediaCodecList.getCodecInfoAt(((Integer) arrayList2.get(i4)).intValue());
                info.append("{e} ");
                info.append(codecInfoAt3.getName());
                info.append(" (");
                if (Build.VERSION.SDK_INT >= 29) {
                    if (codecInfoAt3.isHardwareAccelerated()) {
                        info.append("gpu");
                    }
                    if (codecInfoAt3.isSoftwareOnly()) {
                        info.append("cpu");
                    }
                    if (codecInfoAt3.isVendor()) {
                        info.append(", v");
                    }
                }
                MediaCodecInfo.CodecCapabilities capabilitiesForType2 = codecInfoAt3.getCapabilitiesForType(type);
                info.append("; mi=");
                info.append(capabilitiesForType2.getMaxSupportedInstances());
                info.append(")");
            }
            info.append("\n");
        } catch (Exception unused) {
        }
    }

    public void onTransitionAnimationProgress(boolean isOpen, float progress) {
        super.onTransitionAnimationProgress(isOpen, progress);
        View view = this.blurredView;
        if (view == null || view.getVisibility() != 0) {
            return;
        }
        if (isOpen) {
            this.blurredView.setAlpha(1.0f - progress);
        } else {
            this.blurredView.setAlpha(progress);
        }
    }

    public void prepareBlurBitmap() {
        if (this.blurredView == null) {
            return;
        }
        int measuredWidth = (int) (((BaseFragment) this).fragmentView.getMeasuredWidth() / 6.0f);
        int measuredHeight = (int) (((BaseFragment) this).fragmentView.getMeasuredHeight() / 6.0f);
        Bitmap createBitmap = Bitmap.createBitmap(measuredWidth, measuredHeight, Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(createBitmap);
        canvas.scale(0.16666667f, 0.16666667f);
        ((BaseFragment) this).fragmentView.draw(canvas);
        Utilities.stackBlurBitmap(createBitmap, Math.max(7, Math.max(measuredWidth, measuredHeight) / 180));
        this.blurredView.setBackground(new BitmapDrawable(createBitmap));
        this.blurredView.setAlpha(0.0f);
        this.blurredView.setVisibility(0);
    }

    public ShowDrawable getShowStatusButton() {
        if (this.showStatusButton == null) {
            ShowDrawable showDrawable = new ShowDrawable(LocaleController.getString(R.string.StatusHiddenShow));
            this.showStatusButton = showDrawable;
            showDrawable.setAlpha((int) (Math.min(1.0f, this.extraHeight / AndroidUtilities.dp(88.0f)) * 255.0f));
            this.showStatusButton.setBackgroundColor(ColorUtils.blendARGB(Theme.multAlpha(Theme.adaptHSV(this.actionBarBackgroundColor, 0.18f, -0.1f), 0.5f), 603979775, this.currentExpandAnimatorValue));
        }
        return this.showStatusButton;
    }

    public static class ShowDrawable extends Drawable implements SimpleTextView.PressableDrawable {
        public float alpha;
        public final Paint backgroundPaint;
        public final ButtonBounce bounce;
        public int textColor;
        public final AnimatedTextView.AnimatedTextDrawable textDrawable;
        public View view;

        @Override
        public int getOpacity() {
            return -2;
        }

        @Override
        public void setColorFilter(ColorFilter colorFilter) {
        }

        public ShowDrawable(String string) {
            Paint paint = new Paint(1);
            this.backgroundPaint = paint;
            this.alpha = 1.0f;
            this.bounce = new ButtonBounce(null) {
                public void invalidate() {
                    ShowDrawable.this.invalidateSelf();
                }
            };
            AnimatedTextView.AnimatedTextDrawable animatedTextDrawable = new AnimatedTextView.AnimatedTextDrawable();
            this.textDrawable = animatedTextDrawable;
            animatedTextDrawable.setCallback(new Drawable.Callback() {
                @Override
                public void scheduleDrawable(Drawable who, Runnable what, long when) {
                }

                @Override
                public void unscheduleDrawable(Drawable who, Runnable what) {
                }

                @Override
                public void invalidateDrawable(Drawable who) {
                    if (ShowDrawable.this.view != null) {
                        ShowDrawable.this.view.invalidate();
                    }
                }
            });
            animatedTextDrawable.setText(string);
            animatedTextDrawable.setTextSize(AndroidUtilities.dp(11.0f));
            animatedTextDrawable.setGravity(17);
            paint.setColor(520093696);
        }

        public void setBackgroundColor(int backgroundColor) {
            if (this.backgroundPaint.getColor() != backgroundColor) {
                this.backgroundPaint.setColor(backgroundColor);
                invalidateSelf();
            }
        }

        public void setTextColor(int textColor) {
            if (this.textColor != textColor) {
                this.textColor = textColor;
                invalidateSelf();
            }
        }

        @Override
        public void draw(Canvas canvas) {
            if (this.alpha <= 0.0f) {
                return;
            }
            RectF rectF = AndroidUtilities.rectTmp;
            rectF.set(getBounds());
            canvas.save();
            float scale = this.bounce.getScale(0.1f);
            canvas.scale(scale, scale, rectF.centerX(), rectF.centerY());
            int alpha = this.backgroundPaint.getAlpha();
            this.backgroundPaint.setAlpha((int) (alpha * this.alpha));
            canvas.drawRoundRect(rectF, AndroidUtilities.dp(20.0f), AndroidUtilities.dp(20.0f), this.backgroundPaint);
            this.backgroundPaint.setAlpha(alpha);
            this.textDrawable.setTextColor(this.textColor);
            this.textDrawable.setAlpha((int) (this.alpha * 255.0f));
            this.textDrawable.setBounds((int) rectF.left, (int) rectF.top, (int) rectF.right, (int) rectF.bottom);
            this.textDrawable.draw(canvas);
            canvas.restore();
        }

        @Override
        public void setAlpha(int alpha) {
            this.alpha = alpha / 255.0f;
            invalidateSelf();
        }

        @Override
        public int getIntrinsicWidth() {
            return (int) (this.textDrawable.getAnimateToWidth() + AndroidUtilities.dp(11.0f));
        }

        @Override
        public int getIntrinsicHeight() {
            return AndroidUtilities.dp(17.33f);
        }

        @Override
        public void setPressed(boolean pressed) {
            this.bounce.setPressed(pressed);
        }

        public void setView(View view) {
            this.view = view;
        }
    }

    public void setLoadingSpan(CharacterStyle span) {
        if (this.loadingSpan == span) {
            return;
        }
        this.loadingSpan = span;
        AndroidUtilities.forEachViews(this.listView, new com.google.android.exoplayer2.util.Consumer() {
            public final void accept(Object obj) {
                ProfileActivity.this.lambda$setLoadingSpan$91((View) obj);
            }
        });
    }

    public void lambda$setLoadingSpan$91(View view) {
        if (view instanceof TextDetailCell) {
            TextDetailCell textDetailCell = (TextDetailCell) view;
            textDetailCell.textView.setLoading(this.loadingSpan);
            textDetailCell.valueTextView.setLoading(this.loadingSpan);
        }
    }

    public final void createBirthdayEffect() {
        if (((BaseFragment) this).fragmentView == null || !this.fullyVisible || this.birthdayFetcher == null || getContext() == null) {
            return;
        }
        ProfileBirthdayEffect profileBirthdayEffect = this.birthdayEffect;
        if (profileBirthdayEffect != null) {
            profileBirthdayEffect.updateFetcher(this.birthdayFetcher);
            this.birthdayEffect.invalidate();
        } else {
            ProfileBirthdayEffect profileBirthdayEffect2 = new ProfileBirthdayEffect(this, this.birthdayFetcher);
            this.birthdayEffect = profileBirthdayEffect2;
            ((FrameLayout) ((BaseFragment) this).fragmentView).addView(profileBirthdayEffect2, LayoutHelper.createFrame(-1, -1, 55));
        }
    }

    public final void openLocation(boolean inMapsApp) {
        TLRPC.TL_businessLocation tL_businessLocation;
        TLRPC.UserFull userFull = this.userInfo;
        if (userFull == null || (tL_businessLocation = userFull.business_location) == null) {
            return;
        }
        if (tL_businessLocation.geo_point != null && !inMapsApp) {
            LocationActivity locationActivity = new LocationActivity(this, 3) {
                @Override
                public boolean disablePermissionCheck() {
                    return true;
                }
            };
            locationActivity.setResourceProvider(this.resourcesProvider);
            TLRPC.TL_message tL_message = new TLRPC.TL_message();
            ((TLRPC.Message) tL_message).local_id = -1;
            ((TLRPC.Message) tL_message).peer_id = getMessagesController().getPeer(this.dialogId);
            TLRPC.TL_messageMediaGeo tL_messageMediaGeo = new TLRPC.TL_messageMediaGeo();
            TLRPC.TL_businessLocation tL_businessLocation2 = this.userInfo.business_location;
            ((TLRPC.MessageMedia) tL_messageMediaGeo).geo = tL_businessLocation2.geo_point;
            ((TLRPC.MessageMedia) tL_messageMediaGeo).address = tL_businessLocation2.address;
            ((TLRPC.Message) tL_message).media = tL_messageMediaGeo;
            locationActivity.setSharingAllowed(false);
            locationActivity.setMessageObject(new MessageObject(UserConfig.selectedAccount, tL_message, false, false));
            presentFragment(locationActivity);
            return;
        }
        String str = BuildVars.isHuaweiStoreApp() ? "mapapp://navigation" : "http://maps.google.com/maps";
        try {
            getParentActivity().startActivity(new Intent("android.intent.action.VIEW", Uri.parse(String.format(Locale.US, str + "?q=" + this.userInfo.business_location.address, new Object[0]))));
        } catch (Exception e) {
            FileLog.e(e);
        }
    }

    public final boolean editRow(View view, final int position) {
        TLRPC.TL_businessLocation tL_businessLocation;
        if (!this.myProfile) {
            return false;
        }
        if (view instanceof ProfileChannelCell) {
            view = ((ProfileChannelCell) view).dialogCell;
        }
        TLRPC.User currentUser = getUserConfig().getCurrentUser();
        if (currentUser == null) {
            return false;
        }
        final TLRPC.UserFull userFull = this.userInfo;
        if (userFull == null) {
            userFull = getMessagesController().getUserFull(currentUser.id);
        }
        if (userFull == null) {
            return false;
        }
        String string = LocaleController.getString(R.string.Copy);
        final String str = null;
        if (position == this.channelInfoRow || position == this.userInfoRow || position == this.bioRow) {
            str = userFull.about;
        } else if (position == this.bizHoursRow) {
            str = OpeningHoursActivity.toString(((BaseFragment) this).currentAccount, currentUser, userFull.business_work_hours);
            string = LocaleController.getString(R.string.ProfileHoursCopy);
        } else if (position == this.bizLocationRow) {
            str = userFull.business_location.address;
            string = LocaleController.getString(R.string.ProfileLocationCopy);
        } else if (position == this.usernameRow) {
            String publicUsername = UserObject.getPublicUsername(currentUser);
            if (publicUsername != null) {
                publicUsername = "@" + publicUsername;
            }
            str = publicUsername;
            string = LocaleController.getString(R.string.ProfileCopyUsername);
        } else if (position == this.phoneRow) {
            str = currentUser.phone;
        } else if (position == this.birthdayRow) {
            str = UserInfoActivity.birthdayString(this.userInfo.birthday);
        }
        ItemOptions makeOptions = ItemOptions.makeOptions(this.contentView, this.resourcesProvider, view);
        makeOptions.setGravity(3);
        if (position == this.bizLocationRow && (tL_businessLocation = userFull.business_location) != null) {
            if (tL_businessLocation.geo_point != null) {
                makeOptions.add(R.drawable.msg_view_file, LocaleController.getString(R.string.ProfileLocationView), new Runnable() {
                    @Override
                    public final void run() {
                        ProfileActivity.this.lambda$editRow$92();
                    }
                });
            }
            makeOptions.add(R.drawable.msg_map, LocaleController.getString(R.string.ProfileLocationMaps), new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$editRow$93();
                }
            });
        }
        if (str != null) {
            makeOptions.add(R.drawable.msg_copy, string, new Runnable() {
                @Override
                public final void run() {
                    AndroidUtilities.addToClipboard(str);
                }
            });
        }
        if (position == this.bizHoursRow) {
            makeOptions.add(R.drawable.msg_edit, LocaleController.getString(R.string.ProfileHoursEdit), new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$editRow$95();
                }
            });
            makeOptions.add(R.drawable.msg_delete, LocaleController.getString(R.string.ProfileHoursRemove), true, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$editRow$99(userFull, position);
                }
            });
        } else if (position == this.bizLocationRow) {
            makeOptions.add(R.drawable.msg_edit, LocaleController.getString(R.string.ProfileLocationEdit), new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$editRow$100();
                }
            });
            makeOptions.add(R.drawable.msg_delete, LocaleController.getString(R.string.ProfileLocationRemove), true, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$editRow$104(userFull, position);
                }
            });
        } else if (position == this.usernameRow) {
            makeOptions.add(R.drawable.msg_edit, LocaleController.getString(R.string.ProfileUsernameEdit), new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$editRow$105();
                }
            });
        } else if (position == this.channelInfoRow || position == this.userInfoRow || position == this.bioRow) {
            makeOptions.add(R.drawable.msg_edit, LocaleController.getString(R.string.ProfileEditBio), new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$editRow$106();
                }
            });
        } else if (position == this.phoneRow) {
            makeOptions.add(R.drawable.menu_storage_path, LocaleController.getString(R.string.ProfilePhoneEdit), new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$editRow$107();
                }
            });
        } else if (position == this.birthdayRow) {
            makeOptions.add(R.drawable.msg_edit, LocaleController.getString(R.string.ProfileBirthdayChange), new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$editRow$112(userFull);
                }
            });
            makeOptions.add(R.drawable.msg_delete, LocaleController.getString(R.string.Remove), true, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$editRow$116(userFull, position);
                }
            });
        } else if (position == this.channelRow) {
            final TLRPC.Chat chat = getMessagesController().getChat(Long.valueOf(userFull.personal_channel_id));
            if (chat != null && ChatObject.getPublicUsername(chat) != null) {
                makeOptions.add(R.drawable.msg_copy, LocaleController.getString(R.string.ProfileChannelCopy), new Runnable() {
                    @Override
                    public final void run() {
                        ProfileActivity.this.lambda$editRow$117(chat);
                    }
                });
            }
            makeOptions.add(R.drawable.msg_edit, LocaleController.getString(R.string.ProfileChannelChange), new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$editRow$118();
                }
            });
            makeOptions.add(R.drawable.msg_delete, LocaleController.getString(R.string.Remove), true, new Runnable() {
                @Override
                public final void run() {
                    ProfileActivity.this.lambda$editRow$122(userFull, position);
                }
            });
        }
        if (makeOptions.getItemsCount() <= 0) {
            return false;
        }
        makeOptions.show();
        return true;
    }

    public void lambda$editRow$92() {
        openLocation(false);
    }

    public void lambda$editRow$93() {
        openLocation(true);
    }

    public void lambda$editRow$95() {
        presentFragment(new OpeningHoursActivity());
    }

    public void lambda$editRow$99(final TLRPC.UserFull userFull, final int i) {
        AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
        builder.setTitle(LocaleController.getString(R.string.BusinessHoursClearTitle));
        builder.setMessage(LocaleController.getString(R.string.BusinessHoursClearMessage));
        builder.setPositiveButton(LocaleController.getString(R.string.Remove), new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i2) {
                ProfileActivity.this.lambda$editRow$98(userFull, i, dialogInterface, i2);
            }
        });
        builder.setNegativeButton(LocaleController.getString(R.string.Cancel), null);
        showDialog(builder.create());
    }

    public void lambda$editRow$98(TLRPC.UserFull userFull, int i, DialogInterface dialogInterface, int i2) {
        TLRPC.TL_account_updateBusinessWorkHours tL_account_updateBusinessWorkHours = new TLRPC.TL_account_updateBusinessWorkHours();
        if (userFull != null) {
            userFull.business_work_hours = null;
            userFull.flags2 &= -2;
        }
        getConnectionsManager().sendRequest(tL_account_updateBusinessWorkHours, new RequestDelegate() {
            public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                ProfileActivity.this.lambda$editRow$97(tLObject, tL_error);
            }
        });
        updateRowsIds();
        this.listAdapter.notifyItemRemoved(i);
        getMessagesStorage().updateUserInfo(userFull, false);
    }

    public void lambda$editRow$97(final TLObject tLObject, final TLRPC.TL_error tL_error) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$editRow$96(tL_error, tLObject);
            }
        });
    }

    public void lambda$editRow$96(TLRPC.TL_error tL_error, TLObject tLObject) {
        if (tL_error != null) {
            BulletinFactory.showError(tL_error);
        } else if (tLObject instanceof TLRPC.TL_boolFalse) {
            BulletinFactory.of(this).createErrorBulletin(LocaleController.getString(R.string.UnknownError)).show();
        }
    }

    public void lambda$editRow$100() {
        presentFragment(new org.telegram.ui.Business.LocationActivity());
    }

    public void lambda$editRow$104(final TLRPC.UserFull userFull, final int i) {
        AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
        builder.setTitle(LocaleController.getString(R.string.BusinessLocationClearTitle));
        builder.setMessage(LocaleController.getString(R.string.BusinessLocationClearMessage));
        builder.setPositiveButton(LocaleController.getString(R.string.Remove), new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i2) {
                ProfileActivity.this.lambda$editRow$103(userFull, i, dialogInterface, i2);
            }
        });
        builder.setNegativeButton(LocaleController.getString(R.string.Cancel), null);
        showDialog(builder.create());
    }

    public void lambda$editRow$103(TLRPC.UserFull userFull, int i, DialogInterface dialogInterface, int i2) {
        TLRPC.TL_account_updateBusinessLocation tL_account_updateBusinessLocation = new TLRPC.TL_account_updateBusinessLocation();
        if (userFull != null) {
            userFull.business_location = null;
            userFull.flags2 &= -3;
        }
        getConnectionsManager().sendRequest(tL_account_updateBusinessLocation, new RequestDelegate() {
            public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                ProfileActivity.this.lambda$editRow$102(tLObject, tL_error);
            }
        });
        updateRowsIds();
        this.listAdapter.notifyItemRemoved(i);
        getMessagesStorage().updateUserInfo(userFull, false);
    }

    public void lambda$editRow$102(final TLObject tLObject, final TLRPC.TL_error tL_error) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$editRow$101(tL_error, tLObject);
            }
        });
    }

    public void lambda$editRow$101(TLRPC.TL_error tL_error, TLObject tLObject) {
        if (tL_error != null) {
            BulletinFactory.showError(tL_error);
        } else if (tLObject instanceof TLRPC.TL_boolFalse) {
            BulletinFactory.of(this).createErrorBulletin(LocaleController.getString(R.string.UnknownError)).show();
        }
    }

    public void lambda$editRow$105() {
        presentFragment(new ChangeUsernameActivity());
    }

    public void lambda$editRow$106() {
        presentFragment(new UserInfoActivity());
    }

    public void lambda$editRow$107() {
        presentFragment(new ActionIntroActivity(3));
    }

    public void lambda$editRow$112(final TLRPC.UserFull userFull) {
        showDialog(AlertsCreator.createBirthdayPickerDialog(getContext(), LocaleController.getString(R.string.EditProfileBirthdayTitle), LocaleController.getString(R.string.EditProfileBirthdayButton), userFull.birthday, new Utilities.Callback() {
            public final void run(Object obj) {
                ProfileActivity.this.lambda$editRow$110(userFull, (TLRPC.TL_birthday) obj);
            }
        }, new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$editRow$111();
            }
        }, getResourceProvider()).create());
    }

    public void lambda$editRow$110(final TLRPC.UserFull userFull, TLRPC.TL_birthday tL_birthday) {
        TLRPC.TL_account_updateBirthday tL_account_updateBirthday = new TLRPC.TL_account_updateBirthday();
        tL_account_updateBirthday.flags |= 1;
        tL_account_updateBirthday.birthday = tL_birthday;
        final TLRPC.TL_birthday tL_birthday2 = userFull != null ? userFull.birthday : null;
        if (userFull != null) {
            userFull.flags2 |= 32;
            userFull.birthday = tL_birthday;
        }
        getConnectionsManager().sendRequest(tL_account_updateBirthday, new RequestDelegate() {
            public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                ProfileActivity.this.lambda$editRow$109(userFull, tL_birthday2, tLObject, tL_error);
            }
        }, 1024);
    }

    public void lambda$editRow$109(final TLRPC.UserFull userFull, final TLRPC.TL_birthday tL_birthday, final TLObject tLObject, final TLRPC.TL_error tL_error) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$editRow$108(tLObject, userFull, tL_birthday, tL_error);
            }
        });
    }

    public void lambda$editRow$108(TLObject tLObject, TLRPC.UserFull userFull, TLRPC.TL_birthday tL_birthday, TLRPC.TL_error tL_error) {
        String str;
        if (tLObject instanceof TLRPC.TL_boolTrue) {
            BulletinFactory.of(this).createSimpleBulletin(R.raw.contact_check, LocaleController.getString(R.string.PrivacyBirthdaySetDone)).setDuration(5000).show();
            return;
        }
        if (userFull != null) {
            if (tL_birthday == null) {
                userFull.flags2 &= -33;
            } else {
                userFull.flags2 |= 32;
            }
            userFull.birthday = tL_birthday;
            getMessagesStorage().updateUserInfo(userFull, false);
        }
        if (tL_error != null && (str = tL_error.text) != null && str.startsWith("FLOOD_WAIT_")) {
            if (getContext() != null) {
                showDialog(new AlertDialog.Builder(getContext(), ((BaseFragment) this).resourceProvider).setTitle(LocaleController.getString(R.string.PrivacyBirthdayTooOftenTitle)).setMessage(LocaleController.getString(R.string.PrivacyBirthdayTooOftenMessage)).setPositiveButton(LocaleController.getString(R.string.OK), null).create());
                return;
            }
            return;
        }
        BulletinFactory.of(this).createSimpleBulletin(R.raw.error, LocaleController.getString(R.string.UnknownError)).show();
    }

    public void lambda$editRow$111() {
        BaseFragment$BottomSheetParams baseFragment$BottomSheetParams = new BaseFragment$BottomSheetParams();
        baseFragment$BottomSheetParams.transitionFromLeft = true;
        baseFragment$BottomSheetParams.allowNestedScroll = false;
        showAsSheet(new PrivacyControlActivity(11), baseFragment$BottomSheetParams);
    }

    public void lambda$editRow$116(final TLRPC.UserFull userFull, final int i) {
        AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
        builder.setTitle(LocaleController.getString(R.string.BirthdayClearTitle));
        builder.setMessage(LocaleController.getString(R.string.BirthdayClearMessage));
        builder.setPositiveButton(LocaleController.getString(R.string.Remove), new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i2) {
                ProfileActivity.this.lambda$editRow$115(userFull, i, dialogInterface, i2);
            }
        });
        builder.setNegativeButton(LocaleController.getString(R.string.Cancel), null);
        showDialog(builder.create());
    }

    public void lambda$editRow$115(TLRPC.UserFull userFull, int i, DialogInterface dialogInterface, int i2) {
        TLRPC.TL_account_updateBirthday tL_account_updateBirthday = new TLRPC.TL_account_updateBirthday();
        if (userFull != null) {
            userFull.birthday = null;
            userFull.flags2 &= -33;
        }
        getConnectionsManager().sendRequest(tL_account_updateBirthday, new RequestDelegate() {
            public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                ProfileActivity.this.lambda$editRow$114(tLObject, tL_error);
            }
        });
        updateRowsIds();
        this.listAdapter.notifyItemRemoved(i);
        getMessagesStorage().updateUserInfo(userFull, false);
    }

    public void lambda$editRow$114(final TLObject tLObject, final TLRPC.TL_error tL_error) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$editRow$113(tL_error, tLObject);
            }
        });
    }

    public void lambda$editRow$113(TLRPC.TL_error tL_error, TLObject tLObject) {
        if (tL_error != null) {
            BulletinFactory.showError(tL_error);
        } else if (tLObject instanceof TLRPC.TL_boolFalse) {
            BulletinFactory.of(this).createErrorBulletin(LocaleController.getString(R.string.UnknownError)).show();
        }
    }

    public void lambda$editRow$117(TLRPC.Chat chat) {
        AndroidUtilities.addToClipboard("https://" + getMessagesController().linkPrefix + "/" + ChatObject.getPublicUsername(chat));
    }

    public void lambda$editRow$118() {
        presentFragment(new UserInfoActivity());
    }

    public void lambda$editRow$122(final TLRPC.UserFull userFull, final int i) {
        AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
        builder.setTitle(LocaleController.getString(R.string.ProfileChannelClearTitle));
        builder.setMessage(LocaleController.getString(R.string.ProfileChannelClearMessage));
        builder.setPositiveButton(LocaleController.getString(R.string.Remove), new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i2) {
                ProfileActivity.this.lambda$editRow$121(userFull, i, dialogInterface, i2);
            }
        });
        builder.setNegativeButton(LocaleController.getString(R.string.Cancel), null);
        showDialog(builder.create());
    }

    public void lambda$editRow$121(TLRPC.UserFull userFull, int i, DialogInterface dialogInterface, int i2) {
        TLRPC.TL_account_updatePersonalChannel tL_account_updatePersonalChannel = new TLRPC.TL_account_updatePersonalChannel();
        if (userFull != null) {
            userFull.personal_channel_id = 0L;
            userFull.personal_channel_message = 0;
            userFull.flags2 &= -65;
        }
        getConnectionsManager().sendRequest(tL_account_updatePersonalChannel, new RequestDelegate() {
            public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
                ProfileActivity.this.lambda$editRow$120(tLObject, tL_error);
            }
        });
        updateRowsIds();
        this.listAdapter.notifyItemRemoved(i);
        getMessagesStorage().updateUserInfo(userFull, false);
    }

    public void lambda$editRow$120(final TLObject tLObject, final TLRPC.TL_error tL_error) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                ProfileActivity.this.lambda$editRow$119(tL_error, tLObject);
            }
        });
    }

    public void lambda$editRow$119(TLRPC.TL_error tL_error, TLObject tLObject) {
        if (tL_error != null) {
            BulletinFactory.showError(tL_error);
        } else if (tLObject instanceof TLRPC.TL_boolFalse) {
            BulletinFactory.of(this).createErrorBulletin(LocaleController.getString(R.string.UnknownError)).show();
        }
    }

    public final void updateItemsUsername() {
        TLRPC.User user;
        if (this.myProfile && (user = getMessagesController().getUser(Long.valueOf(this.userId))) != null) {
            if (this.setUsernameItem != null) {
                boolean z = UserObject.getPublicUsername(user) != null;
                this.setUsernameItem.setIcon(z ? R.drawable.menu_username_change : R.drawable.menu_username_set);
                this.setUsernameItem.setText(LocaleController.getString(z ? R.string.ProfileUsernameEdit : R.string.ProfileUsernameSet));
            }
            ActionBarMenuSubItem actionBarMenuSubItem = this.linkItem;
            if (actionBarMenuSubItem != null) {
                actionBarMenuSubItem.setVisibility(UserObject.getPublicUsername(user) == null ? 8 : 0);
            }
        }
    }

    public final void updateEditColorIcon() {
        if (getContext() == null || this.editColorItem == null) {
            return;
        }
        if (getUserConfig().isPremium()) {
            this.editColorItem.setIcon(R.drawable.menu_profile_colors);
            return;
        }
        Drawable drawable = ContextCompat.getDrawable(getContext(), R.drawable.menu_profile_colors_locked);
        drawable.setColorFilter(new PorterDuffColorFilter(getThemedColor(Theme.key_actionBarDefaultSubmenuItemIcon), PorterDuff.Mode.SRC_IN));
        Drawable drawable2 = ContextCompat.getDrawable(getContext(), R.drawable.msg_gallery_locked2);
        drawable2.setColorFilter(new PorterDuffColorFilter(ColorUtils.blendARGB(-1, -16777216, 0.5f), PorterDuff.Mode.MULTIPLY));
        this.editColorItem.setIcon(new CombinedDrawable(this, drawable, drawable2, AndroidUtilities.dp(1.0f), -AndroidUtilities.dp(1.0f)) {
            public void setColorFilter(ColorFilter colorFilter) {
            }
        });
    }
}