导航菜单

页面标题

页面副标题

Easycash v3.75.13 - ECLoanLaunchActivity.java 源代码

正在查看: Easycash v3.75.13 应用的 ECLoanLaunchActivity.java JAVA 源代码文件

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


package com.lingyue.easycash.activity.launch;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.SystemClock;
import android.text.TextUtils;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import butterknife.BindView;
import com.lingyue.easycash.R;
import com.lingyue.easycash.activity.EasyCashMainActivity;
import com.lingyue.easycash.activity.launch.SplashConfigHelper;
import com.lingyue.easycash.appconfig.EasyCashBorrowConfigManager;
import com.lingyue.easycash.appconfig.EasyCashConfigs;
import com.lingyue.easycash.appconfig.GeneralConfigManager;
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.EasyCashCommonActivity;
import com.lingyue.easycash.core.HomeCore;
import com.lingyue.easycash.utils.AppResourceReportUtils;
import com.lingyue.idnbaselib.configmanager.ConfigManagerHolder;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.model.AppResource;
import com.lingyue.idnbaselib.model.AppResourceReportPageType;
import com.lingyue.idnbaselib.model.IdnObserver;
import com.lingyue.idnbaselib.model.PageConfigResponse;
import com.lingyue.idnbaselib.model.SdkType;
import com.lingyue.supertoolkit.customtools.CollectionUtils;
import com.lingyue.supertoolkit.phonetools.AdaptScreenUtil;
import io.reactivex.disposables.Disposable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Objects;

public class ECLoanLaunchActivity extends EasyCashCommonActivity {

    @NonNull
    private SplashConfigHelper B;
    private Runnable D;
    private boolean E;
    private long G;
    private boolean H;

    @BindView(R.id.cl_parent)
    ConstraintLayout clParent;

    @BindView(R.id.gp_splash)
    Group gpSplash;

    @BindView(R.id.iv_splash)
    ImageView ivSplash;

    @BindView(R.id.tv_skip)
    TextView tvSkip;
    private boolean C = false;
    private final long F = 500;

    public static class IntentBuilder {
        private final Context a;
        private String b;

        private IntentBuilder(Context context) {
            this.a = context;
        }

        public static IntentBuilder c(@NonNull Context context) {
            Objects.requireNonNull(context);
            return new IntentBuilder(context);
        }

        public Intent a() {
            Intent intent = new Intent(this.a, (Class<?>) ECLoanLaunchActivity.class);
            intent.putExtra("redirect_url", this.b);
            intent.setFlags(603979776);
            return intent;
        }

        public IntentBuilder b(String str) {
            this.b = str;
            return this;
        }
    }

    public void X() {
        Runnable runnable;
        if (this.E && this.H && (runnable = this.D) != null) {
            this.clParent.removeCallbacks(runnable);
            this.clParent.postDelayed(this.D, Math.max(500 - (SystemClock.elapsedRealtime() - this.G), 0L));
        }
    }

    public void Y() {
        if (!this.B.j()) {
            b0(null, false);
            return;
        }
        this.gpSplash.setVisibility(0);
        if (!TextUtils.isEmpty(this.B.i().id)) {
            ResourceTracCenter.c().h(AppResourceReportPageType.SPLASH_PAGE.name(), ResourceMarketTransform.d(this.B.i()), this);
        }
        AppResourceReportUtils.a(this, Arrays.asList(new AppResource(AppResourceReportPageType.SPLASH_PAGE.name(), null, this.B.i().id)));
        this.B.g(this.ivSplash, this.tvSkip, new SplashConfigHelper.Delegate() {
            @Override
            public final void a(String str) {
                ECLoanLaunchActivity.this.d0(str);
            }
        });
    }

    private void Z() {
        ArrayList arrayList = new ArrayList();
        arrayList.add(EasyCashConfigs.k.c());
        new GeneralConfigManager(this).A(arrayList, false, new Runnable() {
            @Override
            public final void run() {
                ECLoanLaunchActivity.e0();
            }
        });
    }

