导航菜单

页面标题

页面副标题

Easycash v3.75.13 - SettingActivity.java 源代码

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

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


package com.fintopia.lender.module.setting;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import butterknife.BindView;
import butterknife.OnClick;
import com.fintopia.lender.R;
import com.fintopia.lender.module.account.LenderLoginAndRegisterActivity;
import com.fintopia.lender.module.baseui.LenderCommonActivity;
import com.fintopia.lender.module.launch.AppGeneralConfigUtils;
import com.fintopia.lender.module.maintab.AuthHelper;
import com.fintopia.lender.module.maintab.model.AppDownloadUrlResponse;
import com.fintopia.lender.module.network.ILenderApiRoutes;
import com.fintopia.lender.module.profile.PersonalInformationActivity;
import com.fintopia.lender.module.utils.YqdUtils;
import com.fintopia.lender.module.webpage.LenderWebViewActivity;
import com.fintopia.lender.widget.LenderConfirmDialog;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.model.IdnObserver;
import com.lingyue.idnbaselib.utils.EcFormatUtil;
import com.lingyue.idnbaselib.utils.GeneralUtil;
import com.lingyue.idnbaselib.utils.ThirdPartEventUtils;
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.veda.android.bananalibrary.infrastructure.BaseActivity;
import com.yangqianguan.statistics.AutoTrackHelper;
import io.reactivex.disposables.Disposable;
import java.util.ArrayList;
import java.util.HashMap;

public class SettingActivity extends LenderCommonActivity {

    @BindView(5972)
    View line;

    @BindView(5580)
    TextView tvAppVersionCode;

    @BindView(5581)
    TextView tvAppVersionCodeNew;

    @BindView(5643)
    TextView tvDeleteAccount;

    @BindView(5762)
    TextView tvNotification;

    @BindView(5763)
    TextView tvNotificationStatus;

    @BindView(5764)
    TextView tvNotificationTip;

    private boolean f170u;

    private boolean M() {
        if (!this.userSession.d()) {
            LenderLoginAndRegisterActivity.startLenderLoginAndRegisterActivity(u());
        }
        return !this.userSession.d();
    }

    @SensorsDataInstrumented
    public void N(DialogInterface dialogInterface, int i) {
        dialogInterface.dismiss();
        logout(true, true);
        SensorsDataAutoTrackHelper.trackDialog(dialogInterface, i);
        AutoTrackHelper.trackViewOnClick(dialogInterface, i);
    }

    public void O(HashMap hashMap) {
        if (AppGeneralConfigUtils.o().f("app_config.display_user_delete_tab", Boolean.FALSE).booleanValue()) {
            this.tvDeleteAccount.setVisibility(0);
            this.line.setVisibility(0);
        } else {
            this.tvDeleteAccount.setVisibility(8);
            this.line.setVisibility(8);
        }
        dismissLoadingDialog();
    }

    private void P() {
        boolean a = ToastCompat.a(this);
        this.f170u = a;
        if (a) {
            this.tvNotificationStatus.setCompoundDrawablesWithIntrinsicBounds((Drawable) null, (Drawable) null, (Drawable) null, (Drawable) null);
            this.tvNotificationStatus.setTypeface(Typeface.DEFAULT);
            this.tvNotificationStatus.setTextColor(getResources().getColor(R.color.c_base_light_black));
            this.tvNotificationStatus.setText(R.string.ec_opened_notification);
            this.tvNotificationTip.setVisibility(8);
            return;
        }
        this.tvNotificationStatus.setCompoundDrawablesWithIntrinsicBounds((Drawable) null, (Drawable) null, ContextCompat.getDrawable(this, R.drawable.ic_arrow_dcdde0), (Drawable) null);
        this.tvNotificationStatus.setTypeface(Typeface.DEFAULT_BOLD);
        this.tvNotificationStatus.setTextColor(getResources().getColor(R.color.c_base_blue));
        this.tvNotificationStatus.setText(R.string.ec_go_open_notification);
        this.tvNotificationTip.setVisibility(0);
    }

