正在查看: Hyouka private v5.8.9 应用的 ContactInfoFragmentView.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Hyouka private v5.8.9 应用的 ContactInfoFragmentView.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.beint.project.screens.contacts;
import android.R;
import android.animation.Animator;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.provider.ContactsContract;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.appcompat.app.c;
import androidx.appcompat.widget.Toolbar;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.RecyclerView;
import com.beint.project.AbstractZangiActivity;
import com.beint.project.Engine;
import com.beint.project.ExtensionsKt;
import com.beint.project.MainApplication;
import com.beint.project.adapter.InfoNumberAdapter;
import com.beint.project.adapter.NumbersBottomSheetAdapter;
import com.beint.project.adapter.RecentInfoAdapter;
import com.beint.project.addcontact.AddContact;
import com.beint.project.call.CallHelper;
import com.beint.project.core.UserLastActivity.LastActivity;
import com.beint.project.core.UserLastActivity.LastActivityManager;
import com.beint.project.core.UserLastActivity.LastActivityModel;
import com.beint.project.core.UserLastActivity.LastActivityState;
import com.beint.project.core.data.conversationVisibilityData.ConversationVisibilityRepository;
import com.beint.project.core.dataaccess.dao.ContactNumberDao;
import com.beint.project.core.events.RegistrationEventArgs;
import com.beint.project.core.events.RegistrationEventTypes;
import com.beint.project.core.managers.ContactsManagerSync;
import com.beint.project.core.managers.PremiumManager;
import com.beint.project.core.managers.StealthManager;
import com.beint.project.core.model.ModelForContactInfoFragment;
import com.beint.project.core.model.block.number.ZangiBlockNumber;
import com.beint.project.core.model.contact.Contact;
import com.beint.project.core.model.contact.ContactNumber;
import com.beint.project.core.model.contact.Profile;
import com.beint.project.core.model.mute.Mute;
import com.beint.project.core.model.recent.RecentStatus;
import com.beint.project.core.model.recent.ZangiRecent;
import com.beint.project.core.model.recent.ZangiRecentGroup;
import com.beint.project.core.model.sms.Conversation;
import com.beint.project.core.services.impl.BlockContactServiceImpl;
import com.beint.project.core.services.impl.ContactsManager;
import com.beint.project.core.services.impl.IStorageService;
import com.beint.project.core.services.impl.MessagingService;
import com.beint.project.core.services.impl.StorageService;
import com.beint.project.core.services.impl.ZangiConfigurationService;
import com.beint.project.core.services.impl.ZangiMuteService;
import com.beint.project.core.services.impl.ZangiNetworkService;
import com.beint.project.core.services.impl.ZangiProfileServiceImpl;
import com.beint.project.core.services.impl.ZangiRecentService;
import com.beint.project.core.utils.CheckNumbersObjectResponse;
import com.beint.project.core.utils.CheckNumbersResponse;
import com.beint.project.core.utils.Constants;
import com.beint.project.core.utils.DispatchKt;
import com.beint.project.core.utils.Log;
import com.beint.project.core.utils.NotificationCenter;
import com.beint.project.core.utils.ZangiEngineUtils;
import com.beint.project.core.utils.ZangiFileUtils;
import com.beint.project.core.utils.ZangiPermissionUtils;
import com.beint.project.core.utils.contactutils.ContactList;
import com.beint.project.enums.ActionType;
import com.beint.project.enums.ActivityNavigation;
import com.beint.project.enums.MultySelectType;
import com.beint.project.interfaces.BottomSheetClickListener;
import com.beint.project.items.ContactInfoItem;
import com.beint.project.items.ILoadingView;
import com.beint.project.items.InfoAdditionalItem;
import com.beint.project.managers.ContactsManagerHelper;
import com.beint.project.managers.ConversationNotificationManager;
import com.beint.project.managers.InviteController;
import com.beint.project.screens.BaseScreen;
import com.beint.project.screens.ConversationManager;
import com.beint.project.screens.HomeActivity;
import com.beint.project.screens.WhiteListRequestCallBack;
import com.beint.project.screens.contacts.AlertScreen;
import com.beint.project.screens.contacts.EnterIdNumberView;
import com.beint.project.screens.interfaces.ContactInfoFragmentInt;
import com.beint.project.screens.settings.conversationConfiguration.ConversationConfigurationFragment;
import com.beint.project.screens.settings.premium.PremiumActivity;
import com.beint.project.screens.settings.premium.PremiumOverInfoPage;
import com.beint.project.screens.shared.media.SharedMediaActivity;
import com.beint.project.screens.sms.ConversationView;
import com.beint.project.screens.sms.ScreenChooseBackground;
import com.beint.project.screens.ui.ZangiNumberDialogUI;
import com.beint.project.services.PassCodeController;
import com.beint.project.utils.AlertDialogUtils;
import com.beint.project.utils.AlertObject;
import com.beint.project.utils.DateTimeUtils;
import com.beint.project.utils.ProjectUtils;
import com.beint.project.utils.SimpleTextView;
import com.beint.project.utils.color.ColorsManger;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import java.io.Serializable;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
public final class ContactInfoFragmentView extends BaseScreen implements ContactInfoFragmentInt, InfoNumberAdapter.InfoNumberAdapterDelegate, AlertScreen.ALertScreenDelegate, LastActivityModel, EnterIdNumberView.EnterInternalNumberViewDelegate {
public static final Companion Companion = new Companion(null);
private static WeakReference<ContactInfoFragmentView> sInstance = new WeakReference<>(null);
private final long ANIM_DURATION;
private final long ANIM_DURATION_END;
private final fb.f COLLAPSING_TOOLAR_OFFSET_END$delegate;
private final fb.f COLLAPSING_TOOLAR_OFFSET_START$delegate;
private final fb.f COLL_BOTTOM_LENGTH$delegate;
private final fb.f CONTACT_IMAGE_HEIGHT$delegate;
private final int CONTACT_IMAGE_PREVIEW_HEIGHT;
private final int CONTACT_TILE_AVATAR_SIZE;
private final fb.f NAME_STATUS_LAYOUT_Y$delegate;
private final fb.f STATUS_BAR_HEIGHT$delegate;
private final String TAG;
private final int TEXTS_END_MARGIN;
private final float TEXTS_END_PADDING_BOTTOM;
private final int TEXTS_START_MARGIN;
private final int TEXTS_START_MARGIN_BOTTOM;
private final float TEXT_SIZE_CALL_BUTTON;
private final float TEXT_SIZE_END;
private final float TEXT_SIZE_FUNCTIONAL_BUTTON;
private final float TEXT_SIZE_FUNCTIONAL_BUTTON_PROPERTY;
private final float TEXT_SIZE_START;
private final int TEXT_SIZE_STATUS;
private final fb.f TEXT_VIEW_HEIGHT$delegate;
private final fb.f TEXT_VIEW_WIDTH$delegate;
private final fb.f TEXT_VIEW_X$delegate;
private final fb.f TEXT_VIEW_Y$delegate;
private final fb.f TOOLBAR_HEIGHT$delegate;
private final fb.f TOOLBAR_HEIGHT_FULL_SIZE$delegate;
private View addToFavoriteDivider;
private InfoAdditionalItem addToFavoriteLayout;
private boolean afterSharedMedia;
private androidx.appcompat.app.c alert;
private ArrayList<fb.k<String, String>> allNumbersArray;
private AppBarLayout appBarLayout;
private Bitmap avatarBitmap;
private Bitmap bitmap;
private View blockContactDivider;
private LinearLayout blockContactLayout;
private LinearLayout buttonsLayoutH;
private Button callButtonLayout;
private View chatBackgroundDivider;
private InfoAdditionalItem chatBackgroundLayout;
private Button chatButtonLayout;
private View collapsingToolbarBottomBackground;
private CollapsingToolbarLayout collapsingToolbarLayout;
private View collapsingToolbarTopBackground;
private final fb.f colorStateList$delegate;
private Contact contactForCheck;
private ImageView contactImage;
private ModelForContactInfoFragment contactInfo;
private View contactListDivider;
private BroadcastReceiver contactListUpdateUIReceiver;
private SimpleTextView contactName;
private String contactNameText;
private SimpleTextView contactStatus;
private String conversationJid;
private CoordinatorLayout coordinatorLayout;
private View createGroupDivider;
private InfoAdditionalItem createGroupLayout;
private View createNewContactDivider;
private InfoAdditionalItem createNewContactLayout;
private Conversation currentConversation;
private Integer defaultTextId;
private final fb.f dividerHeight$delegate;
private EnterIdNumberView enterIdNumberView;
private TextView enterInternalNumberBottomTextView;
private View enterInternalNumberDevider;
private InfoNumberAdapter infoNumberAdapter;
private RecyclerView.p infoNumbersLayoutManager;
private RecyclerView infoNumbersRecyclerView;
private View inviteToZangiDivider;
private InfoAdditionalItem inviteToZangiLayout;
private boolean isAvatarImage;
private final boolean isCallOutEnabled;
private boolean isCloseAnimationStarted;
private boolean isContactEdited;
private boolean isContactInfoUpdate;
private boolean isRecentInfo;
private boolean isViewCreated;
private View makeChatVisibleDivider;
private InfoAdditionalItem makeChatVisibleLayout;
private Menu menu;
private Conversation muteConversation;
private LinearLayout nameStatusLayout;
private NestedScrollView nestedScrollView;
private View notificationDivider;
private InfoAdditionalItem notificationLayout;
private View notificationPreviewDivider;
private InfoAdditionalItem notificationPreviewLayout;
private ArrayList<String> notificationPreviewNumberList;
private RelativeLayout parentLayoutR;
private LinearLayout parentLayoutV;
private Float positionX;
private SimpleTextView premiumAccountTextView;
private ProgressBar progressBar;
private RelativeLayout progressLayout;
private RecentInfoAdapter recentAdapter;
private ArrayList<ZangiRecent> recentCallsList;
private List<? extends ZangiRecentGroup> recentGroupList;
private View recentListDivider;
private TextView recentOutgoingDate;
private RecyclerView recentRecycleView;
private View screenShotDivider;
private InfoAdditionalItem screenShotLayoutLayout;
private View sharedMediaDivider;
private InfoAdditionalItem sharedMediaLayout;
private View stealthModeDivider;
private InfoAdditionalItem stealthModeLayout;
private Toolbar toolbarLayout;
private boolean updateConversationVisibilityText;
private Button videoCallButtonLayout;
private ZangiBlockNumber zangiBlockNumber;
private Contact zangiContact;
private Button zangiOutButtonLayout;
private ZangiRecentGroup zangiRecentGroup;
public static final class Companion {
private Companion() {
}
public Companion(kotlin.jvm.internal.g gVar) {
this();
}
public final WeakReference<ContactInfoFragmentView> getSInstance() {
return ContactInfoFragmentView.sInstance;
}
public final void setSInstance(WeakReference<ContactInfoFragmentView> weakReference) {
kotlin.jvm.internal.k.f(weakReference, "<set-?>");
ContactInfoFragmentView.sInstance = weakReference;
}
}
public static final class GetSharedMediaFilesCountAsync extends AsyncTask<Contact, fb.r, String> {
private final WeakReference<InfoAdditionalItem> viewRef;
public GetSharedMediaFilesCountAsync(WeakReference<InfoAdditionalItem> weakReference) {
kotlin.jvm.internal.k.f(weakReference, "viewRef");
this.viewRef = weakReference;
}
@Override
public String doInBackground(Contact... contactArr) {
String str;
kotlin.jvm.internal.k.f(contactArr, "contacts");
int i = 0;
if (contactArr.length == 0) {
return "0";
}
Contact contact = contactArr[0];
if ((contact != null ? contact.getContactNumbers() : null) == null) {
return "0";
}
Contact contact2 = contactArr[0];
LinkedList contactNumbers = contact2 != null ? contact2.getContactNumbers() : null;
kotlin.jvm.internal.k.c(contactNumbers);
if (contactNumbers.size() <= 0) {
return "0";
}
Contact contact3 = contactArr[0];
if ((contact3 != null ? contact3.getPpUriSuffix() : null) != null) {
Contact contact4 = contactArr[0];
if (contact4 != null) {
str = contact4.getPpUriSuffix();
}
str = null;
} else {
Contact contact5 = contactArr[0];
LinkedList contactNumbers2 = contact5 != null ? contact5.getContactNumbers() : null;
kotlin.jvm.internal.k.c(contactNumbers2);
if (contactNumbers2.size() > 0) {
Contact contact6 = contactArr[0];
ContactNumber firstContactNumber = contact6 != null ? contact6.getFirstContactNumber() : null;
if (firstContactNumber != null) {
str = firstContactNumber.getFullNumber();
}
str = null;
} else {
str = "";
}
}
Contact contact7 = contactArr[0];
kotlin.jvm.internal.k.c(contact7);
if (contact7.getContactNumbers().size() == 1) {
return String.valueOf(StorageService.INSTANCE.getSharedMediaCountWithoutVoice(str));
}
Contact contact8 = contactArr[0];
LinkedList contactNumbers3 = contact8 != null ? contact8.getContactNumbers() : null;
kotlin.jvm.internal.k.c(contactNumbers3);
if (contactNumbers3.size() <= 1) {
return "0";
}
Contact contact9 = contactArr[0];
kotlin.jvm.internal.k.c(contact9);
Iterator it = contact9.getContactNumbers().iterator();
while (it.hasNext()) {
i += StorageService.INSTANCE.getSharedMediaCountWithoutVoice(ZangiEngineUtils.getNumberFromJidWithoutPlus(((ContactNumber) it.next()).getFullNumber()));
}
return String.valueOf(i);
}
@Override
public void onPostExecute(String str) {
kotlin.jvm.internal.k.f(str, "result");
super.onPostExecute((GetSharedMediaFilesCountAsync) str);
InfoAdditionalItem infoAdditionalItem = this.viewRef.get();
if (infoAdditionalItem == null) {
return;
}
infoAdditionalItem.setDescription(str);
}
}
public class WhenMappings {
public static final int[] $EnumSwitchMapping$0;
public static final int[] $EnumSwitchMapping$1;
public static final int[] $EnumSwitchMapping$2;
static {
int[] iArr = new int[CallVideoChatButtonsEnum.values().length];
try {
iArr[CallVideoChatButtonsEnum.CALL.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[CallVideoChatButtonsEnum.VIDEO.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
iArr[CallVideoChatButtonsEnum.CHAT.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
$EnumSwitchMapping$0 = iArr;
int[] iArr2 = new int[ActionType.values().length];
try {
iArr2[ActionType.FREE_CALL.ordinal()] = 1;
} catch (NoSuchFieldError unused4) {
}
try {
iArr2[ActionType.FREE_VIDEO_CALL.ordinal()] = 2;
} catch (NoSuchFieldError unused5) {
}
try {
iArr2[ActionType.MESSAGE.ordinal()] = 3;
} catch (NoSuchFieldError unused6) {
}
try {
iArr2[ActionType.CALL_OUT.ordinal()] = 4;
} catch (NoSuchFieldError unused7) {
}
try {
iArr2[ActionType.CALL_BACK.ordinal()] = 5;
} catch (NoSuchFieldError unused8) {
}
try {
iArr2[ActionType.CHAT_BACKGROUND.ordinal()] = 6;
} catch (NoSuchFieldError unused9) {
}
try {
iArr2[ActionType.ADD_TO_FAVORITE.ordinal()] = 7;
} catch (NoSuchFieldError unused10) {
}
try {
iArr2[ActionType.INVITE.ordinal()] = 8;
} catch (NoSuchFieldError unused11) {
}
try {
iArr2[ActionType.CREATE_GROUP.ordinal()] = 9;
} catch (NoSuchFieldError unused12) {
}
$EnumSwitchMapping$1 = iArr2;
int[] iArr3 = new int[RegistrationEventTypes.values().length];
try {
iArr3[RegistrationEventTypes.REGISTRATION_OK.ordinal()] = 1;
} catch (NoSuchFieldError unused13) {
}
$EnumSwitchMapping$2 = iArr3;
}
}
public ContactInfoFragmentView() {
String canonicalName = ContactInfoFragmentView.class.getCanonicalName();
this.TAG = canonicalName;
this.isAvatarImage = true;
this.CONTACT_IMAGE_HEIGHT$delegate = fb.g.a(new ContactInfoFragmentView$CONTACT_IMAGE_HEIGHT$2(this));
this.COLLAPSING_TOOLAR_OFFSET_END$delegate = fb.g.a(new ContactInfoFragmentView$COLLAPSING_TOOLAR_OFFSET_END$2(this));
this.TOOLBAR_HEIGHT$delegate = fb.g.a(new ContactInfoFragmentView$TOOLBAR_HEIGHT$2(this));
this.COLLAPSING_TOOLAR_OFFSET_START$delegate = fb.g.a(new ContactInfoFragmentView$COLLAPSING_TOOLAR_OFFSET_START$2(this));
this.TEXT_VIEW_HEIGHT$delegate = fb.g.a(new ContactInfoFragmentView$TEXT_VIEW_HEIGHT$2(this));
this.TEXT_VIEW_WIDTH$delegate = fb.g.a(new ContactInfoFragmentView$TEXT_VIEW_WIDTH$2(this));
this.TEXT_VIEW_X$delegate = fb.g.a(new ContactInfoFragmentView$TEXT_VIEW_X$2(this));
this.TEXT_VIEW_Y$delegate = fb.g.a(new ContactInfoFragmentView$TEXT_VIEW_Y$2(this));
this.NAME_STATUS_LAYOUT_Y$delegate = fb.g.a(new ContactInfoFragmentView$NAME_STATUS_LAYOUT_Y$2(this));
this.COLL_BOTTOM_LENGTH$delegate = fb.g.a(new ContactInfoFragmentView$COLL_BOTTOM_LENGTH$2(this));
this.STATUS_BAR_HEIGHT$delegate = fb.g.a(new ContactInfoFragmentView$STATUS_BAR_HEIGHT$2(this));
this.TEXTS_START_MARGIN = ExtensionsKt.getDp(30);
this.TEXTS_END_MARGIN = ExtensionsKt.getDp(56);
this.TEXT_SIZE_START = 24.0f;
this.TEXT_SIZE_END = 17.0f;
this.TEXT_SIZE_STATUS = 13;
this.TEXT_SIZE_FUNCTIONAL_BUTTON = 16.0f;
this.TEXT_SIZE_FUNCTIONAL_BUTTON_PROPERTY = 14.0f;
this.TEXT_SIZE_CALL_BUTTON = 10.0f;
this.CONTACT_TILE_AVATAR_SIZE = ExtensionsKt.getDp(70);
this.TOOLBAR_HEIGHT_FULL_SIZE$delegate = fb.g.a(new ContactInfoFragmentView$TOOLBAR_HEIGHT_FULL_SIZE$2(this));
this.CONTACT_IMAGE_PREVIEW_HEIGHT = ExtensionsKt.getDp(227);
this.TEXTS_START_MARGIN_BOTTOM = ExtensionsKt.getDp(18);
this.TEXTS_END_PADDING_BOTTOM = ExtensionsKt.getDp(9.8f);
this.ANIM_DURATION = 230L;
this.ANIM_DURATION_END = 230L;
this.contactNameText = "";
this.dividerHeight$delegate = fb.g.a(ContactInfoFragmentView$dividerHeight$2.INSTANCE);
setScreenId(canonicalName);
setScreenType(BaseScreen.SCREEN_TYPE.TAB_INFO_T);
this.isCallOutEnabled = Constants.IS_CALL_OUT_ENABLED;
this.notificationPreviewNumberList = new ArrayList<>();
ContactsManagerHelper contactsManagerHelper = ContactsManagerHelper.INSTANCE;
this.zangiContact = contactsManagerHelper.getZangiCurrentContact();
this.zangiRecentGroup = contactsManagerHelper.getZangiRecentGroup();
this.currentConversation = contactsManagerHelper.getCurrentConversation();
this.isRecentInfo = contactsManagerHelper.isRecentInfo();
this.contactInfo = contactsManagerHelper.getContactInfo();
fillData();
checkUserHaveEmail(this.currentConversation, this.zangiRecentGroup, this.contactInfo);
contactsManagerHelper.resetContactManager();
if (contactsManagerHelper.getBitmap() != null) {
this.avatarBitmap = contactsManagerHelper.getBitmap();
}
this.isCloseAnimationStarted = false;
this.recentGroupList = ZangiRecentService.getInstance().getRecentGroupList(false);
this.conversationJid = getConversationJidIfItExist();
updateView(this.zangiContact, this.contactInfo, this.zangiRecentGroup, this.recentGroupList, true);
this.colorStateList$delegate = fb.g.a(new ContactInfoFragmentView$colorStateList$2(this));
}
private final void _audioCall() {
CallHelper.callVideo(false);
CharSequence text = getResources().getText(2131886591);
kotlin.jvm.internal.k.d(text, "null cannot be cast to non-null type kotlin.String");
callAction(ActionType.FREE_CALL, (String) text);
}
private final void _openScreenChooseBackground() {
Contact contact = this.zangiContact;
ZangiRecentGroup zangiRecentGroup = this.zangiRecentGroup;
Intent intent = new Intent((Context) getActivity(), (Class<?>) ScreenChooseBackground.class);
if (contact == null || !(!contact.getContactNumbers().isEmpty())) {
if (zangiRecentGroup == null || zangiRecentGroup.getDisplayNumber() == null) {
return;
}
String displayNumber = zangiRecentGroup.getDisplayNumber();
kotlin.jvm.internal.k.e(displayNumber, "zRecent.displayNumber");
if (displayNumber.length() > 0) {
ZangiRecentGroup zangiRecentGroup2 = this.zangiRecentGroup;
if (ZangiEngineUtils.isShortNumber(zangiRecentGroup2 != null ? zangiRecentGroup2.getDisplayNumber() : null)) {
BaseScreen.showCustomToast((Context) getActivity(), 2131886728);
return;
} else {
intent.putExtra(Constants.USER_INDIVIDUAL_BACKGROUND, zangiRecentGroup.getDisplayNumber());
startActivity(intent);
return;
}
}
return;
}
if (contact.getOnlyZangiNumbersList().size() > 1) {
NumbersBottomSheetAdapter numbersBottomSheetAdapter = new NumbersBottomSheetAdapter(getActivity(), contact, NumbersBottomSheetAdapter.LOAD_TYPE.ALL, true, false);
ActionType actionType = ActionType.CHAT_BACKGROUND;
CharSequence text = getResources().getText(2131886291);
kotlin.jvm.internal.k.d(text, "null cannot be cast to non-null type kotlin.String");
showBottomSheet(actionType, (String) text, numbersBottomSheetAdapter);
return;
}
if (contact.getOnlyZangiNumbersList().size() == 1) {
ContactNumber firstContactNumber = contact.getFirstContactNumber();
kotlin.jvm.internal.k.c(firstContactNumber);
if (ZangiEngineUtils.isShortNumber(firstContactNumber.getNumber())) {
BaseScreen.showCustomToast((Context) getActivity(), 2131886728);
return;
}
String str = Constants.USER_INDIVIDUAL_BACKGROUND;
ContactNumber firstContactNumber2 = contact.getFirstContactNumber();
kotlin.jvm.internal.k.c(firstContactNumber2);
intent.putExtra(str, firstContactNumber2.getNumber());
startActivity(intent);
}
}
private final void _videoCall() {
if (CallHelper.callVideo(true)) {
CharSequence text = getResources().getText(2131887644);
kotlin.jvm.internal.k.d(text, "null cannot be cast to non-null type kotlin.String");
callAction(ActionType.FREE_VIDEO_CALL, (String) text);
}
}
private final void _zangiOut() {
fb.k<String, String> kVar;
fb.k<String, String> kVar2;
if (Constants.IS_CALL_OUT_ENABLED) {
Contact contact = this.zangiContact;
if (contact == null || this.allNumbersArray == null) {
if (this.contactInfo == null) {
return;
}
contact = new Contact();
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
kotlin.jvm.internal.k.c(modelForContactInfoFragment);
contact.addContactNumbers(modelForContactInfoFragment.getNumbers());
ModelForContactInfoFragment modelForContactInfoFragment2 = this.contactInfo;
kotlin.jvm.internal.k.c(modelForContactInfoFragment2);
contact.setIdentifire(modelForContactInfoFragment2.getIdentifier());
}
Contact contact2 = contact;
ArrayList<fb.k<String, String>> arrayList = this.allNumbersArray;
if (arrayList != null) {
kotlin.jvm.internal.k.c(arrayList);
if (!arrayList.isEmpty()) {
ArrayList<fb.k<String, String>> arrayList2 = this.allNumbersArray;
kotlin.jvm.internal.k.c(arrayList2);
if (arrayList2.size() != 1) {
NumbersBottomSheetAdapter numbersBottomSheetAdapter = new NumbersBottomSheetAdapter(getActivity(), contact2, NumbersBottomSheetAdapter.LOAD_TYPE.ALL, false, true);
ActionType actionType = ActionType.CALL_OUT;
CharSequence text = getResources().getText(2131886253);
kotlin.jvm.internal.k.d(text, "null cannot be cast to non-null type kotlin.String");
showBottomSheet(actionType, (String) text, numbersBottomSheetAdapter);
return;
}
ArrayList<fb.k<String, String>> arrayList3 = this.allNumbersArray;
String str = null;
String str2 = (arrayList3 == null || (kVar2 = arrayList3.get(0)) == null) ? null : (String) kVar2.c();
ArrayList<fb.k<String, String>> arrayList4 = this.allNumbersArray;
if (arrayList4 != null && (kVar = arrayList4.get(0)) != null) {
str = (String) kVar.d();
}
CallHelper.zangiOut(getActivity(), str2, str, new ConversationView.blockNumberCallback() {
@Override
public void callback(boolean r3) {
throw new UnsupportedOperationException("Method not decompiled: com.beint.project.screens.contacts.ContactInfoFragmentView$_zangiOut$1.callback(boolean):void");
}
});
}
}
}
}
private final void addFavoriteAction(String str, boolean z) {
Contact contact = this.zangiContact;
if (contact == null) {
return;
}
LinkedList contactNumbers = contact.getContactNumbers();
ArrayList arrayList = new ArrayList();
for (Object obj : contactNumbers) {
if (kotlin.jvm.internal.k.b(ZangiEngineUtils.getE164WithoutPlus(((ContactNumber) obj).getNumber(), ZangiEngineUtils.getZipCode(), false), ZangiEngineUtils.getE164WithoutPlus(str, ZangiEngineUtils.getZipCode(), false))) {
arrayList.add(obj);
}
}
Iterator it = arrayList.iterator();
while (it.hasNext()) {
((ContactNumber) it.next()).setFavorite(z);
}
setAdapterNumbers(contact.getContactNumbers());
ContactList.INSTANCE.updateFavorite(contact, true);
}
private final void addToContactButtonAction() {
Bitmap bitmap;
this.isContactEdited = true;
ZangiRecentGroup zangiRecentGroup = this.zangiRecentGroup;
if (zangiRecentGroup == null && this.contactInfo == null) {
return;
}
if (zangiRecentGroup != null) {
if (!Constants.IS_DISPLAY_EMAIL_TURN_ON) {
FragmentActivity activity = getActivity();
ZangiRecentGroup zangiRecentGroup2 = this.zangiRecentGroup;
AbstractZangiActivity.startAddContactActivity(activity, zangiRecentGroup2 != null ? zangiRecentGroup2.getDisplayNumber() : null, (String) null, "", true);
return;
} else {
FragmentActivity activity2 = getActivity();
ZangiRecentGroup zangiRecentGroup3 = this.zangiRecentGroup;
String displayNumber = zangiRecentGroup3 != null ? zangiRecentGroup3.getDisplayNumber() : null;
ZangiRecentGroup zangiRecentGroup4 = this.zangiRecentGroup;
AbstractZangiActivity.startAddContactActivity(activity2, displayNumber, zangiRecentGroup4 != null ? zangiRecentGroup4.getDisplayEmail() : null, "", true);
return;
}
}
if (this.contactInfo == null) {
FragmentActivity activity3 = getActivity();
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
String displayNumber2 = modelForContactInfoFragment != null ? modelForContactInfoFragment.getDisplayNumber() : null;
ModelForContactInfoFragment modelForContactInfoFragment2 = this.contactInfo;
String email = modelForContactInfoFragment2 != null ? modelForContactInfoFragment2.getEmail() : null;
ModelForContactInfoFragment modelForContactInfoFragment3 = this.contactInfo;
AbstractZangiActivity.startAddContactActivity(activity3, displayNumber2, email, modelForContactInfoFragment3 != null ? modelForContactInfoFragment3.getDisplayName() : null, true);
return;
}
ArrayList arrayList = new ArrayList();
ArrayList arrayList2 = new ArrayList();
ModelForContactInfoFragment modelForContactInfoFragment4 = this.contactInfo;
if (modelForContactInfoFragment4 != null) {
this.isContactEdited = false;
kotlin.jvm.internal.k.c(modelForContactInfoFragment4);
if (modelForContactInfoFragment4.getNumbers() != null) {
ModelForContactInfoFragment modelForContactInfoFragment5 = this.contactInfo;
kotlin.jvm.internal.k.c(modelForContactInfoFragment5);
arrayList2 = (ArrayList) modelForContactInfoFragment5.getNumbers();
kotlin.jvm.internal.k.c(arrayList2);
ModelForContactInfoFragment modelForContactInfoFragment6 = this.contactInfo;
kotlin.jvm.internal.k.c(modelForContactInfoFragment6);
List<ContactNumber> numbers = modelForContactInfoFragment6.getNumbers();
kotlin.jvm.internal.k.c(numbers);
for (ContactNumber contactNumber : numbers) {
String fullNumber = contactNumber.getFullNumber();
kotlin.jvm.internal.k.c(fullNumber);
if (fullNumber.length() > 0) {
String fullNumber2 = contactNumber.getFullNumber();
kotlin.jvm.internal.k.c(fullNumber2);
arrayList.add(fullNumber2);
} else if (contactNumber.getNumber() != null) {
String number = contactNumber.getNumber();
kotlin.jvm.internal.k.c(number);
if (number.length() > 0) {
String number2 = contactNumber.getNumber();
kotlin.jvm.internal.k.c(number2);
arrayList.add(number2);
}
}
}
}
ArrayList arrayList3 = arrayList2;
ModelForContactInfoFragment modelForContactInfoFragment7 = this.contactInfo;
String displayName = modelForContactInfoFragment7 != null ? modelForContactInfoFragment7.getDisplayName() : null;
Bitmap profileImage = ProjectUtils.getProfileImage(arrayList3, "", getContext(), false);
if (profileImage == null) {
Contact contact = this.zangiContact;
bitmap = contact != null ? Contact.getAvatar$default(contact, 0, 1, (Object) null) : null;
} else {
bitmap = profileImage;
}
AddContact.Companion.setContactInfoItem(new ContactInfoItem(displayName, (String) null, arrayList, "", (Long) null, arrayList3, (ArrayList) null, bitmap, Boolean.FALSE));
}
AbstractZangiActivity.startAddContactActivity(getActivity(), true);
}
private final void addToFavorite() {
Contact contact = this.zangiContact;
if (contact != null) {
ContactList contactList = ContactList.INSTANCE;
kotlin.jvm.internal.k.c(contact);
contactList.updateFavorite(contact, true);
Menu menu = this.menu;
MenuItem findItem = menu != null ? menu.findItem(2131362484) : null;
if (findItem != null) {
findItem.setVisible(true);
}
InfoAdditionalItem infoAdditionalItem = this.addToFavoriteLayout;
if (infoAdditionalItem != null) {
ExtensionsKt.hide(infoAdditionalItem);
}
View view = this.addToFavoriteDivider;
if (view != null) {
ExtensionsKt.hide(view);
}
}
}
public final void audioCall() {
if (ZangiPermissionUtils.hasPermission(getActivity(), 1001, true, new ZangiPermissionUtils.OnPermissionResult() {
public final void onResult(ArrayList arrayList, boolean z) {
ContactInfoFragmentView.audioCall$lambda$99(ContactInfoFragmentView.this, arrayList, z);
}
})) {
_audioCall();
}
}
public static final void audioCall$lambda$99(ContactInfoFragmentView contactInfoFragmentView, ArrayList arrayList, boolean z) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
if (z) {
contactInfoFragmentView._audioCall();
}
}
private final void blockContact() {
ArrayList arrayList = new ArrayList();
if (this.zangiContact != null) {
String zipCode = ZangiEngineUtils.getZipCode();
Contact contact = this.zangiContact;
kotlin.jvm.internal.k.c(contact);
Iterator it = contact.getContactNumbers().iterator();
while (it.hasNext()) {
String e164WithoutPlus = ZangiEngineUtils.getE164WithoutPlus(((ContactNumber) it.next()).getNumber(), zipCode, false);
if (e164WithoutPlus != null && !arrayList.contains(e164WithoutPlus)) {
arrayList.add(e164WithoutPlus);
}
}
}
LinearLayout linearLayout = this.blockContactLayout;
String titleText = linearLayout != null ? getTitleText(linearLayout) : null;
FragmentActivity activity = getActivity();
kotlin.jvm.internal.k.c(activity);
if (kotlin.jvm.internal.k.b(titleText, activity.getString(2131886220))) {
LinearLayout linearLayout2 = this.blockContactLayout;
blockContactAlertDialog(arrayList, linearLayout2 != null ? getTitleTextView(linearLayout2) : null);
} else {
LinearLayout linearLayout3 = this.blockContactLayout;
unblockContactAlertDialog(arrayList, linearLayout3 != null ? getTitleTextView(linearLayout3) : null);
}
}
private final void buttonSheetAction(ActionType actionType, final String str, String str2) {
switch (WhenMappings.$EnumSwitchMapping$1[actionType.ordinal()]) {
case 1:
if (str != null) {
String zipCode = ZangiEngineUtils.getZipCode();
kotlin.jvm.internal.k.e(zipCode, "getZipCode()");
checkAndCall(str, zipCode, str2);
break;
}
break;
case 2:
if (str != null) {
String zipCode2 = ZangiEngineUtils.getZipCode();
kotlin.jvm.internal.k.e(zipCode2, "getZipCode()");
checkAndCall(str, zipCode2, str2);
break;
}
break;
case 3:
String e164WithoutPlus = ZangiEngineUtils.getE164WithoutPlus(str, ZangiEngineUtils.getZipCode(), false);
Conversation conversation = this.currentConversation;
if (conversation != null) {
if (kotlin.jvm.internal.k.b(conversation != null ? conversation.getConversationJid() : null, e164WithoutPlus)) {
FragmentActivity activity = getActivity();
kotlin.jvm.internal.k.c(activity);
activity.onBackPressed();
break;
}
}
if (str != null) {
startConversation(str, false);
break;
}
break;
case 4:
CallHelper.zangiOut(getActivity(), str, str2, new ConversationView.blockNumberCallback() {
@Override
public void callback(boolean r3) {
throw new UnsupportedOperationException("Method not decompiled: com.beint.project.screens.contacts.ContactInfoFragmentView$buttonSheetAction$4.callback(boolean):void");
}
});
break;
case 5:
if (str != null) {
callBack(str);
break;
}
break;
case 6:
if (ZangiPermissionUtils.hasPermission(getActivity(), 1007, true, new ZangiPermissionUtils.OnPermissionResult() {
public final void onResult(ArrayList arrayList, boolean z) {
ContactInfoFragmentView.buttonSheetAction$lambda$107(str, this, arrayList, z);
}
}) && str != null) {
chatBackground(str);
break;
}
break;
case 7:
if (str != null) {
addFavoriteAction(str, true);
}
Contact contact = this.zangiContact;
kotlin.jvm.internal.k.c(contact);
if (!contact.isAnyNotFavoriteNumber()) {
InfoAdditionalItem infoAdditionalItem = this.addToFavoriteLayout;
if (infoAdditionalItem != null) {
ExtensionsKt.hide(infoAdditionalItem);
}
View view = this.addToFavoriteDivider;
if (view != null) {
ExtensionsKt.hide(view);
break;
}
}
break;
case 8:
InviteController.showInviteShareMessage$default(InviteController.INSTANCE, str, str2, true, this, this.inviteToZangiLayout, (qb.l) null, (qb.l) null, 96, (Object) null);
break;
case 9:
Contact contact2 = this.zangiContact;
showGroupCreationScreen(str, str2, contact2 != null ? contact2.getIdentifire() : null);
break;
}
}
public static final void buttonSheetAction$lambda$107(String str, ContactInfoFragmentView contactInfoFragmentView, ArrayList arrayList, boolean z) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
if (!z || str == null) {
return;
}
contactInfoFragmentView.chatBackground(str);
}
private final void calculateAndSetRecentCallRecyclerHeight() {
ArrayList<ZangiRecent> arrayList = this.recentCallsList;
if ((arrayList != null ? arrayList.size() : 0) > 20) {
RecyclerView recyclerView = this.recentRecycleView;
ViewGroup.LayoutParams layoutParams = recyclerView != null ? recyclerView.getLayoutParams() : null;
LinearLayout.LayoutParams layoutParams2 = layoutParams instanceof LinearLayout.LayoutParams ? (LinearLayout.LayoutParams) layoutParams : null;
if (layoutParams2 == null) {
layoutParams2 = new LinearLayout.LayoutParams(-1, ExtensionsKt.getDp(400));
} else {
layoutParams2.height = ExtensionsKt.getDp(400);
}
RecyclerView recyclerView2 = this.recentRecycleView;
if (recyclerView2 != null) {
recyclerView2.setLayoutParams(layoutParams2);
}
RecyclerView recyclerView3 = this.recentRecycleView;
if (recyclerView3 == null) {
return;
}
recyclerView3.setNestedScrollingEnabled(true);
}
}
private final void callAction(ActionType actionType, String str) {
Contact contact = this.zangiContact;
if (contact == null) {
if (this.contactInfo == null) {
return;
}
contact = new Contact();
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
kotlin.jvm.internal.k.c(modelForContactInfoFragment);
contact.addContactNumbers(modelForContactInfoFragment.getNumbers());
ModelForContactInfoFragment modelForContactInfoFragment2 = this.contactInfo;
kotlin.jvm.internal.k.c(modelForContactInfoFragment2);
contact.setIdentifire(modelForContactInfoFragment2.getIdentifier());
}
Contact contact2 = contact;
List onlyZangiNumbersList = contact2.getOnlyZangiNumbersList();
if (onlyZangiNumbersList == null || onlyZangiNumbersList.isEmpty()) {
return;
}
String zipCode = ZangiEngineUtils.getZipCode();
if (onlyZangiNumbersList.size() != 1) {
List onlyZangiNumbersList2 = contact2.getOnlyZangiNumbersList();
if (onlyZangiNumbersList2 == null || onlyZangiNumbersList2.isEmpty() || onlyZangiNumbersList2.size() != 1) {
showBottomSheet(actionType, str, new NumbersBottomSheetAdapter(getActivity(), contact2, NumbersBottomSheetAdapter.LOAD_TYPE.ALL, true, false));
return;
}
String number = ((ContactNumber) onlyZangiNumbersList2.get(0)).getNumber();
if (number == null && (number = ((ContactNumber) onlyZangiNumbersList2.get(0)).getFullNumber()) == null) {
return;
}
kotlin.jvm.internal.k.e(zipCode, "zipcode");
checkAndCall(number, zipCode, ((ContactNumber) onlyZangiNumbersList2.get(0)).getEmail());
return;
}
if (ZangiEngineUtils.isShortNumber(((ContactNumber) onlyZangiNumbersList.get(0)).getNumber())) {
String number2 = ((ContactNumber) onlyZangiNumbersList.get(0)).getNumber();
if (number2 == null) {
number2 = "";
}
kotlin.jvm.internal.k.e(zipCode, "zipcode");
checkAndCall(number2, zipCode, ((ContactNumber) onlyZangiNumbersList.get(0)).getEmail());
return;
}
if (!Constants.IS_CONTACTS_SEND_TO_SERVER || ((ContactNumber) onlyZangiNumbersList.get(0)).isZangi() == 1 || ContactsManager.INSTANCE.isDummyNumber(((ContactNumber) onlyZangiNumbersList.get(0)).getFullNumber())) {
String numberFromJidWithPlus = ZangiEngineUtils.getNumberFromJidWithPlus(ZangiEngineUtils.getNumberFromJidWithPlus(((ContactNumber) onlyZangiNumbersList.get(0)).getFullNumber()));
kotlin.jvm.internal.k.e(numberFromJidWithPlus, "getNumberFromJidWithPlus…giNumbers[0].fullNumber))");
kotlin.jvm.internal.k.e(zipCode, "zipcode");
checkAndCall(numberFromJidWithPlus, zipCode, ((ContactNumber) onlyZangiNumbersList.get(0)).getEmail());
return;
}
String numberFromJidWithPlus2 = ZangiEngineUtils.getNumberFromJidWithPlus(ZangiEngineUtils.getNumberFromJidWithPlus(((ContactNumber) onlyZangiNumbersList.get(0)).getFullNumber()));
kotlin.jvm.internal.k.e(numberFromJidWithPlus2, "getNumberFromJidWithPlus…giNumbers[0].fullNumber))");
kotlin.jvm.internal.k.e(zipCode, "zipcode");
checkAndCall(numberFromJidWithPlus2, zipCode, ((ContactNumber) onlyZangiNumbersList.get(0)).getEmail());
}
private final void changeToInternalContact() {
LinkedList contactNumbers;
Contact contact = this.zangiContact;
if ((contact != null ? contact.getContactNumbers() : null) != null) {
Contact contact2 = this.zangiContact;
if (((contact2 == null || (contactNumbers = contact2.getContactNumbers()) == null) ? 0 : contactNumbers.size()) > 0) {
Contact contact3 = this.zangiContact;
kotlin.jvm.internal.k.c(contact3);
ContactNumber firstContactNumber = contact3.getFirstContactNumber();
kotlin.jvm.internal.k.c(firstContactNumber);
firstContactNumber.setZangi(1);
}
}
StorageService.INSTANCE.addOrUpdateContact(this.zangiContact);
}
private final void chatBackground(String str) {
if (ZangiEngineUtils.isShortNumber(str)) {
BaseScreen.showCustomToast((Context) getActivity(), 2131886728);
return;
}
Intent intent = new Intent((Context) getActivity(), (Class<?>) ScreenChooseBackground.class);
intent.putExtra(Constants.USER_INDIVIDUAL_BACKGROUND, str);
startActivity(intent);
}
private final void checkAndCall(String str, String str2, String str3) {
String e164WithoutPlus = ZangiEngineUtils.getE164WithoutPlus(str, str2, true);
if (BlockContactServiceImpl.getInstance().getZangiBlockNumber(e164WithoutPlus) != null) {
CallHelper.blockedContactCallOrSendMessageAlert(getActivity(), e164WithoutPlus, new ConversationView.blockNumberCallback() {
@Override
public void callback(boolean r3) {
throw new UnsupportedOperationException("Method not decompiled: com.beint.project.screens.contacts.ContactInfoFragmentView$checkAndCall$1.callback(boolean):void");
}
});
return;
}
CallHelper._makeCall(getActivity(), str, str3);
if (TextUtils.isEmpty(str3)) {
ZangiConfigurationService.INSTANCE.putString("IDENTITI_CALL_NUMBER.com.beint.zangi.core.c.b", str, true);
} else {
ZangiConfigurationService.INSTANCE.putString("IDENTITI_CALL_NUMBER.com.beint.zangi.core.c.b", "", true);
}
}
private final void checkContactNumbersForZangi() {
Contact contact = this.zangiContact;
if (contact == null) {
return;
}
ContactsManager contactsManager = ContactsManager.INSTANCE;
kotlin.jvm.internal.k.c(contact);
contactsManager.checkContactNumbersForZangi(contact, new ContactInfoFragmentView$checkContactNumbersForZangi$1(this));
}
private final String checkNotificationIsOn() {
String string;
Context context = getContext();
if (context == null) {
context = MainApplication.Companion.getMainContext();
}
kotlin.jvm.internal.k.e(context, "context ?: MainApplication.getMainContext()");
String string2 = context.getResources().getString(2131887433);
kotlin.jvm.internal.k.e(string2, "mContext.resources.getSt….show_preview_default_on)");
this.defaultTextId = kotlin.jvm.internal.k.b(ConversationNotificationManager.INSTANCE.getDefaultNotificationStatus("com.beint.project.SHOW_PREVIEW"), Boolean.TRUE) ? 2131887433 : 2131887432;
ArrayList<String> arrayList = this.notificationPreviewNumberList;
if (arrayList == null) {
return string2;
}
Contact contact = this.zangiContact;
Boolean bool = null;
if (contact != null) {
kotlin.jvm.internal.k.c(contact);
Iterator it = contact.getContactNumbers().iterator();
while (it.hasNext()) {
ContactNumber contactNumber = (ContactNumber) it.next();
if (contactNumber.getFullNumber() != null && !kotlin.jvm.internal.k.b(contactNumber.getFullNumber(), "")) {
String fullNumber = contactNumber.getFullNumber();
kotlin.jvm.internal.k.c(fullNumber);
arrayList.add(fullNumber);
}
}
} else {
ZangiRecentGroup zangiRecentGroup = this.zangiRecentGroup;
if (zangiRecentGroup != null) {
kotlin.jvm.internal.k.c(zangiRecentGroup);
String displayNumber = zangiRecentGroup.getDisplayNumber();
kotlin.jvm.internal.k.e(displayNumber, "recentNumber");
if (zb.f.t(displayNumber, "+", false, 2, (Object) null)) {
displayNumber = zb.f.p(displayNumber, "+", "", false, 4, (Object) null);
}
arrayList.add(displayNumber);
} else {
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
if (modelForContactInfoFragment != null) {
kotlin.jvm.internal.k.c(modelForContactInfoFragment);
if (modelForContactInfoFragment.getNumbers() != null) {
ModelForContactInfoFragment modelForContactInfoFragment2 = this.contactInfo;
kotlin.jvm.internal.k.c(modelForContactInfoFragment2);
List numbers = modelForContactInfoFragment2.getNumbers();
kotlin.jvm.internal.k.c(numbers);
Iterator it2 = numbers.iterator();
while (it2.hasNext()) {
String fullNumber2 = ((ContactNumber) it2.next()).getFullNumber();
kotlin.jvm.internal.k.c(fullNumber2);
arrayList.add(fullNumber2);
}
}
}
}
}
if (!(!arrayList.isEmpty())) {
return string2;
}
Iterator<String> it3 = arrayList.iterator();
while (it3.hasNext()) {
String next = it3.next();
bool = ConversationNotificationManager.INSTANCE.getNotificationStatus("NOTIFICATION" + next);
}
if (bool == null) {
Resources resources = context.getResources();
Integer num = this.defaultTextId;
kotlin.jvm.internal.k.c(num);
string = resources.getString(num.intValue());
kotlin.jvm.internal.k.e(string, "mContext.resources.getString(defaultTextId!!)");
} else if (bool.booleanValue()) {
string = context.getResources().getString(2131887079);
kotlin.jvm.internal.k.e(string, "mContext.resources.getString(R.string.on)");
} else {
string = context.getResources().getString(2131887075);
kotlin.jvm.internal.k.e(string, "mContext.resources.getString(R.string.off)");
}
return string;
}
private final void checkUserHaveEmail(Conversation conversation, ZangiRecentGroup zangiRecentGroup, ModelForContactInfoFragment modelForContactInfoFragment) {
if (conversation != null && !TextUtils.isEmpty(conversation.getDisplayEmail())) {
if (zangiRecentGroup != null) {
zangiRecentGroup.setDisplayEmail(conversation.getDisplayEmail());
}
if (modelForContactInfoFragment != null) {
modelForContactInfoFragment.setEmail(conversation.getDisplayEmail());
return;
}
return;
}
if ((conversation != null ? conversation.getContactNumber() : null) != null) {
ContactNumber contactNumber = conversation.getContactNumber();
kotlin.jvm.internal.k.c(contactNumber);
if (contactNumber.getEmail() != null) {
if (zangiRecentGroup != null) {
ContactNumber contactNumber2 = conversation.getContactNumber();
kotlin.jvm.internal.k.c(contactNumber2);
zangiRecentGroup.setDisplayEmail(contactNumber2.getEmail());
}
if (modelForContactInfoFragment != null) {
ContactNumber contactNumber3 = conversation.getContactNumber();
kotlin.jvm.internal.k.c(contactNumber3);
modelForContactInfoFragment.setEmail(contactNumber3.getEmail());
}
}
}
}
public static final void closeFragmentWithAnimator$lambda$74$lambda$73(int i, ContactInfoFragmentView contactInfoFragmentView, int i7, ValueAnimator valueAnimator) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
kotlin.jvm.internal.k.f(valueAnimator, "it");
Object animatedValue = valueAnimator.getAnimatedValue();
kotlin.jvm.internal.k.d(animatedValue, "null cannot be cast to non-null type kotlin.Float");
float floatValue = ((Float) animatedValue).floatValue();
float f = 1.0f - floatValue;
int i8 = i + ((int) (((-contactInfoFragmentView.getCOLLAPSING_TOOLAR_OFFSET_START()) - i) * f));
AppBarLayout appBarLayout = contactInfoFragmentView.appBarLayout;
ViewGroup.LayoutParams layoutParams = appBarLayout != null ? appBarLayout.getLayoutParams() : null;
kotlin.jvm.internal.k.d(layoutParams, "null cannot be cast to non-null type androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams");
CoordinatorLayout.c f7 = ((CoordinatorLayout.f) layoutParams).f();
if (f7 != null) {
((AppBarLayout.Behavior) f7).c(i8);
}
AppBarLayout appBarLayout2 = contactInfoFragmentView.appBarLayout;
if (appBarLayout2 != null) {
appBarLayout2.requestLayout();
}
NestedScrollView nestedScrollView = contactInfoFragmentView.nestedScrollView;
if (nestedScrollView != null) {
nestedScrollView.setAlpha(floatValue - 0.5f);
}
NestedScrollView nestedScrollView2 = contactInfoFragmentView.nestedScrollView;
if (nestedScrollView2 != null) {
CoordinatorLayout.f layoutParams2 = nestedScrollView2.getLayoutParams();
kotlin.jvm.internal.k.d(layoutParams2, "null cannot be cast to non-null type androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams");
CoordinatorLayout.f fVar = layoutParams2;
AppBarLayout appBarLayout3 = contactInfoFragmentView.appBarLayout;
((ViewGroup.MarginLayoutParams) fVar).topMargin = i7 - (appBarLayout3 != null ? appBarLayout3.getBottom() : 0);
nestedScrollView2.setX(ExtensionsKt.getDp(100) * f);
}
}
private final void configureAvatarAsync() {
new Thread(new Runnable() {
@Override
public final void run() {
ContactInfoFragmentView.configureAvatarAsync$lambda$3(ContactInfoFragmentView.this);
}
}).start();
}
public static final void configureAvatarAsync$lambda$3(final ContactInfoFragmentView contactInfoFragmentView) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
if (contactInfoFragmentView.getContext() != null) {
Contact contact = contactInfoFragmentView.zangiContact;
if (contact != null) {
fb.o contactAvatar = ContactsManagerHelper.INSTANCE.getContactAvatar(contact, contactInfoFragmentView.getCONTACT_IMAGE_HEIGHT(), contactInfoFragmentView.CONTACT_TILE_AVATAR_SIZE);
contactInfoFragmentView.avatarBitmap = (Bitmap) contactAvatar.a();
Boolean bool = (Boolean) contactAvatar.b();
contactInfoFragmentView.isAvatarImage = bool != null ? bool.booleanValue() : false;
String str = (String) contactAvatar.c();
contactInfoFragmentView.contactNameText = str != null ? str : "";
} else {
ZangiRecentGroup zangiRecentGroup = contactInfoFragmentView.zangiRecentGroup;
if (zangiRecentGroup != null) {
fb.o contactAvatar2 = ContactsManagerHelper.INSTANCE.getContactAvatar(zangiRecentGroup, contactInfoFragmentView.getCONTACT_IMAGE_HEIGHT(), contactInfoFragmentView.CONTACT_TILE_AVATAR_SIZE);
contactInfoFragmentView.avatarBitmap = (Bitmap) contactAvatar2.a();
Boolean bool2 = (Boolean) contactAvatar2.b();
contactInfoFragmentView.isAvatarImage = bool2 != null ? bool2.booleanValue() : false;
String str2 = (String) contactAvatar2.c();
contactInfoFragmentView.contactNameText = str2 != null ? str2 : "";
} else {
ModelForContactInfoFragment modelForContactInfoFragment = contactInfoFragmentView.contactInfo;
if (modelForContactInfoFragment != null) {
fb.o contactAvatar3 = ContactsManagerHelper.INSTANCE.getContactAvatar(modelForContactInfoFragment, contactInfoFragmentView.getCONTACT_IMAGE_HEIGHT(), contactInfoFragmentView.CONTACT_TILE_AVATAR_SIZE);
contactInfoFragmentView.avatarBitmap = (Bitmap) contactAvatar3.a();
Boolean bool3 = (Boolean) contactAvatar3.b();
contactInfoFragmentView.isAvatarImage = bool3 != null ? bool3.booleanValue() : false;
String str3 = (String) contactAvatar3.c();
contactInfoFragmentView.contactNameText = str3 != null ? str3 : "";
}
}
}
if (contactInfoFragmentView.getActivity() != null) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
ContactInfoFragmentView.configureAvatarAsync$lambda$3$lambda$2$lambda$1$lambda$0(ContactInfoFragmentView.this);
}
});
}
}
}
public static final void configureAvatarAsync$lambda$3$lambda$2$lambda$1$lambda$0(ContactInfoFragmentView contactInfoFragmentView) {
Bitmap bitmap;
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
if (!contactInfoFragmentView.isViewCreated || (bitmap = contactInfoFragmentView.avatarBitmap) == null) {
return;
}
contactInfoFragmentView.refreshContactAvatar(contactInfoFragmentView.isAvatarImage, bitmap);
}
public final void contactListChanged(String str) {
Contact contact = this.zangiContact;
if (contact != null) {
kotlin.jvm.internal.k.c(contact);
if (contact.getIdentifire() != null) {
Contact contact2 = this.zangiContact;
kotlin.jvm.internal.k.c(contact2);
if (!kotlin.jvm.internal.k.b(contact2.getIdentifire(), str)) {
return;
}
}
}
Contact contact3 = this.zangiContact;
boolean z = false;
if (contact3 != null) {
kotlin.jvm.internal.k.c(contact3);
if (contact3.getIdentifire() == null) {
Contact contactByIdentifire = StorageService.INSTANCE.getContactByIdentifire(str);
if (contactByIdentifire != null) {
Contact contact4 = this.zangiContact;
kotlin.jvm.internal.k.c(contact4);
LinkedList contactNumbers = contact4.getContactNumbers();
LinkedList contactNumbers2 = contactByIdentifire.getContactNumbers();
Iterator it = contactNumbers.iterator();
while (true) {
if (!it.hasNext()) {
break;
} else if (contactNumbers2.contains((ContactNumber) it.next())) {
z = true;
break;
}
}
if (z) {
this.isContactEdited = true;
StorageService storageService = StorageService.INSTANCE;
Conversation conversation = this.currentConversation;
this.currentConversation = storageService.getConversationItemByChat(conversation != null ? conversation.getConversationJid() : null);
updateView(contactByIdentifire, this.contactInfo, this.zangiRecentGroup, this.recentGroupList, true);
ContactsManagerHelper.INSTANCE.setZangiCurrentContact(contactByIdentifire);
return;
}
return;
}
return;
}
}
this.avatarBitmap = null;
ContactsManagerHelper.INSTANCE.setBitmap((Bitmap) null);
String contactByIdentifire2 = StorageService.INSTANCE.getContactByIdentifire(str);
if (contactByIdentifire2 == null) {
if (this.currentConversation != null) {
fillDataFromConversation();
}
this.isContactEdited = true;
updateView(contactByIdentifire2, this.contactInfo, this.zangiRecentGroup, this.recentGroupList, true);
return;
}
this.isContactEdited = true;
Conversation conversation2 = this.currentConversation;
if (conversation2 != null) {
kotlin.jvm.internal.k.c(conversation2);
String conversationJid = conversation2.getConversationJid();
Conversation conversation3 = this.currentConversation;
kotlin.jvm.internal.k.c(conversation3);
String displayEmail = conversation3.getDisplayEmail();
Iterator it2 = contactByIdentifire2.getContactNumbers().iterator();
while (true) {
if (!it2.hasNext()) {
z = true;
break;
}
ContactNumber contactNumber = (ContactNumber) it2.next();
if (kotlin.jvm.internal.k.b(conversationJid, contactNumber.getFullNumber()) || (displayEmail != null && !kotlin.jvm.internal.k.b(displayEmail, "") && kotlin.jvm.internal.k.b(displayEmail, contactNumber.getEmail()))) {
break;
}
}
if (z) {
fillDataFromConversation();
updateView(r2, this.contactInfo, this.zangiRecentGroup, this.recentGroupList, true);
ContactsManagerHelper.INSTANCE.setZangiCurrentContact(r2);
}
}
r2 = contactByIdentifire2;
updateView(r2, this.contactInfo, this.zangiRecentGroup, this.recentGroupList, true);
ContactsManagerHelper.INSTANCE.setZangiCurrentContact(r2);
}
private final void conversationVisibilityClick() {
if (!((Boolean) bc.g.f((jb.g) null, new ContactInfoFragmentView$conversationVisibilityClick$isEnable$1(null), 1, (Object) null)).booleanValue()) {
this.updateConversationVisibilityText = true;
Bundle bundle = new Bundle();
bundle.putString("chat", this.conversationJid);
BaseScreen.getScreenService().showFragment(ConversationConfigurationFragment.class, bundle);
return;
}
Conversation conversationItemByChat = StorageService.INSTANCE.getConversationItemByChat(this.conversationJid);
String str = (String) bc.g.f((jb.g) null, new ContactInfoFragmentView$conversationVisibilityClick$passCode$1(null), 1, (Object) null);
ConversationManager conversationManager = ConversationManager.INSTANCE;
Context context = getContext();
if (str == null) {
str = "";
}
conversationManager.showEnterHideConversationPinDialog(context, str, new ContactInfoFragmentView$conversationVisibilityClick$1(this), new ContactInfoFragmentView$conversationVisibilityClick$2(conversationItemByChat, this));
}
private final void createAdapter(List<? extends ContactNumber> list) {
RecyclerView recyclerView = this.infoNumbersRecyclerView;
if (recyclerView != null) {
ExtensionsKt.show(recyclerView);
}
if (this.infoNumberAdapter == null) {
InfoNumberAdapter infoNumberAdapter = new InfoNumberAdapter(getContext());
this.infoNumberAdapter = infoNumberAdapter;
infoNumberAdapter.setDelegate(new WeakReference(this));
}
RecyclerView recyclerView2 = this.infoNumbersRecyclerView;
if (recyclerView2 != null) {
recyclerView2.setAdapter(this.infoNumberAdapter);
}
setAdapterNumbers(list);
}
public final void createAudioCall() {
if (Build.VERSION.SDK_INT >= 23) {
showWhiteListPopUpIfNeeded(new WhiteListRequestCallBack() {
@Override
public void requestDone() {
ContactInfoFragmentView.this.audioCall();
}
});
} else {
audioCall();
}
}
private final Button createCallButton(Button button, int i, int i7) {
button.setLayoutParams(new LinearLayout.LayoutParams(getCOLL_BOTTOM_LENGTH(), ExtensionsKt.getDp(70)));
ExtensionsKt.setDefaultSelectableBackground(button);
DispatchKt.asyncThread(new ContactInfoFragmentView$createCallButton$1(button, i, i7, this));
return button;
}
public final void createChat() {
if (Build.VERSION.SDK_INT >= 23) {
showWhiteListPopUpIfNeeded(new WhiteListRequestCallBack() {
@Override
public void requestDone() {
ContactInfoFragmentView.this.startChat();
}
});
} else {
startChat();
}
}
private final View createDividerView() {
View view = new View(getActivity());
LinearLayout linearLayout = this.parentLayoutV;
if (linearLayout != null) {
linearLayout.addView(view);
}
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, getDividerHeight());
layoutParams.setMargins(ExtensionsKt.getDp(25), 0, ExtensionsKt.getDp(25), 0);
view.setLayoutParams(layoutParams);
Context context = view.getContext();
kotlin.jvm.internal.k.c(context);
view.setBackgroundColor(androidx.core.content.a.c(context, ColorsManger.contact_info_divider_color));
return view;
}
private final void createEnterInternalNumberView() {
Context context = getContext();
kotlin.jvm.internal.k.c(context);
EnterIdNumberView enterIdNumberView = new EnterIdNumberView(context);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, EnterIdNumberView.Companion.getEnterInternalNumberViewHeight());
layoutParams.setMargins(ExtensionsKt.getDp(25), ExtensionsKt.getDp(6), ExtensionsKt.getDp(25), ExtensionsKt.getDp(0));
enterIdNumberView.setLayoutParams(layoutParams);
this.enterIdNumberView = enterIdNumberView;
enterIdNumberView.setDelegate(new WeakReference<>(this));
LinearLayout linearLayout = this.parentLayoutV;
if (linearLayout != null) {
linearLayout.addView(this.enterIdNumberView);
}
this.enterInternalNumberDevider = createDividerView();
TextView textView = new TextView(getContext());
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(-1, -2);
layoutParams2.setMargins(ExtensionsKt.getDp(25), ExtensionsKt.getDp(15), ExtensionsKt.getDp(25), ExtensionsKt.getDp(0));
textView.setLayoutParams(layoutParams2);
this.enterInternalNumberBottomTextView = textView;
Context context2 = getContext();
textView.setText(context2 != null ? context2.getString(2131886524) : null);
TextView textView2 = this.enterInternalNumberBottomTextView;
if (textView2 != null) {
Context context3 = getContext();
kotlin.jvm.internal.k.c(context3);
textView2.setTextColor(androidx.core.content.a.c(context3, ColorsManger.enter_internal_number_desc));
}
TextView textView3 = this.enterInternalNumberBottomTextView;
if (textView3 != null) {
textView3.setTextSize(2, 13.0f);
}
LinearLayout linearLayout2 = this.parentLayoutV;
if (linearLayout2 != null) {
linearLayout2.addView(this.enterInternalNumberBottomTextView);
}
Contact contact = this.zangiContact;
updateEnterInternalNumberViewVisibility(contact != null ? contact.isInternal() : false);
}
private final LinearLayout createFunctionalButton(LinearLayout linearLayout, int i, int i7, boolean z, String str) {
linearLayout.setOrientation(0);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, ExtensionsKt.getDp(49));
layoutParams.setMargins(ExtensionsKt.getDp(25), 0, ExtensionsKt.getDp(25), 0);
linearLayout.setLayoutParams(layoutParams);
linearLayout.setGravity(16);
linearLayout.setClickable(true);
linearLayout.setBackgroundResource(2131231593);
TextView textView = new TextView(linearLayout.getContext());
textView.setLayoutParams(new ViewGroup.LayoutParams(-2, -2));
textView.setText(textView.getResources().getString(i7));
textView.setTextColor(androidx.core.content.a.c(textView.getContext(), i));
textView.setTextSize(2, this.TEXT_SIZE_FUNCTIONAL_BUTTON);
linearLayout.addView(textView);
if (z) {
TextView textView2 = new TextView(linearLayout.getContext());
textView2.setLayoutParams(new ViewGroup.LayoutParams(-1, -2));
textView2.setTextSize(2, this.TEXT_SIZE_FUNCTIONAL_BUTTON_PROPERTY);
textView2.setGravity(8388613);
textView2.setText(str);
textView2.setTextColor(androidx.core.content.a.c(textView2.getContext(), ColorsManger.contact_info_call_button_color));
linearLayout.addView(textView2);
}
return linearLayout;
}
static LinearLayout createFunctionalButton$default(ContactInfoFragmentView contactInfoFragmentView, LinearLayout linearLayout, int i, int i7, boolean z, String str, int i8, Object obj) {
boolean z6 = (i8 & 4) != 0 ? false : z;
if ((i8 & 8) != 0) {
str = "";
}
return contactInfoFragmentView.createFunctionalButton(linearLayout, i, i7, z6, str);
}
private final void createGroup() {
Contact contact = this.zangiContact;
if (contact == null) {
if (this.contactInfo == null) {
return;
}
contact = new Contact();
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
kotlin.jvm.internal.k.c(modelForContactInfoFragment);
contact.addContactNumbers(modelForContactInfoFragment.getNumbers());
ModelForContactInfoFragment modelForContactInfoFragment2 = this.contactInfo;
kotlin.jvm.internal.k.c(modelForContactInfoFragment2);
contact.setIdentifire(modelForContactInfoFragment2.getIdentifier());
}
Contact contact2 = contact;
List onlyZangiNumbersList = contact2.getOnlyZangiNumbersList();
if (onlyZangiNumbersList.isEmpty()) {
return;
}
ConversationManager.INSTANCE.setCreateGroupFromContactInfoPage(true);
if (contact2.getOnlyZangiNumbersList().size() == 1) {
showGroupCreationScreen(((ContactNumber) onlyZangiNumbersList.get(0)).getNumber(), ((ContactNumber) onlyZangiNumbersList.get(0)).getEmail(), contact2.getIdentifire());
return;
}
List onlyZangiNumbersList2 = contact2.getOnlyZangiNumbersList();
if (!onlyZangiNumbersList2.isEmpty() && onlyZangiNumbersList2.size() == 1) {
String number = ((ContactNumber) onlyZangiNumbersList2.get(0)).getNumber();
String email = ((ContactNumber) onlyZangiNumbersList2.get(0)).getEmail();
Contact firstContact = ((ContactNumber) onlyZangiNumbersList2.get(0)).getFirstContact();
showGroupCreationScreen(number, email, firstContact != null ? firstContact.getIdentifire() : null);
return;
}
NumbersBottomSheetAdapter numbersBottomSheetAdapter = new NumbersBottomSheetAdapter(getActivity(), contact2, NumbersBottomSheetAdapter.LOAD_TYPE.ALL, true, false);
ActionType actionType = ActionType.CREATE_GROUP;
CharSequence text = getResources().getText(2131886310);
kotlin.jvm.internal.k.d(text, "null cannot be cast to non-null type kotlin.String");
showBottomSheet(actionType, (String) text, numbersBottomSheetAdapter);
}
private final void createProgressBar() {
if (this.progressLayout == null) {
RelativeLayout relativeLayout = new RelativeLayout(getContext());
this.progressLayout = relativeLayout;
relativeLayout.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
this.progressBar = new ProgressBar(getContext());
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ExtensionsKt.getDp(200), ExtensionsKt.getDp(7));
layoutParams.addRule(17);
ProgressBar progressBar = this.progressBar;
if (progressBar != null) {
progressBar.setLayoutParams(layoutParams);
}
RelativeLayout relativeLayout2 = this.progressLayout;
if (relativeLayout2 != null) {
relativeLayout2.addView(this.progressBar);
}
RelativeLayout relativeLayout3 = this.parentLayoutR;
if (relativeLayout3 != null) {
relativeLayout3.addView(this.progressLayout);
}
}
}
public final void createVideoCall() {
if (Build.VERSION.SDK_INT >= 23) {
showWhiteListPopUpIfNeeded(new WhiteListRequestCallBack() {
@Override
public void requestDone() {
ContactInfoFragmentView.this.videoCall();
}
});
} else {
videoCall();
}
}
private final void editContact() {
String str;
String str2;
Bitmap bitmap;
this.isContactEdited = true;
ArrayList arrayList = new ArrayList();
Contact contact = this.zangiContact;
if (contact != null) {
kotlin.jvm.internal.k.c(contact);
Iterator it = contact.getContactNumbers().iterator();
while (it.hasNext()) {
String fullNumber = ((ContactNumber) it.next()).getFullNumber();
kotlin.jvm.internal.k.c(fullNumber);
arrayList.add(fullNumber);
}
Contact contact2 = this.zangiContact;
kotlin.jvm.internal.k.c(contact2);
String identifire = contact2.getIdentifire();
Contact contact3 = this.zangiContact;
kotlin.jvm.internal.k.c(contact3);
Long id = contact3.getId();
Contact contact4 = this.zangiContact;
if (contact4 != null) {
contact4.getName();
}
Contact contact5 = this.zangiContact;
String firstName = contact5 != null ? contact5.getFirstName() : null;
Contact contact6 = this.zangiContact;
String lastName = contact6 != null ? contact6.getLastName() : null;
Contact contact7 = this.zangiContact;
if ((contact7 != null ? contact7.getName() : null) != null) {
Contact contact8 = this.zangiContact;
if ((contact8 != null ? contact8.getLastName() : null) != null) {
Contact contact9 = this.zangiContact;
kotlin.jvm.internal.k.c(contact9);
String name = contact9.getName();
kotlin.jvm.internal.k.c(name);
if (zb.f.t(name, "+", false, 2, (Object) null)) {
Contact contact10 = this.zangiContact;
kotlin.jvm.internal.k.c(contact10);
String name2 = contact10.getName();
kotlin.jvm.internal.k.c(name2);
Contact contact11 = this.zangiContact;
kotlin.jvm.internal.k.c(contact11);
String lastName2 = contact11.getLastName();
kotlin.jvm.internal.k.c(lastName2);
if (zb.f.y(name2, lastName2, false, 2, (Object) null)) {
Contact contact12 = this.zangiContact;
kotlin.jvm.internal.k.c(contact12);
Iterator it2 = contact12.getContactNumbers().iterator();
while (it2.hasNext()) {
String number = ((ContactNumber) it2.next()).getNumber();
Contact contact13 = this.zangiContact;
kotlin.jvm.internal.k.c(contact13);
if (zb.f.l(number, contact13.getName(), false, 2, (Object) null)) {
str2 = null;
str = null;
break;
}
}
}
}
}
}
str = lastName;
str2 = firstName;
Contact contact14 = this.zangiContact;
kotlin.jvm.internal.k.c(contact14);
Bitmap profileImage = ProjectUtils.getProfileImage(contact14.getContactNumbers(), identifire, getContext(), true);
if (profileImage == null) {
Contact contact15 = this.zangiContact;
bitmap = contact15 != null ? Contact.getAvatar$default(contact15, 0, 1, (Object) null) : null;
} else {
bitmap = profileImage;
}
Contact contact16 = this.zangiContact;
kotlin.jvm.internal.k.c(contact16);
AddContact.Companion.setContactInfoItem(new ContactInfoItem(str2, str, arrayList, identifire, id, contact16.getContactNumbers(), (ArrayList) null, bitmap, Boolean.TRUE));
ContactsManagerHelper.INSTANCE.setZangiCurrentContact(this.zangiContact);
}
Context context = getContext();
new AddContact();
Intent intent = new Intent(context, (Class<?>) AddContact.class);
Context context2 = getContext();
kotlin.jvm.internal.k.c(context2);
context2.startActivity(intent);
}
private final void editInNative(long j) {
Cursor cursor;
ContentResolver contentResolver;
Context context = getContext();
if (context == null || (contentResolver = context.getContentResolver()) == null) {
cursor = null;
} else {
cursor = contentResolver.query(ContactsContract.Contacts.CONTENT_URI, null, "_id=" + j, null, null);
}
if (cursor != null) {
if (cursor.moveToFirst()) {
ZangiConfigurationService.INSTANCE.putBoolean(Constants.SYNCING, false);
long j7 = cursor.getLong(cursor.getColumnIndex("_id"));
Intent intent = new Intent("android.intent.action.EDIT");
Uri withAppendedId = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, j7);
kotlin.jvm.internal.k.e(withAppendedId, "withAppendedId(ContactsC…s.CONTENT_URI, idContact)");
intent.setData(withAppendedId);
intent.putExtra("finishActivityOnSaveCompleted", true);
try {
startActivity(intent);
} catch (ActivityNotFoundException unused) {
}
}
cursor.close();
}
}
private final boolean emailValidate(String str) {
if (TextUtils.isEmpty(str)) {
return false;
}
return Constants.VALID_EMAIL_ADDRESS_REGEX.matcher(str).find();
}
private final void fillData() {
if (this.currentConversation != null) {
fillDataFromConversation();
} else {
if (this.zangiRecentGroup == null || !this.isRecentInfo) {
return;
}
fillDataFromRecent();
}
}
private final void fillDataFromConversation() {
ZangiRecentGroup zangiRecentGroup;
String displayEmail;
String str;
ContactNumber contactNumber;
Conversation conversation = this.currentConversation;
kotlin.jvm.internal.k.c(conversation);
String conversationJid = conversation.getConversationJid();
Conversation conversation2 = this.currentConversation;
Contact firstContact = (conversation2 == null || (contactNumber = conversation2.getContactNumber()) == null) ? null : contactNumber.getFirstContact();
String str2 = "";
if (firstContact != null) {
if (!kotlin.jvm.internal.k.b(firstContact.getIdentifire(), "")) {
ContactsManagerHelper.INSTANCE.setZangiCurrentContactId(firstContact.getIdentifire());
}
ContactsManagerHelper contactsManagerHelper = ContactsManagerHelper.INSTANCE;
contactsManagerHelper.setZangiCurrentContact(firstContact);
contactsManagerHelper.setZangiRecentGroup((ZangiRecentGroup) null);
} else {
Iterator it = ZangiRecentService.getInstance().getRecentGroupList(false).iterator();
while (true) {
if (!it.hasNext()) {
zangiRecentGroup = null;
break;
}
zangiRecentGroup = (ZangiRecentGroup) it.next();
if (kotlin.jvm.internal.k.b(zangiRecentGroup.getDisplayNumber(), conversationJid)) {
Conversation conversation3 = this.currentConversation;
if (conversation3 == null || (str = conversation3.getDisplayEmail()) == null) {
str = "";
}
zangiRecentGroup.setDisplayEmail(str);
}
}
if (zangiRecentGroup == null) {
zangiRecentGroup = new ZangiRecentGroup();
zangiRecentGroup.setDisplayNumber(conversationJid);
Conversation conversation4 = this.currentConversation;
if (conversation4 != null && (displayEmail = conversation4.getDisplayEmail()) != null) {
str2 = displayEmail;
}
zangiRecentGroup.setDisplayEmail(str2);
zangiRecentGroup.setDate(System.currentTimeMillis());
}
ContactsManagerHelper contactsManagerHelper2 = ContactsManagerHelper.INSTANCE;
contactsManagerHelper2.setZangiRecentGroup(zangiRecentGroup);
ContactNumberDao contactNumberDao = ContactNumberDao.INSTANCE;
String displayNumber = zangiRecentGroup.getDisplayNumber();
kotlin.jvm.internal.k.e(displayNumber, "zangiRecentGroup.displayNumber");
ContactNumber contactNumber$default = ContactNumberDao.getContactNumber$default(contactNumberDao, zb.f.p(displayNumber, "+", "", false, 4, (Object) null), (String) null, 2, (Object) null);
contactsManagerHelper2.setZangiCurrentContact(contactNumber$default != null ? contactNumber$default.getFirstContact() : null);
}
ContactsManagerHelper contactsManagerHelper3 = ContactsManagerHelper.INSTANCE;
this.zangiContact = contactsManagerHelper3.getZangiCurrentContact();
this.zangiRecentGroup = contactsManagerHelper3.getZangiRecentGroup();
}
private final void fillDataFromRecent() {
ZangiRecentGroup zangiRecentGroup = this.zangiRecentGroup;
kotlin.jvm.internal.k.c(zangiRecentGroup);
String e164WithoutPlus = ZangiEngineUtils.getE164WithoutPlus(zangiRecentGroup.getDisplayNumber(), ZangiEngineUtils.getZipCode(), false);
StorageService storageService = StorageService.INSTANCE;
ZangiRecentGroup zangiRecentGroup2 = this.zangiRecentGroup;
kotlin.jvm.internal.k.c(zangiRecentGroup2);
ContactNumber contactNumber$default = IStorageService.DefaultImpls.getContactNumber$default(storageService, zangiRecentGroup2.getDisplayNumber(), (String) null, 2, (Object) null);
Contact firstContact = contactNumber$default != null ? contactNumber$default.getFirstContact() : null;
if (firstContact != null) {
firstContact.setPpUriSuffix(e164WithoutPlus);
}
ContactsManagerHelper contactsManagerHelper = ContactsManagerHelper.INSTANCE;
contactsManagerHelper.setZangiCurrentContact(firstContact);
this.zangiContact = contactsManagerHelper.getZangiCurrentContact();
}
private final AppBarLayout.g getAppBarLayoutOffsetChangeListener() {
return new AppBarLayout.g() {
@Override
public final void a(AppBarLayout appBarLayout, int i) {
ContactInfoFragmentView.getAppBarLayoutOffsetChangeListener$lambda$112(ContactInfoFragmentView.this, appBarLayout, i);
}
};
}
public static final void getAppBarLayoutOffsetChangeListener$lambda$112(com.beint.project.screens.contacts.ContactInfoFragmentView r9, com.google.android.material.appbar.AppBarLayout r10, int r11) {
throw new UnsupportedOperationException("Method not decompiled: com.beint.project.screens.contacts.ContactInfoFragmentView.getAppBarLayoutOffsetChangeListener$lambda$112(com.beint.project.screens.contacts.ContactInfoFragmentView, com.google.android.material.appbar.AppBarLayout, int):void");
}
public final int getCOLLAPSING_TOOLAR_OFFSET_END() {
return ((Number) this.COLLAPSING_TOOLAR_OFFSET_END$delegate.getValue()).intValue();
}
public final int getCOLLAPSING_TOOLAR_OFFSET_START() {
return ((Number) this.COLLAPSING_TOOLAR_OFFSET_START$delegate.getValue()).intValue();
}
private final int getCOLL_BOTTOM_LENGTH() {
return ((Number) this.COLL_BOTTOM_LENGTH$delegate.getValue()).intValue();
}
public final int getCONTACT_IMAGE_HEIGHT() {
return ((Number) this.CONTACT_IMAGE_HEIGHT$delegate.getValue()).intValue();
}
public final ColorStateList getColorStateList() {
return (ColorStateList) this.colorStateList$delegate.getValue();
}
private final Contact getContactCheck() {
String str;
String displayNumber;
String p;
String email;
String displayNumber2;
String p6;
String str2;
String displayNumber3;
ZangiRecentGroup zangiRecentGroup = this.zangiRecentGroup;
str = "";
if (zangiRecentGroup != null) {
if (TextUtils.isEmpty(zangiRecentGroup != null ? zangiRecentGroup.getDisplayEmail() : null)) {
ZangiRecentGroup zangiRecentGroup2 = this.zangiRecentGroup;
if (TextUtils.isEmpty(zangiRecentGroup2 != null ? zangiRecentGroup2.getDisplayNumber() : null)) {
return null;
}
ZangiRecentGroup zangiRecentGroup3 = this.zangiRecentGroup;
if (zangiRecentGroup3 != null && (displayNumber2 = zangiRecentGroup3.getDisplayNumber()) != null && (p6 = zb.f.p(displayNumber2, "+", "", false, 4, (Object) null)) != null) {
str = p6;
}
return ContactList.INSTANCE.getContactByFullNumberOrEmail(str, (String) null);
}
ZangiRecentGroup zangiRecentGroup4 = this.zangiRecentGroup;
if (zangiRecentGroup4 == null || (displayNumber3 = zangiRecentGroup4.getDisplayNumber()) == null || (str2 = zb.f.p(displayNumber3, "+", "", false, 4, (Object) null)) == null) {
str2 = "";
}
ContactList contactList = ContactList.INSTANCE;
ZangiRecentGroup zangiRecentGroup5 = this.zangiRecentGroup;
String displayEmail = zangiRecentGroup5 != null ? zangiRecentGroup5.getDisplayEmail() : null;
return contactList.getContactByFullNumberOrEmail(str2, displayEmail != null ? displayEmail : "");
}
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
if (modelForContactInfoFragment == null) {
Contact contact = this.zangiContact;
if (contact != null) {
return contact;
}
return null;
}
if (!TextUtils.isEmpty(modelForContactInfoFragment != null ? modelForContactInfoFragment.getEmail() : null)) {
ContactList contactList2 = ContactList.INSTANCE;
ModelForContactInfoFragment modelForContactInfoFragment2 = this.contactInfo;
if (modelForContactInfoFragment2 != null && (email = modelForContactInfoFragment2.getEmail()) != null) {
str = email;
}
return contactList2.getContactByFullNumberOrEmail((String) null, str);
}
ModelForContactInfoFragment modelForContactInfoFragment3 = this.contactInfo;
if (TextUtils.isEmpty(modelForContactInfoFragment3 != null ? modelForContactInfoFragment3.getDisplayNumber() : null)) {
return null;
}
ModelForContactInfoFragment modelForContactInfoFragment4 = this.contactInfo;
if (modelForContactInfoFragment4 != null && (displayNumber = modelForContactInfoFragment4.getDisplayNumber()) != null && (p = zb.f.p(displayNumber, "+", "", false, 4, (Object) null)) != null) {
str = p;
}
return ContactList.INSTANCE.getContactByFullNumberOrEmail(str, (String) null);
}
private final Contact getContactForCheck() {
return getContactCheck();
}
private final int getContactNumbersCount() {
List contactNumbers;
LinkedList contactNumbers2;
if (!isZangiContact()) {
Contact contact = this.zangiContact;
kotlin.jvm.internal.k.c(contact);
int size = contact.getContactNumbers().size() - 1;
if (size < 0) {
return 0;
}
return size;
}
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
if (modelForContactInfoFragment != null) {
if (modelForContactInfoFragment != null) {
contactNumbers = modelForContactInfoFragment.getNumbers();
}
contactNumbers = null;
} else {
Contact contact2 = this.zangiContact;
if (contact2 != null) {
contactNumbers = contact2.getContactNumbers();
}
contactNumbers = null;
}
if (contactNumbers != null) {
return contactNumbers.size();
}
Conversation conversation = this.currentConversation;
if ((conversation != null ? conversation.getContactNumber() : null) != null) {
return 1;
}
Contact contact3 = this.zangiContact;
if (contact3 == null || (contactNumbers2 = contact3.getContactNumbers()) == null) {
return 0;
}
return contactNumbers2.size();
}
private final java.lang.String getConversationJidIfItExist() {
throw new UnsupportedOperationException("Method not decompiled: com.beint.project.screens.contacts.ContactInfoFragmentView.getConversationJidIfItExist():java.lang.String");
}
private final int getConversationVisibilityTextResource() {
Conversation conversationItemByChat = StorageService.INSTANCE.getConversationItemByChat(this.conversationJid);
boolean z = false;
if (conversationItemByChat != null && conversationItemByChat.getVisibilityStatus() == 0) {
z = true;
}
return z ? 2131886666 : 2131887596;
}
private final int getDividerHeight() {
return ((Number) this.dividerHeight$delegate.getValue()).intValue();
}
private final List<String> getEmailsFromContactNumbers() {
List numbers;
Contact contact = this.zangiContact;
List list = null;
if (contact == null) {
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
if (modelForContactInfoFragment != null && modelForContactInfoFragment != null) {
numbers = modelForContactInfoFragment.getNumbers();
list = numbers;
}
} else if (contact != null) {
numbers = contact.getContactNumbers();
list = numbers;
}
return ContactsManagerHelper.INSTANCE.getEmailsFromContactNumbers(list);
}
private final List<String> getFullNumbersFromContactNumbers() {
List numbers;
Contact contact = this.zangiContact;
List list = null;
if (contact == null) {
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
if (modelForContactInfoFragment != null && modelForContactInfoFragment != null) {
numbers = modelForContactInfoFragment.getNumbers();
list = numbers;
}
} else if (contact != null) {
numbers = contact.getContactNumbers();
list = numbers;
}
return ContactsManagerHelper.INSTANCE.getFullNumbersFromContactNumbers(list);
}
private final float getNAME_STATUS_LAYOUT_Y() {
return ((Number) this.NAME_STATUS_LAYOUT_Y$delegate.getValue()).floatValue();
}
private final List<ContactNumber> getNumberList() {
Contact contact = this.zangiContact;
List<ContactNumber> list = null;
list = null;
if (contact != null) {
if (contact != null) {
list = contact.getContactNumbers();
}
} else if (this.currentConversation != null) {
ArrayList arrayList = new ArrayList();
Conversation conversation = this.currentConversation;
kotlin.jvm.internal.k.c(conversation);
ContactNumber contactNumber = conversation.getContactNumber();
kotlin.jvm.internal.k.c(contactNumber);
arrayList.add(contactNumber);
list = arrayList;
} else {
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
if (modelForContactInfoFragment != null) {
list = modelForContactInfoFragment.getNumbers();
}
}
return list == null ? new ArrayList() : list;
}
private final String getNumberWithOutPlus(String str) {
if (str == null) {
return null;
}
if (!zb.f.t(str, "+", false, 2, (Object) null)) {
return str;
}
String substring = str.substring(1);
kotlin.jvm.internal.k.e(substring, "this as java.lang.String).substring(startIndex)");
return substring;
}
public final int getSTATUS_BAR_HEIGHT() {
return ((Number) this.STATUS_BAR_HEIGHT$delegate.getValue()).intValue();
}
public final String getStatus(ContactNumber contactNumber) {
Resources resources;
if (contactNumber.getUserLastActivity() == null) {
return "";
}
LastActivity userLastActivity = contactNumber.getUserLastActivity();
kotlin.jvm.internal.k.c(userLastActivity);
if (userLastActivity.getStatus() == LastActivityState.unavalabile) {
return "";
}
contactNumber.setZangi(1);
ContactNumberDao.INSTANCE.addOrUpdateContactNumber(contactNumber);
LastActivity userLastActivity2 = contactNumber.getUserLastActivity();
kotlin.jvm.internal.k.c(userLastActivity2);
if (userLastActivity2.getLastActivity() == 0) {
Context context = getContext();
String string = (context == null || (resources = context.getResources()) == null) ? null : resources.getString(2131887085);
return string == null ? "" : string;
}
GregorianCalendar gregorianCalendar = new GregorianCalendar();
long currentTimeMillis = System.currentTimeMillis();
LastActivity userLastActivity3 = contactNumber.getUserLastActivity();
kotlin.jvm.internal.k.c(userLastActivity3);
gregorianCalendar.setTime(new Date(currentTimeMillis - (userLastActivity3.getLastActivity() * 1000)));
String conversationTitleDateString = DateTimeUtils.getConversationTitleDateString(getContext(), gregorianCalendar);
kotlin.jvm.internal.k.e(conversationTitleDateString, "getConversationTitleDate…g(this.context, calendar)");
return conversationTitleDateString;
}
private final float getTEXT_VIEW_HEIGHT() {
return ((Number) this.TEXT_VIEW_HEIGHT$delegate.getValue()).floatValue();
}
private final float getTEXT_VIEW_WIDTH() {
return ((Number) this.TEXT_VIEW_WIDTH$delegate.getValue()).floatValue();
}
private final float getTEXT_VIEW_X() {
return ((Number) this.TEXT_VIEW_X$delegate.getValue()).floatValue();
}
private final float getTEXT_VIEW_Y() {
return ((Number) this.TEXT_VIEW_Y$delegate.getValue()).floatValue();
}
public final float getTOOLBAR_HEIGHT() {
return ((Number) this.TOOLBAR_HEIGHT$delegate.getValue()).floatValue();
}
private final float getTOOLBAR_HEIGHT_FULL_SIZE() {
return ((Number) this.TOOLBAR_HEIGHT_FULL_SIZE$delegate.getValue()).floatValue();
}
public final String getTitleText(LinearLayout linearLayout) {
View childAt = linearLayout.getChildAt(0);
if (childAt instanceof TextView) {
return ((TextView) childAt).getText().toString();
}
return null;
}
private final TextView getTitleTextView(LinearLayout linearLayout) {
View childAt = linearLayout.getChildAt(0);
if (childAt instanceof TextView) {
return (TextView) childAt;
}
return null;
}
private final void hideCallBackProgress() {
RelativeLayout relativeLayout = this.progressLayout;
if (relativeLayout != null) {
ExtensionsKt.hide(relativeLayout);
}
HomeActivity.tabLayout.setEnabled(true);
enableDisableView(this.parentLayoutV, true);
}
public final void hideEnterInternalNumberView() {
EnterIdNumberView enterIdNumberView = this.enterIdNumberView;
if (enterIdNumberView != null) {
enterIdNumberView.setVisibility(8);
}
View view = this.enterInternalNumberDevider;
if (view != null) {
view.setVisibility(8);
}
TextView textView = this.enterInternalNumberBottomTextView;
if (textView == null) {
return;
}
textView.setVisibility(8);
}
public final boolean isBlockedNumbers() {
Contact contact = this.zangiContact;
LinkedList contactNumbers = contact != null ? contact.getContactNumbers() : null;
if (contactNumbers == null || !(!contactNumbers.isEmpty())) {
return false;
}
Iterator it = contactNumbers.iterator();
while (it.hasNext()) {
ZangiBlockNumber zangiBlockNumber = BlockContactServiceImpl.getInstance().getZangiBlockNumber(((ContactNumber) it.next()).getFullNumber());
this.zangiBlockNumber = zangiBlockNumber;
if (zangiBlockNumber != null) {
return true;
}
}
return false;
}
private final boolean isContactEnableFromOutCall() {
ContactNumber contactNumber;
List numbers;
LinkedList contactNumbers;
Object obj;
Contact contact = this.zangiContact;
Object obj2 = null;
if (contact == null || (contactNumbers = contact.getContactNumbers()) == null) {
contactNumber = null;
} else {
Iterator it = contactNumbers.iterator();
while (true) {
if (!it.hasNext()) {
obj = null;
break;
}
obj = it.next();
if (!((ContactNumber) obj).isHaveEmail()) {
break;
}
}
contactNumber = (ContactNumber) obj;
}
if (contactNumber != null) {
return true;
}
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
if (modelForContactInfoFragment != null && (numbers = modelForContactInfoFragment.getNumbers()) != null) {
Iterator it2 = numbers.iterator();
while (true) {
if (!it2.hasNext()) {
break;
}
Object next = it2.next();
if (!((ContactNumber) next).isHaveEmail()) {
obj2 = next;
break;
}
}
obj2 = (ContactNumber) obj2;
}
return obj2 != null;
}
private final boolean isHaveLongNumber() {
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
List<ContactNumber> list = null;
if (modelForContactInfoFragment == null) {
Contact contact = this.zangiContact;
if (contact != null) {
list = contact.getContactNumbers();
}
} else if (modelForContactInfoFragment != null) {
list = modelForContactInfoFragment.getNumbers();
}
if (list == null || list.isEmpty()) {
return false;
}
if (list.size() == 1) {
return !(TextUtils.isEmpty(((ContactNumber) list.get(0)).getEmail()) || TextUtils.isEmpty(((ContactNumber) list.get(0)).getNumber()) || !ZangiEngineUtils.isShortNumber(((ContactNumber) list.get(0)).getNumber())) || (TextUtils.isEmpty(((ContactNumber) list.get(0)).getEmail()) && !ZangiEngineUtils.isShortNumber(((ContactNumber) list.get(0)).getNumber()));
}
if (list.size() > 1) {
ArrayList arrayList = new ArrayList();
for (ContactNumber contactNumber : list) {
if (!TextUtils.isEmpty(contactNumber.getNumber()) || !TextUtils.isEmpty(contactNumber.getEmail())) {
arrayList.add(contactNumber);
}
}
if (arrayList.isEmpty()) {
return false;
}
if (arrayList.size() == 1) {
return ZangiEngineUtils.isShortNumber(((ContactNumber) arrayList.get(0)).getNumber()) || !(!TextUtils.isEmpty(((ContactNumber) arrayList.get(0)).getEmail()) || ZangiEngineUtils.isShortNumber(((ContactNumber) arrayList.get(0)).getNumber()) || TextUtils.isEmpty(((ContactNumber) list.get(0)).getNumber()));
}
Iterator it = arrayList.iterator();
while (it.hasNext()) {
ContactNumber contactNumber2 = (ContactNumber) it.next();
if (TextUtils.isEmpty(contactNumber2.getEmail()) && !TextUtils.isEmpty(contactNumber2.getNumber()) && !ZangiEngineUtils.isShortNumber(contactNumber2.getNumber())) {
return true;
}
if (!TextUtils.isEmpty(contactNumber2.getNumber()) && !ZangiEngineUtils.isShortNumber(contactNumber2.getNumber())) {
return true;
}
}
}
return false;
}
private final boolean isHaveShortNumber() {
Contact contact = this.zangiContact;
LinkedList contactNumbers = contact != null ? contact.getContactNumbers() : null;
if (contactNumbers == null) {
return false;
}
Iterator it = contactNumbers.iterator();
while (it.hasNext()) {
ContactNumber contactNumber = (ContactNumber) it.next();
if (!contactNumber.isHaveEmail() && ZangiEngineUtils.isShortNumber(contactNumber.getNumber())) {
return true;
}
}
return false;
}
private final boolean isZangiContact() {
List contactNumbers;
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
if (modelForContactInfoFragment != null) {
if (modelForContactInfoFragment != null) {
contactNumbers = modelForContactInfoFragment.getNumbers();
}
contactNumbers = null;
} else {
Contact contact = this.zangiContact;
if (contact != null) {
contactNumbers = contact.getContactNumbers();
}
contactNumbers = null;
}
if (contactNumbers != null) {
Iterator it = contactNumbers.iterator();
while (it.hasNext()) {
if (((ContactNumber) it.next()).isZangi() == 1) {
return true;
}
}
return false;
}
Conversation conversation = this.currentConversation;
if ((conversation != null ? conversation.getContactNumber() : null) == null) {
return false;
}
Conversation conversation2 = this.currentConversation;
kotlin.jvm.internal.k.c(conversation2);
ContactNumber contactNumber = conversation2.getContactNumber();
kotlin.jvm.internal.k.c(contactNumber);
return contactNumber.isZangi() == 1;
}
public final void onContactChanged(Object obj) {
ContactNumber contactNumber;
String str = obj instanceof String ? (String) obj : null;
Contact contact = this.zangiContact;
if (contact != null) {
if (kotlin.jvm.internal.k.b(contact != null ? contact.getIdentifire() : null, str)) {
Contact contact2 = this.zangiContact;
contactListChanged(contact2 != null ? contact2.getIdentifire() : null);
return;
}
}
Conversation conversation = this.currentConversation;
if ((conversation != null ? conversation.getContactNumber() : null) != null) {
Conversation conversation2 = this.currentConversation;
kotlin.jvm.internal.k.c(conversation2);
ContactNumber contactNumber2 = conversation2.getContactNumber();
kotlin.jvm.internal.k.c(contactNumber2);
Iterator it = contactNumber2.getContacts().iterator();
while (it.hasNext()) {
Contact contact3 = (Contact) it.next();
if (kotlin.jvm.internal.k.b(contact3.getIdentifire(), str)) {
this.zangiContact = contact3;
contactListChanged(contact3.getIdentifire());
return;
}
}
}
ZangiRecentGroup zangiRecentGroup = this.zangiRecentGroup;
if ((zangiRecentGroup != null ? zangiRecentGroup.getE164NumberOrConferenceId() : null) != null) {
StorageService storageService = StorageService.INSTANCE;
ZangiRecentGroup zangiRecentGroup2 = this.zangiRecentGroup;
kotlin.jvm.internal.k.c(zangiRecentGroup2);
String e164NumberOrConferenceId = zangiRecentGroup2.getE164NumberOrConferenceId();
ZangiRecentGroup zangiRecentGroup3 = this.zangiRecentGroup;
kotlin.jvm.internal.k.c(zangiRecentGroup3);
ContactNumber contactNumber3 = storageService.getContactNumber(e164NumberOrConferenceId, zangiRecentGroup3.getDisplayEmail());
if (contactNumber3 != null) {
Iterator it2 = contactNumber3.getContacts().iterator();
while (it2.hasNext()) {
Contact contact4 = (Contact) it2.next();
if (kotlin.jvm.internal.k.b(contact4.getIdentifire(), str)) {
this.zangiContact = contact4;
contactListChanged(contact4.getIdentifire());
return;
}
}
}
}
Contact contactByIdentifire = StorageService.INSTANCE.getContactByIdentifire(str);
if (contactByIdentifire == null) {
return;
}
Iterator it3 = contactByIdentifire.getContactNumbers().iterator();
while (it3.hasNext()) {
ContactNumber contactNumber4 = (ContactNumber) it3.next();
Conversation conversation3 = this.currentConversation;
if (kotlin.jvm.internal.k.b((conversation3 == null || (contactNumber = conversation3.getContactNumber()) == null) ? null : contactNumber.getFullNumber(), contactNumber4.getFullNumber())) {
this.zangiContact = contactByIdentifire;
contactListChanged(contactByIdentifire.getIdentifire());
return;
} else {
ZangiRecentGroup zangiRecentGroup4 = this.zangiRecentGroup;
if (kotlin.jvm.internal.k.b(zangiRecentGroup4 != null ? zangiRecentGroup4.getE164NumberOrConferenceId() : null, contactNumber4.getFullNumber())) {
this.zangiContact = contactByIdentifire;
contactListChanged(contactByIdentifire.getIdentifire());
return;
}
}
}
}
private static final int onCreateAnimator$lambda$69$lambda$65(fb.f<Integer> fVar) {
return ((Number) fVar.getValue()).intValue();
}
public static final void onCreateAnimator$lambda$69$lambda$68(boolean z, ContactInfoFragmentView contactInfoFragmentView, fb.f fVar, ValueAnimator valueAnimator) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
kotlin.jvm.internal.k.f(fVar, "$deltaCollapsingOffset$delegate");
kotlin.jvm.internal.k.f(valueAnimator, "it");
if (!z) {
if (contactInfoFragmentView.isZangiContact()) {
contactInfoFragmentView.openCordinatorLayout();
return;
}
return;
}
Object animatedValue = valueAnimator.getAnimatedValue();
kotlin.jvm.internal.k.d(animatedValue, "null cannot be cast to non-null type kotlin.Float");
float floatValue = ((Float) animatedValue).floatValue();
int collapsing_toolar_offset_start = (int) (((floatValue - 1.0f) * contactInfoFragmentView.getCOLLAPSING_TOOLAR_OFFSET_START()) - (contactInfoFragmentView.getCOLLAPSING_TOOLAR_OFFSET_END() * floatValue));
AppBarLayout appBarLayout = contactInfoFragmentView.appBarLayout;
ViewGroup.LayoutParams layoutParams = appBarLayout != null ? appBarLayout.getLayoutParams() : null;
kotlin.jvm.internal.k.d(layoutParams, "null cannot be cast to non-null type androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams");
CoordinatorLayout.c f = ((CoordinatorLayout.f) layoutParams).f();
if (f != null) {
((AppBarLayout.Behavior) f).c(collapsing_toolar_offset_start);
}
AppBarLayout appBarLayout2 = contactInfoFragmentView.appBarLayout;
if (appBarLayout2 != null) {
appBarLayout2.requestLayout();
}
NestedScrollView nestedScrollView = contactInfoFragmentView.nestedScrollView;
if (nestedScrollView != null) {
CoordinatorLayout.f layoutParams2 = nestedScrollView.getLayoutParams();
kotlin.jvm.internal.k.d(layoutParams2, "null cannot be cast to non-null type androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams");
((ViewGroup.MarginLayoutParams) layoutParams2).topMargin = (int) (onCreateAnimator$lambda$69$lambda$65(fVar) * (1 - floatValue));
nestedScrollView.setX(ExtensionsKt.getDp(100) * (1.0f - floatValue));
}
NestedScrollView nestedScrollView2 = contactInfoFragmentView.nestedScrollView;
if (nestedScrollView2 == null) {
return;
}
nestedScrollView2.setAlpha(floatValue);
}
public static final void onCreateView$lambda$53$lambda$17$lambda$16(ContactInfoFragmentView contactInfoFragmentView, FragmentActivity fragmentActivity, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
kotlin.jvm.internal.k.f(fragmentActivity, "$activity");
SimpleTextView simpleTextView = contactInfoFragmentView.premiumAccountTextView;
CharSequence text = simpleTextView != null ? simpleTextView.getText() : null;
if (text == null || text.length() == 0) {
return;
}
contactInfoFragmentView.startActivity(new Intent((Context) fragmentActivity, (Class<?>) PremiumActivity.class));
}
public static final void onCreateView$lambda$53$lambda$26(ContactInfoFragmentView contactInfoFragmentView, String str) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
if (!TextUtils.isEmpty(str)) {
Button button = contactInfoFragmentView.zangiOutButtonLayout;
if (button == null) {
return;
}
button.setText(str);
return;
}
Button button2 = contactInfoFragmentView.zangiOutButtonLayout;
if (button2 == null) {
return;
}
Context context = contactInfoFragmentView.getContext();
button2.setText(context != null ? context.getString(2131886253) : null);
}
public static final void onCreateView$lambda$53$lambda$27(ContactInfoFragmentView contactInfoFragmentView, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
if (contactInfoFragmentView.isZangiContact() || Constants.IS_DISPLAY_EMAIL_TURN_ON) {
contactInfoFragmentView.createAudioCall();
} else {
contactInfoFragmentView.openDialog(CallVideoChatButtonsEnum.CALL, new ContactInfoFragmentView$onCreateView$1$17$1(contactInfoFragmentView));
}
}
public static final void onCreateView$lambda$53$lambda$28(ContactInfoFragmentView contactInfoFragmentView, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
if (contactInfoFragmentView.isZangiContact() || Constants.IS_DISPLAY_EMAIL_TURN_ON) {
contactInfoFragmentView.createVideoCall();
} else {
contactInfoFragmentView.openDialog(CallVideoChatButtonsEnum.VIDEO, new ContactInfoFragmentView$onCreateView$1$18$1(contactInfoFragmentView));
}
}
public static final void onCreateView$lambda$53$lambda$29(ContactInfoFragmentView contactInfoFragmentView, FragmentActivity fragmentActivity, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
kotlin.jvm.internal.k.f(fragmentActivity, "$activity");
if (!contactInfoFragmentView.isZangiContact() && !Constants.IS_DISPLAY_EMAIL_TURN_ON) {
contactInfoFragmentView.openDialog(CallVideoChatButtonsEnum.CHAT, new ContactInfoFragmentView$onCreateView$1$19$1(contactInfoFragmentView));
return;
}
if (((Boolean) bc.g.f((jb.g) null, new ContactInfoFragmentView$onCreateView$1$19$isEnable$1(null), 1, (Object) null)).booleanValue()) {
String str = contactInfoFragmentView.conversationJid;
boolean z = false;
if (!(str == null || str.length() == 0)) {
if (PremiumManager.INSTANCE.isPremium()) {
Conversation conversationItemByChat = StorageService.INSTANCE.getConversationItemByChat(contactInfoFragmentView.conversationJid);
if (conversationItemByChat != null && conversationItemByChat.getVisibilityStatus() == 1) {
z = true;
}
if (z) {
ConversationManager.INSTANCE.showEnterHideConversationPinDialog(contactInfoFragmentView.getContext(), (String) bc.g.f((jb.g) null, new ContactInfoFragmentView$onCreateView$1$19$passCode$1(null), 1, (Object) null), new ContactInfoFragmentView$onCreateView$1$19$2(contactInfoFragmentView, fragmentActivity), new ContactInfoFragmentView$onCreateView$1$19$3(contactInfoFragmentView));
return;
} else {
contactInfoFragmentView.createChat();
return;
}
}
Bundle bundle = new Bundle();
bundle.putInt("description_text", 2131887189);
Engine.getInstance().getScreenService().showFragment(PremiumOverInfoPage.class, bundle);
PassCodeController passCodeController = PassCodeController.INSTANCE;
ConversationVisibilityRepository conversationConfRepository = passCodeController.getConversationConfRepository();
if (conversationConfRepository != null) {
conversationConfRepository.setEnable(false);
}
ConversationVisibilityRepository conversationConfRepository2 = passCodeController.getConversationConfRepository();
if (conversationConfRepository2 != null) {
conversationConfRepository2.changeAllVisibilityStatus(0);
return;
}
return;
}
}
contactInfoFragmentView.createChat();
}
public static final void onCreateView$lambda$53$lambda$30(final ContactInfoFragmentView contactInfoFragmentView, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
if (Build.VERSION.SDK_INT >= 23) {
contactInfoFragmentView.showWhiteListPopUpIfNeeded(new WhiteListRequestCallBack() {
@Override
public void requestDone() {
ContactInfoFragmentView.this.zangiOut();
}
});
} else {
contactInfoFragmentView.zangiOut();
}
}
public static final void onCreateView$lambda$53$lambda$36(ContactInfoFragmentView contactInfoFragmentView, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
InfoAdditionalItem infoAdditionalItem = contactInfoFragmentView.inviteToZangiLayout;
kotlin.jvm.internal.k.c(infoAdditionalItem);
contactInfoFragmentView.onInviteToZangiClick(infoAdditionalItem);
}
public static final void onCreateView$lambda$53$lambda$37(ContactInfoFragmentView contactInfoFragmentView, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
contactInfoFragmentView.addToContactButtonAction();
}
public static final void onCreateView$lambda$53$lambda$38(ContactInfoFragmentView contactInfoFragmentView, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
contactInfoFragmentView.createGroup();
}
public static final void onCreateView$lambda$53$lambda$39(ContactInfoFragmentView contactInfoFragmentView, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
contactInfoFragmentView.addToFavorite();
}
public static final void onCreateView$lambda$53$lambda$40(ContactInfoFragmentView contactInfoFragmentView, FragmentActivity fragmentActivity, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
kotlin.jvm.internal.k.f(fragmentActivity, "$activity");
if (PremiumManager.INSTANCE.isPremium()) {
contactInfoFragmentView.conversationVisibilityClick();
} else {
contactInfoFragmentView.startActivity(new Intent((Context) fragmentActivity, (Class<?>) PremiumActivity.class));
}
}
private static final void onCreateView$lambda$53$lambda$41(ContactInfoFragmentView contactInfoFragmentView, FragmentActivity fragmentActivity, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
kotlin.jvm.internal.k.f(fragmentActivity, "$activity");
Conversation conversation = contactInfoFragmentView.currentConversation;
if (conversation == null) {
conversation = contactInfoFragmentView.muteConversation;
}
if (conversation != null && conversation.isStealthModeOn()) {
return;
}
if (PremiumManager.INSTANCE.isPremium()) {
ConversationManager.INSTANCE.showPreventCaptureModeCurrentDialog(conversation, fragmentActivity);
return;
}
if (conversation != null && conversation.isPreventCaptureModeOn()) {
ConversationManager.INSTANCE.preventCaptureModeOff(conversation, fragmentActivity);
} else {
ConversationManager.INSTANCE.showPreventCaptureOpenPremiumActivityDialog(fragmentActivity);
}
}
public static final void onCreateView$lambda$53$lambda$42(ContactInfoFragmentView contactInfoFragmentView, FragmentActivity fragmentActivity, View view) {
LinkedList contactNumbers;
ContactNumber contactNumber;
HashSet conversations;
LinkedList contactNumbers2;
ContactNumber contactNumber2;
HashSet conversations2;
LinkedList contactNumbers3;
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
kotlin.jvm.internal.k.f(fragmentActivity, "$activity");
Conversation conversation = contactInfoFragmentView.currentConversation;
if (conversation == null) {
conversation = contactInfoFragmentView.muteConversation;
}
if (conversation == null) {
Contact contact = contactInfoFragmentView.zangiContact;
if ((contact == null || (contactNumbers3 = contact.getContactNumbers()) == null || !(contactNumbers3.isEmpty() ^ true)) ? false : true) {
Contact contact2 = contactInfoFragmentView.zangiContact;
if ((contact2 == null || (contactNumbers2 = contact2.getContactNumbers()) == null || (contactNumber2 = (ContactNumber) contactNumbers2.get(0)) == null || (conversations2 = contactNumber2.getConversations()) == null || !(conversations2.isEmpty() ^ true)) ? false : true) {
Contact contact3 = contactInfoFragmentView.zangiContact;
conversation = (contact3 == null || (contactNumbers = contact3.getContactNumbers()) == null || (contactNumber = (ContactNumber) contactNumbers.get(0)) == null || (conversations = contactNumber.getConversations()) == null) ? null : (Conversation) gb.l.s(conversations);
}
}
}
Conversation conversation2 = conversation;
if (PremiumManager.INSTANCE.isPremium()) {
ConversationManager.showStealthModeCurrentDialog$default(ConversationManager.INSTANCE, conversation2, fragmentActivity, new ContactInfoFragmentView$onCreateView$1$30$1(contactInfoFragmentView), null, 8, null);
} else {
ConversationManager.INSTANCE.showStealthModeOpenPremiumActivityDialog(fragmentActivity);
}
}
public static final void onCreateView$lambda$53$lambda$43(ContactInfoFragmentView contactInfoFragmentView, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
contactInfoFragmentView.openSharedMedia();
}
public static final void onCreateView$lambda$53$lambda$44(ContactInfoFragmentView contactInfoFragmentView, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
contactInfoFragmentView.openChatBackgroundGallery();
}
public static final void onCreateView$lambda$53$lambda$45(ContactInfoFragmentView contactInfoFragmentView, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
Conversation conversation = contactInfoFragmentView.currentConversation;
if (conversation == null) {
conversation = contactInfoFragmentView.muteConversation;
}
contactInfoFragmentView.showMuteDialogList(conversation, contactInfoFragmentView.zangiRecentGroup);
}
public static final void onCreateView$lambda$53$lambda$46(ContactInfoFragmentView contactInfoFragmentView, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
contactInfoFragmentView.showNotificationDialog();
}
public static final void onCreateView$lambda$53$lambda$47(ContactInfoFragmentView contactInfoFragmentView, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
contactInfoFragmentView.blockContact();
}
public static final void onCreateView$lambda$53$lambda$51(final ContactInfoFragmentView contactInfoFragmentView) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
final String checkNotificationIsOn = contactInfoFragmentView.checkNotificationIsOn();
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
ContactInfoFragmentView.onCreateView$lambda$53$lambda$51$lambda$50(ContactInfoFragmentView.this, checkNotificationIsOn);
}
});
}
public static final void onCreateView$lambda$53$lambda$51$lambda$50(ContactInfoFragmentView contactInfoFragmentView, String str) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
kotlin.jvm.internal.k.f(str, "$text");
InfoAdditionalItem infoAdditionalItem = contactInfoFragmentView.notificationPreviewLayout;
if (infoAdditionalItem == null) {
return;
}
infoAdditionalItem.setDescription(str);
}
public static final void onCreateView$lambda$53$lambda$52(ContactInfoFragmentView contactInfoFragmentView) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
sInstance = new WeakReference<>(contactInfoFragmentView);
}
public static final void onCreateView$lambda$53$lambda$7$lambda$6(ContactInfoFragmentView contactInfoFragmentView) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
contactInfoFragmentView.openCordinatorLayout();
}
private final void onInviteToZangiClick(ILoadingView iLoadingView) {
InviteController.showInviteShareMessage$default(InviteController.INSTANCE, getFullNumbersFromContactNumbers(), getEmailsFromContactNumbers(), true, this, iLoadingView, (qb.l) null, (qb.l) null, 96, (Object) null);
}
public static final void onItemLongCkicked$lambda$116(ContactInfoFragmentView contactInfoFragmentView, String str, DialogInterface dialogInterface, int i) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
if (i == 0) {
Context context = contactInfoFragmentView.getContext();
ClipboardManager clipboardManager = (ClipboardManager) (context != null ? context.getSystemService("clipboard") : null);
ClipData newPlainText = ClipData.newPlainText("phone_number", str);
if (clipboardManager != null) {
clipboardManager.setPrimaryClip(newPlainText);
}
}
}
public static final void onResume$lambda$64(ContactInfoFragmentView contactInfoFragmentView) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
Conversation conversationItemByChat = StorageService.INSTANCE.getConversationItemByChat(contactInfoFragmentView.conversationJid);
NotificationCenter.INSTANCE.postNotificationName(NotificationCenter.NotificationType.CONVERSATION_VISIBILITY_CHANGE, conversationItemByChat != null ? Integer.valueOf(conversationItemByChat.getVisibilityStatus()) : null);
InfoAdditionalItem infoAdditionalItem = contactInfoFragmentView.makeChatVisibleLayout;
if (infoAdditionalItem != null) {
Context context = contactInfoFragmentView.getContext();
infoAdditionalItem.setNewTitle(context != null ? context.getString(contactInfoFragmentView.getConversationVisibilityTextResource()) : null);
}
}
private final void onlineStatusFunctionality(ArrayList<LastActivity> arrayList) {
DispatchKt.mainThread(new ContactInfoFragmentView$onlineStatusFunctionality$1(arrayList, this, getNumberList()));
}
private final void openChatBackgroundGallery() {
if (ZangiPermissionUtils.hasPermission(getActivity(), 1007, true, new ZangiPermissionUtils.OnPermissionResult() {
public final void onResult(ArrayList arrayList, boolean z) {
ContactInfoFragmentView.openChatBackgroundGallery$lambda$94(ContactInfoFragmentView.this, arrayList, z);
}
})) {
_openScreenChooseBackground();
}
}
public static final void openChatBackgroundGallery$lambda$94(ContactInfoFragmentView contactInfoFragmentView, ArrayList arrayList, boolean z) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
if (z) {
contactInfoFragmentView._openScreenChooseBackground();
}
}
private final void openCordinatorLayout() {
AppBarLayout appBarLayout = this.appBarLayout;
ViewGroup.LayoutParams layoutParams = appBarLayout != null ? appBarLayout.getLayoutParams() : null;
kotlin.jvm.internal.k.d(layoutParams, "null cannot be cast to non-null type androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams");
CoordinatorLayout.c f = ((CoordinatorLayout.f) layoutParams).f();
if (f != null) {
((AppBarLayout.Behavior) f).c(-getCOLLAPSING_TOOLAR_OFFSET_END());
}
}
private final void openDialog(CallVideoChatButtonsEnum callVideoChatButtonsEnum, final qb.a<fb.r> aVar) {
Resources resources;
Resources resources2;
Resources resources3;
final kotlin.jvm.internal.u uVar = new kotlin.jvm.internal.u();
Context context = getContext();
if (context == null) {
context = MainApplication.Companion.getMainContext();
}
kotlin.jvm.internal.k.e(context, "context ?: MainApplication.getMainContext()");
uVar.a = new ZangiNumberDialogUI(context);
int i = WhenMappings.$EnumSwitchMapping$0[callVideoChatButtonsEnum.ordinal()];
String str = null;
if (i == 1) {
TextView callTextView = ((ZangiNumberDialogUI) uVar.a).getCallTextView();
Context context2 = getContext();
if (context2 != null && (resources = context2.getResources()) != null) {
str = resources.getString(2131887546);
}
callTextView.setText(str);
} else if (i == 2) {
TextView callTextView2 = ((ZangiNumberDialogUI) uVar.a).getCallTextView();
Context context3 = getContext();
if (context3 != null && (resources2 = context3.getResources()) != null) {
str = resources2.getString(2131886177);
}
callTextView2.setText(str);
} else if (i == 3) {
TextView callTextView3 = ((ZangiNumberDialogUI) uVar.a).getCallTextView();
Context context4 = getContext();
if (context4 != null && (resources3 = context4.getResources()) != null) {
str = resources3.getString(2131886884);
}
callTextView3.setText(str);
}
final kotlin.jvm.internal.u uVar2 = new kotlin.jvm.internal.u();
Context context5 = getContext();
kotlin.jvm.internal.k.c(context5);
Dialog dialog = new Dialog(context5, 2131951922);
uVar2.a = dialog;
dialog.requestWindowFeature(1);
Window window = ((Dialog) uVar2.a).getWindow();
if (window != null) {
window.setBackgroundDrawableResource(R.color.transparent);
}
((Dialog) uVar2.a).setContentView((View) uVar.a, new FrameLayout.LayoutParams(-1, ExtensionsKt.getDp(380)));
((Dialog) uVar2.a).setCancelable(true);
((ZangiNumberDialogUI) uVar.a).getCancelTextView().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
ContactInfoFragmentView.openDialog$lambda$54(uVar2, view);
}
});
((ZangiNumberDialogUI) uVar.a).getSendConnectionLinkTextView().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
ContactInfoFragmentView.openDialog$lambda$55(ContactInfoFragmentView.this, view);
}
});
((ZangiNumberDialogUI) uVar.a).getCallTextView().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
ContactInfoFragmentView.openDialog$lambda$56(uVar2, uVar, this, aVar, view);
}
});
((Dialog) uVar2.a).show();
}
public static final void openDialog$lambda$54(kotlin.jvm.internal.u uVar, View view) {
kotlin.jvm.internal.k.f(uVar, "$dialog");
((Dialog) uVar.a).dismiss();
}
public static final void openDialog$lambda$55(ContactInfoFragmentView contactInfoFragmentView, View view) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
InfoAdditionalItem infoAdditionalItem = contactInfoFragmentView.inviteToZangiLayout;
kotlin.jvm.internal.k.c(infoAdditionalItem);
contactInfoFragmentView.onInviteToZangiClick(infoAdditionalItem);
}
public static final void openDialog$lambda$56(kotlin.jvm.internal.u uVar, kotlin.jvm.internal.u uVar2, ContactInfoFragmentView contactInfoFragmentView, qb.a aVar, View view) {
EditText numberEditText;
kotlin.jvm.internal.k.f(uVar, "$dialog");
kotlin.jvm.internal.k.f(uVar2, "$zangiNumberDialogUI");
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
kotlin.jvm.internal.k.f(aVar, "$dialogCallBack");
((Dialog) uVar.a).dismiss();
InfoNumberModel infoNumberModel = new InfoNumberModel();
infoNumberModel.setFullNumber(String.valueOf(ExtensionsKt.getTextWithoutDividerIfNeeded(((ZangiNumberDialogUI) uVar2.a).getFillOutEditText())));
infoNumberModel.setNumber(String.valueOf(ExtensionsKt.getTextWithoutDividerIfNeeded(((ZangiNumberDialogUI) uVar2.a).getFillOutEditText())));
infoNumberModel.setInternal(true);
infoNumberModel.setIdNumber(true);
EnterIdNumberView enterIdNumberView = contactInfoFragmentView.enterIdNumberView;
if (enterIdNumberView != null && (numberEditText = enterIdNumberView.getNumberEditText()) != null) {
ExtensionsKt.setTextWithDividerIfNeeded(numberEditText, infoNumberModel.getNumber());
}
contactInfoFragmentView.onIdNumberSaveClick(infoNumberModel, new ContactInfoFragmentView$openDialog$3$1(contactInfoFragmentView, uVar2, aVar));
}
private final void openSharedMedia() {
String zipCode = ZangiEngineUtils.getZipCode();
Contact contact = this.zangiContact;
if (contact != null) {
LinkedList contactNumbers = contact != null ? contact.getContactNumbers() : null;
kotlin.jvm.internal.k.c(contactNumbers);
wb.c k = wb.g.k(0, contactNumbers.size());
ArrayList arrayList = new ArrayList(gb.l.k(k, 10));
gb.a0 it = k.iterator();
while (it.hasNext()) {
int nextInt = it.nextInt();
Contact contact2 = this.zangiContact;
LinkedList contactNumbers2 = contact2 != null ? contact2.getContactNumbers() : null;
kotlin.jvm.internal.k.c(contactNumbers2);
arrayList.add(((ContactNumber) contactNumbers2.get(nextInt)).getNumber());
}
ArrayList arrayList2 = new ArrayList();
Iterator it2 = arrayList.iterator();
while (it2.hasNext()) {
String e164WithoutPlus = ZangiEngineUtils.getE164WithoutPlus((String) it2.next(), zipCode, false);
if (e164WithoutPlus != null) {
arrayList2.add(e164WithoutPlus);
}
}
String[] strArr = (String[]) arrayList2.toArray(new String[0]);
Intent intent = new Intent((Context) getActivity(), (Class<?>) SharedMediaActivity.class);
intent.putExtra(Constants.USER_PHONE_NUMBER_FOR_MEDIA, strArr);
startActivity(intent);
this.afterSharedMedia = true;
}
}
private final void refreshCallButtons(boolean r5) {
throw new UnsupportedOperationException("Method not decompiled: com.beint.project.screens.contacts.ContactInfoFragmentView.refreshCallButtons(boolean):void");
}
private final void refreshContactAvatar(boolean z, final Bitmap bitmap) {
if (bitmap == null) {
ImageView imageView = this.contactImage;
if (imageView != null) {
imageView.setScaleType(ImageView.ScaleType.CENTER);
}
ImageView imageView2 = this.contactImage;
if (imageView2 != null) {
imageView2.setImageResource(2131231336);
return;
}
return;
}
if (z) {
ImageView imageView3 = this.contactImage;
if (imageView3 != null) {
imageView3.setScaleType(ImageView.ScaleType.CENTER_CROP);
}
View view = this.collapsingToolbarTopBackground;
if (view != null) {
ExtensionsKt.show(view);
}
View view2 = this.collapsingToolbarBottomBackground;
if (view2 != null) {
ExtensionsKt.show(view2);
}
} else {
ImageView imageView4 = this.contactImage;
if (imageView4 != null) {
imageView4.setScaleType(ImageView.ScaleType.CENTER);
}
View view3 = this.collapsingToolbarTopBackground;
if (view3 != null) {
ExtensionsKt.hide(view3);
}
View view4 = this.collapsingToolbarBottomBackground;
if (view4 != null) {
ExtensionsKt.hide(view4);
}
}
MainApplication.Companion.getMainHandler().post(new Runnable() {
@Override
public final void run() {
ContactInfoFragmentView.refreshContactAvatar$lambda$88(ContactInfoFragmentView.this, bitmap);
}
});
}
public static final void refreshContactAvatar$lambda$88(ContactInfoFragmentView contactInfoFragmentView, Bitmap bitmap) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
ImageView imageView = contactInfoFragmentView.contactImage;
if (imageView != null) {
imageView.setImageBitmap(bitmap);
}
}
private final void refreshViewByContactInfo(Boolean bool) {
this.isRecentInfo = false;
InfoAdditionalItem infoAdditionalItem = this.createGroupLayout;
if (infoAdditionalItem != null) {
ExtensionsKt.hide(infoAdditionalItem);
}
View view = this.createGroupDivider;
if (view != null) {
ExtensionsKt.hide(view);
}
InfoAdditionalItem infoAdditionalItem2 = this.chatBackgroundLayout;
if (infoAdditionalItem2 != null) {
ExtensionsKt.hide(infoAdditionalItem2);
}
View view2 = this.chatBackgroundDivider;
if (view2 != null) {
ExtensionsKt.hide(view2);
}
InfoAdditionalItem infoAdditionalItem3 = this.stealthModeLayout;
if (infoAdditionalItem3 != null) {
ExtensionsKt.hide(infoAdditionalItem3);
}
View view3 = this.stealthModeDivider;
if (view3 != null) {
ExtensionsKt.hide(view3);
}
InfoAdditionalItem infoAdditionalItem4 = this.screenShotLayoutLayout;
if (infoAdditionalItem4 != null) {
ExtensionsKt.hide(infoAdditionalItem4);
}
View view4 = this.screenShotDivider;
if (view4 != null) {
ExtensionsKt.hide(view4);
}
InfoAdditionalItem infoAdditionalItem5 = this.notificationPreviewLayout;
if (infoAdditionalItem5 != null) {
ExtensionsKt.hide(infoAdditionalItem5);
}
View view5 = this.notificationPreviewDivider;
if (view5 != null) {
ExtensionsKt.hide(view5);
}
InfoAdditionalItem infoAdditionalItem6 = this.sharedMediaLayout;
if (infoAdditionalItem6 != null) {
ExtensionsKt.hide(infoAdditionalItem6);
}
View view6 = this.sharedMediaDivider;
if (view6 != null) {
ExtensionsKt.hide(view6);
}
LinearLayout linearLayout = this.blockContactLayout;
if (linearLayout != null) {
ExtensionsKt.hide(linearLayout);
}
View view7 = this.blockContactDivider;
if (view7 != null) {
ExtensionsKt.hide(view7);
}
InfoAdditionalItem infoAdditionalItem7 = this.addToFavoriteLayout;
if (infoAdditionalItem7 != null) {
ExtensionsKt.hide(infoAdditionalItem7);
}
View view8 = this.addToFavoriteDivider;
if (view8 != null) {
ExtensionsKt.hide(view8);
}
InfoAdditionalItem infoAdditionalItem8 = this.addToFavoriteLayout;
if (infoAdditionalItem8 != null) {
ExtensionsKt.hide(infoAdditionalItem8);
}
View view9 = this.addToFavoriteDivider;
if (view9 != null) {
ExtensionsKt.hide(view9);
}
InfoAdditionalItem infoAdditionalItem9 = this.inviteToZangiLayout;
if (infoAdditionalItem9 != null) {
ExtensionsKt.show(infoAdditionalItem9);
}
View view10 = this.inviteToZangiDivider;
if (view10 != null) {
ExtensionsKt.show(view10);
}
if (kotlin.jvm.internal.k.b(bool, Boolean.TRUE)) {
InfoAdditionalItem infoAdditionalItem10 = this.createNewContactLayout;
if (infoAdditionalItem10 != null) {
ExtensionsKt.hide(infoAdditionalItem10);
}
View view11 = this.createNewContactDivider;
if (view11 != null) {
ExtensionsKt.hide(view11);
return;
}
return;
}
InfoAdditionalItem infoAdditionalItem11 = this.createNewContactLayout;
if (infoAdditionalItem11 != null) {
ExtensionsKt.show(infoAdditionalItem11);
}
View view12 = this.createNewContactDivider;
if (view12 != null) {
ExtensionsKt.show(view12);
}
}
static void refreshViewByContactInfo$default(ContactInfoFragmentView contactInfoFragmentView, Boolean bool, int i, Object obj) {
if ((i & 1) != 0) {
bool = Boolean.FALSE;
}
contactInfoFragmentView.refreshViewByContactInfo(bool);
}
private final void registerBroadcastReceivers() {
if (this.contactListUpdateUIReceiver == null) {
this.contactListUpdateUIReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
InfoNumberAdapter infoNumberAdapter;
String str;
kotlin.jvm.internal.k.f(context, "arg0");
kotlin.jvm.internal.k.f(intent, "intent");
infoNumberAdapter = ContactInfoFragmentView.this.infoNumberAdapter;
boolean z = false;
if (infoNumberAdapter != null && infoNumberAdapter.isInEditMode()) {
z = true;
}
if (z) {
return;
}
str = ContactInfoFragmentView.this.TAG;
Log.i(str, "update -> 5");
ContactInfoFragmentView.this.contactListUpdated(intent);
}
};
}
NotificationCenter notificationCenter = NotificationCenter.INSTANCE;
notificationCenter.addObserver(this, NotificationCenter.NotificationType.UPDATE_RECENT_ITEM, new ContactInfoFragmentView$registerBroadcastReceivers$2(this));
notificationCenter.addObserver(this, NotificationCenter.NotificationType.STEALTH_MODE_CHANGED, new ContactInfoFragmentView$registerBroadcastReceivers$3(this));
notificationCenter.addObserver(this, NotificationCenter.NotificationType.PREVENT_CAPTURE_CHANGED, new ContactInfoFragmentView$registerBroadcastReceivers$4(this));
notificationCenter.addObserver(this, NotificationCenter.NotificationType.MUTE_CHANGED, new ContactInfoFragmentView$registerBroadcastReceivers$5(this));
notificationCenter.addObserver(this, NotificationCenter.NotificationType.CONTACT_CHANGED, new ContactInfoFragmentView$registerBroadcastReceivers$6(this));
notificationCenter.addObserver(this, NotificationCenter.NotificationType.INCOMING_SHARED_MEDIA_MESSAGE, new ContactInfoFragmentView$registerBroadcastReceivers$7(this));
new Thread(new Runnable() {
@Override
public final void run() {
ContactInfoFragmentView.registerBroadcastReceivers$lambda$87(ContactInfoFragmentView.this);
}
}).start();
}
public static final void registerBroadcastReceivers$lambda$87(ContactInfoFragmentView contactInfoFragmentView) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
FragmentActivity activity = contactInfoFragmentView.getActivity();
if (activity != null) {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("com.beint.project.updateContactListUI");
intentFilter.addAction("com.beint.project.updateContactAfterNativeChange");
intentFilter.addAction("com.beint.project.UPDATE_SINGLE_CONTACT_AVATAR");
activity.registerReceiver(contactInfoFragmentView.contactListUpdateUIReceiver, intentFilter);
}
}
private final void scrollToBottom() {
AppBarLayout appBarLayout = this.appBarLayout;
ViewGroup.LayoutParams layoutParams = appBarLayout != null ? appBarLayout.getLayoutParams() : null;
kotlin.jvm.internal.k.d(layoutParams, "null cannot be cast to non-null type androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams");
CoordinatorLayout.c f = ((CoordinatorLayout.f) layoutParams).f();
if (f != null) {
((AppBarLayout.Behavior) f).c(0);
}
}
private final void scrollToTop() {
AppBarLayout appBarLayout = this.appBarLayout;
if (appBarLayout != null) {
appBarLayout.setExpanded(false, true);
}
}
private final void sendRequestUserStatus() {
Contact contact = this.zangiContact;
if (contact == null && this.contactInfo == null) {
return;
}
List<ContactNumber> list = null;
if (contact == null) {
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
if (modelForContactInfoFragment != null) {
list = modelForContactInfoFragment.getNumbers();
}
} else if (contact != null) {
list = contact.getContactNumbers();
}
ArrayList arrayList = new ArrayList();
if (list != null) {
for (ContactNumber contactNumber : list) {
if (!TextUtils.isEmpty(contactNumber.getFullNumber())) {
String fullNumber = contactNumber.getFullNumber();
kotlin.jvm.internal.k.c(fullNumber);
arrayList.add(fullNumber);
}
}
}
MessagingService.INSTANCE.requestUsersOnlineStatuses(arrayList);
}
public final void setAdapterNumbers(java.util.List<? extends com.beint.project.core.model.contact.ContactNumber> r10) {
throw new UnsupportedOperationException("Method not decompiled: com.beint.project.screens.contacts.ContactInfoFragmentView.setAdapterNumbers(java.util.List):void");
}
private final void setCallButtonEneble(boolean z) {
Button button = this.callButtonLayout;
if (button != null) {
button.setEnabled(z);
}
Button button2 = this.videoCallButtonLayout;
if (button2 != null) {
button2.setEnabled(z);
}
Button button3 = this.chatButtonLayout;
if (button3 != null) {
button3.setEnabled(z);
}
Button button4 = this.zangiOutButtonLayout;
if (button4 == null) {
return;
}
button4.setEnabled(z);
}
public final void setTitleText(LinearLayout linearLayout, int i) {
View childAt = linearLayout.getChildAt(0);
if (childAt instanceof TextView) {
((TextView) childAt).setText(i);
}
}
private final void showAlert(boolean z) {
if (getContext() == null) {
return;
}
androidx.appcompat.app.c cVar = this.alert;
if (cVar != null) {
kotlin.jvm.internal.k.c(cVar);
if (cVar.isShowing()) {
return;
}
}
Context context = getContext();
kotlin.jvm.internal.k.c(context);
c.a aVar = new c.a(context, 2131951921);
aVar.d(true);
Context context2 = getContext();
kotlin.jvm.internal.k.c(context2);
String string = getString(2131887543);
kotlin.jvm.internal.k.e(string, "getString(R.string.this_…_is_not_in_your_contacts)");
AlertScreen alertScreen = new AlertScreen(context2, string, z);
alertScreen.setDelegate(this);
aVar.t(alertScreen);
androidx.appcompat.app.c a = aVar.a();
this.alert = a;
if (a != null) {
a.show();
}
}
private final void showBottomSheet(final ActionType actionType, String str, final NumbersBottomSheetAdapter numbersBottomSheetAdapter) {
BottomSheetMenu bottomSheetMenu = new BottomSheetMenu();
bottomSheetMenu.setOnItemClickListener(new BottomSheetClickListener() {
public final void onClick(int i) {
ContactInfoFragmentView.showBottomSheet$lambda$101(ContactInfoFragmentView.this, actionType, numbersBottomSheetAdapter, i);
}
});
bottomSheetMenu.setAdapter(numbersBottomSheetAdapter);
bottomSheetMenu.setTitle(str);
if (getActivity() != null) {
FragmentActivity activity = getActivity();
kotlin.jvm.internal.k.c(activity);
if (activity.isFinishing()) {
return;
}
FragmentActivity activity2 = getActivity();
kotlin.jvm.internal.k.c(activity2);
bottomSheetMenu.show(activity2.getSupportFragmentManager(), "Numbers Bottom Sheet");
}
}
public static final void showBottomSheet$lambda$101(ContactInfoFragmentView contactInfoFragmentView, ActionType actionType, NumbersBottomSheetAdapter numbersBottomSheetAdapter, int i) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
kotlin.jvm.internal.k.f(actionType, "$callType");
kotlin.jvm.internal.k.f(numbersBottomSheetAdapter, "$adapter");
contactInfoFragmentView.buttonSheetAction(actionType, ((ContactNumber) numbersBottomSheetAdapter.getZangiNumbers().get(i)).getNumber(), ((ContactNumber) numbersBottomSheetAdapter.getZangiNumbers().get(i)).getEmail());
}
private final void showEnterInternalNumberView() {
EnterIdNumberView enterIdNumberView = this.enterIdNumberView;
if (enterIdNumberView != null) {
enterIdNumberView.setVisibility(0);
}
View view = this.enterInternalNumberDevider;
if (view != null) {
view.setVisibility(0);
}
TextView textView = this.enterInternalNumberBottomTextView;
if (textView != null) {
textView.setVisibility(0);
}
EnterIdNumberView enterIdNumberView2 = this.enterIdNumberView;
if (enterIdNumberView2 != null) {
enterIdNumberView2.getFocus();
}
AppBarLayout appBarLayout = this.appBarLayout;
if (appBarLayout != null) {
appBarLayout.setExpanded(false);
}
}
public final void showKeyPad(final View view, final boolean z) {
FragmentActivity activity;
Window window;
Window window2;
WindowManager.LayoutParams attributes;
if (view == null) {
return;
}
FragmentActivity activity2 = getActivity();
if (((activity2 == null || (window2 = activity2.getWindow()) == null || (attributes = window2.getAttributes()) == null || attributes.softInputMode != 3) ? false : true) && (activity = getActivity()) != null && (window = activity.getWindow()) != null) {
window.setSoftInputMode(5);
}
FragmentActivity activity3 = getActivity();
final InputMethodManager inputMethodManager = (InputMethodManager) (activity3 != null ? activity3.getSystemService("input_method") : null);
view.postDelayed(new Runnable() {
@Override
public final void run() {
ContactInfoFragmentView.showKeyPad$lambda$119(z, view, inputMethodManager);
}
}, 100L);
if (inputMethodManager != null) {
inputMethodManager.showSoftInput(view, 0);
}
}
public static final void showKeyPad$lambda$119(boolean z, View view, InputMethodManager inputMethodManager) {
if (z) {
view.requestFocus();
}
if (view instanceof EditText) {
EditText editText = (EditText) view;
editText.setSelection(editText.getText().length());
}
if (inputMethodManager != null) {
inputMethodManager.showSoftInput(view, 1);
}
}
private final void showNotificationDialog() {
AlertDialogUtils.showDialogList(getContext(), new Object(), AlertObject.FOR_WHICH_DIALOG_ENUM.NOTIFICATION_PREVIEW, new ContactInfoFragmentView$showNotificationDialog$1(this));
}
public final void startChat() {
Contact contact = this.zangiContact;
if (contact == null) {
if (this.contactInfo == null) {
return;
}
contact = new Contact();
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
kotlin.jvm.internal.k.c(modelForContactInfoFragment);
contact.addContactNumbers(modelForContactInfoFragment.getNumbers());
ModelForContactInfoFragment modelForContactInfoFragment2 = this.contactInfo;
kotlin.jvm.internal.k.c(modelForContactInfoFragment2);
contact.setIdentifire(modelForContactInfoFragment2.getIdentifier());
}
Contact contact2 = contact;
List onlyZangiNumbersList = contact2.getOnlyZangiNumbersList();
List list = onlyZangiNumbersList;
if (list == null || list.isEmpty()) {
return;
}
if (onlyZangiNumbersList.size() != 1) {
NumbersBottomSheetAdapter numbersBottomSheetAdapter = new NumbersBottomSheetAdapter(getActivity(), contact2, NumbersBottomSheetAdapter.LOAD_TYPE.ALL, true, false);
ActionType actionType = ActionType.MESSAGE;
CharSequence text = getResources().getText(2131886884);
kotlin.jvm.internal.k.d(text, "null cannot be cast to non-null type kotlin.String");
showBottomSheet(actionType, (String) text, numbersBottomSheetAdapter);
return;
}
if (this.currentConversation != null) {
FragmentActivity activity = getActivity();
if (activity != null) {
activity.onBackPressed();
return;
}
return;
}
if (ZangiEngineUtils.isShortNumber(((ContactNumber) onlyZangiNumbersList.get(0)).getNumber())) {
startConversation(((ContactNumber) onlyZangiNumbersList.get(0)).getNumber(), false, true);
return;
}
if (HomeActivity.getInstance() != null) {
startConversation(ZangiEngineUtils.getNumberFromJidWithPlus(ZangiEngineUtils.getNumberFromJidWithPlus(((ContactNumber) onlyZangiNumbersList.get(0)).getFullNumber())), false, true);
return;
}
Bundle bundle = new Bundle();
bundle.putSerializable("com.beint.project.NAVIGATION_TYPE", ActivityNavigation.SHOW_CHAT);
bundle.putInt("com.beint.project.CURRENT_TAB_POSITION", 0);
bundle.putString("com.beint.project.c_jid", ZangiEngineUtils.getNumberFromJidWithPlus(ZangiEngineUtils.getNumberFromJidWithPlus(((ContactNumber) onlyZangiNumbersList.get(0)).getFullNumber())));
Intent intent = new Intent();
intent.putExtras(bundle);
Engine.getInstance().getScreenService().getArguments().putInt("com.beint.project.CURRENT_TAB_POSITION", 0);
Engine.getInstance().getScreenService().showFragment(HomeActivity.class, intent, (Activity) null, Boolean.FALSE);
}
private static final void startChat$lambda$100(ContactInfoFragmentView contactInfoFragmentView, DialogInterface dialogInterface, int i) {
ContactNumber firstContactNumber;
LinkedList contactNumbers;
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
dialogInterface.cancel();
Contact contact = contactInfoFragmentView.zangiContact;
boolean z = false;
if (contact != null && (contactNumbers = contact.getContactNumbers()) != null && contactNumbers.size() == 1) {
z = true;
}
if (z) {
Contact contact2 = contactInfoFragmentView.zangiContact;
contactInfoFragmentView.startConversation((contact2 == null || (firstContactNumber = contact2.getFirstContactNumber()) == null) ? null : firstContactNumber.getFullNumber(), true, true);
return;
}
NumbersBottomSheetAdapter numbersBottomSheetAdapter = new NumbersBottomSheetAdapter(contactInfoFragmentView.getActivity(), contactInfoFragmentView.zangiContact, NumbersBottomSheetAdapter.LOAD_TYPE.ALL, true, false);
ActionType actionType = ActionType.MESSAGE;
CharSequence text = contactInfoFragmentView.getResources().getText(2131886884);
kotlin.jvm.internal.k.d(text, "null cannot be cast to non-null type kotlin.String");
contactInfoFragmentView.showBottomSheet(actionType, (String) text, numbersBottomSheetAdapter);
}
private final void unRegisterBroadcastReceivers() {
if (getActivity() == null) {
return;
}
if (this.contactListUpdateUIReceiver != null) {
FragmentActivity activity = getActivity();
kotlin.jvm.internal.k.c(activity);
activity.unregisterReceiver(this.contactListUpdateUIReceiver);
this.contactListUpdateUIReceiver = null;
}
NotificationCenter.INSTANCE.removeObserver(this);
}
private final void updateEnterInternalNumberViewVisibility(boolean z) {
if (z) {
hideEnterInternalNumberView();
} else {
showEnterInternalNumberView();
}
}
private final void updateFunctionalButtons(boolean r3) {
throw new UnsupportedOperationException("Method not decompiled: com.beint.project.screens.contacts.ContactInfoFragmentView.updateFunctionalButtons(boolean):void");
}
private final void updateNumberList(Object obj) {
ArrayList<fb.k<String, String>> arrayList;
if (obj instanceof Contact) {
this.allNumbersArray = new ArrayList<>();
Iterator it = ((Contact) obj).getContactNumbers().iterator();
while (it.hasNext()) {
ContactNumber contactNumber = (ContactNumber) it.next();
if (contactNumber.getNumber() != null && (arrayList = this.allNumbersArray) != null) {
String number = contactNumber.getNumber();
if (number == null) {
number = "";
}
String email = contactNumber.getEmail();
arrayList.add(new fb.k<>(number, email != null ? email : ""));
}
}
}
}
private final void updateOptionsMenu() {
MenuItem findItem;
Contact contact = this.zangiContact;
if (contact != null) {
kotlin.jvm.internal.k.c(contact);
if (kotlin.jvm.internal.k.b(contact.getIdentifire(), "")) {
Menu menu = this.menu;
MenuItem findItem2 = menu != null ? menu.findItem(2131362484) : null;
if (findItem2 != null) {
findItem2.setVisible(false);
}
Menu menu2 = this.menu;
MenuItem findItem3 = menu2 != null ? menu2.findItem(2131363399) : null;
if (findItem3 != null) {
findItem3.setVisible(true);
}
Menu menu3 = this.menu;
MenuItem findItem4 = menu3 != null ? menu3.findItem(2131362434) : null;
if (findItem4 != null) {
findItem4.setVisible(false);
}
Menu menu4 = this.menu;
findItem = menu4 != null ? menu4.findItem(2131362484) : null;
if (findItem == null) {
return;
}
findItem.setVisible(false);
return;
}
}
if (getContactForCheck() == null) {
Menu menu5 = this.menu;
MenuItem findItem5 = menu5 != null ? menu5.findItem(2131362484) : null;
if (findItem5 != null) {
findItem5.setVisible(false);
}
Menu menu6 = this.menu;
MenuItem findItem6 = menu6 != null ? menu6.findItem(2131363399) : null;
if (findItem6 != null) {
findItem6.setVisible(true);
}
Menu menu7 = this.menu;
findItem = menu7 != null ? menu7.findItem(2131362434) : null;
if (findItem == null) {
return;
}
findItem.setVisible(false);
return;
}
Menu menu8 = this.menu;
MenuItem findItem7 = menu8 != null ? menu8.findItem(2131362484) : null;
if (findItem7 != null) {
Contact contactForCheck = getContactForCheck();
findItem7.setVisible(contactForCheck != null ? contactForCheck.isFavorite() : false);
}
Menu menu9 = this.menu;
MenuItem findItem8 = menu9 != null ? menu9.findItem(2131363399) : null;
if (findItem8 != null) {
findItem8.setVisible(false);
}
Menu menu10 = this.menu;
findItem = menu10 != null ? menu10.findItem(2131362434) : null;
if (findItem == null) {
return;
}
findItem.setVisible(true);
}
public final void updateRecentCallList() {
if (this.zangiRecentGroup != null) {
ArrayList<ZangiRecent> arrayList = this.recentCallsList;
if (arrayList != null) {
arrayList.clear();
}
ZangiRecentGroup zangiRecentGroup = this.zangiRecentGroup;
kotlin.jvm.internal.k.c(zangiRecentGroup);
for (ZangiRecent zangiRecent : zangiRecentGroup.getZangiRecentList()) {
if (zangiRecent.getEndTime() == 0 && zangiRecent.getStatus() == RecentStatus.OUTGOING) {
zangiRecent.setStatus(RecentStatus.CANCELED);
}
if (zangiRecent.getStatus() == RecentStatus.OUTGOING || zangiRecent.getStatus() == RecentStatus.CANCELED || zangiRecent.getStatus() == RecentStatus.CALL_OUT) {
ArrayList<ZangiRecent> arrayList2 = this.recentCallsList;
if (arrayList2 != null) {
arrayList2.add(zangiRecent);
}
} else if (zangiRecent.getStatus() == RecentStatus.INCOMING || zangiRecent.getStatus() == RecentStatus.MISSED || zangiRecent.getStatus() == RecentStatus.CALLBACK) {
ArrayList<ZangiRecent> arrayList3 = this.recentCallsList;
if (arrayList3 != null) {
arrayList3.add(zangiRecent);
}
}
}
}
}
private final void updateViaContactInfo() {
boolean z;
String str;
SimpleTextView simpleTextView;
ModelForContactInfoFragment modelForContactInfoFragment;
ContactList contactList = ContactList.INSTANCE;
ModelForContactInfoFragment modelForContactInfoFragment2 = this.contactInfo;
String displayNumber = modelForContactInfoFragment2 != null ? modelForContactInfoFragment2.getDisplayNumber() : null;
ModelForContactInfoFragment modelForContactInfoFragment3 = this.contactInfo;
refreshViewByContactInfo(Boolean.valueOf(contactList.getContactByFullNumberOrEmail(displayNumber, modelForContactInfoFragment3 != null ? modelForContactInfoFragment3.getEmail() : null) != null));
ModelForContactInfoFragment modelForContactInfoFragment4 = this.contactInfo;
if ((modelForContactInfoFragment4 != null ? modelForContactInfoFragment4.getNumbers() : null) != null) {
ModelForContactInfoFragment modelForContactInfoFragment5 = this.contactInfo;
List numbers = modelForContactInfoFragment5 != null ? modelForContactInfoFragment5.getNumbers() : null;
kotlin.jvm.internal.k.c(numbers);
Iterator it = numbers.iterator();
z = false;
while (it.hasNext()) {
if (((ContactNumber) it.next()).isZangi() == 1) {
z = true;
}
}
} else {
z = false;
}
ModelForContactInfoFragment modelForContactInfoFragment6 = this.contactInfo;
ContactNumber contactNumber$default = IStorageService.DefaultImpls.getContactNumber$default(StorageService.INSTANCE, ZangiEngineUtils.getE164WithoutPlus(modelForContactInfoFragment6 != null ? modelForContactInfoFragment6.getDisplayNumber() : null, ZangiEngineUtils.getZipCode(), false), (String) null, 2, (Object) null);
if (contactNumber$default != null) {
ModelForContactInfoFragment modelForContactInfoFragment7 = this.contactInfo;
contactNumber$default.setNumber(modelForContactInfoFragment7 != null ? modelForContactInfoFragment7.getDisplayNumber() : null);
}
ZangiProfileServiceImpl zangiProfileServiceImpl = ZangiProfileServiceImpl.getInstance();
ModelForContactInfoFragment modelForContactInfoFragment8 = this.contactInfo;
Profile userProfile = zangiProfileServiceImpl.getUserProfile(modelForContactInfoFragment8 != null ? modelForContactInfoFragment8.getDisplayNumber() : null);
if (userProfile != null && (modelForContactInfoFragment = this.contactInfo) != null) {
modelForContactInfoFragment.setFullName(userProfile.getFirstName());
}
ModelForContactInfoFragment modelForContactInfoFragment9 = this.contactInfo;
if ((modelForContactInfoFragment9 != null ? modelForContactInfoFragment9.getNumbers() : null) != null) {
ModelForContactInfoFragment modelForContactInfoFragment10 = this.contactInfo;
if (modelForContactInfoFragment10 == null || (str = modelForContactInfoFragment10.getDisplayName()) == null) {
str = "";
}
if (!TextUtils.isEmpty(str) && (simpleTextView = this.contactName) != null) {
simpleTextView.setText(str);
}
Contact contact = new Contact();
ModelForContactInfoFragment modelForContactInfoFragment11 = this.contactInfo;
contact.addContactNumbers(modelForContactInfoFragment11 != null ? modelForContactInfoFragment11.getNumbers() : null);
View view = this.contactListDivider;
if (view != null) {
ExtensionsKt.show(view);
}
ModelForContactInfoFragment modelForContactInfoFragment12 = this.contactInfo;
createAdapter(modelForContactInfoFragment12 != null ? modelForContactInfoFragment12.getNumbers() : null);
updateNumberList(contact);
}
refreshCallButtons(z);
if (z) {
InfoAdditionalItem infoAdditionalItem = this.inviteToZangiLayout;
if (infoAdditionalItem != null) {
ExtensionsKt.hide(infoAdditionalItem);
}
View view2 = this.inviteToZangiDivider;
if (view2 != null) {
ExtensionsKt.hide(view2);
}
}
}
private final void updateViaRecent() {
ZangiRecentGroup zangiRecentGroup = this.zangiRecentGroup;
if (zangiRecentGroup != null) {
this.zangiContact = new Contact();
ArrayList arrayList = new ArrayList();
String e164WithoutPlus = ZangiEngineUtils.getE164WithoutPlus(zangiRecentGroup.getDisplayNumber(), ZangiEngineUtils.getZipCode(), false);
if (e164WithoutPlus == null) {
e164WithoutPlus = zangiRecentGroup.getDisplayNumber();
}
ContactNumber contactNumber$default = IStorageService.DefaultImpls.getContactNumber$default(StorageService.INSTANCE, e164WithoutPlus, (String) null, 2, (Object) null);
if (contactNumber$default == null) {
if (zangiRecentGroup.isConferenceCall().booleanValue()) {
contactNumber$default = new ContactNumber();
contactNumber$default.setLabel(getString(2131887567));
contactNumber$default.setNumber(zangiRecentGroup.getDisplayNumber());
contactNumber$default.setFullNumber(zangiRecentGroup.getE164NumberOrConferenceId());
contactNumber$default.setEmail(zangiRecentGroup.getDisplayEmail());
} else {
contactNumber$default = ContactNumberDao.INSTANCE.createContactNumberIfNeeded(e164WithoutPlus, zangiRecentGroup.getDisplayEmail());
}
}
Profile userProfile = ZangiProfileServiceImpl.getInstance().getUserProfile(zangiRecentGroup.getDisplayNumber());
String displayNumber = (TextUtils.isEmpty(zangiRecentGroup.getDisplayEmail()) || !Constants.IS_DISPLAY_EMAIL_TURN_ON) ? zangiRecentGroup.getDisplayNumber() : zangiRecentGroup.getDisplayEmail();
if (userProfile != null) {
Contact contact = this.zangiContact;
if (contact != null) {
contact.setFirstName(userProfile.getFirstName());
}
Contact contact2 = this.zangiContact;
if (contact2 != null) {
contact2.setLastName(userProfile.getLastName());
}
}
Contact firstContact = contactNumber$default.getFirstContact();
if (firstContact != null) {
Contact contact3 = this.zangiContact;
if (contact3 != null) {
contact3.setFirstName(firstContact.getFirstName());
}
Contact contact4 = this.zangiContact;
if (contact4 != null) {
contact4.setLastName(firstContact.getLastName());
}
Contact contact5 = this.zangiContact;
if (contact5 != null) {
contact5.setIdentifire(firstContact.getIdentifire());
}
} else {
Contact contact6 = this.zangiContact;
if (contact6 != null) {
contact6.setIdentifire("");
}
}
Contact contact7 = this.zangiContact;
if (!TextUtils.isEmpty(contact7 != null ? contact7.getFirstName() : null)) {
Contact contact8 = this.zangiContact;
displayNumber = contact8 != null ? contact8.getFirstName() : null;
}
Contact contact9 = this.zangiContact;
if (!TextUtils.isEmpty(contact9 != null ? contact9.getLastName() : null)) {
Contact contact10 = this.zangiContact;
if (TextUtils.isEmpty(contact10 != null ? contact10.getFirstName() : null)) {
Contact contact11 = this.zangiContact;
displayNumber = contact11 != null ? contact11.getLastName() : null;
} else {
StringBuilder sb = new StringBuilder();
Contact contact12 = this.zangiContact;
sb.append(contact12 != null ? contact12.getFirstName() : null);
sb.append(' ');
Contact contact13 = this.zangiContact;
sb.append(contact13 != null ? contact13.getLastName() : null);
displayNumber = sb.toString();
}
}
Contact contact14 = this.zangiContact;
if (contact14 != null) {
contact14.setPpUriSuffix(e164WithoutPlus);
}
Contact contact15 = this.zangiContact;
if (contact15 != null) {
contact15.setDisplayNumber(displayNumber);
}
if (zangiRecentGroup.getDisplayEmail() != null && !kotlin.jvm.internal.k.b(zangiRecentGroup.getDisplayEmail(), "")) {
if (ZangiFileUtils.isNumeric(displayNumber != null ? zb.f.p(displayNumber, "+", "", false, 4, (Object) null) : null)) {
if (TextUtils.isEmpty(userProfile != null ? userProfile.getDisplayName() : null) && Constants.IS_DISPLAY_EMAIL_TURN_ON) {
displayNumber = zangiRecentGroup.getDisplayEmail();
}
}
}
SimpleTextView simpleTextView = this.contactName;
if (simpleTextView != null) {
simpleTextView.setText(displayNumber);
}
if (firstContact == null || firstContact.isFavorite()) {
InfoAdditionalItem infoAdditionalItem = this.addToFavoriteLayout;
if (infoAdditionalItem != null) {
ExtensionsKt.hide(infoAdditionalItem);
}
View view = this.addToFavoriteDivider;
if (view != null) {
ExtensionsKt.hide(view);
}
} else {
InfoAdditionalItem infoAdditionalItem2 = this.addToFavoriteLayout;
if (infoAdditionalItem2 != null) {
ExtensionsKt.show(infoAdditionalItem2);
}
View view2 = this.addToFavoriteDivider;
if (view2 != null) {
ExtensionsKt.show(view2);
}
}
arrayList.add(contactNumber$default);
Contact contact16 = this.zangiContact;
if (contact16 != null) {
contact16.addContactNumbers(arrayList);
}
ArrayList arrayList2 = new ArrayList();
arrayList2.add(contactNumber$default);
createAdapter(arrayList2);
View view3 = this.contactListDivider;
if (view3 != null) {
ExtensionsKt.show(view3);
}
}
}
private final void updateViaZangiContact() {
throw new UnsupportedOperationException("Method not decompiled: com.beint.project.screens.contacts.ContactInfoFragmentView.updateViaZangiContact():void");
}
public static final void updateView$lambda$77(final kotlin.jvm.internal.u uVar, Conversation conversation, final ContactInfoFragmentView contactInfoFragmentView) {
FragmentActivity activity;
kotlin.jvm.internal.k.f(uVar, "$mute");
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
uVar.a = ZangiMuteService.getInstance().getMute(conversation);
FragmentActivity activity2 = contactInfoFragmentView.getActivity();
if (activity2 == null || activity2.isFinishing() || !contactInfoFragmentView.isAdded() || (activity = contactInfoFragmentView.getActivity()) == null) {
return;
}
activity.runOnUiThread(new Runnable() {
@Override
public final void run() {
ContactInfoFragmentView.updateView$lambda$77$lambda$76$lambda$75(uVar, contactInfoFragmentView);
}
});
}
public static final void updateView$lambda$77$lambda$76$lambda$75(kotlin.jvm.internal.u uVar, ContactInfoFragmentView contactInfoFragmentView) {
kotlin.jvm.internal.k.f(uVar, "$mute");
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
Object obj = uVar.a;
if (obj != null) {
kotlin.jvm.internal.k.c(obj);
Mute.MuteType muteType = ((Mute) obj).getMuteType();
Object obj2 = uVar.a;
kotlin.jvm.internal.k.c(obj2);
contactInfoFragmentView.formatMuteTillText(muteType, Long.valueOf(((Mute) obj2).getWhenMuteEnding()), contactInfoFragmentView.notificationLayout, true);
}
}
public static final void updateView$lambda$80(final ContactInfoFragmentView contactInfoFragmentView, ModelForContactInfoFragment modelForContactInfoFragment) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
if (contactInfoFragmentView.getContext() != null) {
Contact contact = contactInfoFragmentView.zangiContact;
if (contact != null) {
if (!kotlin.jvm.internal.k.b(contact != null ? contact.getIdentifire() : null, "")) {
fb.o contactAvatar = ContactsManagerHelper.INSTANCE.getContactAvatar(contactInfoFragmentView.zangiContact, contactInfoFragmentView.getCONTACT_IMAGE_HEIGHT(), contactInfoFragmentView.CONTACT_TILE_AVATAR_SIZE);
contactInfoFragmentView.avatarBitmap = (Bitmap) contactAvatar.a();
Boolean bool = (Boolean) contactAvatar.b();
contactInfoFragmentView.isAvatarImage = bool != null ? bool.booleanValue() : false;
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
ContactInfoFragmentView.updateView$lambda$80$lambda$79$lambda$78(ContactInfoFragmentView.this);
}
});
}
}
ZangiRecentGroup zangiRecentGroup = contactInfoFragmentView.zangiRecentGroup;
if (zangiRecentGroup != null) {
fb.o contactAvatar2 = ContactsManagerHelper.INSTANCE.getContactAvatar(zangiRecentGroup, contactInfoFragmentView.getCONTACT_IMAGE_HEIGHT(), contactInfoFragmentView.CONTACT_TILE_AVATAR_SIZE);
contactInfoFragmentView.avatarBitmap = (Bitmap) contactAvatar2.a();
Boolean bool2 = (Boolean) contactAvatar2.b();
contactInfoFragmentView.isAvatarImage = bool2 != null ? bool2.booleanValue() : false;
} else if (modelForContactInfoFragment != null) {
fb.o contactAvatar3 = ContactsManagerHelper.INSTANCE.getContactAvatar(modelForContactInfoFragment, contactInfoFragmentView.getCONTACT_IMAGE_HEIGHT(), contactInfoFragmentView.CONTACT_TILE_AVATAR_SIZE);
contactInfoFragmentView.avatarBitmap = (Bitmap) contactAvatar3.a();
Boolean bool3 = (Boolean) contactAvatar3.b();
contactInfoFragmentView.isAvatarImage = bool3 != null ? bool3.booleanValue() : false;
}
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
ContactInfoFragmentView.updateView$lambda$80$lambda$79$lambda$78(ContactInfoFragmentView.this);
}
});
}
}
public static final void updateView$lambda$80$lambda$79$lambda$78(ContactInfoFragmentView contactInfoFragmentView) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
contactInfoFragmentView.refreshContactAvatar(contactInfoFragmentView.isAvatarImage, contactInfoFragmentView.avatarBitmap);
}
public static final void updateView$lambda$83(final ContactInfoFragmentView contactInfoFragmentView, ModelForContactInfoFragment modelForContactInfoFragment) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
if (contactInfoFragmentView.getContext() != null) {
ZangiRecentGroup zangiRecentGroup = contactInfoFragmentView.zangiRecentGroup;
if (zangiRecentGroup != null) {
fb.o contactAvatar = ContactsManagerHelper.INSTANCE.getContactAvatar(zangiRecentGroup, contactInfoFragmentView.getCONTACT_IMAGE_HEIGHT(), contactInfoFragmentView.CONTACT_TILE_AVATAR_SIZE);
contactInfoFragmentView.avatarBitmap = (Bitmap) contactAvatar.a();
Boolean bool = (Boolean) contactAvatar.b();
contactInfoFragmentView.isAvatarImage = bool != null ? bool.booleanValue() : false;
} else if (modelForContactInfoFragment != null) {
fb.o contactAvatar2 = ContactsManagerHelper.INSTANCE.getContactAvatar(modelForContactInfoFragment, contactInfoFragmentView.getCONTACT_IMAGE_HEIGHT(), contactInfoFragmentView.CONTACT_TILE_AVATAR_SIZE);
contactInfoFragmentView.avatarBitmap = (Bitmap) contactAvatar2.a();
Boolean bool2 = (Boolean) contactAvatar2.b();
contactInfoFragmentView.isAvatarImage = bool2 != null ? bool2.booleanValue() : false;
}
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
ContactInfoFragmentView.updateView$lambda$83$lambda$82$lambda$81(ContactInfoFragmentView.this);
}
});
}
}
public static final void updateView$lambda$83$lambda$82$lambda$81(ContactInfoFragmentView contactInfoFragmentView) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
contactInfoFragmentView.refreshContactAvatar(contactInfoFragmentView.isAvatarImage, contactInfoFragmentView.avatarBitmap);
}
public final void videoCall() {
if (ZangiPermissionUtils.hasPermission(getActivity(), 1009, true, new ZangiPermissionUtils.OnPermissionResult() {
public final void onResult(ArrayList arrayList, boolean z) {
ContactInfoFragmentView.videoCall$lambda$98(ContactInfoFragmentView.this, arrayList, z);
}
})) {
_videoCall();
}
}
public static final void videoCall$lambda$98(ContactInfoFragmentView contactInfoFragmentView, ArrayList arrayList, boolean z) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
if (z) {
contactInfoFragmentView._videoCall();
}
}
public final void zangiOut() {
if (ZangiPermissionUtils.hasPermission(getActivity(), 1001, true, new ZangiPermissionUtils.OnPermissionResult() {
public final void onResult(ArrayList arrayList, boolean z) {
ContactInfoFragmentView.zangiOut$lambda$97(ContactInfoFragmentView.this, arrayList, z);
}
})) {
_zangiOut();
}
}
public static final void zangiOut$lambda$97(ContactInfoFragmentView contactInfoFragmentView, ArrayList arrayList, boolean z) {
kotlin.jvm.internal.k.f(contactInfoFragmentView, "this$0");
if (z) {
contactInfoFragmentView._zangiOut();
}
}
public final void actionRegistrationEvent(RegistrationEventArgs registrationEventArgs) {
kotlin.jvm.internal.k.f(registrationEventArgs, "args");
this.isContactEdited = true;
try {
Log.i(this.TAG, "Main Signal Receive " + registrationEventArgs.getEventType() + "!!!!!!!!!!");
Contact contact = this.zangiContact;
if (contact != null) {
kotlin.jvm.internal.k.d(contact, "null cannot be cast to non-null type com.beint.project.core.model.contact.Contact");
RegistrationEventTypes eventType = registrationEventArgs.getEventType();
if ((eventType == null ? -1 : WhenMappings.$EnumSwitchMapping$2[eventType.ordinal()]) == 1 && (!contact.getContactNumbers().isEmpty())) {
sendRequestUserStatus();
}
}
} catch (Exception e) {
Log.i(this.TAG, "mSignallingBroadcastReceiver exception message " + e.getMessage() + "!!!!!!!!!!");
}
}
public final void callBack(String str) {
kotlin.jvm.internal.k.f(str, "zangiNumber");
if (BlockContactServiceImpl.getInstance().getZangiBlockNumber(str) != null) {
CallHelper.blockedContactCallOrSendMessageAlert(getActivity(), str, new ConversationView.blockNumberCallback() {
@Override
public void callback(boolean r3) {
throw new UnsupportedOperationException("Method not decompiled: com.beint.project.screens.contacts.ContactInfoFragmentView$callBack$1.callback(boolean):void");
}
});
return;
}
createProgressBar();
showCallBackProgress(this.progressLayout, this.parentLayoutR, this.progressBar);
if (makeCallBack(str, this.progressLayout, getView())) {
return;
}
hideCallBackProgress();
}
public final boolean checkNumberRequestResponse(Object obj) {
CheckNumbersResponse checkNumbersResponse = new CheckNumbersResponse(obj instanceof List ? (List) obj : null);
if (checkNumbersResponse.getNumbers().size() == 0) {
return false;
}
Iterator it = checkNumbersResponse.getNumbers().iterator();
while (it.hasNext()) {
if (!((CheckNumbersObjectResponse) it.next()).getRegistered()) {
return false;
}
}
return true;
}
@Override
public void clcickCreateNewConatc() {
addToContactButtonAction();
androidx.appcompat.app.c cVar = this.alert;
if (cVar != null) {
cVar.dismiss();
}
}
@Override
public void clcikAddToExistingContact() {
String displayNumber;
ModelForContactInfoFragment modelForContactInfoFragment;
String email;
ZangiRecentGroup zangiRecentGroup;
Intent intent = new Intent();
intent.putExtra(Constants.LOAD_ONLY_NOT_ZANGI_CONTACTS, (Serializable) MultySelectType.ADD_TO_EXISTING_CONTACTS);
intent.putExtra("isExisting", true);
ZangiRecentGroup zangiRecentGroup2 = this.zangiRecentGroup;
if (zangiRecentGroup2 == null && this.contactInfo == null) {
return;
}
if (zangiRecentGroup2 != null) {
displayNumber = zangiRecentGroup2 != null ? zangiRecentGroup2.getDisplayNumber() : null;
if (Constants.IS_DISPLAY_EMAIL_TURN_ON && (zangiRecentGroup = this.zangiRecentGroup) != null) {
email = zangiRecentGroup.getDisplayEmail();
}
email = null;
} else {
ModelForContactInfoFragment modelForContactInfoFragment2 = this.contactInfo;
displayNumber = modelForContactInfoFragment2 != null ? modelForContactInfoFragment2.getDisplayNumber() : null;
if (Constants.IS_DISPLAY_EMAIL_TURN_ON && (modelForContactInfoFragment = this.contactInfo) != null) {
email = modelForContactInfoFragment.getEmail();
}
email = null;
}
intent.putExtra("number", String.valueOf(ZangiEngineUtils.getE164WithoutPlus(displayNumber, ZangiEngineUtils.getZipCode(), false)));
if (email != null) {
intent.putExtra("email", email);
}
BaseScreen.getScreenService().showFragment(MultiSelectListFragment.class, intent, (Activity) null, Boolean.FALSE);
androidx.appcompat.app.c cVar = this.alert;
if (cVar != null) {
cVar.dismiss();
}
}
@Override
public void clcikBlockContact() {
blockContact();
androidx.appcompat.app.c cVar = this.alert;
if (cVar != null) {
cVar.dismiss();
}
}
public final void closeFragmentWithAnimator() {
final int i;
if (this.isCloseAnimationStarted) {
return;
}
this.isCloseAnimationStarted = true;
ValueAnimator ofFloat = ValueAnimator.ofFloat(1.0f, 0.0f);
AppBarLayout appBarLayout = this.appBarLayout;
ViewGroup.LayoutParams layoutParams = appBarLayout != null ? appBarLayout.getLayoutParams() : null;
kotlin.jvm.internal.k.d(layoutParams, "null cannot be cast to non-null type androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams");
CoordinatorLayout.c f = ((CoordinatorLayout.f) layoutParams).f();
if (f != null) {
kotlin.jvm.internal.k.d(f, "null cannot be cast to non-null type com.google.android.material.appbar.AppBarLayout.Behavior");
i = ((AppBarLayout.Behavior) f).a();
} else {
i = 0;
}
ofFloat.setDuration(this.ANIM_DURATION_END);
final boolean z = this.currentConversation != null;
ImageView imageView = this.contactImage;
if (imageView != null) {
imageView.setLayerType(2, null);
}
LinearLayout linearLayout = this.parentLayoutV;
if (linearLayout != null) {
linearLayout.setLayerType(2, null);
}
AppBarLayout appBarLayout2 = this.appBarLayout;
final int bottom = appBarLayout2 != null ? appBarLayout2.getBottom() : 0;
ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
ContactInfoFragmentView.closeFragmentWithAnimator$lambda$74$lambda$73(i, this, bottom, valueAnimator);
}
});
ofFloat.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationCancel(Animator animator) {
kotlin.jvm.internal.k.f(animator, "animation");
}
@Override
public void onAnimationEnd(Animator animator) {
ImageView imageView2;
LinearLayout linearLayout2;
kotlin.jvm.internal.k.f(animator, "animation");
imageView2 = this.contactImage;
if (imageView2 != null) {
imageView2.setLayerType(0, null);
}
linearLayout2 = this.parentLayoutV;
if (linearLayout2 != null) {
linearLayout2.setLayerType(0, null);
}
FragmentActivity activity = this.getActivity();
if (activity != null) {
activity.finish();
}
}
@Override
public void onAnimationRepeat(Animator animator) {
kotlin.jvm.internal.k.f(animator, "animation");
}
@Override
public void onAnimationStart(android.animation.Animator r2) {
throw new UnsupportedOperationException("Method not decompiled: com.beint.project.screens.contacts.ContactInfoFragmentView$closeFragmentWithAnimator$1$2.onAnimationStart(android.animation.Animator):void");
}
});
ofFloat.start();
}
public final void contactListUpdated(Intent intent) {
kotlin.jvm.internal.k.f(intent, "intent");
Contact contact = this.zangiContact;
if (contact == null && this.zangiRecentGroup == null && this.contactInfo == null) {
back();
} else {
this.isContactEdited = true;
updateView(contact, this.contactInfo, this.zangiRecentGroup, this.recentGroupList, true);
}
}
public final boolean getAfterSharedMedia() {
return this.afterSharedMedia;
}
public final Conversation getCurrentConversation() {
return this.currentConversation;
}
@Override
public n0.a getDefaultViewModelCreationExtras() {
return androidx.lifecycle.h.a(this);
}
public final void getUserProfile() {
if (isZangiContact()) {
if (getContactNumbersCount() > 0) {
sendRequestUserStatus();
return;
}
return;
}
StorageService storageService = StorageService.INSTANCE;
Contact contact = this.zangiContact;
Contact contactByIdentifire = storageService.getContactByIdentifire(contact != null ? contact.getIdentifire() : null);
if (contactByIdentifire == null) {
checkContactNumbersForZangi();
return;
}
contactByIdentifire.setSynced(false);
storageService.addOrUpdateContact(contactByIdentifire);
ContactsManagerSync.INSTANCE.syncContact();
}
public final void makeContactNumberInternal() {
boolean z;
boolean z6;
List<ContactNumber> numberList = getNumberList();
Contact contact = this.zangiContact;
if (contact != null) {
kotlin.jvm.internal.k.c(contact);
z6 = contact.isInternal();
} else {
loop0: while (true) {
z = false;
for (ContactNumber contactNumber : numberList) {
if (contactNumber.isZangi() == 1) {
if (contactNumber.isZangi() == 1) {
z = true;
}
}
}
}
z6 = z;
}
refreshCallButtons(z6);
if (this.contactInfo == null) {
updateFunctionalButtons(z6);
updateEnterInternalNumberViewVisibility(z6);
}
}
@Override
public void onActivityResult(int i, int i7, Intent intent) {
String stringExtra;
super.onActivityResult(i, i7, intent);
if (i != 2445 || intent == null || (stringExtra = intent.getStringExtra("com.beint.project.USER_PHONE_NUMBER")) == null) {
return;
}
ContactNumber contactNumber$default = IStorageService.DefaultImpls.getContactNumber$default(StorageService.INSTANCE, stringExtra, (String) null, 2, (Object) null);
updateView(contactNumber$default != null ? contactNumber$default.getFirstContact() : null, this.contactInfo, this.zangiRecentGroup, this.recentGroupList, true);
}
@Override
public void onCreate(android.os.Bundle r7) {
throw new UnsupportedOperationException("Method not decompiled: com.beint.project.screens.contacts.ContactInfoFragmentView.onCreate(android.os.Bundle):void");
}
public Animator onCreateAnimator(int i, boolean z, int i7) {
ValueAnimator valueAnimator = null;
if (z) {
LinearLayout linearLayout = this.parentLayoutV;
if (linearLayout != null) {
linearLayout.setLayerType(2, null);
}
valueAnimator = ValueAnimator.ofFloat(0.0f, 1.0f);
final fb.f a = fb.g.a(new ContactInfoFragmentView$onCreateAnimator$1$deltaCollapsingOffset$2(this));
final boolean z6 = this.currentConversation != null;
valueAnimator.setDuration(this.ANIM_DURATION);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public final void onAnimationUpdate(ValueAnimator valueAnimator2) {
ContactInfoFragmentView.onCreateAnimator$lambda$69$lambda$68(z6, this, a, valueAnimator2);
}
});
valueAnimator.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationCancel(Animator animator) {
kotlin.jvm.internal.k.f(animator, "animation");
}
@Override
public void onAnimationEnd(Animator animator) {
ImageView imageView;
LinearLayout linearLayout2;
kotlin.jvm.internal.k.f(animator, "animation");
imageView = ContactInfoFragmentView.this.contactImage;
if (imageView != null) {
imageView.setLayerType(0, null);
}
linearLayout2 = ContactInfoFragmentView.this.parentLayoutV;
if (linearLayout2 != null) {
linearLayout2.setLayerType(0, null);
}
}
@Override
public void onAnimationRepeat(Animator animator) {
kotlin.jvm.internal.k.f(animator, "animation");
}
@Override
public void onAnimationStart(Animator animator) {
kotlin.jvm.internal.k.f(animator, "animation");
}
});
}
return valueAnimator;
}
public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
kotlin.jvm.internal.k.f(menu, "menu");
kotlin.jvm.internal.k.f(menuInflater, "inflater");
menu.clear();
menuInflater.inflate(2131689476, menu);
this.menu = menu;
updateOptionsMenu();
super.onCreateOptionsMenu(menu, menuInflater);
}
public android.view.View onCreateView(android.view.LayoutInflater r24, android.view.ViewGroup r25, android.os.Bundle r26) {
throw new UnsupportedOperationException("Method not decompiled: com.beint.project.screens.contacts.ContactInfoFragmentView.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle):android.view.View");
}
public void onDestroyView() {
super.onDestroyView();
ContactsManagerHelper.INSTANCE.setBitmap((Bitmap) null);
sInstance = new WeakReference<>(null);
ZangiMuteService.getInstance().stopMuteCheckTimer();
unRegisterBroadcastReceivers();
}
public void onEditIdNumberClick(InfoNumberModel infoNumberModel, qb.l<? super Boolean, fb.r> lVar) {
kotlin.jvm.internal.k.f(infoNumberModel, "model");
kotlin.jvm.internal.k.f(lVar, "completition");
onIdNumberSaveClick(infoNumberModel, lVar);
scrollToTop();
}
@Override
public void onIdNumberSaveClick(com.beint.project.screens.contacts.InfoNumberModel r12, qb.l<? super java.lang.Boolean, fb.r> r13) {
throw new UnsupportedOperationException("Method not decompiled: com.beint.project.screens.contacts.ContactInfoFragmentView.onIdNumberSaveClick(com.beint.project.screens.contacts.InfoNumberModel, qb.l):void");
}
@Override
public void onInternalTextEditGotFocuse() {
RecyclerView recyclerView = this.infoNumbersRecyclerView;
if (recyclerView != null) {
recyclerView.scrollBy(0, ExtensionsKt.getDp(300));
}
}
public void onItemClicked(InfoNumberModel infoNumberModel, View view) {
boolean isShortNumber = ZangiEngineUtils.isShortNumber(infoNumberModel != null ? infoNumberModel.getNumber() : null);
String e164WithoutPlus = ZangiEngineUtils.getE164WithoutPlus(infoNumberModel != null ? infoNumberModel.getNumber() : null, ZangiEngineUtils.getZipCode(), true);
if (BlockContactServiceImpl.getInstance().getZangiBlockNumber(e164WithoutPlus) == null) {
if (isShortNumber) {
CallHelper.makeCall(getActivity(), infoNumberModel != null ? infoNumberModel.getNumber() : null, e164WithoutPlus, infoNumberModel != null ? infoNumberModel.getEmail() : null, true);
return;
}
boolean z = false;
CallHelper.callVideo(false);
if (infoNumberModel != null && infoNumberModel.isInternal()) {
z = true;
}
if (z) {
CallHelper._makeCall(getActivity(), infoNumberModel.getNumber(), infoNumberModel.getEmail());
} else if (e164WithoutPlus == null) {
if (view == null) {
return;
}
view.setBackground(null);
return;
}
ZangiConfigurationService.INSTANCE.putString("IDENTITI_CALL_NUMBER.com.beint.zangi.core.c.b", infoNumberModel != null ? infoNumberModel.getNumber() : null, true);
}
}
public void onItemEditMode() {
scrollToTop();
}
public void onItemLongCkicked(InfoNumberModel infoNumberModel) {
if ((infoNumberModel != null ? infoNumberModel.getNumber() : null) == null) {
return;
}
c.a alertDialog = AlertDialogUtils.getAlertDialog(getContext());
alertDialog.d(true);
final String number = TextUtils.isEmpty(infoNumberModel.getEmail()) ? infoNumberModel.getNumber() : (Constants.IS_CONTACTS_SEND_TO_SERVER || kotlin.jvm.internal.k.b(infoNumberModel.getNumber(), "") || infoNumberModel.getNumber() == null) ? infoNumberModel.getEmail() : infoNumberModel.getNumber();
alertDialog.s(number);
Context context = getContext();
kotlin.jvm.internal.k.c(context);
String string = context.getString(2131886377);
kotlin.jvm.internal.k.e(string, "context!!.getString(R.string.copy_title_message)");
alertDialog.g(new CharSequence[]{string}, new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
ContactInfoFragmentView.onItemLongCkicked$lambda$116(ContactInfoFragmentView.this, number, dialogInterface, i);
}
});
androidx.appcompat.app.c a = alertDialog.a();
kotlin.jvm.internal.k.e(a, "inviteDialog.create()");
a.setCanceledOnTouchOutside(true);
a.show();
Window window = a.getWindow();
kotlin.jvm.internal.k.c(window);
window.setLayout(AlertDialogUtils.getAlertSize(), -2);
AlertDialogUtils.setCurrentDialog(a);
}
public void onItemMoreClicked(InfoNumberModel infoNumberModel) {
if (ZangiNetworkService.INSTANCE.isOnline()) {
AlertDialogUtils.showRatesInfoDialog(getActivity(), this, infoNumberModel != null ? infoNumberModel.getNumber() : null, infoNumberModel != null ? infoNumberModel.getEmail() : null);
} else {
BaseScreen.showCustomToast(getContext(), 2131887051);
}
}
public boolean onOptionsItemSelected(MenuItem menuItem) {
kotlin.jvm.internal.k.f(menuItem, "item");
int itemId = menuItem.getItemId();
if (itemId != 2131362434) {
if (itemId == 2131363399) {
LinearLayout linearLayout = this.blockContactLayout;
String titleText = linearLayout != null ? getTitleText(linearLayout) : null;
FragmentActivity activity = getActivity();
if (kotlin.jvm.internal.k.b(titleText, activity != null ? activity.getString(2131886220) : null)) {
if (getActivity() != null) {
FragmentActivity activity2 = getActivity();
kotlin.jvm.internal.k.c(activity2);
if (!activity2.isFinishing()) {
showAlert(false);
}
}
} else if (getActivity() != null) {
FragmentActivity activity3 = getActivity();
kotlin.jvm.internal.k.c(activity3);
if (!activity3.isFinishing()) {
showAlert(true);
}
}
} else if (itemId == 16908332) {
EnterIdNumberView enterIdNumberView = this.enterIdNumberView;
hideKeyPad(enterIdNumberView != null ? enterIdNumberView.getNumberEditText() : null);
FragmentActivity activity4 = getActivity();
kotlin.jvm.internal.k.c(activity4);
activity4.onBackPressed();
}
} else if (Constants.IS_CONTACTS_SEND_TO_SERVER) {
Contact contact = this.zangiContact;
if (contact != null) {
kotlin.jvm.internal.k.c(contact);
editInNative(Long.parseLong(contact.getIdentifire()));
} else if (getContactForCheck() != null) {
Contact contactForCheck = getContactForCheck();
kotlin.jvm.internal.k.c(contactForCheck);
editInNative(Long.parseLong(contactForCheck.getIdentifire()));
}
} else {
editContact();
}
return super.onOptionsItemSelected(menuItem);
}
public void onReceiveContactsOnlineStatuses(ArrayList<LastActivity> arrayList) {
kotlin.jvm.internal.k.f(arrayList, "activities");
}
public void onReciveStatus(ArrayList<LastActivity> arrayList) {
kotlin.jvm.internal.k.f(arrayList, "activities");
if (isAdded()) {
onlineStatusFunctionality(arrayList);
}
}
@Override
public void onResume() {
super.onResume();
if (this.afterSharedMedia) {
this.afterSharedMedia = false;
new GetSharedMediaFilesCountAsync(new WeakReference(this.sharedMediaLayout)).execute(this.zangiContact);
}
if (this.updateConversationVisibilityText) {
this.updateConversationVisibilityText = false;
MainApplication.Companion.getMainHandler().postDelayed(new Runnable() {
@Override
public final void run() {
ContactInfoFragmentView.onResume$lambda$64(ContactInfoFragmentView.this);
}
}, 500L);
}
getUserProfile();
updateOptionsMenu();
}
@Override
public void onSaveInstanceState(Bundle bundle) {
kotlin.jvm.internal.k.f(bundle, "outState");
super.onSaveInstanceState(bundle);
Contact contact = this.zangiContact;
if (contact != null) {
kotlin.jvm.internal.k.c(contact);
bundle.putString("zangiContactFromBundle", contact.getIdentifire());
}
ZangiRecentGroup zangiRecentGroup = this.zangiRecentGroup;
if (zangiRecentGroup != null) {
bundle.putSerializable("zangiRecentGroupFromBundle", zangiRecentGroup);
}
Conversation conversation = this.currentConversation;
if (conversation != null) {
bundle.putSerializable("currentConversationFromBundle", conversation);
}
bundle.putBoolean("isRecentInfoFromBundle", this.isRecentInfo);
ModelForContactInfoFragment modelForContactInfoFragment = this.contactInfo;
if (modelForContactInfoFragment != null) {
bundle.putSerializable("contactInfoFromBundle", modelForContactInfoFragment);
}
}
public void onStart() {
super.onStart();
ConversationManager.INSTANCE.setCreateGroupFromContactInfoPage(false);
}
public void onViewCreated(View view, Bundle bundle) {
kotlin.jvm.internal.k.f(view, "view");
super.onViewCreated(view, bundle);
ZangiMuteService.getInstance().startMuteCheckTimer(this.currentConversation);
registerBroadcastReceivers();
this.isViewCreated = true;
LastActivityManager.INSTANCE.addModel(this);
updateView(this.zangiContact, this.contactInfo, this.zangiRecentGroup, this.recentGroupList, false);
}
public final void setAfterSharedMedia(boolean z) {
this.afterSharedMedia = z;
}
public final void setCurrentConversation(Conversation conversation) {
this.currentConversation = conversation;
}
@Override
public void setIsContactInfoUpdate(boolean z) {
this.isContactInfoUpdate = z;
}
public final void updateScreenShotLayoutState() {
Conversation conversation = this.currentConversation;
if (conversation == null) {
conversation = this.muteConversation;
}
if (!(conversation != null && conversation.isStealthModeOn())) {
if (!(conversation != null && conversation.isPreventCaptureModeOn())) {
InfoAdditionalItem infoAdditionalItem = this.screenShotLayoutLayout;
if (infoAdditionalItem == null) {
return;
}
String string = getResources().getString(2131887075);
kotlin.jvm.internal.k.e(string, "resources.getString(R.string.off)");
infoAdditionalItem.setDescription(string);
return;
}
}
InfoAdditionalItem infoAdditionalItem2 = this.screenShotLayoutLayout;
if (infoAdditionalItem2 == null) {
return;
}
String string2 = getResources().getString(2131887079);
kotlin.jvm.internal.k.e(string2, "resources.getString(R.string.on)");
infoAdditionalItem2.setDescription(string2);
}
public final void updateStealtLayoutState() {
LinkedList contactNumbers;
ContactNumber contactNumber;
HashSet conversations;
LinkedList contactNumbers2;
ContactNumber contactNumber2;
HashSet conversations2;
LinkedList contactNumbers3;
Conversation conversation = this.currentConversation;
if (conversation == null) {
conversation = this.muteConversation;
}
if (conversation == null) {
Contact contact = this.zangiContact;
if ((contact == null || (contactNumbers3 = contact.getContactNumbers()) == null || !(contactNumbers3.isEmpty() ^ true)) ? false : true) {
Contact contact2 = this.zangiContact;
if ((contact2 == null || (contactNumbers2 = contact2.getContactNumbers()) == null || (contactNumber2 = (ContactNumber) contactNumbers2.get(0)) == null || (conversations2 = contactNumber2.getConversations()) == null || !(conversations2.isEmpty() ^ true)) ? false : true) {
Contact contact3 = this.zangiContact;
conversation = (contact3 == null || (contactNumbers = contact3.getContactNumbers()) == null || (contactNumber = (ContactNumber) contactNumbers.get(0)) == null || (conversations = contactNumber.getConversations()) == null) ? null : (Conversation) gb.l.s(conversations);
}
}
}
if (conversation != null && conversation.isStealthModeOn()) {
InfoAdditionalItem infoAdditionalItem = this.stealthModeLayout;
if (infoAdditionalItem == null) {
return;
}
infoAdditionalItem.setDescription(StealthManager.INSTANCE.getCurrentActiveTimeText(conversation));
return;
}
InfoAdditionalItem infoAdditionalItem2 = this.stealthModeLayout;
if (infoAdditionalItem2 == null) {
return;
}
String string = getResources().getString(2131887075);
kotlin.jvm.internal.k.e(string, "resources.getString(R.string.off)");
infoAdditionalItem2.setDescription(string);
}
@Override
public void updateView(com.beint.project.core.model.contact.Contact r11, final com.beint.project.core.model.ModelForContactInfoFragment r12, com.beint.project.core.model.recent.ZangiRecentGroup r13, java.util.List<? extends com.beint.project.core.model.recent.ZangiRecentGroup> r14, boolean r15) {
throw new UnsupportedOperationException("Method not decompiled: com.beint.project.screens.contacts.ContactInfoFragmentView.updateView(com.beint.project.core.model.contact.Contact, com.beint.project.core.model.ModelForContactInfoFragment, com.beint.project.core.model.recent.ZangiRecentGroup, java.util.List, boolean):void");
}
private final Button createCallButton(Button button, int i, String str) {
button.setLayoutParams(new LinearLayout.LayoutParams(getCOLL_BOTTOM_LENGTH(), ExtensionsKt.getDp(70)));
ExtensionsKt.setDefaultSelectableBackground(button);
DispatchKt.asyncThread(new ContactInfoFragmentView$createCallButton$2(button, i, this, str));
return button;
}
}