    private void a0() {
        this.D = null;
        SplashConfigHelper splashConfigHelper = new SplashConfigHelper(this);
        this.B = splashConfigHelper;
        splashConfigHelper.h(new Runnable() {
            @Override
            public final void run() {
                ECLoanLaunchActivity.this.Y();
            }
        });
    }

    private void b0(@Nullable final String str, boolean z2) {
        if (this.C) {
            return;
        }
        this.C = true;
        if (TextUtils.isEmpty(str)) {
            str = i0();
        }
        Runnable runnable = new Runnable() {
            @Override
            public final void run() {
                ECLoanLaunchActivity.this.f0(str);
            }
        };
        if (z2) {
            runnable.run();
        } else {
            this.D = runnable;
            X();
        }
    }

    private void c0(String str) {
        HomeCore.v().w().b();
        startActivity(EasyCashMainActivity.IntentBuilder.f(this).b(str).a());
    }

    public void d0(String str) {
        if (!TextUtils.isEmpty(str)) {
            ResourceTracCenter.c().e(AppResourceReportPageType.SPLASH_PAGE.name(), ResourceMarketTransform.d(this.B.i()), this, ResourceType.ResourceBtnType.Confirm);
            HomeCore.v().p();
        }
        b0(str, true);
    }

    public void f0(String str) {
        c0(str);
        finish();
    }

    private void fetchOperateTabConfig() {
        this.H = false;
        ArrayList arrayList = new ArrayList();
        arrayList.add(SdkType.IDN_YQD.name());
        this.apiHelper.a().F(arrayList).a(new IdnObserver<PageConfigResponse>(this) {
            @Override
            public void onError(Throwable th, PageConfigResponse pageConfigResponse) {
                super.onError(th, (Throwable) pageConfigResponse);
                ECLoanLaunchActivity.this.H = true;
                ECLoanLaunchActivity.this.X();
            }

            @Override
            public void onSuccess(PageConfigResponse pageConfigResponse) {
                if (CollectionUtils.f(pageConfigResponse.body.bottomTabList)) {
                    ECLoanLaunchActivity.this.userSession.f().operationTabConfig = null;
                } else {
                    ECLoanLaunchActivity.this.userSession.f().operationTabConfig = pageConfigResponse.body.bottomTabList.get(0);
                }
                ECLoanLaunchActivity.this.H = true;
                ECLoanLaunchActivity.this.X();
            }
        });
    }

    public void g0() {
        HomeCore.v().U(this);
        HomeCore.v().X();
        this.E = true;
        X();
    }

    private void h0() {
        this.E = false;
        if (this.userSession.e()) {
            new RefreshUserTokenHelper(this).d(new Runnable() {
                @Override
                public final void run() {
                    ECLoanLaunchActivity.this.g0();
                }
            });
            return;
        }
        HomeCore.v().U(this);
        HomeCore.v().X();
        this.E = true;
        X();
    }

    private String i0() {
        return getIntent().getStringExtra("redirect_url");
    }

    @Override
    public int getLayoutID() {
        return R.layout.easycash_activity_loan_launch;
    }

    @Override
    public Resources getResources() {
        Resources resources = super.getResources();
        AdaptScreenUtil.c(resources);
        return resources;
    }

    @Override
    protected void init() {
        this.G = SystemClock.elapsedRealtime();
        Z();
        a0();
        h0();
        fetchOperateTabConfig();
        EventCenter.d().b(EventCenter.Event.LOAN_LAUNCH_PAGE);
    }

    public void onBackPressed() {
        finish();
    }

    @Override
    protected void onCreate(@Nullable Bundle bundle) {
        overridePendingTransition(2130771984, 2130771985);
        ConfigManagerHolder.c().d(EasyCashBorrowConfigManager.o());
        super.onCreate(bundle);
    }

    @Override
    protected void onDestroy() {
        this.clParent.removeCallbacks(this.D);
        this.B.f();
        super.onDestroy();
    }

    @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 static void e0() {
    }
}