    private void Q() {
        showLoadingDialog();
        ArrayList arrayList = new ArrayList();
        arrayList.add("app_config.display_user_delete_tab");
        AppGeneralConfigUtils.o().w(this, arrayList, new AppGeneralConfigUtils.Callback() {
            @Override
            public final void b(HashMap hashMap) {
                SettingActivity.this.O(hashMap);
            }
        });
    }

    public static void startSettingActivity(Activity activity) {
        activity.startActivity(new Intent(activity, (Class<?>) SettingActivity.class));
    }

    @Override
    protected void A() {
        super.A();
        this.tvAppVersionCode.setText(EcFormatUtil.z(Long.parseLong(YqdUtils.d())));
        if (this.userSession.f().latestBuild > Long.parseLong(YqdUtils.d())) {
            this.tvAppVersionCodeNew.setVisibility(0);
            this.line.setVisibility(0);
        } else {
            this.tvAppVersionCodeNew.setVisibility(8);
            this.line.setVisibility(8);
        }
    }

    @OnClick({5643})
    public void clickDeleteAccount() {
        if (BaseUtils.l()) {
            return;
        }
        startActivity(new Intent((Context) this, (Class<?>) LenderPreDeleteAccountActivity.class));
    }

    @OnClick({4773})
    public void clickOpenNotification() {
        if (BaseUtils.l() || this.f170u) {
            return;
        }
        GeneralUtil.b(this);
    }

    @OnClick({5808})
    protected void clickPrivacyPolicy() {
        if (BaseUtils.l()) {
            return;
        }
        LenderWebViewActivity.startWebActivity(this, Uri.parse(((BaseActivity) this).appGlobal.a.a().toString()).buildUpon().path("webview/static-agreement/EASYCASH_IDN_REGISTER").build().toString());
    }

    @OnClick({5884})
    protected void clickTermsOfUse() {
        if (BaseUtils.l()) {
            return;
        }
        LenderWebViewActivity.startWebActivity(this, Uri.parse(((BaseActivity) this).appGlobal.a.a().toString()).buildUpon().path("webview/static-agreement/INVESTAJA_TERMS_OF_USE").build().toString());
    }

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

    @OnClick({5559})
    protected void goAboutUs() {
        if (BaseUtils.l()) {
            return;
        }
        ThirdPartEventUtils.y(this, "lender_setting_btn_aboutus");
        if (M()) {
            return;
        }
        LenderWebViewActivity.startWebActivity(this, Uri.parse(((BaseActivity) this).appGlobal.a.a().toString()).buildUpon().path("/webview/about-us").build().toString());
    }

    @OnClick({5799})
    protected void goPersonalInformation(View view) {
        if (BaseUtils.l()) {
            return;
        }
        if (AuthHelper.g(this)) {
            PersonalInformationActivity.startPersonalInformationActivity(u());
        } else {
            AuthHelper.f(this, null);
        }
    }

    @OnClick({4687})
    protected void logout() {
        if (BaseUtils.l()) {
            return;
        }
        ThirdPartEventUtils.y(this, "lender_setting_btn_logout");
        LenderConfirmDialog.e(this).s("dialog_logout").f(R.string.lender_confirm_logout).n(new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                SettingActivity.this.N(dialogInterface, i);
            }
        }).show();
    }

    @Override
    protected void onResume() {
        super.onResume();
        P();
    }

    @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);
    }

    @OnClick({5329})
    protected void updateApp(View view) {
        if (!BaseUtils.l() && this.userSession.f().latestBuild > Long.parseLong(YqdUtils.d())) {
            showLoadingDialog();
            ((ILenderApiRoutes) this.apiHelper.a()).I0(Long.valueOf(this.userSession.f().latestBuild)).a(new IdnObserver<AppDownloadUrlResponse>(this) {
                public void onSuccess(AppDownloadUrlResponse appDownloadUrlResponse) {
                    if (!TextUtils.isEmpty(appDownloadUrlResponse.body.url)) {
                        SettingActivity.this.openBrowser(appDownloadUrlResponse.body.url);
                    }
                    SettingActivity.this.dismissLoadingDialog();
                }
            });
        }
    }

    @Override
    protected void w() {
        super.w();
        Q();
    }
}