正在查看: CallApp v2.226 应用的 PostCallActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: CallApp v2.226 应用的 PostCallActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.callapp.contacts.activity.contact.details;
import a1.d0;
import android.app.KeyguardManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.ColorFilter;
import android.graphics.PointF;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.Pair;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.z;
import apk.tool.patcher.Premium;
import com.callapp.contacts.CallAppApplication;
import com.callapp.contacts.R;
import com.callapp.contacts.activity.InterstitialAdLoader;
import com.callapp.contacts.activity.base.BaseActivity;
import com.callapp.contacts.activity.base.InformativeTransparentActivity;
import com.callapp.contacts.activity.contact.cards.AdCard;
import com.callapp.contacts.activity.contact.cards.framework.CardArrayRecyclerViewAdapterWithPriority;
import com.callapp.contacts.activity.contact.cards.postCall.PostCallAdCard;
import com.callapp.contacts.activity.contact.cards.postCall.PostCallPhoneVerifyCard;
import com.callapp.contacts.activity.contact.details.BaseContactDetailsActivity;
import com.callapp.contacts.activity.contact.details.PresentersContainer;
import com.callapp.contacts.activity.interfaces.AdCardBindEvent;
import com.callapp.contacts.activity.interfaces.AdCardShowingEvent;
import com.callapp.contacts.activity.interfaces.FinishPostCallActivityListener;
import com.callapp.contacts.activity.interfaces.IdentificationListener;
import com.callapp.contacts.activity.interfaces.PostCallStartedListener;
import com.callapp.contacts.event.EventBusManager;
import com.callapp.contacts.event.bus.EventBus;
import com.callapp.contacts.event.listener.DestroyListener;
import com.callapp.contacts.event.listener.PauseListener;
import com.callapp.contacts.event.listener.ResumeListener;
import com.callapp.contacts.manager.CallAppRemoteConfigManager;
import com.callapp.contacts.manager.ContactLoaderManager;
import com.callapp.contacts.manager.NotificationExtractors.IMDataExtractionUtils;
import com.callapp.contacts.manager.WindowInsetsManager;
import com.callapp.contacts.manager.analytics.AnalyticsManager;
import com.callapp.contacts.manager.asset.managers.StoreItemAssetManager;
import com.callapp.contacts.manager.phone.CallStateListener;
import com.callapp.contacts.manager.phone.PhoneManager;
import com.callapp.contacts.manager.phone.PhoneStateManager;
import com.callapp.contacts.manager.preferences.Prefs;
import com.callapp.contacts.manager.task.Task;
import com.callapp.contacts.model.Constants;
import com.callapp.contacts.model.Reward;
import com.callapp.contacts.model.call.CallData;
import com.callapp.contacts.model.call.CallState;
import com.callapp.contacts.model.contact.ContactData;
import com.callapp.contacts.model.contact.ContactDataChangeListener;
import com.callapp.contacts.model.contact.ContactField;
import com.callapp.contacts.model.contact.social.ContactFieldEnumSets;
import com.callapp.contacts.model.objectbox.PostCallData;
import com.callapp.contacts.model.objectbox.PostCallData_;
import com.callapp.contacts.receiver.ScreenUnlockReceiver;
import com.callapp.contacts.util.Activities;
import com.callapp.contacts.util.AndroidUtils;
import com.callapp.contacts.util.CLog;
import com.callapp.contacts.util.CallLogUtils;
import com.callapp.contacts.util.LocaleUtils;
import com.callapp.contacts.util.TCF2Manager;
import com.callapp.contacts.util.ThemeUtils;
import com.callapp.contacts.util.UserCorrectedInfoUtil;
import com.callapp.contacts.util.ViewUtils;
import com.callapp.contacts.util.glide.GlideUtils;
import com.callapp.contacts.util.glide.RoundedCornersTransformation;
import com.callapp.contacts.widget.ProfilePictureView;
import com.callapp.contacts.widget.RewardView;
import com.callapp.contacts.widget.SwipeGestureListener;
import com.callapp.contacts.widget.recyclerviewext.CardRecyclerView;
import com.callapp.framework.util.CollectionUtils;
import com.callapp.framework.util.StringUtils;
import io.objectbox.query.QueryBuilder;
import java.util.ArrayList;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import kotlin.jvm.internal.Intrinsics;
public class PostCallActivity extends InformativeTransparentActivity implements ContactDataChangeListener, CallStateListener, FinishPostCallActivityListener, AdCardShowingEvent, AdCardBindEvent, IdentificationListener {
public static final String EXTRA_IM_TYPE = "imType";
public static final String EXTRA_IS_GOLD = "isGold";
public static final String EXTRA_IS_IN_DEVICE = "isInDevice";
public static final String EXTRA_IS_SPAMMER = "isSpammer";
public static final String EXTRA_POST_CALL_DATA = "postCallData";
private boolean adWasShown;
private String asset;
private StoreItemAssetManager assetManager;
private ImageView callAppIcon;
protected CardArrayRecyclerViewAdapterWithPriority cardsAdapter;
private ImageView closeButton;
private ContactData contact;
private GestureDetector detector;
private ImageView editNameIcon;
private View editNameIconArea;
private final EventBus eventBus;
private View fullScreenShadow;
private IMDataExtractionUtils.RecognizedPersonOrigin imType;
private boolean isBlocked;
private boolean isGold;
private boolean isOutsideClickDisabled;
private boolean isSpammer;
private final Runnable outsideClickDisableTimer;
private ImageView overlayImage;
private CardRecyclerView postCallCardRecycleView;
protected final PresentersContainerImpl presenterContainer;
private final PresenterManager presenterManager;
private View tint;
private LinearLayout visibleContainer;
public enum PostCallShowStatus {
SHOW,
INCOGNITO,
DRIVE_MODE,
UNKNOWN_NUMBER,
UNSPECIFIED,
CONFERENCE,
DISABLED_IN_SETTINGS
}
public PostCallActivity() {
PresentersContainer.MODE mode = PresentersContainer.MODE.POST_CALL_SCREEN;
this.presenterManager = new PresenterManager(mode);
EventBus eventBus = new EventBus();
this.eventBus = eventBus;
this.isOutsideClickDisabled = false;
this.adWasShown = false;
this.outsideClickDisableTimer = new Runnable() {
@Override
public final void run() {
StringUtils.I(PostCallActivity.class);
CLog.a();
PostCallActivity.this.isOutsideClickDisabled = false;
}
};
this.presenterContainer = new PresentersContainerImpl(eventBus, mode) {
@Override
public Fragment findFragment(int i) {
return PostCallActivity.this.getSupportFragmentManager().F(i);
}
@Override
public View findViewById(int i) {
return PostCallActivity.this.findViewById(i);
}
@Override
public void finish() {
PostCallActivity.this.finish();
}
@Override
public CardArrayRecyclerViewAdapterWithPriority getCardsAdapter() {
return PostCallActivity.this.cardsAdapter;
}
@Override
public int getColor(int i) {
return super.getColor(i);
}
@Override
public ContactData getContact() {
return PostCallActivity.this.contact;
}
@Override
public BaseContactDetailsActivity.DetailsActivityMode getDetailsActivityMode() {
return super.getDetailsActivityMode();
}
@Override
public Drawable getDrawable(int i) {
return super.getDrawable(i);
}
@Override
public EventBus getEventBus() {
return PostCallActivity.this.eventBus;
}
@Override
public FragmentManager getFragmentManager() {
return PostCallActivity.this.getSupportFragmentManager();
}
@Override
public Context getRealContext() {
return PostCallActivity.this;
}
@Override
public boolean hasFocus() {
return true;
}
@Override
public boolean hasIntentExtra(String str) {
Intent intent = PostCallActivity.this.getIntent();
if (intent == null || !StringUtils.x(str)) {
return false;
}
return intent.hasExtra(str);
}
@Override
public boolean isClickValid(View view) {
return PostCallActivity.this.isClickValid(view);
}
@Override
public boolean isFinishing() {
return PostCallActivity.this.isFinishing();
}
@Override
public boolean isIncognito(ContactData contactData) {
return super.isIncognito(contactData);
}
@Override
public void openNotificationAccsess() {
}
@Override
public void scrollToPosition(int i) {
CardRecyclerView cardRecyclerView = PostCallActivity.this.postCallCardRecycleView;
if (cardRecyclerView != null) {
cardRecyclerView.t0(0);
}
}
};
}
public void finishActivity() {
CallAppApplication.get().runOnMainThread(new Runnable() {
@Override
public final void run() {
PostCallActivity postCallActivity = PostCallActivity.this;
if (postCallActivity.fullScreenShadow != null) {
postCallActivity.fullScreenShadow.setBackgroundColor(0);
postCallActivity.setStatusBarColor(0);
}
CallAppApplication.get().postRunnable(new Runnable() {
@Override
public final void run() {
PostCallActivity.this.finish();
}
});
}
});
}
private void initLayout() {
final CallData callData = (CallData) getIntent().getExtras().getSerializable(EXTRA_POST_CALL_DATA);
if (callData == null) {
return;
}
ImageView imageView = (ImageView) findViewById(R.id.callAppIcon);
this.callAppIcon = imageView;
imageView.setVisibility(8);
if (ThemeUtils.isThemeLight()) {
this.callAppIcon.setColorFilter(new PorterDuffColorFilter(ThemeUtils.getColor(R.color.defaultPrimary), PorterDuff.Mode.SRC_IN));
} else {
this.callAppIcon.setColorFilter(new PorterDuffColorFilter(ThemeUtils.getColor(2131101228), PorterDuff.Mode.SRC_IN));
}
if (ThemeUtils.isThemeLight()) {
this.editNameIcon.setColorFilter((ColorFilter) null);
} else {
this.editNameIcon.setColorFilter(new PorterDuffColorFilter(ThemeUtils.getColor(2131101228), PorterDuff.Mode.SRC_IN));
}
ImageView imageView2 = (ImageView) findViewById(R.id.closeButton);
this.closeButton = imageView2;
imageView2.setVisibility(0);
this.closeButton.postDelayed(new Runnable() {
@Override
public final void run() {
PostCallActivity postCallActivity = PostCallActivity.this;
View findViewById = postCallActivity.findViewById(R.id.mainTop);
if (findViewById != null) {
postCallActivity.updateComponentsHeight(findViewById.getHeight());
}
}
}, 50L);
this.tint = findViewById(R.id.overlay_image_tint);
Bundle extras = getIntent().getExtras();
this.isBlocked = callData.isBlocked();
this.isSpammer = extras.getBoolean(EXTRA_IS_SPAMMER);
this.isGold = extras.getBoolean(EXTRA_IS_GOLD);
IMDataExtractionUtils.RecognizedPersonOrigin recognizedPersonOrigin = (IMDataExtractionUtils.RecognizedPersonOrigin) extras.getSerializable(EXTRA_IM_TYPE);
this.imType = recognizedPersonOrigin;
if (recognizedPersonOrigin != null) {
TextView textView = (TextView) findViewById(R.id.postCallHeaderImText);
ImageView imageView3 = (ImageView) findViewById(R.id.postCallHeaderImImage);
LinearLayout linearLayout = (LinearLayout) findViewById(R.id.postCallHeaderImLayout);
textView.setText(IMDataExtractionUtils.e(this.imType));
imageView3.setImageDrawable(ViewUtils.getDrawable(IMDataExtractionUtils.f(this.imType)));
linearLayout.setBackground(ViewUtils.i(2131231133, Integer.valueOf(ThemeUtils.getColor(IMDataExtractionUtils.d(this.imType)))));
linearLayout.setVisibility(0);
}
this.overlayImage = (ImageView) ((FrameLayout) findViewById(R.id.topBarContainer)).findViewById(R.id.overlay_image);
this.editNameIconArea.setClickable(false);
this.editNameIconArea.setVisibility(8);
this.editNameIconArea.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
PostCallActivity.this.lambda$initLayout$2(callData, view);
}
});
StoreItemAssetManager.Builder builder = new StoreItemAssetManager.Builder();
builder.g = new StoreItemAssetManager.AssetListener<String>() {
@Override
public final void a(String str, String str2) {
if (StringUtils.t(str)) {
return;
}
PostCallActivity postCallActivity = PostCallActivity.this;
postCallActivity.asset = str;
postCallActivity.setCover();
}
};
StoreItemAssetManager a = builder.a();
this.assetManager = a;
a.getAssets();
View findViewById = findViewById(R.id.fullScreenShadow);
this.fullScreenShadow = findViewById;
if (findViewById != null) {
findViewById.setOnTouchListener(new View.OnTouchListener() {
@Override
public final boolean onTouch(View view, MotionEvent motionEvent) {
?? r4 = PostCallActivity.this;
if (ViewUtils.n(motionEvent.getRawX(), motionEvent.getRawY(), ((PostCallActivity) r4).visibleContainer) || ((PostCallActivity) r4).isOutsideClickDisabled) {
return true;
}
if (motionEvent.getAction() != 0 || r4.isFinishing()) {
return false;
}
r4.finishActivity();
return false;
}
});
}
ImageView imageView4 = this.closeButton;
if (imageView4 != null) {
imageView4.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AnalyticsManager.get().p(Constants.POST_CALL, "ClickPostCall_actionType", "close");
AndroidUtils.e(view, 1);
PostCallActivity.this.finish();
}
});
}
ProfilePictureView profilePictureView = (ProfilePictureView) findViewById(R.id.profilePictureView);
if (profilePictureView != null) {
profilePictureView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
boolean z;
AndroidUtils.e(view, 1);
?? r9 = PostCallActivity.this;
Intent intent = r9.getIntent();
if (intent != null && intent.getExtras().containsKey(PostCallActivity.EXTRA_POST_CALL_DATA)) {
try {
z = ((CallData) intent.getExtras().get(PostCallActivity.EXTRA_POST_CALL_DATA)).getImCallType() != null;
} catch (Exception unused) {
}
AppCompatActivity appCompatActivity = PostCallActivity.this;
ContactDetailsActivity.startFullDetailsActivity(appCompatActivity, appCompatActivity.getIntent(), null, false, false, "PostCallActivity", z);
r9.finishActivity();
}
z = false;
AppCompatActivity appCompatActivity2 = PostCallActivity.this;
ContactDetailsActivity.startFullDetailsActivity(appCompatActivity2, appCompatActivity2.getIntent(), null, false, false, "PostCallActivity", z);
r9.finishActivity();
}
});
}
findViewById(R.id.postOverlayRoot).setOnTouchListener(new View.OnTouchListener() {
@Override
public final boolean onTouch(View view, MotionEvent motionEvent) {
return PostCallActivity.this.detector.onTouchEvent(motionEvent);
}
});
setLayoutColors(this.isSpammer, this.contact);
}
public void lambda$initLayout$2(CallData callData, View view) {
AnalyticsManager.get().p(Constants.POST_CALL, "Edit Non Contact", Constants.CLICK);
Context realContext = this.presenterContainer.getRealContext();
ContactData contact = this.presenterContainer.getContact();
callData.getNumber();
UserCorrectedInfoUtil.i(Constants.USER_CORRECTED_INFO, "", Constants.POST_CALL, realContext, contact, null);
}
public void lambda$onCreate$0() {
WindowInsetsManager windowInsetsManager = WindowInsetsManager.get();
View findViewById = findViewById(R.id.postOverlayRoot);
windowInsetsManager.getClass();
Intrinsics.checkNotNullParameter(findViewById, "view");
findViewById.setPadding(0, 0, 0, 0);
if (Build.VERSION.SDK_INT < 35) {
findViewById(android.R.id.content).setBackgroundColor(getColor(R.color.black_with_alpha));
WindowInsetsManager.get().a(findViewById(R.id.postOverlayRoot), false);
setStatusBarColor(getColor(2131101162));
} else {
findViewById(R.id.postcallContainer).setBackgroundColor(getColor(R.color.black_with_alpha));
findViewById(R.id.postcallContainer).setPadding(0, WindowInsetsManager.get().getH(), 0, 0);
findViewById(R.id.post_call_visible_area_container).setPadding(0, 0, 0, WindowInsetsManager.get().getNavigationBarHeight());
}
}
public static void lambda$onCreate$1(boolean z) {
}
public static PostCallShowStatus needToShowPostCall(ContactData contactData, CallData callData) {
return ((contactData == null || !contactData.isIncognito()) && (callData == null || !callData.getMarkAsIncognito())) ? PhoneManager.get().isInDriveMode() ? PostCallShowStatus.DRIVE_MODE : (callData == null || !CallLogUtils.s(callData.getNumber().c())) ? (callData == null || !callData.isConferenceManager()) ? callData != null ? PostCallShowStatus.SHOW : PostCallShowStatus.UNSPECIFIED : PostCallShowStatus.CONFERENCE : PostCallShowStatus.UNKNOWN_NUMBER : PostCallShowStatus.INCOGNITO;
}
public void setCover() {
if (this.imType == null) {
CallAppApplication.get().runOnMainThread(new Runnable() {
@Override
public final void run() {
if (Prefs.l.get().booleanValue()) {
?? r0 = PostCallActivity.this;
if (((PostCallActivity) r0).overlayImage == null || ((PostCallActivity) r0).tint == null) {
return;
}
((PostCallActivity) r0).overlayImage.setVisibility(0);
((PostCallActivity) r0).closeButton.setColorFilter(new PorterDuffColorFilter(r0.presenterContainer.getColor(R.color.postcall_x_color), PorterDuff.Mode.SRC_IN));
((PostCallActivity) r0).tint.setAlpha(0.9f);
double ceil = Math.ceil(Activities.e(11.0f));
GlideUtils.GlideRequestBuilder glideRequestBuilder = new GlideUtils.GlideRequestBuilder(((PostCallActivity) r0).overlayImage, ((PostCallActivity) r0).asset, (Context) r0);
int i = (int) ceil;
RoundedCornersTransformation.CornerType cornerType = RoundedCornersTransformation.CornerType.TOP;
glideRequestBuilder.s = true;
glideRequestBuilder.E = cornerType;
glideRequestBuilder.t = i;
glideRequestBuilder.a();
}
}
});
}
}
public void setLayoutColors(boolean z, ContactData contactData) {
this.isSpammer = z;
boolean Premium = contactData != null ? Premium.Premium() : true;
boolean z2 = contactData != null && contactData.isVerifiedBusiness();
if (this.imType == null) {
ViewUtils.c(this.tint, this.isSpammer, this.isBlocked, Premium, z2, 250);
}
if (this.isSpammer || Premium) {
int color = ThemeUtils.getColor(R.color.title);
ImageView imageView = this.callAppIcon;
PorterDuff.Mode mode = PorterDuff.Mode.SRC_IN;
imageView.setColorFilter(new PorterDuffColorFilter(color, mode));
this.closeButton.setColorFilter(new PorterDuffColorFilter(color, mode));
} else if (!ThemeUtils.isThemeLight()) {
this.closeButton.setColorFilter(new PorterDuffColorFilter(ThemeUtils.getColor(2131101228), PorterDuff.Mode.SRC_IN));
}
if (StringUtils.x(this.asset)) {
setCover();
}
}
public static void showAllPendingPostCalls() {
io.objectbox.a m = com.amazon.device.ads.l.m(PostCallData.class);
QueryBuilder i = m.i();
i.B(PostCallData_.id, 0);
PostCallData postCallData = (PostCallData) i.b().j0();
if (postCallData == null) {
return;
}
if (postCallData.getCallData() == null) {
CLog.p(Constants.POST_CALL, "Call data is null", new Exception("Call data is null"));
return;
}
m.q();
AnalyticsManager.get().p(Constants.POST_CALL_SCREEN, "ShowingPostCallPending", postCallData.getAnalyticsLabel());
startIfScreenIsNotLocked(postCallData.getContactId(), postCallData.getName(), postCallData.isSpam(), Premium.Premium(), postCallData.getCallData(), postCallData.getAnalyticsLabel(), postCallData.getRecognizedPersonOrigin());
}
public static void startIfScreenIsNotLocked(long j, String str, boolean z, boolean z2, @NonNull CallData callData, String str2, IMDataExtractionUtils.RecognizedPersonOrigin recognizedPersonOrigin) {
if (((KeyguardManager) CallAppApplication.get().getSystemServiceDirect("keyguard")).isKeyguardLocked()) {
AnalyticsManager.get().p(Constants.POST_CALL_SCREEN, Constants.NOT_SHOWING_POST_CALL, "KeyguardLocked-" + str2);
PostCallData postCallData = new PostCallData(callData, z, z2, j, str, str2, recognizedPersonOrigin);
long b = CallAppApplication.get().getObjectBoxStore().u(PostCallData.class).b();
if (b > 0) {
AnalyticsManager.get().q(Constants.POST_CALL_SCREEN, Constants.NOT_SHOWING_POST_CALL, d0.C("DroppedPendingKeyguardLocked-", str2), b, new String[0]);
}
if (callData == null) {
CLog.p(Constants.POST_CALL, "Putting PostCallData with CallData null", new Exception());
}
try {
CallAppApplication.get().getObjectBoxStore().u(PostCallData.class).q();
CallAppApplication.get().getObjectBoxStore().u(PostCallData.class).g(postCallData);
} catch (Throwable th) {
CLog.p(Constants.POST_CALL, "Error while putting post call", th);
}
ScreenUnlockReceiver.c();
if (PhoneManager.get().isDefaultPhoneApp() || Prefs.t1.get().booleanValue()) {
return;
}
InterstitialAdLoader.g(callData);
return;
}
boolean z3 = j != 0;
if (InformativeTransparentActivity.getOpenedInformativeActivity(PostCallActivity.class) == InformativeTransparentActivity.InformativeActivityState.DECLINED) {
AnalyticsManager.get().p(Constants.POST_CALL_SCREEN, Constants.NOT_SHOWING_POST_CALL, "InformativeActivityState.DECLINED");
StringUtils.I(PostCallActivity.class);
CLog.a();
return;
}
if (Prefs.S2.get().booleanValue() && ((!Prefs.E.get().booleanValue() || !z3) && (!Prefs.F.get().booleanValue() || z3))) {
AnalyticsManager.get().p(Constants.POST_CALL_SCREEN, Constants.NOT_SHOWING_POST_CALL, "isPremium-" + z3);
return;
}
Intent intent = new Intent((Context) CallAppApplication.get(), (Class<?>) PostCallActivity.class);
intent.putExtra(EXTRA_POST_CALL_DATA, callData);
if (StringUtils.x(str)) {
intent.putExtra(ContactDetailsActivity.EXTRA_FULL_NAME, str);
}
intent.putExtra("contactId", j);
intent.putExtra(EXTRA_IS_SPAMMER, z);
intent.putExtra(EXTRA_IS_GOLD, z2);
intent.putExtra(EXTRA_IS_IN_DEVICE, z3);
intent.putExtra(Constants.EXTRA_PHONE_NUMBER, callData.getNumber().getRawNumber());
if (recognizedPersonOrigin != null) {
intent.putExtra(EXTRA_IM_TYPE, recognizedPersonOrigin);
}
intent.setFlags(268435456);
try {
CountDownLatch postCallAdPreloadedLatch = PhoneStateManager.get().getPostCallAdPreloadedLatch();
if (postCallAdPreloadedLatch != null) {
postCallAdPreloadedLatch.await(CallAppRemoteConfigManager.get().c("PostCallPreloadTimeoutSec"), TimeUnit.SECONDS);
}
} catch (InterruptedException unused) {
}
Activities.E(CallAppApplication.get(), intent);
}
public void updateComponentsHeight(int i) {
ImageView imageView = (ImageView) findViewById(R.id.overlay_image);
View findViewById = findViewById(R.id.overlay_image_tint);
if (imageView == null || findViewById == null) {
return;
}
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) imageView.getLayoutParams();
FrameLayout.LayoutParams layoutParams2 = (FrameLayout.LayoutParams) findViewById.getLayoutParams();
layoutParams.height = i;
layoutParams2.height = i;
imageView.setLayoutParams(layoutParams);
findViewById.setLayoutParams(layoutParams2);
}
public CallData updateDataFromIntent(Intent intent) {
long j = getIntent().getExtras().getLong("contactId");
CallData callData = (CallData) getIntent().getExtras().getSerializable(EXTRA_POST_CALL_DATA);
if (callData != null) {
String stringExtra = intent.getStringExtra(ContactDetailsActivity.EXTRA_FULL_NAME);
Pair<ContactData, Set<ContactField>> registerForContactDetailsStack = ContactLoaderManager.get().registerForContactDetailsStack(callData.getNumber(), j, this, ContactFieldEnumSets.ALL);
this.contact = (ContactData) registerForContactDetailsStack.first;
if (((Set) registerForContactDetailsStack.second).size() > 0) {
onContactChanged(this.contact, (Set) registerForContactDetailsStack.second);
}
if (StringUtils.x(stringExtra)) {
this.contact.assertIntentDataExists();
this.contact.getIntentData().setFullName(stringExtra);
this.contact.updateFullName();
} else {
this.contact.fireChange(ContactField.phone);
}
this.eventBus.b(CallStateListener.C8, callData, false);
}
if (!PhoneManager.get().isDefaultPhoneApp() && !Prefs.t1.get().booleanValue()) {
InterstitialAdLoader.g(callData);
}
return callData;
}
public boolean dispatchTouchEvent(MotionEvent motionEvent) {
try {
if (!ViewUtils.n(motionEvent.getRawX(), motionEvent.getRawY(), this.postCallCardRecycleView)) {
this.detector.onTouchEvent(motionEvent);
}
return super/*android.app.Activity*/.dispatchTouchEvent(motionEvent);
} catch (Exception unused) {
return false;
}
}
@Override
public int getLayoutResourceId() {
return R.layout.activity_post_call;
}
@Override
public int getThemeResId() {
return ThemeUtils.getCallScreenTransparentTheme();
}
@Override
public boolean isColoringTheStatusBar() {
return true;
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
if (i == 7453 && Prefs.O0.isNotNull()) {
CardArrayRecyclerViewAdapterWithPriority cardsAdapter = this.presenterContainer.getCardsAdapter();
((eu.b) cardsAdapter).m.remove(this.presenterManager.e(PostCallPhoneVerifyCard.class));
cardsAdapter.notifyDataSetChanged();
}
}
@Override
public void onAdCardBind(AdCard adCard) {
if (!(adCard instanceof PostCallAdCard) || this.adWasShown || Prefs.S2.get().booleanValue()) {
return;
}
this.adWasShown = true;
long c = CallAppRemoteConfigManager.get().c("PostCallDisableCloseOnOutsideAfterAdMS");
if (c > 0) {
StringUtils.I(PostCallActivity.class);
CLog.a();
this.isOutsideClickDisabled = true;
CallAppApplication.get().removePostedRunnable(this.outsideClickDisableTimer);
CallAppApplication.get().postRunnableDelayed(this.outsideClickDisableTimer, c);
}
}
@Override
public void onAdCardShowing(AdCard adCard) {
if (adCard instanceof PostCallAdCard) {
runOnUiThread(new Runnable() {
@Override
public final void run() {
PostCallActivity postCallActivity = PostCallActivity.this;
if (postCallActivity.postCallCardRecycleView == null || postCallActivity.postCallCardRecycleView.getAdapter() == null) {
return;
}
postCallActivity.postCallCardRecycleView.getAdapter().notifyDataSetChanged();
CallAppApplication.get().postRunnableDelayed(new Runnable() {
@Override
public final void run() {
PostCallActivity.this.postCallCardRecycleView.p0(PostCallActivity.this.cardsAdapter.getItemCount() - 1);
}
}, 500L);
}
});
}
}
public void onBackPressed() {
finishActivity();
}
@Override
public void onCallStateChanged(CallData callData) {
if (callData.getState() == CallState.RINGING_OUTGOING) {
finishActivity();
}
this.eventBus.b(CallStateListener.C8, callData, true);
}
@Override
public void onContactChanged(final ContactData contactData, Set<ContactField> set) {
if (contactData.isVerifiedBusiness() || Premium.Premium() || CollectionUtils.b(set, ContactField.spamScore)) {
this.presenterContainer.safeRunOnUIThread(new Runnable() {
@Override
public final void run() {
?? r0 = PostCallActivity.this;
if (r0.isFinishing()) {
return;
}
ContactData contactData2 = contactData;
r0.setLayoutColors(UserCorrectedInfoUtil.g(contactData2), contactData2);
}
});
}
this.presenterContainer.safeRunOnUIThread(new Runnable() {
@Override
public final void run() {
ContactData contactData2 = contactData;
boolean isContactInDevice = contactData2.isContactInDevice();
PostCallActivity postCallActivity = PostCallActivity.this;
if (isContactInDevice || contactData2.isVerifiedBusiness()) {
postCallActivity.editNameIcon.setVisibility(8);
postCallActivity.editNameIconArea.setVisibility(8);
postCallActivity.editNameIconArea.setClickable(false);
} else {
postCallActivity.editNameIcon.setVisibility(0);
postCallActivity.editNameIconArea.setVisibility(0);
postCallActivity.editNameIconArea.setClickable(true);
}
}
});
this.presenterContainer.onContactChanged(contactData, set);
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
AnalyticsManager.get().t(Constants.POST_CALL_SCREEN, null);
if (getIntent().getExtras() == null) {
StringUtils.I(PostCallActivity.class);
CLog.a();
finish();
return;
}
WindowInsetsManager.get().d(this, new k(this));
boolean z = false;
TCF2Manager.a(false, new com.callapp.contacts.b(5), this);
this.presenterManager.g(this.presenterContainer);
this.presenterContainer.getEventBus().a(AdCardShowingEvent.R7, this);
this.presenterContainer.getEventBus().a(AdCardBindEvent.O7, this);
EventBusManager.a.a(FinishPostCallActivityListener.X7, this);
this.editNameIcon = (ImageView) findViewById(R.id.postCallEditNameIcon);
this.editNameIconArea = findViewById(R.id.editNameArea);
CardRecyclerView cardRecyclerView = (CardRecyclerView) findViewById(R.id.postCallCardRecycleView);
this.postCallCardRecycleView = cardRecyclerView;
if (cardRecyclerView != null) {
cardRecyclerView.setLayoutManager(new LinearLayoutManager(this, this) {
public final void o0(final RecyclerView recyclerView, RecyclerView.u uVar, int i) {
z zVar = new z(this, recyclerView.getContext()) {
public final PointF a(int i2) {
return recyclerView.getLayoutManager().a(i2);
}
public int getVerticalSnapPreference() {
return -1;
}
public final float j(DisplayMetrics displayMetrics) {
return 250.0f / displayMetrics.densityDpi;
}
};
zVar.setTargetPosition(i);
p0(zVar);
}
});
this.postCallCardRecycleView.setItemAnimator((RecyclerView.k) null);
}
CardArrayRecyclerViewAdapterWithPriority cardArrayRecyclerViewAdapterWithPriority = new CardArrayRecyclerViewAdapterWithPriority(this, new ArrayList(), new CardArrayRecyclerViewAdapterWithPriority.CardEventsListener(this) {
@Override
public final void a() {
}
@Override
public final void b() {
}
});
this.cardsAdapter = cardArrayRecyclerViewAdapterWithPriority;
this.postCallCardRecycleView.setAdapter(cardArrayRecyclerViewAdapterWithPriority);
LinearLayout linearLayout = (LinearLayout) findViewById(R.id.post_call_visible_area_container);
this.visibleContainer = linearLayout;
ViewUtils.e(linearLayout, R.drawable.post_call_rounded_layout, ThemeUtils.getColor(R.color.background));
initLayout();
Animation loadAnimation = AnimationUtils.loadAnimation(this, R.anim.dialpad_slide_in_bottom);
LinearLayout linearLayout2 = this.visibleContainer;
if (linearLayout2 != null) {
linearLayout2.setVisibility(0);
this.visibleContainer.startAnimation(loadAnimation);
}
new Task() {
@Override
public final void doTask() {
?? r0 = PostCallActivity.this;
((PostCallActivity) r0).presenterManager.b(r0.presenterContainer);
if (((BaseActivity) r0).mResumed != null) {
if (((BaseActivity) r0).mResumed.booleanValue()) {
((PostCallActivity) r0).eventBus.b(ResumeListener.A8, null, false);
} else {
((PostCallActivity) r0).eventBus.b(PauseListener.z8, null, false);
}
}
CallData updateDataFromIntent = r0.updateDataFromIntent(r0.getIntent());
if (updateDataFromIntent != null) {
AnalyticsManager.get().p(Constants.POST_CALL_SCREEN, "PostCallShown", String.valueOf((androidx.fragment.app.n.d() - (updateDataFromIntent.getDuration() + updateDataFromIntent.getCreationTime())) / 1000));
}
}
}.execute();
PhoneStateManager.get().addListener(this);
this.detector = new GestureDetector((Context) this, (GestureDetector.OnGestureListener) new SwipeGestureListener(z, SwipeGestureListener.Sensitivity.MEDIUM) {
@Override
public final boolean a() {
PostCallActivity.this.finishActivity();
return true;
}
@Override
public final boolean d() {
PostCallActivity.this.finishActivity();
return true;
}
});
if (Prefs.S2.get().booleanValue()) {
return;
}
long c = CallAppRemoteConfigManager.get().c("PostCallDisableCloseOnOutsideMS");
if (c > 0) {
this.isOutsideClickDisabled = true;
StringUtils.I(PostCallActivity.class);
CLog.a();
CallAppApplication.get().postRunnableDelayed(this.outsideClickDisableTimer, c);
}
}
@Override
public void onDestroy() {
ContactLoaderManager.get().unRegisterForContactDetailsStack(this.contact, this);
this.eventBus.b(DestroyListener.f620y8, null, false);
BaseActivity.setStatusBarTextColor(getWindow(), ThemeUtils.isThemeLight());
CallAppApplication.get().removePostedRunnable(this.outsideClickDisableTimer);
EventBusManager.a.f(FinishPostCallActivityListener.X7, this);
this.presenterContainer.getEventBus().f(AdCardShowingEvent.R7, this);
this.presenterContainer.getEventBus().f(AdCardBindEvent.O7, this);
this.presenterManager.h();
this.presenterContainer.onDestroy();
this.eventBus.e();
PhoneStateManager.get().removeListener(this);
StoreItemAssetManager storeItemAssetManager = this.assetManager;
if (storeItemAssetManager != null) {
storeItemAssetManager.a();
}
super.onDestroy();
}
@Override
public void onIdentifyClicked(@NonNull final View view, final Reward reward) {
final FrameLayout frameLayout = (FrameLayout) findViewById(R.id.rewardViewContainer);
final RewardView rewardView = (RewardView) findViewById(R.id.reward);
rewardView.setReward(reward.getRewardValue());
final int[] iArr = new int[2];
view.getLocationOnScreen(iArr);
if (iArr[0] != 0) {
CallAppApplication.get().runOnMainThread(new Runnable() {
@Override
public final void run() {
frameLayout.setVisibility(0);
?? r0 = rewardView;
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) r0.getLayoutParams();
int[] iArr2 = iArr;
float dimension = iArr2[1] - PostCallActivity.this.getResources().getDimension(2131166642);
View view2 = view;
layoutParams.topMargin = (int) (dimension + (view2.getHeight() / 2));
if (LocaleUtils.isRTL()) {
layoutParams.gravity = 3;
layoutParams.setMarginEnd(iArr2[0] - (view2.getWidth() / 2));
} else {
layoutParams.leftMargin = iArr2[0] - (view2.getWidth() / 2);
}
r0.setLayoutParams(layoutParams);
r0.n();
reward.onRewardGranted();
}
});
}
}
@Override
public void onPause() {
this.eventBus.b(PauseListener.z8, null, false);
super.onPause();
}
@Override
public void onResume() {
super.onResume();
this.eventBus.b(ResumeListener.A8, null, false);
}
@Override
public void onStart() {
super.onStart();
EventBusManager.a.b(PostCallStartedListener.a.getTYPE(), null, false);
}
@Override
public void finishActivity(Boolean bool) {
finishActivity();
}
}