正在查看: Plus 12 v10.13.1.1 应用的 ChatEditActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Plus 12 v10.13.1.1 应用的 ChatEditActivity.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.ValueAnimator;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Vibrator;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.util.Property;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.telegram.messenger.AndroidUtilities;
import org.telegram.messenger.ChatObject;
import org.telegram.messenger.FileLog;
import org.telegram.messenger.ImageLocation;
import org.telegram.messenger.LocaleController;
import org.telegram.messenger.MessagesController;
import org.telegram.messenger.MessagesStorage;
import org.telegram.messenger.NotificationCenter;
import org.telegram.messenger.R;
import org.telegram.messenger.browser.Browser;
import org.telegram.tgnet.RequestDelegate;
import org.telegram.tgnet.TLObject;
import org.telegram.tgnet.TLRPC;
import org.telegram.tgnet.tl.TL_stories;
import org.telegram.ui.ActionBar.AlertDialog;
import org.telegram.ui.ActionBar.BaseFragment;
import org.telegram.ui.ActionBar.BottomSheet;
import org.telegram.ui.ActionBar.Theme;
import org.telegram.ui.ActionBar.ThemeDescription;
import org.telegram.ui.Cells.HeaderCell;
import org.telegram.ui.Cells.RadioButtonCell;
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.TextSettingsCell;
import org.telegram.ui.ChatEditActivity;
import org.telegram.ui.Components.AlertsCreator;
import org.telegram.ui.Components.AnimatedEmojiDrawable;
import org.telegram.ui.Components.AvatarDrawable;
import org.telegram.ui.Components.BackupImageView;
import org.telegram.ui.Components.BulletinFactory;
import org.telegram.ui.Components.CubicBezierInterpolator;
import org.telegram.ui.Components.EditTextBoldCursor;
import org.telegram.ui.Components.EditTextEmoji;
import org.telegram.ui.Components.ImageUpdater;
import org.telegram.ui.Components.LayoutHelper;
import org.telegram.ui.Components.RLottieDrawable;
import org.telegram.ui.Components.RadialProgressView;
import org.telegram.ui.Components.Reactions.ChatCustomReactionsEditActivity;
import org.telegram.ui.Components.Reactions.ReactionsUtils;
import org.telegram.ui.Components.UndoView;
import org.telegram.ui.LocationActivity;
import org.telegram.ui.PeerColorActivity;
import org.telegram.ui.PhotoViewer;
public class ChatEditActivity extends BaseFragment implements ImageUpdater.ImageUpdaterDelegate, NotificationCenter.NotificationCenterDelegate {
public TextCell adminCell;
public TLRPC.ChatReactions availableReactions;
public TLRPC.FileLocation avatar;
public AnimatorSet avatarAnimation;
public LinearLayout avatarContainer;
public AvatarDrawable avatarDrawable;
public BackupImageView avatarImage;
public View avatarOverlay;
public RadialProgressView avatarProgressView;
public TextCell blockCell;
public TL_stories.TL_premium_boostsStatus boostsStatus;
public TextInfoPrivacyCell botInfoCell;
public RLottieDrawable cameraDrawable;
public boolean canForum;
public TextCell changeBotSettingsCell;
public long chatId;
public PeerColorActivity.ChangeNameColorCell colorCell;
public boolean createAfterUpload;
public TLRPC.Chat currentChat;
public TLRPC.User currentUser;
public TextSettingsCell deleteCell;
public FrameLayout deleteContainer;
public ShadowSectionCell deleteInfoCell;
public EditTextBoldCursor descriptionTextView;
public View doneButton;
public boolean donePressed;
public TextCell editCommandsCell;
public TextCell editIntroCell;
public boolean forum;
public TextCell forumsCell;
public boolean hasUploadedPhoto;
public TextCell historyCell;
public boolean historyHidden;
public ImageUpdater imageUpdater;
public TLRPC.ChatFull info;
public LinearLayout infoContainer;
public ShadowSectionCell infoSectionCell;
public TextCell inviteLinksCell;
public boolean isChannel;
public LinearLayout linearLayout;
public TextCell linkedCell;
public TextCell locationCell;
public TextCell logCell;
public TextCell memberRequestsCell;
public TextCell membersCell;
public EditTextEmoji nameTextView;
public final List<AnimatedEmojiDrawable> preloadedReactions;
public AlertDialog progressDialog;
public PhotoViewer.PhotoViewerProvider provider;
public TextCell publicLinkCell;
public TextCell reactionsCell;
public TextCell setAvatarCell;
public LinearLayout settingsContainer;
public TextInfoPrivacyCell settingsSectionCell;
public ShadowSectionCell settingsTopSectionCell;
public TextCell signCell;
public boolean signMessages;
public TextCell statsAndBoosts;
public TextCell stickersCell;
public FrameLayout stickersContainer;
public TextInfoPrivacyCell stickersInfoCell;
public TextCell typeCell;
public LinearLayout typeEditContainer;
public UndoView undoView;
public ValueAnimator updateHistoryShowAnimator;
public long userId;
public TLRPC.UserFull userInfo;
public static boolean lambda$createView$2(View view, MotionEvent motionEvent) {
return true;
}
public boolean canFinishFragment() {
return ImageUpdater.ImageUpdaterDelegate.-CC.$default$canFinishFragment(this);
}
public void didUploadFailed() {
ImageUpdater.ImageUpdaterDelegate.-CC.$default$didUploadFailed(this);
}
public class AnonymousClass1 extends PhotoViewer.EmptyPhotoViewerProvider {
@Override
public boolean canLoadMoreAvatars() {
return false;
}
@Override
public int getTotalImageCount() {
return 1;
}
public AnonymousClass1() {
}
@Override
public org.telegram.ui.PhotoViewer.PlaceProviderObject getPlaceForPhoto(org.telegram.messenger.MessageObject r7, org.telegram.tgnet.TLRPC.FileLocation r8, int r9, boolean r10) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.ui.ChatEditActivity.AnonymousClass1.getPlaceForPhoto(org.telegram.messenger.MessageObject, org.telegram.tgnet.TLRPC$FileLocation, int, boolean):org.telegram.ui.PhotoViewer$PlaceProviderObject");
}
@Override
public void willHidePhotoViewer() {
ChatEditActivity.this.avatarImage.getImageReceiver().setVisible(true, true);
}
@Override
public void openPhotoForEdit(String file, String thumb, boolean isVideo) {
ChatEditActivity.this.imageUpdater.openPhotoForEdit(file, thumb, 0, isVideo);
}
@Override
public boolean onDeletePhoto(int index) {
if (ChatEditActivity.this.userId == 0) {
return true;
}
TLRPC.TL_photos_updateProfilePhoto tL_photos_updateProfilePhoto = new TLRPC.TL_photos_updateProfilePhoto();
tL_photos_updateProfilePhoto.bot = ChatEditActivity.this.getMessagesController().getInputUser(ChatEditActivity.this.userId);
tL_photos_updateProfilePhoto.flags |= 2;
tL_photos_updateProfilePhoto.id = new TLRPC.TL_inputPhotoEmpty();
ChatEditActivity.this.getConnectionsManager().sendRequest(tL_photos_updateProfilePhoto, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
ChatEditActivity.AnonymousClass1.this.lambda$onDeletePhoto$1(tLObject, tL_error);
}
});
return false;
}
public void lambda$onDeletePhoto$1(TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
ChatEditActivity.AnonymousClass1.this.lambda$onDeletePhoto$0();
}
});
}
public void lambda$onDeletePhoto$0() {
ChatEditActivity.this.avatarImage.setImageDrawable(ChatEditActivity.this.avatarDrawable);
ChatEditActivity.this.setAvatarCell.setTextAndIcon((CharSequence) LocaleController.getString("ChatSetPhotoOrVideo", R.string.ChatSetPhotoOrVideo), R.drawable.msg_addphoto, true);
if (ChatEditActivity.this.currentUser != null) {
ChatEditActivity.this.currentUser.photo = null;
ChatEditActivity.this.getMessagesController().putUser(ChatEditActivity.this.currentUser, true);
}
ChatEditActivity.this.hasUploadedPhoto = true;
ChatEditActivity chatEditActivity = ChatEditActivity.this;
if (chatEditActivity.cameraDrawable == null) {
int i = R.raw.camera_outline;
chatEditActivity.cameraDrawable = new RLottieDrawable(i, "" + i, AndroidUtilities.dp(50.0f), AndroidUtilities.dp(50.0f), false, (int[]) null);
}
ChatEditActivity.this.setAvatarCell.imageView.setTranslationX(-AndroidUtilities.dp(8.0f));
ChatEditActivity.this.setAvatarCell.imageView.setAnimation(ChatEditActivity.this.cameraDrawable);
}
}
public ChatEditActivity(Bundle args) {
super(args);
this.preloadedReactions = new ArrayList();
this.provider = new AnonymousClass1();
this.avatarDrawable = new AvatarDrawable();
this.chatId = args.getLong("chat_id", 0L);
this.userId = args.getLong("user_id", 0L);
if (this.chatId != 0) {
TLRPC.Chat chat = getMessagesController().getChat(Long.valueOf(this.chatId));
this.imageUpdater = new ImageUpdater(true, (chat == null || !ChatObject.isChannelAndNotMegaGroup(chat)) ? 2 : 1, true);
} else {
this.imageUpdater = new ImageUpdater(false, 0, false);
}
}
public boolean onFragmentCreate() {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.ui.ChatEditActivity.onFragmentCreate():boolean");
}
public final void loadLinksCount() {
TLRPC.TL_messages_getExportedChatInvites tL_messages_getExportedChatInvites = new TLRPC.TL_messages_getExportedChatInvites();
tL_messages_getExportedChatInvites.peer = getMessagesController().getInputPeer(-this.chatId);
tL_messages_getExportedChatInvites.admin_id = getMessagesController().getInputUser(getUserConfig().getCurrentUser());
tL_messages_getExportedChatInvites.limit = 0;
getConnectionsManager().sendRequest(tL_messages_getExportedChatInvites, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
ChatEditActivity.this.lambda$loadLinksCount$1(tLObject, tL_error);
}
});
}
public void lambda$loadLinksCount$1(final TLObject tLObject, final TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
ChatEditActivity.this.lambda$loadLinksCount$0(tL_error, tLObject);
}
});
}
public void lambda$loadLinksCount$0(TLRPC.TL_error tL_error, TLObject tLObject) {
if (tL_error == null) {
this.info.invitesCount = ((TLRPC.TL_messages_exportedChatInvites) tLObject).count;
getMessagesStorage().saveChatLinksCount(this.chatId, this.info.invitesCount);
updateFields(false, false);
}
}
public void onFragmentDestroy() {
super.onFragmentDestroy();
ImageUpdater imageUpdater = this.imageUpdater;
if (imageUpdater != null) {
imageUpdater.clear();
}
if (this.currentChat != null) {
NotificationCenter.getInstance(((BaseFragment) this).currentAccount).removeObserver(this, NotificationCenter.chatInfoDidLoad);
NotificationCenter.getInstance(((BaseFragment) this).currentAccount).removeObserver(this, NotificationCenter.chatAvailableReactionsUpdated);
} else {
NotificationCenter.getInstance(((BaseFragment) this).currentAccount).removeObserver(this, NotificationCenter.userInfoDidLoad);
}
NotificationCenter.getInstance(((BaseFragment) this).currentAccount).removeObserver(this, NotificationCenter.updateInterfaces);
EditTextEmoji editTextEmoji = this.nameTextView;
if (editTextEmoji != null) {
editTextEmoji.onDestroy();
}
}
public void onResume() {
super.onResume();
EditTextEmoji editTextEmoji = this.nameTextView;
if (editTextEmoji != null) {
editTextEmoji.onResume();
this.nameTextView.getEditText().requestFocus();
}
updateColorCell();
AndroidUtilities.requestAdjustResize(getParentActivity(), ((BaseFragment) this).classGuid);
updateFields(true, true);
this.imageUpdater.onResume();
}
public void onPause() {
super.onPause();
ReactionsUtils.stopPreloadReactions(this.preloadedReactions);
EditTextEmoji editTextEmoji = this.nameTextView;
if (editTextEmoji != null) {
editTextEmoji.onPause();
}
UndoView undoView = this.undoView;
if (undoView != null) {
undoView.hide(true, 0);
}
this.imageUpdater.onPause();
}
public void onBecomeFullyHidden() {
UndoView undoView = this.undoView;
if (undoView != null) {
undoView.hide(true, 0);
}
}
public void dismissCurrentDialog() {
if (this.imageUpdater.dismissCurrentDialog(((BaseFragment) this).visibleDialog)) {
return;
}
super.dismissCurrentDialog();
}
public boolean dismissDialogOnPause(Dialog dialog) {
return this.imageUpdater.dismissDialogOnPause(dialog) && super.dismissDialogOnPause(dialog);
}
public void onRequestPermissionsResultFragment(int requestCode, String[] permissions, int[] grantResults) {
this.imageUpdater.onRequestPermissionsResultFragment(requestCode, permissions, grantResults);
}
public boolean onBackPressed() {
EditTextEmoji editTextEmoji = this.nameTextView;
if (editTextEmoji != null && editTextEmoji.isPopupShowing()) {
this.nameTextView.hidePopup(true);
return false;
}
return checkDiscard();
}
public android.view.View createView(final android.content.Context r29) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.ui.ChatEditActivity.createView(android.content.Context):android.view.View");
}
public void lambda$createView$3(View view) {
if (this.imageUpdater.isUploadingImage()) {
return;
}
ImageLocation imageLocation = null;
TLRPC.User user = this.userId == 0 ? null : getMessagesController().getUser(Long.valueOf(this.userId));
if (user != null) {
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;
}
TLRPC.Chat chat = getMessagesController().getChat(Long.valueOf(this.chatId));
TLRPC.ChatPhoto chatPhoto = chat.photo;
if (chatPhoto == 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.info;
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.info.chat_photo.video_sizes.get(0), this.info.chat_photo);
}
}
PhotoViewer.getInstance().openPhotoWithVideo(chat.photo.photo_big, imageLocation, this.provider);
}
public void lambda$createView$8(View view) {
this.imageUpdater.openMenu(this.avatar != null, new Runnable() {
@Override
public final void run() {
ChatEditActivity.this.lambda$createView$6();
}
}, new DialogInterface.OnDismissListener() {
@Override
public final void onDismiss(DialogInterface dialogInterface) {
ChatEditActivity.this.lambda$createView$7(dialogInterface);
}
}, 0);
this.cameraDrawable.setCurrentFrame(0);
this.cameraDrawable.setCustomEndFrame(43);
this.setAvatarCell.imageView.playAnimation();
}
public void lambda$createView$6() {
this.avatar = null;
if (this.userId == 0) {
MessagesController.getInstance(((BaseFragment) this).currentAccount).changeChatAvatar(this.chatId, (TLRPC.TL_inputChatPhoto) null, (TLRPC.InputFile) null, (TLRPC.InputFile) null, (TLRPC.VideoSize) null, 0.0d, (String) null, (TLRPC.FileLocation) null, (TLRPC.FileLocation) null, (Runnable) null);
} else {
TLRPC.TL_photos_updateProfilePhoto tL_photos_updateProfilePhoto = new TLRPC.TL_photos_updateProfilePhoto();
tL_photos_updateProfilePhoto.bot = getMessagesController().getInputUser(this.userId);
tL_photos_updateProfilePhoto.flags |= 2;
tL_photos_updateProfilePhoto.id = new TLRPC.TL_inputPhotoEmpty();
getConnectionsManager().sendRequest(tL_photos_updateProfilePhoto, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
ChatEditActivity.this.lambda$createView$5(tLObject, tL_error);
}
});
}
showAvatarProgress(false, true);
BackupImageView backupImageView = this.avatarImage;
AvatarDrawable avatarDrawable = this.avatarDrawable;
TLRPC.Chat chat = this.currentUser;
if (chat == null) {
chat = this.currentChat;
}
backupImageView.setImage((ImageLocation) null, (String) null, avatarDrawable, chat);
this.cameraDrawable.setCurrentFrame(0);
this.setAvatarCell.imageView.playAnimation();
}
public void lambda$createView$5(TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
ChatEditActivity.this.lambda$createView$4();
}
});
}
public void lambda$createView$4() {
this.avatarImage.setImageDrawable(this.avatarDrawable);
this.setAvatarCell.setTextAndIcon((CharSequence) LocaleController.getString("ChatSetPhotoOrVideo", R.string.ChatSetPhotoOrVideo), R.drawable.msg_addphoto, true);
TLRPC.User user = this.currentUser;
if (user != null) {
user.photo = null;
getMessagesController().putUser(this.currentUser, true);
}
this.hasUploadedPhoto = true;
if (this.cameraDrawable == null) {
int i = R.raw.camera_outline;
this.cameraDrawable = new RLottieDrawable(i, "" + i, AndroidUtilities.dp(50.0f), AndroidUtilities.dp(50.0f), false, (int[]) null);
}
this.setAvatarCell.imageView.setTranslationX(-AndroidUtilities.dp(8.0f));
this.setAvatarCell.imageView.setAnimation(this.cameraDrawable);
}
public void lambda$createView$7(DialogInterface dialogInterface) {
if (!this.imageUpdater.isUploadingImage()) {
this.cameraDrawable.setCustomEndFrame(86);
this.setAvatarCell.imageView.playAnimation();
} else {
this.cameraDrawable.setCurrentFrame(0, false);
}
}
public boolean lambda$createView$9(TextView textView, int i, KeyEvent keyEvent) {
View view;
if (i != 6 || (view = this.doneButton) == null) {
return false;
}
view.performClick();
return true;
}
public void lambda$createView$11(View view) {
if (AndroidUtilities.isMapsInstalled(this)) {
LocationActivity locationActivity = new LocationActivity(4);
locationActivity.setDialogId(-this.chatId);
TLRPC.ChatFull chatFull = this.info;
if (chatFull != null) {
TLRPC.ChannelLocation channelLocation = chatFull.location;
if (channelLocation instanceof TLRPC.TL_channelLocation) {
locationActivity.setInitialLocation((TLRPC.TL_channelLocation) channelLocation);
}
}
locationActivity.setDelegate(new LocationActivity.LocationActivityDelegate() {
@Override
public final void didSelectLocation(TLRPC.MessageMedia messageMedia, int i, boolean z, int i2) {
ChatEditActivity.this.lambda$createView$10(messageMedia, i, z, i2);
}
});
presentFragment(locationActivity);
}
}
public void lambda$createView$10(TLRPC.MessageMedia messageMedia, int i, boolean z, int i2) {
TLRPC.TL_channelLocation tL_channelLocation = new TLRPC.TL_channelLocation();
tL_channelLocation.address = messageMedia.address;
tL_channelLocation.geo_point = messageMedia.geo;
TLRPC.ChatFull chatFull = this.info;
chatFull.location = tL_channelLocation;
chatFull.flags |= 32768;
updateFields(false, true);
getMessagesController().loadFullChat(this.chatId, 0, true);
}
public void lambda$createView$12(View view) {
long j = this.chatId;
TextCell textCell = this.locationCell;
ChatEditTypeActivity chatEditTypeActivity = new ChatEditTypeActivity(j, textCell != null && textCell.getVisibility() == 0);
chatEditTypeActivity.setInfo(this.info);
presentFragment(chatEditTypeActivity);
}
public void lambda$createView$13(View view) {
ChatLinkActivity chatLinkActivity = new ChatLinkActivity(this.chatId);
chatLinkActivity.setInfo(this.info);
presentFragment(chatLinkActivity);
}
public void lambda$createView$14(View view) {
presentFragment(new ChannelColorActivity(-this.currentChat.id).setOnApplied(this));
MessagesController.getInstance(((BaseFragment) this).currentAccount).getMainSettings().edit().putInt("boostingappearance", MessagesController.getInstance(((BaseFragment) this).currentAccount).getMainSettings().getInt("boostingappearance", 0) + 1).apply();
}
public void lambda$createView$16(Context context, View view) {
final BottomSheet.Builder builder = new BottomSheet.Builder(context);
builder.setApplyTopPadding(false);
LinearLayout linearLayout = new LinearLayout(context);
linearLayout.setOrientation(1);
HeaderCell headerCell = new HeaderCell(context, Theme.key_dialogTextBlue2, 23, 15, false);
headerCell.setHeight(47);
headerCell.setText(LocaleController.getString("ChatHistory", R.string.ChatHistory));
linearLayout.addView(headerCell);
LinearLayout linearLayout2 = new LinearLayout(context);
linearLayout2.setOrientation(1);
linearLayout.addView(linearLayout2, LayoutHelper.createLinear(-1, -2));
final RadioButtonCell[] radioButtonCellArr = new RadioButtonCell[2];
for (int i = 0; i < 2; i++) {
radioButtonCellArr[i] = new RadioButtonCell(context, true);
radioButtonCellArr[i].setTag(Integer.valueOf(i));
radioButtonCellArr[i].setBackgroundDrawable(Theme.getSelectorDrawable(false));
if (i == 0) {
radioButtonCellArr[i].setTextAndValue(LocaleController.getString("ChatHistoryVisible", R.string.ChatHistoryVisible), LocaleController.getString("ChatHistoryVisibleInfo", R.string.ChatHistoryVisibleInfo), true, !this.historyHidden);
} else if (ChatObject.isChannel(this.currentChat)) {
radioButtonCellArr[i].setTextAndValue(LocaleController.getString("ChatHistoryHidden", R.string.ChatHistoryHidden), LocaleController.getString("ChatHistoryHiddenInfo", R.string.ChatHistoryHiddenInfo), false, this.historyHidden);
} else {
radioButtonCellArr[i].setTextAndValue(LocaleController.getString("ChatHistoryHidden", R.string.ChatHistoryHidden), LocaleController.getString("ChatHistoryHiddenInfo2", R.string.ChatHistoryHiddenInfo2), false, this.historyHidden);
}
linearLayout2.addView(radioButtonCellArr[i], LayoutHelper.createLinear(-1, -2));
radioButtonCellArr[i].setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
ChatEditActivity.this.lambda$createView$15(radioButtonCellArr, builder, view2);
}
});
}
builder.setCustomView(linearLayout);
showDialog(builder.create());
}
public void lambda$createView$15(RadioButtonCell[] radioButtonCellArr, BottomSheet.Builder builder, View view) {
Integer num = (Integer) view.getTag();
radioButtonCellArr[0].setChecked(num.intValue() == 0, true);
radioButtonCellArr[1].setChecked(num.intValue() == 1, true);
this.historyHidden = num.intValue() == 1;
builder.getDismissRunnable().run();
updateFields(true, true);
}
public void lambda$createView$17(TL_stories.TL_premium_boostsStatus tL_premium_boostsStatus) {
this.boostsStatus = tL_premium_boostsStatus;
}
public void lambda$createView$18(View view) {
GroupColorActivity groupColorActivity = new GroupColorActivity(-this.currentChat.id);
groupColorActivity.boostsStatus = this.boostsStatus;
groupColorActivity.setOnApplied(this);
presentFragment(groupColorActivity);
}
public void lambda$createView$19(View view) {
boolean z = !this.signMessages;
this.signMessages = z;
((TextCell) view).setChecked(z);
}
public void lambda$createView$20(FrameLayout frameLayout, View view) {
SpannableStringBuilder replaceTags;
if (!this.canForum) {
TLRPC.ChatFull chatFull = this.info;
if (chatFull != null && chatFull.linked_chat_id != 0) {
replaceTags = AndroidUtilities.replaceTags(LocaleController.getString("ChannelTopicsDiscussionForbidden", R.string.ChannelTopicsDiscussionForbidden));
} else {
replaceTags = AndroidUtilities.replaceTags(LocaleController.formatPluralString("ChannelTopicsForbidden", getMessagesController().forumUpgradeParticipantsMin, new Object[0]));
}
BulletinFactory.of(this).createSimpleBulletin(R.raw.topics, replaceTags).show();
frameLayout.performHapticFeedback(3);
return;
}
boolean z = !this.forum;
this.forum = z;
this.avatarImage.animateToRoundRadius(AndroidUtilities.dp(z ? 16.0f : 32.0f));
((TextCell) view).setChecked(this.forum);
updateFields(false, true);
}
public void lambda$createView$21(View view) {
Bundle bundle = new Bundle();
bundle.putLong("chat_id", this.chatId);
bundle.putInt("type", (this.isChannel || this.currentChat.gigagroup) ? 0 : 3);
ChatUsersActivity chatUsersActivity = new ChatUsersActivity(bundle);
chatUsersActivity.setInfo(this.info);
presentFragment(chatUsersActivity);
}
public void lambda$createView$22(View view) {
ManageLinksActivity manageLinksActivity = new ManageLinksActivity(this.chatId, 0L, 0);
TLRPC.ChatFull chatFull = this.info;
manageLinksActivity.setInfo(chatFull, chatFull.exported_invite);
presentFragment(manageLinksActivity);
}
public void lambda$createView$23(View view) {
if (ChatObject.isChannelAndNotMegaGroup(this.currentChat)) {
presentFragment(new ChatCustomReactionsEditActivity(this.chatId, this.info));
return;
}
Bundle bundle = new Bundle();
bundle.putLong("chat_id", this.chatId);
ChatReactionsEditActivity chatReactionsEditActivity = new ChatReactionsEditActivity(bundle);
chatReactionsEditActivity.setInfo(this.info);
presentFragment(chatReactionsEditActivity);
}
public void lambda$createView$24(View view) {
Bundle bundle = new Bundle();
bundle.putLong("chat_id", this.chatId);
bundle.putInt("type", 1);
ChatUsersActivity chatUsersActivity = new ChatUsersActivity(bundle);
chatUsersActivity.setInfo(this.info);
presentFragment(chatUsersActivity);
}
public void lambda$createView$25(View view) {
Bundle bundle = new Bundle();
bundle.putLong("chat_id", this.chatId);
bundle.putInt("type", 2);
ChatUsersActivity chatUsersActivity = new ChatUsersActivity(bundle);
chatUsersActivity.setInfo(this.info);
presentFragment(chatUsersActivity);
}
public void lambda$createView$26(View view) {
presentFragment(new MemberRequestsActivity(this.chatId));
}
public void lambda$createView$27(View view) {
presentFragment(new ChannelAdminLogActivity(this.currentChat));
}
public void lambda$createView$28(View view) {
presentFragment(StatisticActivity.create(this.currentChat, false));
}
public void lambda$createView$29(View view) {
Bundle bundle = new Bundle();
bundle.putLong("bot_id", this.userId);
presentFragment(new ChangeUsernameActivity(bundle));
}
public void lambda$createView$30(View view) {
Browser.openUrl(view.getContext(), "https://t.me/BotFather?start=" + getActiveUsername(this.currentUser) + "-intro");
}
public void lambda$createView$31(View view) {
Browser.openUrl(view.getContext(), "https://t.me/BotFather?start=" + getActiveUsername(this.currentUser) + "-commands");
}
public void lambda$createView$32(View view) {
Browser.openUrl(view.getContext(), "https://t.me/BotFather?start=" + getActiveUsername(this.currentUser));
}
public void lambda$createView$34(View view) {
AlertsCreator.createClearOrDeleteDialogAlert(this, false, true, false, this.currentChat, (TLRPC.User) null, false, true, false, new MessagesStorage.BooleanCallback() {
public final void run(boolean z) {
ChatEditActivity.this.lambda$createView$33(z);
}
}, (Theme.ResourcesProvider) null);
}
public void lambda$createView$33(boolean z) {
if (AndroidUtilities.isTablet()) {
getNotificationCenter().postNotificationName(NotificationCenter.closeChats, new Object[]{Long.valueOf(-this.chatId)});
} else {
getNotificationCenter().postNotificationName(NotificationCenter.closeChats, new Object[0]);
}
finishFragment();
getNotificationCenter().postNotificationName(NotificationCenter.needDeleteDialog, new Object[]{Long.valueOf(-this.currentChat.id), null, this.currentChat, Boolean.valueOf(z)});
}
public final void updatePublicLinksCount() {
if (this.publicLinkCell == null) {
return;
}
if (this.currentUser.usernames.size() > 1) {
Iterator it = this.currentUser.usernames.iterator();
int i = 0;
while (it.hasNext()) {
if (((TLRPC.TL_username) it.next()).active) {
i++;
}
}
this.publicLinkCell.setTextAndValueAndIcon((CharSequence) LocaleController.getString(R.string.BotPublicLinks), (CharSequence) LocaleController.formatString(R.string.BotPublicLinksCount, new Object[]{Integer.valueOf(i), Integer.valueOf(this.currentUser.usernames.size())}), R.drawable.msg_link2, true);
return;
}
this.publicLinkCell.setTextAndValueAndIcon((CharSequence) LocaleController.getString(R.string.BotPublicLink), (CharSequence) ("t.me/" + this.currentUser.username), R.drawable.msg_link2, true);
}
public final String getActiveUsername(TLRPC.User user) {
String str = user.username;
if (str != null) {
return str;
}
Iterator it = user.usernames.iterator();
while (it.hasNext()) {
TLRPC.TL_username tL_username = (TLRPC.TL_username) it.next();
if (tL_username.active) {
return tL_username.username;
}
}
return null;
}
public final void setAvatar() {
if (this.avatarImage == null || this.hasUploadedPhoto) {
return;
}
TLRPC.User chat = getMessagesController().getChat(Long.valueOf(this.chatId));
TLRPC.User user = this.userId == 0 ? null : getMessagesController().getUser(Long.valueOf(this.userId));
if (chat == null && user == null) {
return;
}
this.currentUser = user;
this.currentChat = chat;
boolean z = false;
if (user == null ? ((TLRPC.Chat) chat).photo != null : user.photo != null) {
TLRPC.User user2 = user != null ? user : chat;
this.avatar = user != null ? user.photo.photo_small : ((TLRPC.Chat) chat).photo.photo_small;
ImageLocation forUserOrChat = ImageLocation.getForUserOrChat(user2, 1);
this.avatarImage.setForUserOrChat(user2, this.avatarDrawable);
if (forUserOrChat != null) {
z = true;
}
} else {
this.avatarImage.setImageDrawable(this.avatarDrawable);
}
if (this.setAvatarCell != null) {
if (z || this.imageUpdater.isUploadingImage()) {
this.setAvatarCell.setTextAndIcon((CharSequence) LocaleController.getString("ChatSetNewPhoto", R.string.ChatSetNewPhoto), R.drawable.msg_addphoto, true);
} else {
this.setAvatarCell.setTextAndIcon((CharSequence) LocaleController.getString("ChatSetPhotoOrVideo", R.string.ChatSetPhotoOrVideo), R.drawable.msg_addphoto, true);
}
if (this.cameraDrawable == null) {
int i = R.raw.camera_outline;
this.cameraDrawable = new RLottieDrawable(i, "" + i, AndroidUtilities.dp(50.0f), AndroidUtilities.dp(50.0f), false, (int[]) null);
}
this.setAvatarCell.imageView.setTranslationX(-AndroidUtilities.dp(8.0f));
this.setAvatarCell.imageView.setAnimation(this.cameraDrawable);
}
if (PhotoViewer.hasInstance() && PhotoViewer.getInstance().isVisible()) {
PhotoViewer.getInstance().checkCurrentImageVisibility();
}
}
public final void updateCanForum() {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.ui.ChatEditActivity.updateCanForum():void");
}
public void didReceivedNotification(int id, int account, Object... args) {
EditTextBoldCursor editTextBoldCursor;
boolean z = true;
if (id == NotificationCenter.chatInfoDidLoad) {
TLRPC.ChatFull chatFull = (TLRPC.ChatFull) args[0];
if (chatFull.id == this.chatId) {
if (this.info == null && (editTextBoldCursor = this.descriptionTextView) != null) {
editTextBoldCursor.setText(chatFull.about);
}
boolean z2 = this.info == null;
this.info = chatFull;
updateCanForum();
if (ChatObject.isChannel(this.currentChat) && !this.info.hidden_prehistory) {
z = false;
}
this.historyHidden = z;
updateFields(false, false);
if (z2) {
loadLinksCount();
return;
}
return;
}
return;
}
if (id == NotificationCenter.updateInterfaces) {
int intValue = ((Integer) args[0]).intValue();
if ((MessagesController.UPDATE_MASK_AVATAR & intValue) != 0) {
setAvatar();
}
if ((intValue & MessagesController.UPDATE_MASK_NAME) != 0) {
updatePublicLinksCount();
return;
}
return;
}
if (id == NotificationCenter.chatAvailableReactionsUpdated) {
long longValue = ((Long) args[0]).longValue();
if (longValue == this.chatId) {
TLRPC.ChatFull chatFull2 = getMessagesController().getChatFull(longValue);
this.info = chatFull2;
if (chatFull2 != null) {
this.availableReactions = chatFull2.available_reactions;
}
updateReactionsCell(true);
}
}
}
public void onUploadProgressChanged(float progress) {
RadialProgressView radialProgressView = this.avatarProgressView;
if (radialProgressView == null) {
return;
}
radialProgressView.setProgress(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() {
ChatEditActivity.this.lambda$didUploadPhoto$37(smallSize, photo, video, emojiMarkup, bigSize, videoStartTimestamp, videoPath);
}
});
}
public void lambda$didUploadPhoto$37(TLRPC.PhotoSize photoSize, TLRPC.InputFile inputFile, TLRPC.InputFile inputFile2, TLRPC.VideoSize videoSize, TLRPC.PhotoSize photoSize2, double d, String str) {
TLRPC.FileLocation fileLocation = photoSize.location;
this.avatar = fileLocation;
if (inputFile != null || inputFile2 != null || videoSize != null) {
long j = 0;
if (this.userId != 0) {
TLRPC.User user = this.currentUser;
if (user != null) {
user.photo = new TLRPC.TL_userProfilePhoto();
TLRPC.UserProfilePhoto userProfilePhoto = this.currentUser.photo;
if (inputFile != null) {
j = inputFile.id;
} else if (inputFile2 != null) {
j = inputFile2.id;
}
userProfilePhoto.photo_id = j;
userProfilePhoto.photo_big = photoSize2.location;
userProfilePhoto.photo_small = photoSize.location;
getMessagesController().putUser(this.currentUser, true);
}
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;
}
tL_photos_uploadProfilePhoto.bot = getMessagesController().getInputUser(this.currentUser);
tL_photos_uploadProfilePhoto.flags |= 32;
getConnectionsManager().sendRequest(tL_photos_uploadProfilePhoto, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
ChatEditActivity.this.lambda$didUploadPhoto$36(tLObject, tL_error);
}
});
} else {
getMessagesController().changeChatAvatar(this.chatId, (TLRPC.TL_inputChatPhoto) null, inputFile, inputFile2, videoSize, d, str, photoSize.location, photoSize2.location, (Runnable) null);
}
if (this.createAfterUpload) {
try {
AlertDialog alertDialog = this.progressDialog;
if (alertDialog != null && alertDialog.isShowing()) {
this.progressDialog.dismiss();
this.progressDialog = null;
}
} catch (Exception e) {
FileLog.e(e);
}
this.donePressed = false;
this.doneButton.performClick();
}
showAvatarProgress(false, true);
return;
}
BackupImageView backupImageView = this.avatarImage;
ImageLocation forLocal = ImageLocation.getForLocal(fileLocation);
AvatarDrawable avatarDrawable = this.avatarDrawable;
TLRPC.Chat chat = this.currentUser;
if (chat == null) {
chat = this.currentChat;
}
backupImageView.setImage(forLocal, "50_50", avatarDrawable, chat);
this.setAvatarCell.setTextAndIcon((CharSequence) LocaleController.getString("ChatSetNewPhoto", R.string.ChatSetNewPhoto), R.drawable.msg_addphoto, true);
if (this.cameraDrawable == null) {
int i2 = R.raw.camera_outline;
this.cameraDrawable = new RLottieDrawable(i2, "" + i2, AndroidUtilities.dp(50.0f), AndroidUtilities.dp(50.0f), false, (int[]) null);
}
this.setAvatarCell.imageView.setTranslationX(-AndroidUtilities.dp(8.0f));
this.setAvatarCell.imageView.setAnimation(this.cameraDrawable);
showAvatarProgress(true, false);
}
public void lambda$didUploadPhoto$36(TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
ChatEditActivity.this.lambda$didUploadPhoto$35();
}
});
}
public void lambda$didUploadPhoto$35() {
this.hasUploadedPhoto = true;
NotificationCenter.getInstance(((BaseFragment) this).currentAccount).postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(MessagesController.UPDATE_MASK_AVATAR)});
}
public String getInitialSearchString() {
return this.nameTextView.getText().toString();
}
public void showConvertTooltip() {
this.undoView.showWithAction(0L, 76, (Runnable) null);
}
public final boolean checkDiscard() {
EditTextEmoji editTextEmoji;
EditTextBoldCursor editTextBoldCursor;
String str;
EditTextBoldCursor editTextBoldCursor2;
String str2;
String str3 = "";
if (this.userId != 0) {
TLRPC.UserFull userFull = this.userInfo;
if (userFull != null && (str2 = userFull.about) != null) {
str3 = str2;
}
EditTextEmoji editTextEmoji2 = this.nameTextView;
if ((editTextEmoji2 == null || this.currentUser.first_name.equals(editTextEmoji2.getText().toString())) && ((editTextBoldCursor2 = this.descriptionTextView) == null || str3.equals(editTextBoldCursor2.getText().toString()))) {
return true;
}
showDialog(new AlertDialog.Builder(getParentActivity()).setTitle(LocaleController.getString("UserRestrictionsApplyChanges", R.string.UserRestrictionsApplyChanges)).setMessage(LocaleController.getString(R.string.BotSettingsChangedAlert)).setPositiveButton(LocaleController.getString("ApplyTheme", R.string.ApplyTheme), new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
ChatEditActivity.this.lambda$checkDiscard$38(dialogInterface, i);
}
}).setNegativeButton(LocaleController.getString("PassportDiscard", R.string.PassportDiscard), new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
ChatEditActivity.this.lambda$checkDiscard$39(dialogInterface, i);
}
}).create());
return false;
}
TLRPC.ChatFull chatFull = this.info;
if (chatFull != null && (str = chatFull.about) != null) {
str3 = str;
}
if ((chatFull == null || !ChatObject.isChannel(this.currentChat) || this.info.hidden_prehistory == this.historyHidden) && (((editTextEmoji = this.nameTextView) == null || this.currentChat.title.equals(editTextEmoji.getText().toString())) && ((editTextBoldCursor = this.descriptionTextView) == null || str3.equals(editTextBoldCursor.getText().toString())))) {
boolean z = this.signMessages;
TLRPC.Chat chat = this.currentChat;
if (z == chat.signatures && this.forum == chat.forum) {
return true;
}
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("UserRestrictionsApplyChanges", R.string.UserRestrictionsApplyChanges));
if (this.isChannel) {
builder.setMessage(LocaleController.getString("ChannelSettingsChangedAlert", R.string.ChannelSettingsChangedAlert));
} else {
builder.setMessage(LocaleController.getString("GroupSettingsChangedAlert", R.string.GroupSettingsChangedAlert));
}
builder.setPositiveButton(LocaleController.getString("ApplyTheme", R.string.ApplyTheme), new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
ChatEditActivity.this.lambda$checkDiscard$40(dialogInterface, i);
}
});
builder.setNegativeButton(LocaleController.getString("PassportDiscard", R.string.PassportDiscard), new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
ChatEditActivity.this.lambda$checkDiscard$41(dialogInterface, i);
}
});
showDialog(builder.create());
return false;
}
public void lambda$checkDiscard$38(DialogInterface dialogInterface, int i) {
processDone();
}
public void lambda$checkDiscard$39(DialogInterface dialogInterface, int i) {
finishFragment();
}
public void lambda$checkDiscard$40(DialogInterface dialogInterface, int i) {
processDone();
}
public void lambda$checkDiscard$41(DialogInterface dialogInterface, int i) {
finishFragment();
}
public final int getAdminCount() {
TLRPC.ChatFull chatFull = this.info;
if (chatFull == null) {
return 1;
}
int size = chatFull.participants.participants.size();
int i = 0;
for (int i2 = 0; i2 < size; i2++) {
TLRPC.ChatParticipant chatParticipant = (TLRPC.ChatParticipant) this.info.participants.participants.get(i2);
if ((chatParticipant instanceof TLRPC.TL_chatParticipantAdmin) || (chatParticipant instanceof TLRPC.TL_chatParticipantCreator)) {
i++;
}
}
return i;
}
public final void processDone() {
EditTextEmoji editTextEmoji;
String str;
String str2;
if (this.donePressed || (editTextEmoji = this.nameTextView) == null) {
return;
}
if (editTextEmoji.length() == 0) {
Vibrator vibrator = (Vibrator) getParentActivity().getSystemService("vibrator");
if (vibrator != null) {
vibrator.vibrate(200L);
}
AndroidUtilities.shakeView(this.nameTextView);
return;
}
this.donePressed = true;
String str3 = "";
if (this.currentUser != null) {
final TLRPC.TL_bots_setBotInfo tL_bots_setBotInfo = new TLRPC.TL_bots_setBotInfo();
tL_bots_setBotInfo.bot = getMessagesController().getInputUser(this.currentUser);
tL_bots_setBotInfo.flags |= 4;
tL_bots_setBotInfo.lang_code = "";
if (!this.currentUser.first_name.equals(this.nameTextView.getText().toString())) {
tL_bots_setBotInfo.name = this.nameTextView.getText().toString();
tL_bots_setBotInfo.flags |= 8;
}
TLRPC.UserFull userFull = this.userInfo;
if (userFull != null && (str2 = userFull.about) != null) {
str3 = str2;
}
EditTextBoldCursor editTextBoldCursor = this.descriptionTextView;
if (editTextBoldCursor != null && !str3.equals(editTextBoldCursor.getText().toString())) {
tL_bots_setBotInfo.about = this.descriptionTextView.getText().toString();
tL_bots_setBotInfo.flags = 1 | tL_bots_setBotInfo.flags;
}
this.progressDialog = new AlertDialog(getParentActivity(), 3);
final int sendRequest = getConnectionsManager().sendRequest(tL_bots_setBotInfo, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
ChatEditActivity.this.lambda$processDone$43(tL_bots_setBotInfo, tLObject, tL_error);
}
});
this.progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public final void onCancel(DialogInterface dialogInterface) {
ChatEditActivity.this.lambda$processDone$44(sendRequest, dialogInterface);
}
});
this.progressDialog.show();
return;
}
if (!ChatObject.isChannel(this.currentChat) && (!this.historyHidden || this.forum)) {
getMessagesController().convertToMegaGroup(getParentActivity(), this.chatId, this, new MessagesStorage.LongCallback() {
public final void run(long j) {
ChatEditActivity.this.lambda$processDone$45(j);
}
});
return;
}
if (this.info != null && ChatObject.isChannel(this.currentChat)) {
TLRPC.ChatFull chatFull = this.info;
boolean z = chatFull.hidden_prehistory;
boolean z2 = this.historyHidden;
if (z != z2) {
chatFull.hidden_prehistory = z2;
getMessagesController().toggleChannelInvitesHistory(this.chatId, this.historyHidden);
}
}
if (this.imageUpdater.isUploadingImage()) {
this.createAfterUpload = true;
AlertDialog alertDialog = new AlertDialog(getParentActivity(), 3);
this.progressDialog = alertDialog;
alertDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public final void onCancel(DialogInterface dialogInterface) {
ChatEditActivity.this.lambda$processDone$46(dialogInterface);
}
});
this.progressDialog.show();
return;
}
if (!this.currentChat.title.equals(this.nameTextView.getText().toString())) {
getMessagesController().changeChatTitle(this.chatId, this.nameTextView.getText().toString());
}
TLRPC.ChatFull chatFull2 = this.info;
if (chatFull2 != null && (str = chatFull2.about) != null) {
str3 = str;
}
EditTextBoldCursor editTextBoldCursor2 = this.descriptionTextView;
if (editTextBoldCursor2 != null && !str3.equals(editTextBoldCursor2.getText().toString())) {
getMessagesController().updateChatAbout(this.chatId, this.descriptionTextView.getText().toString(), this.info);
}
boolean z3 = this.signMessages;
TLRPC.Chat chat = this.currentChat;
if (z3 != chat.signatures) {
chat.signatures = true;
getMessagesController().toggleChannelSignatures(this.chatId, this.signMessages);
}
if (this.forum != this.currentChat.forum) {
getMessagesController().toggleChannelForum(this.chatId, this.forum);
List<BaseFragment> fragmentStack = getParentLayout().getFragmentStack();
for (int i = 0; i < fragmentStack.size(); i++) {
if ((fragmentStack.get(i) instanceof ChatActivity) && ((ChatActivity) fragmentStack.get(i)).getArguments().getLong("chat_id") == this.chatId) {
getParentLayout().removeFragmentFromStack(i);
Bundle bundle = new Bundle();
bundle.putLong("chat_id", this.chatId);
getParentLayout().addFragmentToStack(TopicsFragment.getTopicsOrChat(this, bundle), i);
}
}
}
finishFragment();
}
public void lambda$processDone$43(TLRPC.TL_bots_setBotInfo tL_bots_setBotInfo, TLObject tLObject, TLRPC.TL_error tL_error) {
TLRPC.UserFull userFull = this.userInfo;
if (userFull != null) {
userFull.about = tL_bots_setBotInfo.about;
getMessagesStorage().updateUserInfo(this.userInfo, false);
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
ChatEditActivity.this.lambda$processDone$42();
}
});
}
public void lambda$processDone$42() {
this.progressDialog.dismiss();
finishFragment();
}
public void lambda$processDone$44(int i, DialogInterface dialogInterface) {
this.donePressed = false;
this.progressDialog = null;
getConnectionsManager().cancelRequest(i, true);
}
public void lambda$processDone$45(long j) {
if (j == 0) {
this.donePressed = false;
return;
}
this.chatId = j;
this.currentChat = getMessagesController().getChat(Long.valueOf(j));
this.donePressed = false;
TLRPC.ChatFull chatFull = this.info;
if (chatFull != null) {
chatFull.hidden_prehistory = true;
}
processDone();
}
public void lambda$processDone$46(DialogInterface dialogInterface) {
this.createAfterUpload = false;
this.progressDialog = null;
this.donePressed = false;
}
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) {
AnimatorSet animatorSet2 = new AnimatorSet();
this.avatarAnimation = animatorSet2;
if (show) {
this.avatarProgressView.setVisibility(0);
this.avatarOverlay.setVisibility(0);
this.avatarAnimation.playTogether(ObjectAnimator.ofFloat(this.avatarProgressView, (Property<RadialProgressView, Float>) View.ALPHA, 1.0f), ObjectAnimator.ofFloat(this.avatarOverlay, (Property<View, Float>) View.ALPHA, 1.0f));
} else {
animatorSet2.playTogether(ObjectAnimator.ofFloat(this.avatarProgressView, (Property<RadialProgressView, Float>) View.ALPHA, 0.0f), ObjectAnimator.ofFloat(this.avatarOverlay, (Property<View, Float>) View.ALPHA, 0.0f));
}
this.avatarAnimation.setDuration(180L);
this.avatarAnimation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (ChatEditActivity.this.avatarAnimation == null || ChatEditActivity.this.avatarProgressView == null) {
return;
}
if (!show) {
ChatEditActivity.this.avatarProgressView.setVisibility(4);
ChatEditActivity.this.avatarOverlay.setVisibility(4);
}
ChatEditActivity.this.avatarAnimation = null;
}
@Override
public void onAnimationCancel(Animator animation) {
ChatEditActivity.this.avatarAnimation = null;
}
});
this.avatarAnimation.start();
return;
}
if (show) {
this.avatarProgressView.setAlpha(1.0f);
this.avatarProgressView.setVisibility(0);
this.avatarOverlay.setAlpha(1.0f);
this.avatarOverlay.setVisibility(0);
return;
}
this.avatarProgressView.setAlpha(0.0f);
this.avatarProgressView.setVisibility(4);
this.avatarOverlay.setAlpha(0.0f);
this.avatarOverlay.setVisibility(4);
}
public void onActivityResultFragment(int requestCode, int resultCode, Intent data) {
this.imageUpdater.onActivityResult(requestCode, resultCode, data);
}
public void saveSelfArgs(Bundle args) {
String str;
ImageUpdater imageUpdater = this.imageUpdater;
if (imageUpdater != null && (str = imageUpdater.currentPicturePath) != null) {
args.putString("path", str);
}
EditTextEmoji editTextEmoji = this.nameTextView;
if (editTextEmoji != null) {
String obj = editTextEmoji.getText().toString();
if (obj.length() != 0) {
args.putString("nameTextView", obj);
}
}
}
public void setInfo(TLRPC.UserFull userFull) {
this.userInfo = userFull;
if (userFull == null || this.currentUser != null) {
return;
}
this.currentUser = this.userId == 0 ? null : getMessagesController().getUser(Long.valueOf(this.userId));
}
public void setInfo(TLRPC.ChatFull chatFull) {
this.info = chatFull;
if (chatFull != null) {
if (this.currentChat == null) {
this.currentChat = getMessagesController().getChat(Long.valueOf(this.chatId));
}
this.historyHidden = !ChatObject.isChannel(this.currentChat) || this.info.hidden_prehistory;
this.availableReactions = this.info.available_reactions;
this.preloadedReactions.clear();
this.preloadedReactions.addAll(ReactionsUtils.startPreloadReactions(this.currentChat, this.info));
}
}
public final void updateFields(boolean z, boolean z2) {
int i;
int i2;
String str;
TLRPC.ChatFull chatFull;
int i3;
String str2;
String string;
TextCell textCell;
TextCell textCell2;
TextCell textCell3;
TextCell textCell4;
int i4;
String str3;
String format;
TextCell textCell5;
TextCell textCell6;
TextCell textCell7;
TextCell textCell8;
TextCell textCell9;
TLRPC.Chat chat;
if (z && (chat = getMessagesController().getChat(Long.valueOf(this.chatId))) != null) {
this.currentChat = chat;
}
boolean z3 = !ChatObject.isPublic(this.currentChat);
TextInfoPrivacyCell textInfoPrivacyCell = this.settingsSectionCell;
if (textInfoPrivacyCell != null) {
textInfoPrivacyCell.setVisibility((this.signCell == null && this.typeCell == null && ((textCell7 = this.linkedCell) == null || textCell7.getVisibility() != 0) && (((textCell8 = this.historyCell) == null || textCell8.getVisibility() != 0) && ((textCell9 = this.locationCell) == null || textCell9.getVisibility() != 0))) ? 8 : 0);
}
TextCell textCell10 = this.logCell;
if (textCell10 != null) {
textCell10.setVisibility(ChatObject.isChannel(this.currentChat) ? 0 : 8);
}
TextCell textCell11 = this.linkedCell;
if (textCell11 != null) {
TLRPC.ChatFull chatFull2 = this.info;
if (chatFull2 == null || (!this.isChannel && chatFull2.linked_chat_id == 0)) {
textCell11.setVisibility(8);
} else {
textCell11.setVisibility(0);
if (this.info.linked_chat_id == 0) {
this.linkedCell.setTextAndValueAndIcon((CharSequence) LocaleController.getString("Discussion", R.string.Discussion), (CharSequence) LocaleController.getString("DiscussionInfoShort", R.string.DiscussionInfoShort), R.drawable.msg_discuss, true);
} else {
TLRPC.Chat chat2 = getMessagesController().getChat(Long.valueOf(this.info.linked_chat_id));
if (chat2 == null) {
this.linkedCell.setVisibility(8);
} else if (this.isChannel) {
String publicUsername = ChatObject.getPublicUsername(chat2);
if (TextUtils.isEmpty(publicUsername)) {
this.linkedCell.setTextAndValueAndIcon((CharSequence) LocaleController.getString("Discussion", R.string.Discussion), (CharSequence) chat2.title, R.drawable.msg_discuss, true);
} else {
this.linkedCell.setTextAndValueAndIcon((CharSequence) LocaleController.getString("Discussion", R.string.Discussion), (CharSequence) ("@" + publicUsername), R.drawable.msg_discuss, true);
}
} else {
String publicUsername2 = ChatObject.getPublicUsername(chat2);
if (TextUtils.isEmpty(publicUsername2)) {
TextCell textCell12 = this.linkedCell;
String string2 = LocaleController.getString("LinkedChannel", R.string.LinkedChannel);
String str4 = chat2.title;
int i5 = R.drawable.msg_channel;
TextCell textCell13 = this.forumsCell;
textCell12.setTextAndValueAndIcon(string2, str4, i5, textCell13 != null && textCell13.getVisibility() == 0);
} else {
TextCell textCell14 = this.linkedCell;
String string3 = LocaleController.getString("LinkedChannel", R.string.LinkedChannel);
String str5 = "@" + publicUsername2;
int i6 = R.drawable.msg_channel;
TextCell textCell15 = this.forumsCell;
textCell14.setTextAndValueAndIcon(string3, str5, i6, textCell15 != null && textCell15.getVisibility() == 0);
}
}
}
}
}
TextCell textCell16 = this.locationCell;
if (textCell16 != null) {
TLRPC.ChatFull chatFull3 = this.info;
if (chatFull3 != null && chatFull3.can_set_location) {
textCell16.setVisibility(0);
TLRPC.TL_channelLocation tL_channelLocation = this.info.location;
if (tL_channelLocation instanceof TLRPC.TL_channelLocation) {
this.locationCell.setTextAndValue(LocaleController.getString("AttachLocation", R.string.AttachLocation), tL_channelLocation.address, z2, true);
} else {
this.locationCell.setTextAndValue(LocaleController.getString("AttachLocation", R.string.AttachLocation), "Unknown address", z2, true);
}
} else {
textCell16.setVisibility(8);
}
}
if (this.typeCell != null) {
TLRPC.ChatFull chatFull4 = this.info;
if (chatFull4 != null && (chatFull4.location instanceof TLRPC.TL_channelLocation)) {
if (z3) {
format = LocaleController.getString("TypeLocationGroupEdit", R.string.TypeLocationGroupEdit);
} else {
format = String.format("https://" + getMessagesController().linkPrefix + "/%s", ChatObject.getPublicUsername(this.currentChat));
}
TextCell textCell17 = this.typeCell;
String string4 = LocaleController.getString("TypeLocationGroup", R.string.TypeLocationGroup);
int i7 = R.drawable.msg_channel;
TextCell textCell18 = this.historyCell;
textCell17.setTextAndValueAndIcon(string4, format, i7, (textCell18 != null && textCell18.getVisibility() == 0) || ((textCell5 = this.linkedCell) != null && textCell5.getVisibility() == 0) || ((textCell6 = this.forumsCell) != null && textCell6.getVisibility() == 0));
} else {
boolean z4 = this.currentChat.noforwards;
if (this.isChannel) {
if (!z3) {
i4 = R.string.TypePublic;
str3 = "TypePublic";
} else if (z4) {
i4 = R.string.TypePrivateRestrictedForwards;
str3 = "TypePrivateRestrictedForwards";
} else {
i4 = R.string.TypePrivate;
str3 = "TypePrivate";
}
string = LocaleController.getString(str3, i4);
} else {
if (!z3) {
i3 = R.string.TypePublicGroup;
str2 = "TypePublicGroup";
} else if (z4) {
i3 = R.string.TypePrivateGroupRestrictedForwards;
str2 = "TypePrivateGroupRestrictedForwards";
} else {
i3 = R.string.TypePrivateGroup;
str2 = "TypePrivateGroup";
}
string = LocaleController.getString(str2, i3);
}
if (this.isChannel) {
TextCell textCell19 = this.typeCell;
String string5 = LocaleController.getString("ChannelType", R.string.ChannelType);
int i8 = R.drawable.msg_channel;
TextCell textCell20 = this.historyCell;
textCell19.setTextAndValueAndIcon(string5, string, i8, (textCell20 != null && textCell20.getVisibility() == 0) || ((textCell3 = this.linkedCell) != null && textCell3.getVisibility() == 0) || ((textCell4 = this.forumsCell) != null && textCell4.getVisibility() == 0));
} else {
TextCell textCell21 = this.typeCell;
String string6 = LocaleController.getString("GroupType", R.string.GroupType);
int i9 = R.drawable.msg_groups;
TextCell textCell22 = this.historyCell;
textCell21.setTextAndValueAndIcon(string6, string, i9, (textCell22 != null && textCell22.getVisibility() == 0) || ((textCell = this.linkedCell) != null && textCell.getVisibility() == 0) || ((textCell2 = this.forumsCell) != null && textCell2.getVisibility() == 0));
}
}
}
if (this.historyCell != null) {
if (!this.historyHidden || this.forum) {
i2 = R.string.ChatHistoryVisible;
str = "ChatHistoryVisible";
} else {
i2 = R.string.ChatHistoryHidden;
str = "ChatHistoryHidden";
}
this.historyCell.setTextAndValueAndIcon(LocaleController.getString("ChatHistoryShort", R.string.ChatHistoryShort), LocaleController.getString(str, i2), z2, R.drawable.msg_discuss, this.forumsCell != null);
this.historyCell.setEnabled(!this.forum);
updateHistoryShow(!this.forum && z3 && ((chatFull = this.info) == null || chatFull.linked_chat_id == 0) && (chatFull == null || !(chatFull.location instanceof TLRPC.TL_channelLocation)), z2);
}
TextCell textCell23 = this.membersCell;
if (textCell23 != null) {
if (this.info != null) {
TextCell textCell24 = this.memberRequestsCell;
if (textCell24 != null) {
if (textCell24.getParent() == null) {
this.infoContainer.addView(this.memberRequestsCell, this.infoContainer.indexOfChild(this.membersCell) + 1, LayoutHelper.createLinear(-1, -2));
}
this.memberRequestsCell.setVisibility(this.info.requests_pending > 0 ? 0 : 8);
}
if (this.isChannel) {
this.membersCell.setTextAndValueAndIcon((CharSequence) LocaleController.getString("ChannelSubscribers", R.string.ChannelSubscribers), (CharSequence) String.format("%d", Integer.valueOf(this.info.participants_count)), R.drawable.msg_groups, true);
TextCell textCell25 = this.blockCell;
String string7 = LocaleController.getString("ChannelBlacklist", R.string.ChannelBlacklist);
TLRPC.ChatFull chatFull5 = this.info;
String format2 = String.format("%d", Integer.valueOf(Math.max(chatFull5.banned_count, chatFull5.kicked_count)));
int i10 = R.drawable.msg_user_remove;
TextCell textCell26 = this.logCell;
textCell25.setTextAndValueAndIcon(string7, format2, i10, textCell26 != null && textCell26.getVisibility() == 0);
} else {
if (ChatObject.isChannel(this.currentChat)) {
this.membersCell.setTextAndValueAndIcon((CharSequence) LocaleController.getString("ChannelMembers", R.string.ChannelMembers), (CharSequence) String.format("%d", Integer.valueOf(this.info.participants_count)), R.drawable.msg_groups, true);
} else {
this.membersCell.setTextAndValueAndIcon(LocaleController.getString("ChannelMembers", R.string.ChannelMembers), String.format("%d", Integer.valueOf(this.info.participants.participants.size())), R.drawable.msg_groups, this.memberRequestsCell.getVisibility() == 0);
}
TLRPC.Chat chat3 = this.currentChat;
if (chat3.gigagroup) {
TextCell textCell27 = this.blockCell;
String string8 = LocaleController.getString("ChannelBlacklist", R.string.ChannelBlacklist);
TLRPC.ChatFull chatFull6 = this.info;
String format3 = String.format("%d", Integer.valueOf(Math.max(chatFull6.banned_count, chatFull6.kicked_count)));
int i11 = R.drawable.msg_user_remove;
TextCell textCell28 = this.logCell;
textCell27.setTextAndValueAndIcon(string8, format3, i11, textCell28 != null && textCell28.getVisibility() == 0);
} else {
TLRPC.TL_chatBannedRights tL_chatBannedRights = chat3.default_banned_rights;
if (tL_chatBannedRights != null) {
i = (!tL_chatBannedRights.send_plain ? 1 : 0) + ChatUsersActivity.getSendMediaSelectedCount(tL_chatBannedRights);
TLRPC.TL_chatBannedRights tL_chatBannedRights2 = this.currentChat.default_banned_rights;
if (!tL_chatBannedRights2.pin_messages) {
i++;
}
if (!tL_chatBannedRights2.invite_users) {
i++;
}
if (this.forum && !tL_chatBannedRights2.manage_topics) {
i++;
}
if (!tL_chatBannedRights2.change_info) {
i++;
}
} else {
i = this.forum ? 17 : 16;
}
TextCell textCell29 = this.blockCell;
String string9 = LocaleController.getString("ChannelPermissions", R.string.ChannelPermissions);
Object[] objArr = new Object[2];
objArr[0] = Integer.valueOf(i);
objArr[1] = Integer.valueOf(this.forum ? 17 : 16);
textCell29.setTextAndValueAndIcon(string9, String.format("%d/%d", objArr), z2, R.drawable.msg_permissions, true);
}
TextCell textCell30 = this.memberRequestsCell;
if (textCell30 != null) {
String string10 = LocaleController.getString("MemberRequests", R.string.MemberRequests);
String format4 = String.format("%d", Integer.valueOf(this.info.requests_pending));
int i12 = R.drawable.msg_requests;
TextCell textCell31 = this.logCell;
textCell30.setTextAndValueAndIcon(string10, format4, i12, textCell31 != null && textCell31.getVisibility() == 0);
}
}
TextCell textCell32 = this.adminCell;
String string11 = LocaleController.getString("ChannelAdministrators", R.string.ChannelAdministrators);
Object[] objArr2 = new Object[1];
objArr2[0] = Integer.valueOf(ChatObject.isChannel(this.currentChat) ? this.info.admins_count : getAdminCount());
textCell32.setTextAndValueAndIcon((CharSequence) string11, (CharSequence) String.format("%d", objArr2), R.drawable.msg_admins, true);
} else {
if (this.isChannel) {
textCell23.setTextAndIcon((CharSequence) LocaleController.getString("ChannelSubscribers", R.string.ChannelSubscribers), R.drawable.msg_groups, true);
TextCell textCell33 = this.blockCell;
String string12 = LocaleController.getString("ChannelBlacklist", R.string.ChannelBlacklist);
int i13 = R.drawable.msg_chats_remove;
TextCell textCell34 = this.logCell;
textCell33.setTextAndIcon(string12, i13, textCell34 != null && textCell34.getVisibility() == 0);
} else {
String string13 = LocaleController.getString("ChannelMembers", R.string.ChannelMembers);
int i14 = R.drawable.msg_groups;
TextCell textCell35 = this.logCell;
textCell23.setTextAndIcon(string13, i14, textCell35 != null && textCell35.getVisibility() == 0);
if (this.currentChat.gigagroup) {
TextCell textCell36 = this.blockCell;
String string14 = LocaleController.getString("ChannelBlacklist", R.string.ChannelBlacklist);
int i15 = R.drawable.msg_chats_remove;
TextCell textCell37 = this.logCell;
textCell36.setTextAndIcon(string14, i15, textCell37 != null && textCell37.getVisibility() == 0);
} else {
this.blockCell.setTextAndIcon((CharSequence) LocaleController.getString("ChannelPermissions", R.string.ChannelPermissions), R.drawable.msg_permissions, true);
}
}
this.adminCell.setTextAndIcon((CharSequence) LocaleController.getString("ChannelAdministrators", R.string.ChannelAdministrators), R.drawable.msg_admins, true);
}
this.reactionsCell.setVisibility(ChatObject.canChangeChatInfo(this.currentChat) ? 0 : 8);
updateReactionsCell(z2);
if (this.info == null || !ChatObject.canUserDoAdminAction(this.currentChat, 3) || (!z3 && this.currentChat.creator)) {
this.inviteLinksCell.setVisibility(8);
} else if (this.info.invitesCount > 0) {
this.inviteLinksCell.setTextAndValueAndIcon((CharSequence) LocaleController.getString("InviteLinks", R.string.InviteLinks), (CharSequence) Integer.toString(this.info.invitesCount), R.drawable.msg_link2, true);
} else {
this.inviteLinksCell.setTextAndValueAndIcon((CharSequence) LocaleController.getString("InviteLinks", R.string.InviteLinks), (CharSequence) "1", R.drawable.msg_link2, true);
}
}
TextCell textCell38 = this.stickersCell;
if (textCell38 == null || this.info == null) {
return;
}
String string15 = LocaleController.getString(R.string.GroupStickers);
TLRPC.StickerSet stickerSet = this.info.stickerset;
textCell38.setTextAndValueAndIcon((CharSequence) string15, (CharSequence) (stickerSet != null ? stickerSet.title : LocaleController.getString(R.string.Add)), R.drawable.msg_sticker, false);
}
public void updateColorCell() {
TextCell textCell;
TextCell textCell2;
PeerColorActivity.ChangeNameColorCell changeNameColorCell = this.colorCell;
if (changeNameColorCell != null) {
TLRPC.Chat chat = this.currentChat;
TextCell textCell3 = this.historyCell;
changeNameColorCell.set(chat, (textCell3 != null && textCell3.getVisibility() == 0) || ((textCell = this.signCell) != null && textCell.getVisibility() == 0) || (((textCell2 = this.forumsCell) != null && textCell2.getVisibility() == 0) || (ChatObject.isMegagroup(this.currentChat) && ChatObject.hasAdminRights(this.currentChat))));
}
}
public final void updateHistoryShow(final boolean show, boolean animated) {
ValueAnimator valueAnimator = this.updateHistoryShowAnimator;
if (valueAnimator != null) {
valueAnimator.cancel();
}
if (this.historyCell.getAlpha() <= 0.0f && !show) {
this.historyCell.setVisibility(8);
updateColorCell();
return;
}
if (this.historyCell.getVisibility() == 0 && this.historyCell.getAlpha() >= 1.0f && show) {
return;
}
final ArrayList arrayList = new ArrayList();
boolean z = false;
for (int i = 0; i < this.typeEditContainer.getChildCount(); i++) {
if (!z && this.typeEditContainer.getChildAt(i) == this.historyCell) {
z = true;
} else if (z) {
arrayList.add(this.typeEditContainer.getChildAt(i));
}
}
boolean z2 = false;
for (int i2 = 0; i2 < this.linearLayout.getChildCount(); i2++) {
if (!z2 && this.linearLayout.getChildAt(i2) == this.typeEditContainer) {
z2 = true;
} else if (z2) {
arrayList.add(this.linearLayout.getChildAt(i2));
}
}
if (this.historyCell.getVisibility() != 0) {
this.historyCell.setAlpha(0.0f);
this.historyCell.setTranslationY((-r5.getHeight()) / 2.0f);
}
this.historyCell.setVisibility(0);
for (int i3 = 0; i3 < arrayList.size(); i3++) {
((View) arrayList.get(i3)).setTranslationY((-this.historyCell.getHeight()) * (1.0f - this.historyCell.getAlpha()));
}
if (animated) {
float[] fArr = new float[2];
fArr[0] = this.historyCell.getAlpha();
fArr[1] = show ? 1.0f : 0.0f;
ValueAnimator ofFloat = ValueAnimator.ofFloat(fArr);
this.updateHistoryShowAnimator = ofFloat;
ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public final void onAnimationUpdate(ValueAnimator valueAnimator2) {
ChatEditActivity.this.lambda$updateHistoryShow$47(arrayList, valueAnimator2);
}
});
this.updateHistoryShowAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
ChatEditActivity.this.historyCell.setVisibility(show ? 0 : 8);
for (int i4 = 0; i4 < arrayList.size(); i4++) {
((View) arrayList.get(i4)).setTranslationY(0.0f);
}
}
});
this.updateHistoryShowAnimator.setDuration(320L);
this.updateHistoryShowAnimator.setInterpolator(CubicBezierInterpolator.EASE_OUT_QUINT);
this.updateHistoryShowAnimator.start();
return;
}
this.historyCell.setAlpha(show ? 1.0f : 0.0f);
this.historyCell.setTranslationY(((-r13.getHeight()) / 2.0f) * (show ? 0.0f : 1.0f));
this.historyCell.setScaleY(((show ? 1.0f : 0.0f) * 0.8f) + 0.2f);
this.historyCell.setVisibility(show ? 0 : 8);
for (int i4 = 0; i4 < arrayList.size(); i4++) {
((View) arrayList.get(i4)).setTranslationY(0.0f);
}
this.updateHistoryShowAnimator = null;
}
public void lambda$updateHistoryShow$47(ArrayList arrayList, ValueAnimator valueAnimator) {
float floatValue = ((Float) valueAnimator.getAnimatedValue()).floatValue();
this.historyCell.setAlpha(floatValue);
float f = 1.0f - floatValue;
this.historyCell.setTranslationY(((-r0.getHeight()) / 2.0f) * f);
this.historyCell.setScaleY((floatValue * 0.8f) + 0.2f);
for (int i = 0; i < arrayList.size(); i++) {
((View) arrayList.get(i)).setTranslationY((-this.historyCell.getHeight()) * f);
}
}
public final void updateReactionsCell(boolean animated) {
String string;
int i;
boolean isChannelAndNotMegaGroup = ChatObject.isChannelAndNotMegaGroup(this.currentChat);
TLRPC.TL_chatReactionsSome tL_chatReactionsSome = this.availableReactions;
if (tL_chatReactionsSome == null || (tL_chatReactionsSome instanceof TLRPC.TL_chatReactionsNone)) {
string = LocaleController.getString("ReactionsOff", R.string.ReactionsOff);
} else if (tL_chatReactionsSome instanceof TLRPC.TL_chatReactionsSome) {
TLRPC.TL_chatReactionsSome tL_chatReactionsSome2 = tL_chatReactionsSome;
int i2 = 0;
while (i < tL_chatReactionsSome2.reactions.size()) {
TLRPC.TL_reactionEmoji tL_reactionEmoji = (TLRPC.Reaction) tL_chatReactionsSome2.reactions.get(i);
if (tL_reactionEmoji instanceof TLRPC.TL_reactionEmoji) {
TLRPC.TL_availableReaction tL_availableReaction = (TLRPC.TL_availableReaction) getMediaDataController().getReactionsMap().get(tL_reactionEmoji.emoticon);
if (tL_availableReaction != null) {
if (tL_availableReaction.inactive) {
}
i2++;
}
} else {
i = tL_reactionEmoji instanceof TLRPC.TL_reactionCustomEmoji ? 0 : i + 1;
i2++;
}
}
if (isChannelAndNotMegaGroup) {
string = i2 == 0 ? LocaleController.getString("ReactionsOff", R.string.ReactionsOff) : String.valueOf(i2);
} else {
int min = Math.min(getMediaDataController().getEnabledReactionsList().size(), i2);
if (min == 0) {
string = LocaleController.getString("ReactionsOff", R.string.ReactionsOff);
} else {
string = LocaleController.formatString("ReactionsCount", R.string.ReactionsCount, new Object[]{Integer.valueOf(min), Integer.valueOf(getMediaDataController().getEnabledReactionsList().size())});
}
}
} else {
string = LocaleController.getString("ReactionsAll", R.string.ReactionsAll);
}
this.reactionsCell.setTextAndValueAndIcon(LocaleController.getString("Reactions", R.string.Reactions), string, animated, R.drawable.msg_reactions2, true);
}
public ArrayList<ThemeDescription> getThemeDescriptions() {
ArrayList<ThemeDescription> arrayList = new ArrayList<>();
ThemeDescription.ThemeDescriptionDelegate themeDescriptionDelegate = new ThemeDescription.ThemeDescriptionDelegate() {
@Override
public final void didSetColor() {
ChatEditActivity.this.lambda$getThemeDescriptions$48();
}
@Override
public void onAnimationProgress(float f) {
ThemeDescription.ThemeDescriptionDelegate.CC.$default$onAnimationProgress(this, f);
}
};
arrayList.add(new ThemeDescription(((BaseFragment) this).fragmentView, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_windowBackgroundGray));
arrayList.add(new ThemeDescription(((BaseFragment) this).actionBar, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_actionBarDefault));
arrayList.add(new ThemeDescription(((BaseFragment) this).actionBar, ThemeDescription.FLAG_AB_ITEMSCOLOR, null, null, null, null, Theme.key_actionBarDefaultIcon));
arrayList.add(new ThemeDescription(((BaseFragment) this).actionBar, ThemeDescription.FLAG_AB_TITLECOLOR, null, null, null, null, Theme.key_actionBarDefaultTitle));
arrayList.add(new ThemeDescription(((BaseFragment) this).actionBar, ThemeDescription.FLAG_AB_SELECTORCOLOR, null, null, null, null, Theme.key_actionBarDefaultSelector));
TextCell textCell = this.setAvatarCell;
int i = ThemeDescription.FLAG_SELECTOR;
int i2 = Theme.key_listSelector;
arrayList.add(new ThemeDescription(textCell, i, null, null, null, null, i2));
arrayList.add(new ThemeDescription(this.setAvatarCell, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{TextCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_windowBackgroundWhiteBlueButton));
arrayList.add(new ThemeDescription(this.setAvatarCell, 0, new Class[]{TextCell.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_windowBackgroundWhiteBlueIcon));
arrayList.add(new ThemeDescription(this.membersCell, ThemeDescription.FLAG_SELECTOR, null, null, null, null, i2));
int i3 = Theme.key_windowBackgroundWhiteBlackText;
arrayList.add(new ThemeDescription(this.membersCell, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{TextCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i3));
int i4 = Theme.key_windowBackgroundWhiteGrayIcon;
arrayList.add(new ThemeDescription(this.membersCell, 0, new Class[]{TextCell.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i4));
arrayList.add(new ThemeDescription(this.adminCell, ThemeDescription.FLAG_SELECTOR, null, null, null, null, i2));
arrayList.add(new ThemeDescription(this.adminCell, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{TextCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i3));
arrayList.add(new ThemeDescription(this.adminCell, 0, new Class[]{TextCell.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i4));
arrayList.add(new ThemeDescription(this.inviteLinksCell, ThemeDescription.FLAG_SELECTOR, null, null, null, null, i2));
arrayList.add(new ThemeDescription(this.inviteLinksCell, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{TextCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i3));
arrayList.add(new ThemeDescription(this.inviteLinksCell, 0, new Class[]{TextCell.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i4));
if (this.memberRequestsCell != null) {
arrayList.add(new ThemeDescription(this.memberRequestsCell, ThemeDescription.FLAG_SELECTOR, null, null, null, null, i2));
arrayList.add(new ThemeDescription(this.memberRequestsCell, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{TextCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i3));
arrayList.add(new ThemeDescription(this.memberRequestsCell, 0, new Class[]{TextCell.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i4));
}
arrayList.add(new ThemeDescription(this.blockCell, ThemeDescription.FLAG_SELECTOR, null, null, null, null, i2));
arrayList.add(new ThemeDescription(this.blockCell, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{TextCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i3));
arrayList.add(new ThemeDescription(this.blockCell, 0, new Class[]{TextCell.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i4));
arrayList.add(new ThemeDescription(this.logCell, ThemeDescription.FLAG_SELECTOR, null, null, null, null, i2));
arrayList.add(new ThemeDescription(this.logCell, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{TextCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i3));
arrayList.add(new ThemeDescription(this.logCell, 0, new Class[]{TextCell.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i4));
arrayList.add(new ThemeDescription(this.typeCell, ThemeDescription.FLAG_SELECTOR, null, null, null, null, i2));
arrayList.add(new ThemeDescription(this.typeCell, 0, new Class[]{TextDetailCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i3));
int i5 = Theme.key_windowBackgroundWhiteGrayText2;
arrayList.add(new ThemeDescription(this.typeCell, 0, new Class[]{TextDetailCell.class}, new String[]{"valueTextView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i5));
arrayList.add(new ThemeDescription(this.historyCell, ThemeDescription.FLAG_SELECTOR, null, null, null, null, i2));
arrayList.add(new ThemeDescription(this.historyCell, 0, new Class[]{TextDetailCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i3));
arrayList.add(new ThemeDescription(this.historyCell, 0, new Class[]{TextDetailCell.class}, new String[]{"valueTextView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i5));
arrayList.add(new ThemeDescription(this.locationCell, ThemeDescription.FLAG_SELECTOR, null, null, null, null, i2));
arrayList.add(new ThemeDescription(this.locationCell, 0, new Class[]{TextDetailCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i3));
arrayList.add(new ThemeDescription(this.locationCell, 0, new Class[]{TextDetailCell.class}, new String[]{"valueTextView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i5));
arrayList.add(new ThemeDescription(this.nameTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, i3));
EditTextEmoji editTextEmoji = this.nameTextView;
int i6 = ThemeDescription.FLAG_HINTTEXTCOLOR;
int i7 = Theme.key_windowBackgroundWhiteHintText;
arrayList.add(new ThemeDescription(editTextEmoji, i6, null, null, null, null, i7));
arrayList.add(new ThemeDescription(this.nameTextView, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputField));
arrayList.add(new ThemeDescription(this.nameTextView, ThemeDescription.FLAG_BACKGROUNDFILTER | ThemeDescription.FLAG_DRAWABLESELECTEDSTATE, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated));
arrayList.add(new ThemeDescription(this.descriptionTextView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, i3));
arrayList.add(new ThemeDescription(this.descriptionTextView, ThemeDescription.FLAG_HINTTEXTCOLOR, null, null, null, null, i7));
LinearLayout linearLayout = this.avatarContainer;
int i8 = ThemeDescription.FLAG_BACKGROUND;
int i9 = Theme.key_windowBackgroundWhite;
arrayList.add(new ThemeDescription(linearLayout, i8, null, null, null, null, i9));
arrayList.add(new ThemeDescription(this.settingsContainer, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, i9));
arrayList.add(new ThemeDescription(this.typeEditContainer, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, i9));
arrayList.add(new ThemeDescription(this.deleteContainer, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, i9));
arrayList.add(new ThemeDescription(this.stickersContainer, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, i9));
arrayList.add(new ThemeDescription(this.infoContainer, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, i9));
int i10 = Theme.key_windowBackgroundGrayShadow;
arrayList.add(new ThemeDescription(this.settingsTopSectionCell, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[]{ShadowSectionCell.class}, null, null, null, i10));
arrayList.add(new ThemeDescription(this.settingsSectionCell, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[]{ShadowSectionCell.class}, null, null, null, i10));
arrayList.add(new ThemeDescription(this.deleteInfoCell, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[]{ShadowSectionCell.class}, null, null, null, i10));
arrayList.add(new ThemeDescription(this.signCell, ThemeDescription.FLAG_SELECTOR, null, null, null, null, i2));
arrayList.add(new ThemeDescription(this.signCell, 0, new Class[]{TextCheckCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i3));
arrayList.add(new ThemeDescription(this.signCell, 0, new Class[]{TextCheckCell.class}, new String[]{"checkBox"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_switchTrack));
arrayList.add(new ThemeDescription(this.signCell, 0, new Class[]{TextCheckCell.class}, new String[]{"checkBox"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_switchTrackChecked));
arrayList.add(new ThemeDescription(this.deleteCell, ThemeDescription.FLAG_SELECTOR, null, null, null, null, i2));
arrayList.add(new ThemeDescription(this.deleteCell, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{TextSettingsCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_text_RedRegular));
arrayList.add(new ThemeDescription(this.stickersCell, ThemeDescription.FLAG_SELECTOR, null, null, null, null, i2));
arrayList.add(new ThemeDescription(this.stickersCell, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{TextSettingsCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i3));
arrayList.add(new ThemeDescription(this.stickersInfoCell, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[]{TextInfoPrivacyCell.class}, null, null, null, i10));
arrayList.add(new ThemeDescription(this.stickersInfoCell, 0, new Class[]{TextInfoPrivacyCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, Theme.key_windowBackgroundWhiteGrayText4));
arrayList.add(new ThemeDescription(null, 0, null, null, Theme.avatarDrawables, themeDescriptionDelegate, Theme.key_avatar_text));
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 i11 = 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, i11));
arrayList.add(new ThemeDescription((View) this.undoView, 0, new Class[]{UndoView.class}, new String[]{"undoTextView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i11));
int i12 = 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, i12));
arrayList.add(new ThemeDescription((View) this.undoView, 0, new Class[]{UndoView.class}, new String[]{"textPaint"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i12));
arrayList.add(new ThemeDescription((View) this.undoView, 0, new Class[]{UndoView.class}, new String[]{"progressPaint"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i12));
arrayList.add(new ThemeDescription((View) this.undoView, ThemeDescription.FLAG_IMAGECOLOR, new Class[]{UndoView.class}, new String[]{"leftImageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i12));
arrayList.add(new ThemeDescription(this.reactionsCell, ThemeDescription.FLAG_SELECTOR, null, null, null, null, i2));
arrayList.add(new ThemeDescription(this.reactionsCell, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{TextCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i3));
arrayList.add(new ThemeDescription(this.reactionsCell, 0, new Class[]{TextCell.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i4));
if (this.statsAndBoosts != null) {
arrayList.add(new ThemeDescription(this.statsAndBoosts, ThemeDescription.FLAG_SELECTOR, null, null, null, null, i2));
arrayList.add(new ThemeDescription(this.statsAndBoosts, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{TextCell.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i3));
arrayList.add(new ThemeDescription(this.statsAndBoosts, 0, new Class[]{TextCell.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (ThemeDescription.ThemeDescriptionDelegate) null, i4));
}
return arrayList;
}
public void lambda$getThemeDescriptions$48() {
BackupImageView backupImageView = this.avatarImage;
if (backupImageView != null) {
backupImageView.invalidate();
}
}
}