正在查看: Easycash v3.75.13 应用的 EasyCashMainActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Easycash v3.75.13 应用的 EasyCashMainActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.lingyue.easycash.activity;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.core.view.OnApplyWindowInsetsListener;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
import com.airbnb.lottie.LottieAnimationView;
import com.appsflyer.AppsFlyerLib;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.animation.GlideAnimation;
import com.bumptech.glide.request.target.SimpleTarget;
import com.fintopia.lender.module.launch.AppGeneralConfigUtils;
import com.fintopia.lender.module.utils.LocationHelper;
import com.google.android.material.bottomnavigation.BottomNavigationItemView;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx;
import com.lingyue.easycash.R;
import com.lingyue.easycash.SwitchConfig;
import com.lingyue.easycash.account.ECLoginAndRegisterV2Activity;
import com.lingyue.easycash.account.LoginAndRegisterWrapper;
import com.lingyue.easycash.account.model.LoginAndRegisterExpConfig;
import com.lingyue.easycash.activity.EasyCashMainActivity;
import com.lingyue.easycash.activity.launch.EasyCashLaunchActivity;
import com.lingyue.easycash.activity.launch.PermissionSwitchConfigHelper;
import com.lingyue.easycash.appconfig.EasyCashConfigs;
import com.lingyue.easycash.appconfig.EasycashConfigKey;
import com.lingyue.easycash.appconfig.GeneralConfigManager;
import com.lingyue.easycash.business.home.IHomeContract;
import com.lingyue.easycash.business.market.ResourceMarketTransform;
import com.lingyue.easycash.business.market.ResourceTracCenter;
import com.lingyue.easycash.business.market.ResourceType;
import com.lingyue.easycash.business.nsrender.EventCenter;
import com.lingyue.easycash.commom.EasyCashBaseFragment;
import com.lingyue.easycash.commom.EasyCashCommonActivity;
import com.lingyue.easycash.commom.IUserSession;
import com.lingyue.easycash.core.HomeCore;
import com.lingyue.easycash.fragment.EasyCashBillsFragment;
import com.lingyue.easycash.fragment.EasyCashHomeFragment;
import com.lingyue.easycash.fragment.EasyCashPersonalCenterFragment;
import com.lingyue.easycash.fragment.EasyCashRateUsHelper;
import com.lingyue.easycash.fragment.EasyCashWebViewFragment;
import com.lingyue.easycash.models.AppInfo;
import com.lingyue.easycash.models.AppListRequest;
import com.lingyue.easycash.models.AppListWithTypeRequest;
import com.lingyue.easycash.models.AwardStepType;
import com.lingyue.easycash.models.EventLoginOrRegisterEnd;
import com.lingyue.easycash.models.EventTranslucentPreRegisterFlowFinish;
import com.lingyue.easycash.models.GiftAwardGetSuccess;
import com.lingyue.easycash.models.SetPasswordSuccess;
import com.lingyue.easycash.models.enums.PageVersion;
import com.lingyue.easycash.models.enums.UserDisplayStatus;
import com.lingyue.easycash.models.event.FinishMainActEvent;
import com.lingyue.easycash.models.event.InitCheckOrderSuccessEvent;
import com.lingyue.easycash.models.event.JoinActivityEvent;
import com.lingyue.easycash.models.event.QuickRepayResultEvent;
import com.lingyue.easycash.models.event.UserConfirmAgreementStickyEvent;
import com.lingyue.easycash.models.home.FinishAuthEvent;
import com.lingyue.easycash.models.home.HomeBody;
import com.lingyue.easycash.models.order.BillingOrderCountTipInfo;
import com.lingyue.easycash.models.order.BillingOrderCountTipResponse;
import com.lingyue.easycash.models.response.ServiceContactResponse;
import com.lingyue.easycash.route.RouteCenter;
import com.lingyue.easycash.utils.AdjustInfoUtils;
import com.lingyue.easycash.utils.AppResourceReportUtils;
import com.lingyue.easycash.utils.CreateOrderSuccessUtils;
import com.lingyue.easycash.utils.EasycashUmengEvent;
import com.lingyue.easycash.utils.GiftAwardOperationUtil;
import com.lingyue.easycash.utils.IPushActAccompany;
import com.lingyue.easycash.utils.PhoneUtil;
import com.lingyue.easycash.utils.RequestCacheManager;
import com.lingyue.easycash.utils.SensorTrackEvent;
import com.lingyue.easycash.utils.YqdUtils;
import com.lingyue.easycash.utils.applist.ALScene;
import com.lingyue.easycash.utils.applist.AppListCallBack;
import com.lingyue.easycash.utils.applist.AppListSceneConfigHelper;
import com.lingyue.easycash.utils.applist.AppListUtils;
import com.lingyue.easycash.utils.applist.DialogProcessor;
import com.lingyue.easycash.widget.EasycashUpdateDialog;
import com.lingyue.easycash.widght.EasycashPermissionConfirmDialog;
import com.lingyue.easycash.widght.EasycashSingleButtonDialog;
import com.lingyue.easycash.widght.FullScreenDialog;
import com.lingyue.easycash.widght.bottomDialog.EasyCashDialogGiftDialog;
import com.lingyue.idnbaselib.CustomTrackEvent;
import com.lingyue.idnbaselib.GeneralConfigKey;
import com.lingyue.idnbaselib.configmanager.ConfigEvent;
import com.lingyue.idnbaselib.dialogmanager.DialogHandler;
import com.lingyue.idnbaselib.dialogmanager.DialogManager;
import com.lingyue.idnbaselib.dialogmanager.DialogTask;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.model.AppResource;
import com.lingyue.idnbaselib.model.AppResourceReportPageType;
import com.lingyue.idnbaselib.model.ForceUpdateResponse;
import com.lingyue.idnbaselib.model.FreshmanGiftDialogBean;
import com.lingyue.idnbaselib.model.IdnBaseResult;
import com.lingyue.idnbaselib.model.IdnObserver;
import com.lingyue.idnbaselib.model.MediaRegisterAwardResponse;
import com.lingyue.idnbaselib.model.MessageUnreadCountResponse;
import com.lingyue.idnbaselib.model.OperationTabConfig;
import com.lingyue.idnbaselib.model.PageConfigResponse;
import com.lingyue.idnbaselib.model.SdkType;
import com.lingyue.idnbaselib.model.VerificationConfigOrder;
import com.lingyue.idnbaselib.model.VersionInfo;
import com.lingyue.idnbaselib.utils.ActiveTrackManger;
import com.lingyue.idnbaselib.utils.ColorUtil;
import com.lingyue.idnbaselib.utils.EcFormatUtil;
import com.lingyue.idnbaselib.utils.JsonParamsBuilder;
import com.lingyue.idnbaselib.utils.SharedPreferenceWithPhoneUtils;
import com.lingyue.idnbaselib.utils.ThirdPartEventUtils;
import com.lingyue.idnbaselib.widget.EasyCashTooltip;
import com.lingyue.idnbaselib.widget.UnSlidingConflictViewPager;
import com.lingyue.supertoolkit.customtools.CollectionUtils;
import com.lingyue.supertoolkit.customtools.CrashReporter;
import com.lingyue.supertoolkit.hookchecktools.HookCheckUtils;
import com.lingyue.supertoolkit.permissiontools.permission.PermissionDenied;
import com.lingyue.supertoolkit.permissiontools.permission.PermissionGranted;
import com.lingyue.supertoolkit.phonetools.ScreenUtils;
import com.lingyue.supertoolkit.resourcetools.DeviceUtils;
import com.lingyue.supertoolkit.resourcetools.SharedPreferenceUtils;
import com.lingyue.supertoolkit.rxjavatools.RxUtil;
import com.lingyue.supertoolkit.screen.IScreenShotProtectPage;
import com.lingyue.supertoolkit.widgets.BaseUtils;
import com.lingyue.supertoolkit.widgets.toastcompat.ToastCompat;
import com.sensorsdata.analytics.android.autotrack.aop.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.umeng.analytics.MobclickAgent;
import com.umeng.analytics.pro.as;
import com.umeng.analytics.pro.bg;
import com.veda.android.bananalibrary.common.BananaBaseApplication;
import com.veda.android.bananalibrary.infrastructure.BaseActivity;
import com.veda.android.imageloaderlib.Imager;
import com.yangqianguan.statistics.AutoTrackHelper;
import io.reactivex.Flowable;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.BiFunction;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Predicate;
import io.reactivex.schedulers.Schedulers;
import io.sentry.ITransaction;
import io.sentry.Sentry;
import io.sentry.SpanStatus;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import okhttp3.ResponseBody;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONException;
import org.json.JSONObject;
public class EasyCashMainActivity extends EasyCashCommonActivity implements IUserSession.IUserLoginStateChangeListener, ViewPager.OnPageChangeListener, IHomeContract, IScreenShotProtectPage {
private static final int f1b0 = Color.parseColor("#48E572");
private TextView C;
private EasyCashHomeFragment F;
private EasyCashBillsFragment G;
private EasyCashWebViewFragment H;
private EasyCashPersonalCenterFragment I;
private Disposable J;
private DialogManager K;
private EasyCashTooltip L;
private long O;
private boolean P;
private boolean Q;
private String R;
EasyCashDialogGiftDialog S;
private String T;
@Deprecated
private AppListUtils V;
private Disposable W;
@Nullable
DialogTask Y;
Disposable Z;
private boolean f2a0;
@BindView(R.id.bnv_tabs)
BottomNavigationViewEx bnvTabs;
public Runnable giftDialogRunnable;
@BindView(R.id.iv_toolbar_right_icon_point)
ImageView ivToolbarRightIconPoint;
@BindView(R.id.lav_toolbar_customer_service_icon)
LottieAnimationView lavToolbarCustomerServiceIcon;
@BindView(R.id.tv_toolbar_left_icon_title)
TextView tvToolbarLeftIconTitle;
@BindView(R.id.uscvp_main)
UnSlidingConflictViewPager uscvpMain;
private final String B = "LOAN_REGISTER_AGREEMENT";
private List<EasyCashBaseFragment> D = new ArrayList();
private Set<String> E = new HashSet();
private int M = 0;
private int N = 0;
private boolean U = false;
private int X = -1;
static class AnonymousClass19 {
static final int[] a;
static {
int[] iArr = new int[VersionInfo.UpdateType.values().length];
a = iArr;
try {
iArr[VersionInfo.UpdateType.FORCE_UPDATE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[VersionInfo.UpdateType.VERSION_INFO.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[VersionInfo.UpdateType.UPDATE_NOTICE.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
}
}
public static class IntentBuilder {
private final Context a;
private int b = -1;
private String c;
private IntentBuilder(Context context) {
this.a = context;
}
public static IntentBuilder f(@NonNull Context context) {
Objects.requireNonNull(context);
return new IntentBuilder(context);
}
public Intent a() {
Intent intent = new Intent(this.a, (Class<?>) EasyCashMainActivity.class);
intent.setFlags(603979776);
intent.putExtra("target_fragment_index", String.valueOf(this.b));
intent.putExtra("redirect_url", this.c);
return intent;
}
public IntentBuilder b(String str) {
this.c = str;
return this;
}
public IntentBuilder c() {
this.b = 1;
return this;
}
public IntentBuilder d() {
this.b = 0;
return this;
}
public IntentBuilder e() {
this.b = 3;
return this;
}
}
private void A1() {
this.a.setVisibility(4);
this.a.setEnabled(false);
this.ivToolbarRightIconPoint.setVisibility(8);
}
public void A2(ALScene aLScene, final AppListCallBack appListCallBack, final FullScreenDialog fullScreenDialog) {
final DialogTask dialogTask = new DialogTask(u1(aLScene));
fullScreenDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public final void onDismiss(DialogInterface dialogInterface) {
EasyCashMainActivity.this.y2(dialogTask, dialogInterface);
}
});
this.K.b(dialogTask, new DialogHandler() {
@Override
public final void show() {
EasyCashMainActivity.this.z2(dialogTask, appListCallBack, fullScreenDialog);
}
});
}
private void B1() {
this.bnvTabs.e(false);
this.bnvTabs.g(false);
this.bnvTabs.f(false);
this.bnvTabs.r(12.0f);
this.bnvTabs.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
public final boolean onNavigationItemSelected(MenuItem menuItem) {
boolean Z1;
Z1 = EasyCashMainActivity.this.Z1(menuItem);
return Z1;
}
});
}
public void B2() {
this.a.setVisibility(0);
this.a.setEnabled(true);
this.ivToolbarRightIconPoint.setVisibility(8);
this.lavToolbarCustomerServiceIcon.setVisibility(0);
n3();
}
private void C1() {
if (this.F == null) {
this.F = EasyCashHomeFragment.H0();
}
this.D.add(this.F);
if (this.G == null) {
this.G = EasyCashBillsFragment.p0();
}
this.D.add(this.G);
if (this.H == null) {
if (this.userSession.f().operationTabConfig == null || TextUtils.isEmpty(this.userSession.f().operationTabConfig.redirectUrl)) {
this.R = w1();
} else {
this.R = this.userSession.f().operationTabConfig.redirectUrl;
}
this.H = EasyCashWebViewFragment.t0(this.R, false, false);
}
this.D.add(this.H);
if (this.I == null) {
this.I = EasyCashPersonalCenterFragment.I1();
}
this.D.add(this.I);
}
public void C2() {
this.giftDialogRunnable = null;
A1();
this.lavToolbarCustomerServiceIcon.setVisibility(8);
this.bnvTabs.m(0);
TextView textView = this.C;
if (textView != null) {
textView.setVisibility(4);
}
this.P = false;
ActiveTrackManger.c().a();
RxUtil.b(this.J);
removeTriggerSurveyRunnable();
n3();
}
private void D1(int i) {
BottomNavigationItemView childAt = this.bnvTabs.getChildAt(0).getChildAt(i);
View inflate = LayoutInflater.from(this).inflate(R.layout.easycash_layout_menu_badge, (ViewGroup) childAt, false);
this.C = (TextView) inflate.findViewById(R.id.tv_badge);
childAt.addView(inflate);
}
public void D2() {
if (!HomeCore.v().z() || isFinishing() || isDestroyed() || this.f2a0 || getSupportFragmentManager().isStateSaved()) {
return;
}
try {
this.uscvpMain.setOffscreenPageLimit(3);
this.f2a0 = true;
} catch (Exception e) {
Sentry.h(e);
}
}
private void E1() {
B1();
FragmentPagerAdapter fragmentPagerAdapter = new FragmentPagerAdapter(getSupportFragmentManager(), 1) {
public int getCount() {
return EasyCashMainActivity.this.D.size();
}
public Fragment getItem(int i) {
return (Fragment) EasyCashMainActivity.this.D.get(i);
}
};
if (HomeCore.v().z()) {
this.uscvpMain.setOffscreenPageLimit(1);
} else {
this.uscvpMain.setOffscreenPageLimit(3);
}
this.uscvpMain.setScrollable(false);
this.uscvpMain.setAdapter(fragmentPagerAdapter);
this.uscvpMain.addOnPageChangeListener(this);
this.bnvTabs.s(this.uscvpMain);
U2();
f3();
}
private void E2() {
String str = EasycashUmengEvent.f49j0;
int currentItem = this.uscvpMain.getCurrentItem();
if (currentItem == 0) {
str = EasycashUmengEvent.f49j0;
} else if (currentItem == 1) {
str = EasycashUmengEvent.f51l0;
} else if (currentItem == 3) {
str = EasycashUmengEvent.f50k0;
}
ThirdPartEventUtils.y(this, str);
}
private void F1() {
this.f.setVisibility(8);
this.f.setBackgroundColor(0);
this.f.setNavigationIcon((Drawable) null);
setTitle("");
G1();
H1();
setPaddingForStatusBar(this.f);
}
private void F2() {
HashMap hashMap = new HashMap();
hashMap.put("hasAppsFlyerUID", j1(AppsFlyerLib.getInstance().getAppsFlyerUID(this)));
hashMap.put("hasAppsLocalGaid", j1(SharedPreferenceUtils.s(this, "gaid", "")));
hashMap.put("hasDeviceId", j1(DeviceUtils.h(BananaBaseApplication.getApplication())));
hashMap.put("hasAppsflyerInstallData", j1(SharedPreferenceUtils.s(this, "appsflyer_install_data", "")));
hashMap.put("hasOpenTimes", j1(String.valueOf(SharedPreferenceUtils.p(this, "startAppCount", 0))));
ThirdPartEventUtils.u("advertisement_open_app", hashMap);
}
private void G1() {
this.lavToolbarCustomerServiceIcon.setVisibility(0);
this.lavToolbarCustomerServiceIcon.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
EasyCashMainActivity.this.b2(view);
}
});
}
private void G2() {
ThirdPartEventUtils.D(this, EasycashUmengEvent.A2, new JsonParamsBuilder().d("id").a(this.userSession.f().operationTabConfig != null ? this.userSession.f().operationTabConfig.id : "").d("content").a(this.userSession.f().operationTabConfig != null ? this.userSession.f().operationTabConfig.content : "").d("imageUrl").a(this.userSession.f().operationTabConfig != null ? this.userSession.f().operationTabConfig.iconUrl : "").d("redirectUrl").a(this.userSession.f().operationTabConfig != null ? this.userSession.f().operationTabConfig.redirectUrl : "").c());
if (this.userSession.f().operationTabConfig != null) {
ResourceTracCenter.c().e(AppResourceReportPageType.HOME.name(), ResourceMarketTransform.c(this.userSession.f().operationTabConfig), this, ResourceType.ResourceBtnType.Confirm);
}
}
private void H1() {
this.a.setVisibility(isLoggedIn() ? 0 : 4);
this.a.setEnabled(isLoggedIn());
this.a.setImageResource(2131230896);
this.a.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
EasyCashMainActivity.this.c2(view);
}
});
}
private void H2() {
if (System.currentTimeMillis() - this.O < 2000) {
super/*androidx.activity.ComponentActivity*/.onBackPressed();
} else {
BaseUtils.p(this, getString(2131886861));
this.O = System.currentTimeMillis();
}
}
private boolean I1(int i) {
return i == 0 || i == 1 || i == 2 || i == 3;
}
public void I2(ForceUpdateResponse forceUpdateResponse) {
if (n1(forceUpdateResponse)) {
d3(forceUpdateResponse.body);
}
}
private void J1() {
if (isLoggedIn()) {
E2();
String b = EasyCashConfigs.r.b(true);
if (TextUtils.isEmpty(b)) {
b = "webview/message";
}
jumpToWebPage(YqdUtils.f(this.appGlobal.a.a() + b));
}
}
private void J2(@NonNull Bundle bundle) {
this.T = bundle.getString("redirect_url", "");
bundle.remove("redirect_url");
}
public void K1(DialogTask dialogTask, DialogInterface dialogInterface) {
this.K.f(dialogTask);
}
public void K2(int i, boolean z2) {
if (i <= 0) {
TextView textView = this.C;
if (textView != null) {
textView.setVisibility(4);
return;
}
return;
}
if (this.C == null) {
D1(1);
}
this.C.setVisibility(0);
this.C.setText(String.valueOf(i));
this.C.setBackground(ContextCompat.getDrawable(this, z2 ? R.drawable.easycash_shape_circle_solid_red_r_8 : R.drawable.shape_circle_solid_yellow_r_8));
}
public void L1(String str) {
ThirdPartEventUtils.y(this, str);
}
private void L2() {
if (this.userSession.b().pageConfigVersion != PageVersion.V1) {
this.lavToolbarCustomerServiceIcon.setImageTintList(ColorStateList.valueOf(getResources().getColor(2131099772)));
this.lavToolbarCustomerServiceIcon.setPadding(getResources().getDimensionPixelSize(2131165529), getResources().getDimensionPixelSize(2131165597), getResources().getDimensionPixelSize(2131165415), getResources().getDimensionPixelSize(2131165597));
this.lavToolbarCustomerServiceIcon.setImageResource(2131230884);
return;
}
this.lavToolbarCustomerServiceIcon.setImageTintList(null);
this.lavToolbarCustomerServiceIcon.setPadding(getResources().getDimensionPixelSize(2131165529), getResources().getDimensionPixelSize(2131165413), getResources().getDimensionPixelSize(2131165415), getResources().getDimensionPixelSize(2131165413));
this.lavToolbarCustomerServiceIcon.setImageResource(R.drawable.easycash_ic_customer_service);
this.lavToolbarCustomerServiceIcon.setVisibility(0);
}
public void M1(String str, DialogInterface dialogInterface) {
ThirdPartEventUtils.z(this, EasycashUmengEvent.h2, new JsonParamsBuilder().d("step").a(str).d("operational_activity").a("big_gift_package_event").c());
}
private void M2() {
L2();
new GeneralConfigManager(this).h(Collections.singletonList(EasycashConfigKey.CUSTOMER_SERVICE_DISPLAY_BILLS), new GeneralConfigManager.Callback() {
@Override
public void a() {
EasyCashMainActivity.this.lavToolbarCustomerServiceIcon.setVisibility(8);
}
@Override
public void b(@NonNull HashMap<String, String> hashMap) {
EasyCashMainActivity.this.lavToolbarCustomerServiceIcon.setVisibility(Boolean.parseBoolean(hashMap.get(EasycashConfigKey.CUSTOMER_SERVICE_DISPLAY_BILLS)) ? 0 : 8);
}
});
}
public void N1(String str, final ObservableEmitter observableEmitter) throws Exception {
Glide.with(this).load(str).asBitmap().into(new SimpleTarget<Bitmap>() {
public void onResourceReady(Object obj, GlideAnimation glideAnimation) {
onResourceReady((Bitmap) obj, (GlideAnimation<? super Bitmap>) glideAnimation);
}
public void onResourceReady(Bitmap bitmap, GlideAnimation<? super Bitmap> glideAnimation) {
observableEmitter.onNext(new BitmapDrawable(EasyCashMainActivity.this.getResources(), bitmap));
}
});
}
private void N2() {
L2();
new GeneralConfigManager(this).h(Collections.singletonList(EasycashConfigKey.CUSTOMER_SERVICE_DISPLAY_ME), new GeneralConfigManager.Callback() {
@Override
public void a() {
EasyCashMainActivity.this.lavToolbarCustomerServiceIcon.setVisibility(8);
}
@Override
public void b(@NonNull HashMap<String, String> hashMap) {
EasyCashMainActivity.this.lavToolbarCustomerServiceIcon.setVisibility(Boolean.parseBoolean(hashMap.get(EasycashConfigKey.CUSTOMER_SERVICE_DISPLAY_ME)) ? 0 : 8);
}
});
}
public void O1(ITransaction iTransaction) throws Exception {
if (ContextCompat.checkSelfPermission(this, "android.permission.ACCESS_COARSE_LOCATION") != 0) {
customActivityTTFDTransaction().a("showPermissionDlg", "true");
reportFullDisplayManually("showPermissionDlg", "showPermission");
}
}
private void O2() {
EasyCashWebViewFragment easyCashWebViewFragment = this.H;
if (easyCashWebViewFragment == null || !easyCashWebViewFragment.isAdded()) {
return;
}
final OperationTabConfig operationTabConfig = this.userSession.f().operationTabConfig;
this.H.v0(this.R);
Disposable disposable = this.Z;
if (disposable == null || disposable.c()) {
Disposable g02 = this.H.lifecycleObs().C(new Predicate() {
public final boolean test(Object obj) {
boolean l2;
l2 = EasyCashMainActivity.l2((LifecycleEvent) obj);
return l2;
}
}).g0(new Consumer() {
public final void accept(Object obj) {
EasyCashMainActivity.this.m2(operationTabConfig, (LifecycleEvent) obj);
}
}, new com.lingyue.easycash.account.u());
this.Z = g02;
addCompositeDisposable(g02);
}
}
public void P1(String str, DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
openBrowser(str);
}
private void P2() {
EasyCashRateUsHelper easyCashRateUsHelper = new EasyCashRateUsHelper(this);
easyCashRateUsHelper.A("after_sign");
easyCashRateUsHelper.C();
}
public void Q1(DialogInterface dialogInterface) {
MobclickAgent.onKillProcess(this);
System.exit(0);
}
private void Q2() {
this.tvToolbarLeftIconTitle.setVisibility(8);
this.tvToolbarLeftIconTitle.setClickable(false);
setTitle(R.string.easycash_bills);
if (!isLoggedIn()) {
this.f.setBackgroundColor(0);
A1();
return;
}
this.f.setBackgroundColor(0);
this.e.setTextColor(-16777216);
this.a.setVisibility(0);
this.a.setEnabled(true);
S2();
M2();
}
public void R1(DialogTask dialogTask, DialogInterface dialogInterface) {
this.K.f(dialogTask);
}
private void R2() {
this.f.setBackgroundColor(ColorUtil.a(this.userSession.f().invasiveToolBarColor, f1b0));
this.tvToolbarLeftIconTitle.setCompoundDrawablesWithIntrinsicBounds(ContextCompat.getDrawable(this, R.drawable.easycash_shape_block_point_red), (Drawable) null, (Drawable) null, (Drawable) null);
this.tvToolbarLeftIconTitle.setCompoundDrawablePadding(ScreenUtils.b(this, 3));
this.tvToolbarLeftIconTitle.setPadding(ScreenUtils.b(this, 5), ScreenUtils.b(this, 5), ScreenUtils.b(this, 5), ScreenUtils.b(this, 5));
this.tvToolbarLeftIconTitle.setTextColor(ContextCompat.getColor(this, 2131099802));
this.tvToolbarLeftIconTitle.setTextSize(0, getResources().getDimensionPixelSize(2131165949));
this.tvToolbarLeftIconTitle.setBackground(ContextCompat.getDrawable(this, R.drawable.easycash_shape_c_dark_black_a_15_r16));
if (!isLoggedIn()) {
A1();
return;
}
this.a.setVisibility(0);
this.a.setEnabled(true);
this.a.setImageTintList(null);
this.a.setImageResource(this.M > 0 ? 2131230900 : 2131230899);
this.ivToolbarRightIconPoint.setVisibility(8);
}
@SensorsDataInstrumented
public void S1(String str, DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
openBrowser(str);
SensorsDataAutoTrackHelper.trackDialog(dialogInterface, i);
AutoTrackHelper.trackViewOnClick(dialogInterface, i);
}
private void S2() {
int color = this.userSession.b().pageConfigVersion == PageVersion.V1 ? getResources().getColor(2131099767) : 0;
this.a.setImageTintList(color == 0 ? null : ColorStateList.valueOf(color));
this.ivToolbarRightIconPoint.setVisibility(8);
this.a.setImageResource(R.drawable.easycash_ic_transaction_record);
}
@SensorsDataInstrumented
public static void T1(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
SensorsDataAutoTrackHelper.trackDialog(dialogInterface, i);
AutoTrackHelper.trackViewOnClick(dialogInterface, i);
}
public void T2() {
if (this.userSession.b().pageConfigVersion == PageVersion.V1) {
this.a.setImageTintList(null);
this.ivToolbarRightIconPoint.setVisibility(8);
this.a.setImageResource(this.M > 0 ? 2131230898 : 2131230896);
} else {
this.ivToolbarRightIconPoint.setVisibility(this.M > 0 ? 0 : 8);
this.a.setImageTintList(ColorStateList.valueOf(getResources().getColor(2131099762)));
this.a.setImageResource(2131230897);
}
}
public void U1(int i, DialogInterface dialogInterface) {
String str = "suggest_upgrade_" + i;
HashSet hashSet = new HashSet(SharedPreferenceUtils.t(this, str, new HashSet()));
hashSet.add(String.valueOf(37513));
SharedPreferenceUtils.K(this, str, hashSet);
}
public void U2() {
String str;
if (isDestroyed()) {
return;
}
OperationTabConfig operationTabConfig = this.userSession.f().operationTabConfig;
if (operationTabConfig == null) {
str = getString(R.string.easycash_gift);
this.bnvTabs.j(2).setImageDrawable(ContextCompat.getDrawable(this, R.drawable.easycash_selector_operation_icon));
this.R = w1();
} else {
String str2 = operationTabConfig.pressIconUrl;
String str3 = operationTabConfig.iconUrl;
String str4 = operationTabConfig.text;
if (!TextUtils.isEmpty(str3) && !TextUtils.isEmpty(str2)) {
V2(str2, str3);
} else if (TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str3)) {
Imager.a().b(this, str3, this.bnvTabs.j(2));
}
if (this.userSession.f().operationTabConfig == null || TextUtils.isEmpty(this.userSession.f().operationTabConfig.redirectUrl)) {
this.R = w1();
} else {
this.R = this.userSession.f().operationTabConfig.redirectUrl;
}
ThirdPartEventUtils.D(this, EasycashUmengEvent.z2, new JsonParamsBuilder().d("id").a(operationTabConfig.id).d("content").a(operationTabConfig.content).d("imageUrl").a(operationTabConfig.iconUrl).d("redirectUrl").a(operationTabConfig.redirectUrl).c());
W2(operationTabConfig);
str = str4;
}
g1(str);
}
private void V2(String str, String str2) {
Observable.m0(h1(str), h1(str2), new BiFunction() {
public final Object apply(Object obj, Object obj2) {
StateListDrawable p2;
p2 = EasyCashMainActivity.p2((Drawable) obj, (Drawable) obj2);
return p2;
}
}).a(new Observer<StateListDrawable>() {
public void onNext(StateListDrawable stateListDrawable) {
EasyCashMainActivity.this.bnvTabs.j(2).setImageDrawable(stateListDrawable);
}
public void onError(Throwable th) {
}
public void onSubscribe(Disposable disposable) {
}
public void onComplete() {
}
});
}
public void W1(int i, DialogInterface dialogInterface) {
SharedPreferenceUtils.H(this, "introduce_feature", i);
}
private void W2(OperationTabConfig operationTabConfig) {
AppResourceReportUtils.a(this, Arrays.asList(new AppResource(AppResourceReportPageType.HOME.name(), this.userSession.b().exactStatus, operationTabConfig.id)));
}
public void X1(DialogTask dialogTask, DialogInterface dialogInterface) {
this.K.f(dialogTask);
}
public void X2(String str, String str2) {
AppGeneralConfigUtils.o().u(str, str2);
}
public void Y1(PermissionSwitchConfigHelper permissionSwitchConfigHelper, DialogTask dialogTask) {
l1();
permissionSwitchConfigHelper.b();
this.K.f(dialogTask);
}
private void Y2() {
this.K.a();
this.apiHelper.a().R().a(new IdnObserver<ForceUpdateResponse>(this) {
@Override
public void onError(Throwable th, ForceUpdateResponse forceUpdateResponse) {
super.onError(th, (Throwable) forceUpdateResponse);
EasyCashMainActivity.this.K.e();
}
@Override
public void onSuccess(ForceUpdateResponse forceUpdateResponse) {
EasyCashMainActivity.this.I2(forceUpdateResponse);
EasyCashMainActivity.this.K.e();
}
@Override
protected boolean superShowErrorToast() {
return false;
}
});
}
@SensorsDataInstrumented
public boolean Z1(MenuItem menuItem) {
ThirdPartEventUtils.z(this, EasycashUmengEvent.V0, menuItem.getTitle().toString());
if (menuItem.getItemId() != 2131361953 || this.userSession.d()) {
SensorsDataAutoTrackHelper.trackMenuItem(this, menuItem);
return true;
}
jumpToLoginOrRegisterPage();
SensorsDataAutoTrackHelper.trackMenuItem(this, menuItem);
return false;
}
private void Z2() {
F2();
this.apiHelper.a().V(AppsFlyerLib.getInstance().getAppsFlyerUID(this), SharedPreferenceUtils.s(this, "appsflyer_install_data", ""), AdjustInfoUtils.b(), AdjustInfoUtils.a(), SharedPreferenceUtils.p(this, "startAppCount", 0)).a(new Observer<ResponseBody>() {
public void onNext(ResponseBody responseBody) {
}
public void onError(Throwable th) {
}
public void onSubscribe(Disposable disposable) {
}
public void onComplete() {
}
});
}
public void a2() {
if (this.userSession.f().isRefreshAppList) {
p3(ALScene.HOMEPAGE_AUTO_UPLOAD);
}
if (isPersonFragmentItem()) {
this.tvToolbarLeftIconTitle.setText(EcFormatUtil.v(this.userSession.b().mobileNumber));
} else {
this.tvToolbarLeftIconTitle.setText(this.userSession.f().cashLoanTkbConfig.externalString);
}
if (isLoggedIn()) {
y1();
}
}
public void a3(List<AppInfo> list) {
this.apiHelper.a().x1(new AppListRequest(list)).a(new IdnObserver<IdnBaseResult>(this) {
@Override
protected boolean superShowErrorToast() {
return false;
}
@Override
public void onSuccess(IdnBaseResult idnBaseResult) {
}
});
}
@SensorsDataInstrumented
public void b2(View view) {
if (BaseUtils.l()) {
SensorsDataAutoTrackHelper.trackViewOnClick(view);
AutoTrackHelper.trackViewOnClick(view);
} else {
h3();
openCustomerService();
SensorsDataAutoTrackHelper.trackViewOnClick(view);
AutoTrackHelper.trackViewOnClick(view);
}
}
private void b3() {
ArrayList arrayList = new ArrayList();
arrayList.add(EasycashConfigKey.STORE_RATING_POPUP_AFTER_SIGN);
new GeneralConfigManager(this).z(arrayList, new Runnable() {
@Override
public final void run() {
EasyCashMainActivity.this.q2();
}
});
}
@SensorsDataInstrumented
public void c2(View view) {
if (BaseUtils.l()) {
SensorsDataAutoTrackHelper.trackViewOnClick(view);
AutoTrackHelper.trackViewOnClick(view);
return;
}
if (isBillFragmentItem()) {
ThirdPartEventUtils.y(this, EasycashUmengEvent.r1);
ECBillRecordActivity.startECBillRecordActivity(this);
} else {
J1();
}
SensorsDataAutoTrackHelper.trackViewOnClick(view);
AutoTrackHelper.trackViewOnClick(view);
}
private void c3() {
DialogManager dialogManager = this.K;
dialogManager.g(dialogManager.d("register_success_award_dialog"), false);
BottomSheetDialog bottomSheetDialog = this.S;
if (bottomSheetDialog != null && bottomSheetDialog.isShowing()) {
this.S.dismiss();
}
GiftAwardOperationUtil.a(AwardStepType.AUTH_SUCCESS.name(), this, true, new AnonymousClass15());
}
public void d2() {
if (this.userSession.f().isRefreshAppList) {
p3(ALScene.LOGIN_OR_REGISTER_END);
}
if (isPersonFragmentItem()) {
refreshToolBarViewForPerson();
}
}
private void d3(VersionInfo versionInfo) {
int i = AnonymousClass19.a[versionInfo.type.ordinal()];
if (i == 1) {
p1(versionInfo.desc, versionInfo.url);
return;
}
if (i == 2) {
if (k1(versionInfo.latestVersion)) {
t1(versionInfo.desc, versionInfo.latestVersion);
}
} else if (i == 3 && m1(versionInfo.latestVersion)) {
r1(versionInfo.desc, versionInfo.url, versionInfo.latestVersion);
}
}
public void e2(GiftAwardGetSuccess giftAwardGetSuccess) {
q1(giftAwardGetSuccess.bean);
}
private boolean e3(int i) {
return i == 0 && this.F.B0();
}
private void f1(FreshmanGiftDialogBean freshmanGiftDialogBean, String str, final String str2, final String str3) {
this.S = new EasyCashDialogGiftDialog(this, freshmanGiftDialogBean);
final DialogTask dialogTask = new DialogTask(str);
this.S.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public final void onDismiss(DialogInterface dialogInterface) {
EasyCashMainActivity.this.K1(dialogTask, dialogInterface);
}
});
this.S.d(new EasyCashDialogGiftDialog.OnButtonClickListener() {
@Override
public final void a() {
EasyCashMainActivity.this.L1(str2);
}
});
this.S.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public final void onShow(DialogInterface dialogInterface) {
EasyCashMainActivity.this.M1(str3, dialogInterface);
}
});
DialogManager dialogManager = this.K;
EasyCashDialogGiftDialog easyCashDialogGiftDialog = this.S;
Objects.requireNonNull(easyCashDialogGiftDialog);
dialogManager.b(dialogTask, new g2(easyCashDialogGiftDialog));
}
public void f2(GiftAwardGetSuccess giftAwardGetSuccess) {
s1(giftAwardGetSuccess.bean);
}
private void f3() {
UnSlidingConflictViewPager unSlidingConflictViewPager;
String stringExtra = getIntent().getStringExtra("target_fragment_index");
int parseInt = !TextUtils.isEmpty(stringExtra) ? Integer.parseInt(stringExtra) : -1;
if (!I1(parseInt) || (unSlidingConflictViewPager = this.uscvpMain) == null || unSlidingConflictViewPager.getCurrentItem() == parseInt) {
return;
}
if (parseInt != 1 || isLoggedIn()) {
this.uscvpMain.setCurrentItem(parseInt, false);
} else {
jumpToLoginOrRegisterPage();
}
}
private void g1(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
this.bnvTabs.getMenu().getItem(2).setTitle(str);
}
public void g2(final GiftAwardGetSuccess giftAwardGetSuccess) {
if (isFinishing() || isDestroyed()) {
return;
}
AwardStepType awardStepType = giftAwardGetSuccess.type;
if (awardStepType == AwardStepType.REGISTRATION_SUCCESS) {
this.giftDialogRunnable = new Runnable() {
@Override
public final void run() {
EasyCashMainActivity.this.e2(giftAwardGetSuccess);
}
};
} else if (awardStepType == AwardStepType.RETURN_APP) {
this.giftDialogRunnable = new Runnable() {
@Override
public final void run() {
EasyCashMainActivity.this.f2(giftAwardGetSuccess);
}
};
}
}
private void g3() {
String s = SharedPreferenceUtils.s(this, "appsflyer_install_data", "");
ThirdPartEventUtils.D(this, EasycashUmengEvent.z1, new JsonParamsBuilder().d("appsFlyerInfo").a(s).d("appsflyerId").a(AppsFlyerLib.getInstance().getAppsFlyerUID(this)).c());
}
private Observable<Drawable> h1(final String str) {
return Observable.n(new ObservableOnSubscribe() {
public final void a(ObservableEmitter observableEmitter) {
EasyCashMainActivity.this.N1(str, observableEmitter);
}
});
}
public void h2(DialogTask dialogTask, Integer num) throws Exception {
this.K.g(dialogTask, true);
}
private void h3() {
ThirdPartEventUtils.z(this, EasycashUmengEvent.j2, new JsonParamsBuilder().d("tab").a(isHomeFragmentItem() ? "home" : isBillFragmentItem() ? "bills" : isPersonFragmentItem() ? "me" : "").c());
if (this.userSession.b().userStatus == UserDisplayStatus.REJECTED || this.userSession.b().userStatus == UserDisplayStatus.ENABLE_REAPPLIED) {
SensorTrackEvent sensorTrackEvent = SensorTrackEvent.EC_LOAN_MARKET_CUSTOMER_SERVICE_CLICK;
ThirdPartEventUtils.G(this, null, sensorTrackEvent.b(), null, sensorTrackEvent.a());
}
}
private void i1() {
if (this.X == 1) {
this.G.h0();
}
}
private void i3() {
ThirdPartEventUtils.z(this, EasycashUmengEvent.R1, new JsonParamsBuilder().d("deviceId").a(DeviceUtils.h(this)).d("isNotificationOpen").a(String.valueOf(ToastCompat.a(this))).c());
}
private static String j1(String str) {
return TextUtils.isEmpty(str) ? "0" : "1";
}
public void j2(ConfigEvent configEvent) throws Exception {
this.userSession.f().orderVerificationConfig = (VerificationConfigOrder) configEvent.b();
}
private void j3() {
if (HookCheckUtils.a()) {
Bundle bundle = new Bundle();
if (TextUtils.isEmpty(this.userSession.b().mobileNumber)) {
bundle.putString("number", this.userSession.b().mobileNumber);
}
FirebaseAnalytics.getInstance(this).b(CustomTrackEvent.a, bundle);
}
}
private boolean k1(int i) {
return i != SharedPreferenceUtils.p(this, "introduce_feature", 0);
}
private void k3() {
if (EasyCashLaunchActivity.isFirstLaunchApp()) {
ArrayList arrayList = new ArrayList();
arrayList.add(SdkType.IDN_YQD.name());
arrayList.add(SdkType.IDN_FIN.name());
this.apiHelper.a().F(arrayList).a(new IdnObserver<PageConfigResponse>(this) {
@Override
public void onSuccess(PageConfigResponse pageConfigResponse) {
if (CollectionUtils.f(pageConfigResponse.body.bottomTabList)) {
return;
}
for (OperationTabConfig operationTabConfig : pageConfigResponse.body.bottomTabList) {
if (SdkType.IDN_YQD.name().equals(operationTabConfig.sdkType)) {
EasyCashMainActivity.this.userSession.f().operationTabConfig = operationTabConfig;
} else if (SdkType.IDN_FIN.name().equals(operationTabConfig.sdkType)) {
EasyCashMainActivity easyCashMainActivity = EasyCashMainActivity.this;
easyCashMainActivity.X2("app_config.fin_tab_operation", easyCashMainActivity.gson.t(operationTabConfig));
}
}
EasyCashMainActivity.this.U2();
}
});
}
}
private void l1() {
RxUtil.b(this.W);
Disposable g02 = Flowable.M(customActivityTTFDTransaction()).s(1L, TimeUnit.SECONDS, Schedulers.c()).Q(AndroidSchedulers.a()).g0(new Consumer() {
public final void accept(Object obj) {
EasyCashMainActivity.this.O1((ITransaction) obj);
}
}, new o2());
this.W = g02;
onSubscribe(g02);
}
public static boolean l2(LifecycleEvent lifecycleEvent) throws Exception {
return lifecycleEvent == LifecycleEvent.RESUMED;
}
private void l3() {
if (this.userSession.d()) {
GiftAwardOperationUtil.a(AwardStepType.RETURN_APP.name(), this, true, new GiftAwardOperationUtil.GiftAwardCallback() {
@Override
public void b(MediaRegisterAwardResponse mediaRegisterAwardResponse) {
MediaRegisterAwardResponse.Body body = mediaRegisterAwardResponse.body;
if (body.showPopUp) {
EasyCashMainActivity.this.s1(body.convertToFreshmanGiftBean());
}
}
@Override
public void a() {
}
});
}
}
private boolean m1(int i) {
return !SharedPreferenceUtils.t(this, "suggest_upgrade_" + i, new HashSet()).contains(String.valueOf(37513));
}
public void m2(OperationTabConfig operationTabConfig, LifecycleEvent lifecycleEvent) throws Exception {
if (operationTabConfig != null) {
ResourceTracCenter.c().h(AppResourceReportPageType.HOME.name(), ResourceMarketTransform.c(operationTabConfig), this);
}
ThirdPartEventUtils.M(getActivity(), this.H, SensorTrackEvent.EC_ACTIVITY_TAB);
}
private void m3() {
if (shouldOpenLoginPage()) {
customActivityTTFDTransaction().a("toLogin", String.valueOf(true));
customActivityTTFDTransaction().a("expInfo", LoginAndRegisterExpConfig.a());
reportFullDisplayManually("toLoginPage", "notLogin");
this.Q = AppListSceneConfigHelper.h().j();
ECLoginAndRegisterV2Activity.startECLoginAndRegisterV2Activity(this);
SharedPreferenceUtils.E(this, "sp_first_install_should_open_login_page", false);
}
}
private boolean n1(ForceUpdateResponse forceUpdateResponse) {
return (forceUpdateResponse == null || forceUpdateResponse.body == null) ? false : true;
}
@SensorsDataInstrumented
public void n2(View view) {
if (BaseUtils.l()) {
SensorsDataAutoTrackHelper.trackViewOnClick(view);
AutoTrackHelper.trackViewOnClick(view);
return;
}
this.L.c(this.tvToolbarLeftIconTitle, this.userSession.f().cashLoanTkbConfig.internalList, (int) BaseUtils.a(-70.0f, this), (int) BaseUtils.a(8.0f, this));
SensorsDataAutoTrackHelper.trackViewOnClick(view);
AutoTrackHelper.trackViewOnClick(view);
}
private void n3() {
if (isHomeFragmentItem()) {
return;
}
sendBottomTabRequest();
}
public void o1(FreshmanGiftDialogBean freshmanGiftDialogBean) {
if (freshmanGiftDialogBean == null || CollectionUtils.f(freshmanGiftDialogBean.a)) {
return;
}
f1(freshmanGiftDialogBean, "auth_success_award_dialog", EasycashUmengEvent.f2, AwardStepType.AUTH_SUCCESS.name());
}
@SensorsDataInstrumented
public void o2(View view) {
this.I.l1();
SensorsDataAutoTrackHelper.trackViewOnClick(view);
AutoTrackHelper.trackViewOnClick(view);
}
public void o3(@Nullable String str) {
if (SharedPreferenceUtils.m(this, "sp_borrower_have_show_permission_confirm_dialog", false) || this.Q || this.Y != null || TextUtils.isEmpty(str)) {
return;
}
final EasycashPermissionConfirmDialog n = EasycashPermissionConfirmDialog.f(this).h(str).j(2131886864).l(2131886769).k(new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
EasyCashMainActivity.this.s2(dialogInterface, i);
}
}).i(new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
EasyCashMainActivity.t2(dialogInterface, i);
}
}).g(false).n("ec_dialog_permission_confirm");
n.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public final void onShow(DialogInterface dialogInterface) {
EasyCashMainActivity.this.u2(dialogInterface);
}
});
n.setOnKeyListener(new DialogInterface.OnKeyListener() {
@Override
public final boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
boolean v2;
v2 = EasyCashMainActivity.v2(dialogInterface, i, keyEvent);
return v2;
}
});
final DialogTask dialogTask = new DialogTask("permission_confirm_dialog");
n.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public final void onDismiss(DialogInterface dialogInterface) {
EasyCashMainActivity.this.w2(dialogTask, dialogInterface);
}
});
this.K.b(dialogTask, new DialogHandler() {
@Override
public final void show() {
EasyCashMainActivity.this.x2(dialogTask, n);
}
});
}
private void p1(@NonNull String str, @NonNull final String str2) {
EasycashSingleButtonDialog l = EasycashSingleButtonDialog.d(this).m(getString(R.string.find_new_version)).i(3).o("dialog_force_update").h(str.replace("\\n", "\n")).f(R.string.update_right_now).l(new EasycashSingleButtonDialog.OnDialogButtonClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
EasyCashMainActivity.this.P1(str2, dialogInterface, i);
}
});
l.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public final void onDismiss(DialogInterface dialogInterface) {
EasyCashMainActivity.this.Q1(dialogInterface);
}
});
this.K.b(DialogTask.c, new u2(l));
}
public static StateListDrawable p2(Drawable drawable, Drawable drawable2) throws Exception {
StateListDrawable stateListDrawable = new StateListDrawable();
stateListDrawable.addState(new int[]{android.R.attr.state_checked}, drawable);
stateListDrawable.addState(new int[0], drawable2);
return stateListDrawable;
}
private void p3(final ALScene aLScene) {
if (this.userSession.d()) {
final AppListCallBack<List<AppInfo>> appListCallBack = new AppListCallBack<List<AppInfo>>() {
@Override
public void c(List<AppInfo> list) {
if (CollectionUtils.f(list)) {
return;
}
EasyCashMainActivity.this.a3(list);
}
};
v1().v(aLScene, appListCallBack, new DialogProcessor() {
@Override
public final void a(FullScreenDialog fullScreenDialog) {
EasyCashMainActivity.this.A2(aLScene, appListCallBack, fullScreenDialog);
}
});
}
}
private void q1(FreshmanGiftDialogBean freshmanGiftDialogBean) {
if (freshmanGiftDialogBean == null || CollectionUtils.f(freshmanGiftDialogBean.a) || !TextUtils.equals(this.userSession.b().mobileNumber, SharedPreferenceUtils.s(this, "display_media_register_success_dialog", ""))) {
return;
}
f1(freshmanGiftDialogBean, "register_success_award_dialog", EasycashUmengEvent.e2, AwardStepType.REGISTRATION_SUCCESS.name());
SharedPreferenceUtils.k(this, "display_media_register_success_dialog");
}
public void q2() {
if (!this.userSession.f().storeRatingPopupAfterSign.booleanValue() || SharedPreferenceWithPhoneUtils.f(this, this.userSession.b().mobileNumber, "has_rate_us_with_phone")) {
return;
}
EasyCashRateUsHelper.x();
P2();
}
private void q3(AppListWithTypeRequest.AdditionalType additionalType, String str) {
CreateOrderSuccessUtils.l(this, v1(), additionalType, str);
}
private void r1(@NonNull String str, @NonNull final String str2, final int i) {
final DialogTask dialogTask = new DialogTask("update_notice_dialog");
final EasycashUpdateDialog i2 = EasycashUpdateDialog.f(this).l(getString(R.string.find_new_version)).h(3).g(str.replace("\\n", "\n")).k(R.string.update_right_now).m("dialog_update").j(new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i3) {
EasyCashMainActivity.this.S1(str2, dialogInterface, i3);
}
}).i(new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i3) {
EasyCashMainActivity.T1(dialogInterface, i3);
}
});
i2.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public final void onShow(DialogInterface dialogInterface) {
EasyCashMainActivity.this.U1(i, dialogInterface);
}
});
i2.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public final void onDismiss(DialogInterface dialogInterface) {
EasyCashMainActivity.this.R1(dialogTask, dialogInterface);
}
});
this.K.b(dialogTask, new DialogHandler() {
@Override
public final void show() {
EasycashUpdateDialog.this.show();
}
});
}
public void r2() {
customActivityTTFDTransaction().a("toLogin", String.valueOf(true));
customActivityTTFDTransaction().a("expInfo", LoginAndRegisterExpConfig.a());
reportFullDisplayManually("toLoginPage", "notLogin");
this.Q = AppListSceneConfigHelper.h().j();
LoginAndRegisterWrapper.d(this);
SharedPreferenceUtils.E(this, "sp_first_install_should_open_login_page", false);
}
private boolean r3() {
return SharedPreferenceUtils.m(this, "sp_consent_gain_app_list", false);
}
private void refreshMessageCenterStatus() {
RxUtil.b(this.J);
this.apiHelper.a().i().a(new IdnObserver<MessageUnreadCountResponse>(this) {
@Override
public void onSuccess(MessageUnreadCountResponse messageUnreadCountResponse) {
EasyCashMainActivity.this.M = messageUnreadCountResponse.body.unreadCount;
EasyCashMainActivity.this.userSession.b().unreadCount = messageUnreadCountResponse.body.unreadCount;
if (EasyCashMainActivity.this.isBillFragmentItem()) {
int color = EasyCashMainActivity.this.userSession.b().pageConfigVersion == PageVersion.V1 ? EasyCashMainActivity.this.getResources().getColor(2131099767) : 0;
((BaseActivity) EasyCashMainActivity.this).a.setImageTintList(color != 0 ? ColorStateList.valueOf(color) : null);
((BaseActivity) EasyCashMainActivity.this).a.setImageResource(R.drawable.easycash_ic_transaction_record);
} else {
if (EasyCashMainActivity.this.isPersonFragmentItem()) {
EasyCashMainActivity.this.T2();
return;
}
if (EasyCashMainActivity.this.isHomeFragmentItem()) {
if (EasyCashMainActivity.this.userSession.b().pageConfigVersion != PageVersion.V1) {
HomeCore.v().x().b(EasyCashMainActivity.this.M);
} else if (EasyCashMainActivity.this.userSession.b().isDynamicallySetHomeToolBarColor) {
((BaseActivity) EasyCashMainActivity.this).a.setImageTintList(null);
((BaseActivity) EasyCashMainActivity.this).a.setImageResource(EasyCashMainActivity.this.M > 0 ? 2131230900 : 2131230899);
} else {
((BaseActivity) EasyCashMainActivity.this).a.setImageTintList(null);
((BaseActivity) EasyCashMainActivity.this).a.setImageResource(EasyCashMainActivity.this.M > 0 ? 2131230898 : 2131230896);
}
}
}
}
@Override
public void onSubscribe(Disposable disposable) {
super.onSubscribe(disposable);
EasyCashMainActivity.this.J = disposable;
}
@Override
protected boolean superShowErrorToast() {
return false;
}
});
}
public void s1(FreshmanGiftDialogBean freshmanGiftDialogBean) {
if (freshmanGiftDialogBean == null || CollectionUtils.f(freshmanGiftDialogBean.a)) {
return;
}
f1(freshmanGiftDialogBean, "back_app_award_dialog", EasycashUmengEvent.l4, AwardStepType.RETURN_APP.name());
}
@SensorsDataInstrumented
public void s2(DialogInterface dialogInterface, int i) {
SharedPreferenceUtils.E(this, "sp_consent_gain_app_list", true);
HomeCore.v().r();
dialogInterface.dismiss();
SensorsDataAutoTrackHelper.trackDialog(dialogInterface, i);
AutoTrackHelper.trackViewOnClick(dialogInterface, i);
}
private void t1(@NonNull String str, final int i) {
if (TextUtils.isEmpty(str)) {
return;
}
final DialogTask dialogTask = new DialogTask("version_info_dialog");
EasycashSingleButtonDialog l = EasycashSingleButtonDialog.d(this).m(getString(R.string.easycash_feature_of_new_version)).i(3).o("dialog_display_version").h(str.replace("\\n", "\n")).f(R.string.got_it).l(new EasycashSingleButtonDialog.OnDialogButtonClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i2) {
dialogInterface.dismiss();
}
});
l.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public final void onShow(DialogInterface dialogInterface) {
EasyCashMainActivity.this.W1(i, dialogInterface);
}
});
l.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public final void onDismiss(DialogInterface dialogInterface) {
EasyCashMainActivity.this.X1(dialogTask, dialogInterface);
}
});
this.K.b(dialogTask, new u2(l));
}
@SensorsDataInstrumented
public static void t2(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
SensorsDataAutoTrackHelper.trackDialog(dialogInterface, i);
AutoTrackHelper.trackViewOnClick(dialogInterface, i);
}
private String u1(ALScene aLScene) {
if (aLScene == null) {
return "gain_app_list_dlg" + System.currentTimeMillis();
}
return "gain_app_list_dlg" + aLScene.value + System.currentTimeMillis();
}
public void u2(DialogInterface dialogInterface) {
ThirdPartEventUtils.D(this, EasycashUmengEvent.T2, null);
}
private AppListUtils v1() {
if (this.V == null) {
this.V = new AppListUtils(this);
}
return this.V;
}
public static boolean v2(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
if (i != 4) {
return false;
}
dialogInterface.dismiss();
return true;
}
@NonNull
private String w1() {
return Uri.parse(this.appGlobal.a.a().toString()).buildUpon().path("webview/activity-center").appendQueryParameter(bg.aE, as.m).appendQueryParameter("reqSpeBar", "1").appendQueryParameter("isAppBarHid", "1").appendQueryParameter("noReturn", "1").build().toString();
}
public void w2(DialogTask dialogTask, DialogInterface dialogInterface) {
SharedPreferenceUtils.E(this, "sp_borrower_have_show_permission_confirm_dialog", true);
this.K.f(dialogTask);
}
private void x1() {
this.apiHelper.a().p1().a(new IdnObserver<ServiceContactResponse>(this) {
@Override
public void onSuccess(ServiceContactResponse serviceContactResponse) {
if (serviceContactResponse != null) {
EasyCashMainActivity.this.userSession.f().customerServiceNumber = serviceContactResponse.body.telephone;
EasyCashMainActivity.this.userSession.f().appStoreUrl = serviceContactResponse.body.appStoreUrl;
EasyCashMainActivity.this.userSession.f().workingTime = serviceContactResponse.body.workingTime;
}
}
@Override
protected boolean superShowErrorToast() {
return false;
}
});
}
public void x2(DialogTask dialogTask, EasycashPermissionConfirmDialog easycashPermissionConfirmDialog) {
if (SharedPreferenceUtils.m(this, "sp_borrower_have_show_permission_confirm_dialog", false) || this.Q || this.Y != null) {
this.K.g(dialogTask, true);
} else {
easycashPermissionConfirmDialog.show();
}
}
private void y1() {
if (!this.P && TextUtils.equals(this.userSession.f().agreementReadMethod, "FORCE_READ")) {
HashSet hashSet = new HashSet(SharedPreferenceUtils.t(this, "user_need_force_display_protocol_with_diversion", new HashSet()));
this.E = hashSet;
if (CollectionUtils.f(hashSet) || !this.E.contains(this.userSession.b().mobileNumber)) {
return;
}
jumpToWebPage(Uri.parse(this.appGlobal.a.a().toString()).buildUpon().path("webview/protocol").appendQueryParameter("purpose", "LOAN_REGISTER_AGREEMENT").appendQueryParameter("reqSpeBar", "1").appendQueryParameter("isAppBarHid", "1").build().toString());
this.P = true;
ThirdPartEventUtils.y(this, EasycashUmengEvent.a2);
}
}
public void y2(DialogTask dialogTask, DialogInterface dialogInterface) {
this.K.f(dialogTask);
}
private boolean z1(String str) {
if (TextUtils.isEmpty(str)) {
return false;
}
RouteCenter.f(this, str);
return true;
}
public void z2(DialogTask dialogTask, AppListCallBack appListCallBack, FullScreenDialog fullScreenDialog) {
if (!r3()) {
fullScreenDialog.show();
} else {
this.K.f(dialogTask);
PhoneUtil.b(this, appListCallBack);
}
}
@Override
protected void B(@NonNull Bundle bundle) {
super.B(bundle);
J2(bundle);
Fragment fragment = getSupportFragmentManager().getFragment(bundle, "HOME_FRAGMENT_TAG");
if (fragment instanceof EasyCashBaseFragment) {
this.F = (EasyCashHomeFragment) fragment;
}
Fragment fragment2 = getSupportFragmentManager().getFragment(bundle, "BILLS_FRAGMENT_TAG");
if (fragment2 instanceof EasyCashBillsFragment) {
this.G = (EasyCashBillsFragment) fragment2;
}
Fragment fragment3 = getSupportFragmentManager().getFragment(bundle, "OPERATOR_FRAGMENT_TAG");
if (fragment3 instanceof EasyCashWebViewFragment) {
this.H = (EasyCashWebViewFragment) fragment3;
}
Fragment fragment4 = getSupportFragmentManager().getFragment(bundle, "PERSON_FRAGMENT_TAG");
if (fragment4 instanceof EasyCashBaseFragment) {
this.I = (EasyCashPersonalCenterFragment) fragment4;
}
}
@Override
protected void D() {
E1();
F1();
}
@Override
protected void N(@NonNull Bundle bundle) {
super.N(bundle);
EasyCashHomeFragment easyCashHomeFragment = this.F;
if (easyCashHomeFragment != null && easyCashHomeFragment.isAdded()) {
getSupportFragmentManager().putFragment(bundle, "HOME_FRAGMENT_TAG", this.F);
}
EasyCashBillsFragment easyCashBillsFragment = this.G;
if (easyCashBillsFragment != null && easyCashBillsFragment.isAdded()) {
getSupportFragmentManager().putFragment(bundle, "BILLS_FRAGMENT_TAG", this.G);
}
EasyCashWebViewFragment easyCashWebViewFragment = this.H;
if (easyCashWebViewFragment != null && easyCashWebViewFragment.isAdded()) {
getSupportFragmentManager().putFragment(bundle, "OPERATOR_FRAGMENT_TAG", this.H);
}
EasyCashPersonalCenterFragment easyCashPersonalCenterFragment = this.I;
if (easyCashPersonalCenterFragment == null || !easyCashPersonalCenterFragment.isAdded()) {
return;
}
getSupportFragmentManager().putFragment(bundle, "PERSON_FRAGMENT_TAG", this.I);
}
@Override
public boolean dispatchTouchEvent(MotionEvent motionEvent) {
this.F.dispatchTouchEvent(motionEvent);
return super.dispatchTouchEvent(motionEvent);
}
public void fetchPermissionSwitchConfig() {
if (this.U) {
return;
}
final PermissionSwitchConfigHelper permissionSwitchConfigHelper = new PermissionSwitchConfigHelper(this);
permissionSwitchConfigHelper.a(new PermissionSwitchConfigHelper.PermissionSwitchConfigProcessor() {
@Override
public void a() {
?? r0 = EasyCashMainActivity.this;
r0.o3(r0.getString(2131886855));
}
@Override
public void b(HashMap<String, String> hashMap) {
EasyCashMainActivity.this.U = true;
SwitchConfig.c().h(hashMap);
EasyCashMainActivity.this.o3(SwitchConfig.c().b());
}
});
final DialogTask dialogTask = new DialogTask("dlg_permission_compilations");
this.K.b(dialogTask, new DialogHandler() {
@Override
public final void show() {
EasyCashMainActivity.this.Y1(permissionSwitchConfigHelper, dialogTask);
}
});
}
public void getBillingOrderCountTipRequestForLoggedIn() {
if (isLoggedIn()) {
this.apiHelper.a().p0().a(new IdnObserver<BillingOrderCountTipResponse>(this) {
@Override
public void onSuccess(BillingOrderCountTipResponse billingOrderCountTipResponse) {
BillingOrderCountTipInfo billingOrderCountTipInfo = billingOrderCountTipResponse.body;
EasyCashMainActivity.this.K2(billingOrderCountTipInfo.repayingInstalmentCount, billingOrderCountTipInfo.overdue);
}
});
}
}
@Override
public IHomeContract.PageType getContainerType() {
return IHomeContract.PageType.HOME;
}
@Override
public DialogManager getDialogManager() {
return this.K;
}
public int getHomeTabIndex() {
return this.uscvpMain.getCurrentItem();
}
@Override
public int getLayoutID() {
return R.layout.activity_main_page;
}
@Override
public String getTrackUrl() {
return isHomeFragmentItem() ? EasyCashHomeFragment.class.getName() : isBillFragmentItem() ? EasyCashBillsFragment.class.getName() : isPersonFragmentItem() ? EasyCashPersonalCenterFragment.class.getName() : getClass().getName();
}
public void gotoHomeTab() {
this.bnvTabs.m(0);
}
public void gotoOrderTab() {
this.bnvTabs.m(1);
}
public void gotoPersonTab() {
this.bnvTabs.m(3);
}
@Override
protected void init() {
super.init();
getWindow().addFlags(67108864);
this.userSession.h(this);
this.K = new DialogManager();
this.L = new EasyCashTooltip(this);
C1();
g3();
i3();
j3();
if (z1(this.T)) {
this.T = "";
}
if (LoginAndRegisterExpConfig.c()) {
m3();
}
}
@Override
public void initDefaultToolBarBackground(int i) {
this.f.setBackgroundColor(i);
}
public boolean isBillFragmentItem() {
return this.uscvpMain.getCurrentItem() == 1;
}
@Override
public boolean isCreatingOrder() {
EasyCashHomeFragment easyCashHomeFragment = this.F;
if (easyCashHomeFragment == null || !easyCashHomeFragment.isAdded()) {
return false;
}
return this.F.isCreatingOrder();
}
public boolean isHomeFragmentItem() {
return this.uscvpMain.getCurrentItem() == 0;
}
@Override
public boolean isNeedProcessScreenShot() {
return isHomeFragmentItem() || isBillFragmentItem() || isPersonFragmentItem();
}
public boolean isPersonFragmentItem() {
return this.uscvpMain.getCurrentItem() == 3;
}
@Override
public boolean isPullRefresh() {
EasyCashHomeFragment easyCashHomeFragment = this.F;
if (easyCashHomeFragment == null) {
return false;
}
return easyCashHomeFragment.isPullRefresh();
}
@PermissionGranted({"android.permission.ACCESS_COARSE_LOCATION"})
protected void onAccessCoarseLocation() {
HomeCore.v().r();
RxUtil.b(this.W);
LocationHelper.d().j();
}
public void onBackPressed() {
if (getOnBackPressedDispatcher().hasEnabledCallbacks()) {
super/*androidx.activity.ComponentActivity*/.onBackPressed();
return;
}
int currentItem = this.uscvpMain.getCurrentItem();
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("tabIndex", String.valueOf(currentItem));
} catch (JSONException e) {
e.printStackTrace();
}
ThirdPartEventUtils.z(this, EasycashUmengEvent.R0, jSONObject.toString());
if (e3(currentItem) && this.F.I0()) {
return;
}
H2();
}
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onEventLoginOrRegister(EventLoginOrRegisterEnd eventLoginOrRegisterEnd) {
new GeneralConfigManager(this).g(new Runnable() {
@Override
public final void run() {
EasyCashMainActivity.this.d2();
}
});
}
@Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
public void onEventUserConfirmAgreement(UserConfirmAgreementStickyEvent userConfirmAgreementStickyEvent) {
if ("LOAN_REGISTER_AGREEMENT".equals(userConfirmAgreementStickyEvent.purpose)) {
EventBus.c().q(userConfirmAgreementStickyEvent);
this.P = false;
this.E.remove(this.userSession.b().mobileNumber);
SharedPreferenceUtils.K(this, "user_need_force_display_protocol_with_diversion", this.E);
ThirdPartEventUtils.y(this, EasycashUmengEvent.b2);
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onFinishAuth(FinishAuthEvent finishAuthEvent) {
refreshHomeView();
c3();
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onFlowInfoInvalidEvent(FinishMainActEvent finishMainActEvent) {
finish();
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onGiftAwardGetSuccess(final GiftAwardGetSuccess giftAwardGetSuccess) {
if (giftAwardGetSuccess != null) {
new Handler().postDelayed(new Runnable() {
@Override
public final void run() {
EasyCashMainActivity.this.g2(giftAwardGetSuccess);
}
}, 2000L);
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onInitCheckOrderSuccess(InitCheckOrderSuccessEvent initCheckOrderSuccessEvent) {
gotoHomeTab();
b3();
}
@Override
public void onJoinActivity() {
EventBus.c().k(new JoinActivityEvent());
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
f3();
if (intent.getBooleanExtra("finishCreateOrder", false)) {
q3((AppListWithTypeRequest.AdditionalType) intent.getSerializableExtra("appListAdditionalType"), intent.getStringExtra("supplementId"));
intent.removeExtra("finishCreateOrder");
intent.removeExtra("appListAdditionalType");
intent.removeExtra("supplementId");
}
if (z1(this.T)) {
this.T = "";
}
}
public void onPageSelected(int i) {
if (i != 0 && HomeCore.v().z()) {
D2();
}
HomeCore.v().X();
IPushActAccompany.f(this);
if (i == 0) {
i1();
refreshToolBarViewForHome();
} else if (i == 1) {
this.f.setVisibility(0);
Q2();
removeTriggerSurveyRunnable();
} else if (i == 2) {
this.f.setVisibility(8);
O2();
i1();
G2();
removeTriggerSurveyRunnable();
} else if (i == 3) {
i1();
this.f.setVisibility(0);
refreshToolBarViewForPerson();
removeTriggerSurveyRunnable();
}
this.X = i;
}
@Override
protected void onPause() {
super.onPause();
if (this.Q) {
this.K.a();
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onPreRegisterFlowFinish(EventTranslucentPreRegisterFlowFinish eventTranslucentPreRegisterFlowFinish) {
final DialogTask dialogTask = this.Y;
if (dialogTask == null) {
return;
}
this.Y = null;
duringActive(Flowable.M(1)).g0(new Consumer() {
public final void accept(Object obj) {
EasyCashMainActivity.this.h2(dialogTask, (Integer) obj);
}
}, new Consumer() {
public final void accept(Object obj) {
EasyCashMainActivity.i2((Throwable) obj);
}
});
o3(SwitchConfig.c().b());
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onQuickRepayResultEvent(QuickRepayResultEvent quickRepayResultEvent) {
if (quickRepayResultEvent.isSuccess) {
gotoHomeTab();
}
}
@PermissionDenied("android.permission.ACCESS_COARSE_LOCATION")
protected void onRejectLocation() {
HomeCore.v().r();
RxUtil.b(this.W);
}
@Override
protected void onResume() {
super.onResume();
if (this.Q && this.N >= 1) {
this.K.e();
}
this.N++;
if (isLoggedIn()) {
y1();
refreshMessageCenterStatus();
getBillingOrderCountTipRequestForLoggedIn();
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onSetPasswordSuccess(SetPasswordSuccess setPasswordSuccess) {
duringActive(GeneralConfigKey.j.a()).g0(new Consumer() {
public final void accept(Object obj) {
EasyCashMainActivity.this.j2((ConfigEvent) obj);
}
}, new Consumer() {
public final void accept(Object obj) {
EasyCashMainActivity.k2((Throwable) obj);
}
});
}
@Override
public void refreshHomeView() {
EasyCashHomeFragment easyCashHomeFragment = this.F;
if (easyCashHomeFragment == null || !easyCashHomeFragment.isAdded()) {
return;
}
this.F.N0(false);
}
@Override
public void refreshToolBarView() {
if (isHomeFragmentItem()) {
refreshToolBarViewForHome();
}
}
public void refreshToolBarViewForHome() {
if (this.userSession.b().pageConfigVersion == PageVersion.V3) {
this.f.setVisibility(8);
HomeCore.v().x().a();
return;
}
if (this.userSession.b().pageConfigVersion == PageVersion.V2) {
this.f.setVisibility(8);
HomeCore.v().x().a();
return;
}
if (this.userSession.b().pageConfigVersion == PageVersion.V1) {
setTitle("");
this.f.setVisibility(0);
this.tvToolbarLeftIconTitle.setVisibility(0);
this.tvToolbarLeftIconTitle.setClickable(true);
this.tvToolbarLeftIconTitle.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
EasyCashMainActivity.this.n2(view);
}
});
this.tvToolbarLeftIconTitle.setText(this.userSession.f().cashLoanTkbConfig.externalString);
this.lavToolbarCustomerServiceIcon.setImageTintList(null);
this.lavToolbarCustomerServiceIcon.setPadding(getResources().getDimensionPixelSize(2131165529), getResources().getDimensionPixelSize(2131165413), getResources().getDimensionPixelSize(2131165415), getResources().getDimensionPixelSize(2131165413));
this.lavToolbarCustomerServiceIcon.setImageResource(R.drawable.easycash_ic_customer_service);
this.lavToolbarCustomerServiceIcon.setVisibility(0);
if (this.userSession.b().isDynamicallySetHomeToolBarColor) {
R2();
} else {
refreshToolBarViewForHomeTransparent();
}
}
}
public void refreshToolBarViewForHomeTransparent() {
this.f.setBackgroundColor(0);
this.tvToolbarLeftIconTitle.setCompoundDrawablesWithIntrinsicBounds(ContextCompat.getDrawable(this, R.drawable.easycash_ic_ojk), (Drawable) null, (Drawable) null, (Drawable) null);
this.tvToolbarLeftIconTitle.setCompoundDrawablePadding(ScreenUtils.b(this, 10));
this.tvToolbarLeftIconTitle.setPadding(0, 0, 0, 0);
this.tvToolbarLeftIconTitle.setTextColor(ContextCompat.getColor(this, 2131099762));
this.tvToolbarLeftIconTitle.setTextSize(0, getResources().getDimensionPixelSize(2131165953));
this.tvToolbarLeftIconTitle.setBackgroundColor(0);
if (!isLoggedIn()) {
A1();
return;
}
this.a.setVisibility(0);
this.a.setEnabled(true);
this.a.setImageTintList(null);
this.a.setImageResource(this.M > 0 ? 2131230898 : 2131230896);
this.ivToolbarRightIconPoint.setVisibility(8);
}
public void refreshToolBarViewForPerson() {
setTitle("");
N2();
if (!isLoggedIn()) {
this.f.setBackgroundColor(0);
A1();
this.tvToolbarLeftIconTitle.setClickable(false);
this.tvToolbarLeftIconTitle.setVisibility(8);
return;
}
this.f.setBackgroundColor(0);
this.tvToolbarLeftIconTitle.setTextColor(-16777216);
this.tvToolbarLeftIconTitle.setText(EcFormatUtil.v(this.userSession.b().mobileNumber));
this.tvToolbarLeftIconTitle.setVisibility(0);
this.tvToolbarLeftIconTitle.setCompoundDrawablesWithIntrinsicBounds(ContextCompat.getDrawable(this, R.drawable.easycash_ic_user), (Drawable) null, (Drawable) null, (Drawable) null);
this.tvToolbarLeftIconTitle.setCompoundDrawablePadding(ScreenUtils.b(this, 10));
this.tvToolbarLeftIconTitle.setPadding(0, 0, 0, 0);
this.tvToolbarLeftIconTitle.setTextSize(0, getResources().getDimensionPixelSize(2131165953));
this.tvToolbarLeftIconTitle.setClickable(true);
this.tvToolbarLeftIconTitle.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
EasyCashMainActivity.this.o2(view);
}
});
this.tvToolbarLeftIconTitle.setBackgroundColor(0);
this.a.setVisibility(0);
this.a.setEnabled(true);
T2();
}
public void removeTriggerSurveyRunnable() {
this.F.P0();
}
public void reportFullDisplayManually(@NonNull String str, @NonNull String str2) {
try {
if (!customActivityTTFDTransaction().isFinished()) {
customActivityTTFDTransaction().a("sub_fragment", str);
customActivityTTFDTransaction().a("exactStatus", str2);
L();
customActivityTTFDTransaction().o(SpanStatus.OK);
}
} catch (Exception e) {
CrashReporter.a(e);
}
this.uscvpMain.post(new Runnable() {
@Override
public final void run() {
EasyCashMainActivity.this.D2();
}
});
EventCenter.d().b(EventCenter.Event.MAIN_PAGE);
}
@Override
public Disposable runOnActiveEvent(Runnable runnable) {
return com.lingyue.idnbaselib.framework.lifecycle.m.a(this, runnable);
}
@Override
@SuppressLint({"CheckResult"})
public Disposable runOnCreated(@NonNull Runnable runnable) {
return com.lingyue.idnbaselib.framework.lifecycle.m.b(this, runnable);
}
@Override
@SuppressLint({"CheckResult"})
public Disposable runOnDestroy(@NonNull Runnable runnable) {
return com.lingyue.idnbaselib.framework.lifecycle.m.c(this, runnable);
}
@Override
@SuppressLint({"CheckResult"})
public Disposable runOnEvent(@NonNull LifecycleEvent lifecycleEvent, @Nullable Runnable runnable) {
return com.lingyue.idnbaselib.framework.lifecycle.m.d(this, lifecycleEvent, runnable);
}
@Override
public Disposable runOnEvents(@NonNull LifecycleEvent[] lifecycleEventArr, @Nullable Runnable runnable) {
return com.lingyue.idnbaselib.framework.lifecycle.m.e(this, lifecycleEventArr, runnable);
}
public void sendBottomTabRequest() {
ArrayList arrayList = new ArrayList();
arrayList.add(SdkType.IDN_YQD.name());
this.apiHelper.a().F(arrayList).a(new IdnObserver<PageConfigResponse>(this) {
@Override
public void onSuccess(PageConfigResponse pageConfigResponse) {
if (CollectionUtils.f(pageConfigResponse.body.bottomTabList)) {
EasyCashMainActivity.this.userSession.f().operationTabConfig = null;
} else {
EasyCashMainActivity.this.userSession.f().operationTabConfig = pageConfigResponse.body.bottomTabList.get(0);
}
EasyCashMainActivity.this.U2();
}
});
}
public void setPaddingForStatusBar(View view) {
if (view == null) {
return;
}
ViewCompat.setOnApplyWindowInsetsListener(view, new OnApplyWindowInsetsListener() {
boolean a = false;
@NonNull
public WindowInsetsCompat onApplyWindowInsets(View view2, WindowInsetsCompat windowInsetsCompat) {
if (!this.a) {
int i = windowInsetsCompat.getInsets(WindowInsetsCompat.Type.statusBars()).top;
view2.setPadding(0, i, 0, 0);
if (i > 0) {
this.a = true;
ViewCompat.setOnApplyWindowInsetsListener(view2, (OnApplyWindowInsetsListener) null);
ViewCompat.dispatchApplyWindowInsets(view2, windowInsetsCompat);
}
}
return windowInsetsCompat;
}
});
}
@Override
public void setToolBarVisibility(int i) {
a0.a.b(this, i);
}
public boolean shouldOpenLoginPage() {
return !this.userSession.d() && TextUtils.isEmpty(this.T) && SharedPreferenceUtils.m(this, "sp_first_install_should_open_login_page", true);
}
@Override
public void switchToHomeFragment(HomeBody homeBody, int i) {
a0.a.c(this, homeBody, i);
}
public void tryGotoLoginPageWithDiversionV2() {
if (shouldOpenLoginPage()) {
DialogTask dialogTask = new DialogTask("fakeDialogTaskLoginRegister");
this.Y = dialogTask;
this.K.b(dialogTask, new DialogHandler() {
@Override
public final void show() {
EasyCashMainActivity.this.r2();
}
});
}
}
@Override
public void userLogin() {
runOnUiThread(new Runnable() {
@Override
public final void run() {
EasyCashMainActivity.this.B2();
}
});
}
@Override
public void userLogout() {
runOnUiThread(new Runnable() {
@Override
public final void run() {
EasyCashMainActivity.this.C2();
}
});
}
@Override
@NonNull
protected ITransaction w() {
return Sentry.C("ECMainPage", "ui.ttfd");
}
@Override
@SuppressLint({"CheckResult"})
protected void z() {
new GeneralConfigManager(this).g(new Runnable() {
@Override
public final void run() {
EasyCashMainActivity.this.a2();
}
});
x1();
Z2();
Y2();
k3();
l3();
RequestCacheManager.j().l();
}
public void refreshHomeView(boolean z2) {
EasyCashHomeFragment easyCashHomeFragment = this.F;
if (easyCashHomeFragment == null || !easyCashHomeFragment.isAdded()) {
return;
}
this.F.N0(z2);
}
public static void i2(Throwable th) throws Exception {
}
public static void k2(Throwable th) throws Exception {
}
public void onPageScrollStateChanged(int i) {
}
@Override
public void setPulRefreshEnable(boolean z2) {
}
class AnonymousClass15 implements GiftAwardOperationUtil.GiftAwardCallback {
AnonymousClass15() {
}
public void d(MediaRegisterAwardResponse mediaRegisterAwardResponse) {
EasyCashMainActivity.this.o1(mediaRegisterAwardResponse.body.convertToFreshmanGiftBean());
}
@Override
public void b(final MediaRegisterAwardResponse mediaRegisterAwardResponse) {
EasyCashMainActivity.this.giftDialogRunnable = new Runnable() {
@Override
public final void run() {
EasyCashMainActivity.AnonymousClass15.this.d(mediaRegisterAwardResponse);
}
};
}
@Override
public void a() {
}
}
@Override
public EasyCashCommonActivity getActivity() {
return this;
}
public void onPageScrolled(int i, float f, int i2) {
}
}