导航菜单

页面标题

页面副标题

Súper Préstamo v1.9.1 - ConfiguracionActivity.java 源代码

正在查看: Súper Préstamo v1.9.1 应用的 ConfiguracionActivity.java JAVA 源代码文件

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


package com.pf.prestafast.view.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.StringUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.pf.prestafast.R$id;
import com.pf.prestafast.R$layout;
import com.pf.prestafast.R$string;
import com.pf.prestafast.base.BaseActivity;
import com.pf.prestafast.model.Api;
import com.pf.prestafast.mrytNetwork.RxObservable;
import com.pf.prestafast.mrytNetwork.mrytBase.MrytBaseResponse;
import com.pf.prestafast.view.activity.ConfiguracionActivity;
import com.pf.prestafast.view.activity.MainActivity;
import defpackage.f30;
import defpackage.hp;
import defpackage.o51;
import defpackage.w51;
import defpackage.y5;
import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;
import java.util.LinkedHashMap;
import java.util.Map;

public final class ConfiguracionActivity extends BaseActivity {
    public Map h = new LinkedHashMap();
    public final long f = 500;

    public static final class a implements hp.b {
        @Override
        public void a() {
            MainActivity.a aVar = MainActivity.s;
            aVar.e(false);
            aVar.f(false);
            o51.a.a().clear();
            w51.a().f();
            ActivityUtils.finishAllActivities();
            ActivityUtils.startActivity(SplashActivity.class);
            y5.y().b = false;
        }

        @Override
        public void b() {
        }
    }

    public static final class b implements hp.b {

        public static final class a implements Observer {
            @Override
            public void onNext(MrytBaseResponse mrytBaseResponse) {
                f30.h(mrytBaseResponse, "t");
                int leave = mrytBaseResponse.getLeave();
                if (leave == -1) {
                    ToastUtils.showShort("Lo sentimos, aún tienes pedidos sin terminar y no puedes cancelar tu cuenta.", new Object[0]);
                    return;
                }
                if (leave != 0) {
                    return;
                }
                ToastUtils.showShort("Eliminaremos permanentemente sus datos en " + StringUtils.getString(2131755042) + " dentro de las 48 horas.", new Object[0]);
                MainActivity.a aVar = MainActivity.s;
                aVar.e(false);
                aVar.f(false);
                o51.a.a().clear();
                w51.a().f();
                ActivityUtils.finishAllActivities();
                ActivityUtils.startActivity(SplashActivity.class);
                y5.y().b = false;
            }

            @Override
            public void onComplete() {
            }

            @Override
            public void onError(Throwable th) {
                f30.h(th, "e");
            }

            @Override
            public void onSubscribe(Disposable disposable) {
                f30.h(disposable, "d");
            }
        }

        public b() {
        }

        @Override
        public void a() {
            RxObservable.getObservable(((Api) RxObservable.createService(Api.class)).httpLogOff(), ConfiguracionActivity.this.o()).subscribe(new a());
        }

        @Override
        public void b() {
        }
    }

    public static final void F(ConfiguracionActivity configuracionActivity, View view) {
        f30.h(configuracionActivity, "this$0");
        configuracionActivity.finish();
    }

    public static final void G(ConfiguracionActivity configuracionActivity, View view) {
        f30.h(configuracionActivity, "this$0");
        hp.a aVar = hp.m;
        String string = StringUtils.getString(R$string.logout_dialog_title);
        f30.g(string, "getString(R.string.logout_dialog_title)");
        String string2 = StringUtils.getString(R$string.logout_dialog_content);
        f30.g(string2, "getString(R.string.logout_dialog_content)");
        hp a2 = aVar.a(string, string2, StringUtils.getString(R$string.logout_dialog_rightbtnname), StringUtils.getString(R$string.logout_dialog_leftbtnname));
        a2.setOnBtnClickListener(new a());
        a2.showNow(configuracionActivity.getSupportFragmentManager(), "DoubleBtnNoticeDialogFragment");
    }

    public static final void H(ConfiguracionActivity configuracionActivity, View view) {
        f30.h(configuracionActivity, "this$0");
        hp.a aVar = hp.m;
        String string = StringUtils.getString(R$string.logoff_dialog_title);
        f30.g(string, "getString(R.string.logoff_dialog_title)");
        String string2 = StringUtils.getString(R$string.logoff_dialog_content);
        f30.g(string2, "getString(R.string.logoff_dialog_content)");
        hp a2 = aVar.a(string, string2, StringUtils.getString(R$string.logoff_dialog_rightbtnname), StringUtils.getString(R$string.logoff_dialog_leftbtnname));
        a2.setOnBtnClickListener(configuracionActivity.new b());
        a2.showNow(configuracionActivity.getSupportFragmentManager(), "DoubleBtnNoticeDialogFragment");
    }

    public View E(int i) {
        Map map = this.h;
        View view = (View) map.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i);
        if (findViewById == null) {
            return null;
        }
        map.put(Integer.valueOf(i), findViewById);
        return findViewById;
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R$layout.activity_configuracion);
        ((TextView) E(R$id.mTvVersion)).setText('V' + AppUtils.getAppVersionName());
        ((ImageView) E(R$id.mIvFinish)).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ConfiguracionActivity.F(ConfiguracionActivity.this, view);
            }
        });
        ((TextView) E(R$id.mTvLogOut)).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ConfiguracionActivity.G(ConfiguracionActivity.this, view);
            }
        });
        ((TextView) E(R$id.mTvLogOff)).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ConfiguracionActivity.H(ConfiguracionActivity.this, view);
            }
        });
    }
}