导航菜单

页面标题

页面副标题

TruCred v1.1.3 - LogoutReasonActivity.java 源代码

正在查看: TruCred v1.1.3 应用的 LogoutReasonActivity.java JAVA 源代码文件

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


package com.veloz.app.ui.mine;

import android.view.View;
import androidx.lifecycle.Observer;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.veloz.app.R$layout;
import com.veloz.app.adapter.ReasonListAdapter;
import com.veloz.app.adapter.decoration.XDividerItemDecoration;
import com.veloz.app.databinding.LogoutReasonActivityBinding;
import com.veloz.app.entity.DeregisterTypeInfo;
import com.veloz.app.entity.DictCodeInfo;
import com.veloz.app.entity.ResultInfo;
import com.veloz.app.my.MyActivity;
import com.veloz.app.utils.SensorsHelper;
import com.veloz.app.utils.XToastUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class LogoutReasonActivity extends MyActivity<LogoutReasonActivityBinding, LogoutReasonActivityViewModel> {
    public ReasonListAdapter e;
    public final List f = new ArrayList();

    public void A(View view) {
        SensorsHelper.c("logout", "cancel");
        finish();
    }

    public void y(View view) {
        finish();
    }

    public void z(View view) {
        DictCodeInfo dictCodeInfo;
        ReasonListAdapter reasonListAdapter = this.e;
        if (reasonListAdapter == null || reasonListAdapter.getItemCount() <= 0) {
            return;
        }
        List n2 = this.e.n();
        boolean z2 = false;
        int i = 0;
        while (true) {
            if (i >= n2.size()) {
                dictCodeInfo = null;
                break;
            }
            dictCodeInfo = (DictCodeInfo) n2.get(i);
            if (dictCodeInfo.checked) {
                z2 = true;
                break;
            }
            i++;
        }
        if (z2) {
            SensorsHelper.c("logout", "submit");
            ((LogoutReasonActivityViewModel) this.vm).d(dictCodeInfo.remark, dictCodeInfo.dictValue);
        }
    }

    public final void B(ResultInfo resultInfo) {
        if (resultInfo != null) {
            if (resultInfo.status == 0) {
                XToastUtils.b(resultInfo.remark, false);
            } else {
                startActivity(LogoutAdvertenciaActivity.class).go();
            }
        }
    }

    public final void C(DeregisterTypeInfo deregisterTypeInfo) {
        if (deregisterTypeInfo != null) {
            List<DictCodeInfo> list = deregisterTypeInfo.deregister_type;
            if (list != null && !list.isEmpty()) {
                Collections.sort(list);
                list.get(0).checked = true;
                SensorsHelper.d("logout", "select", list.get(0).dictValue);
            }
            this.e.submitList(list);
        }
    }

    @Override
    public void o(LogoutReasonActivityBinding logoutReasonActivityBinding, LogoutReasonActivityViewModel logoutReasonActivityViewModel) {
        super.o(logoutReasonActivityBinding, logoutReasonActivityViewModel);
        logoutReasonActivityBinding.a(logoutReasonActivityViewModel);
    }

    @Override
    public void initData() {
        SensorsHelper.j("logout");
        ((LogoutReasonActivityViewModel) this.vm).c();
    }

    @Override
    public void m() {
        ((LogoutReasonActivityBinding) this.bind).d.h(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                LogoutReasonActivity.this.y(view);
            }
        });
        this.e = new ReasonListAdapter(this.f);
        ((LogoutReasonActivityBinding) this.bind).c.setLayoutManager(new LinearLayoutManager(this));
        ((LogoutReasonActivityBinding) this.bind).c.addItemDecoration(new XDividerItemDecoration(20, 0));
        ((LogoutReasonActivityBinding) this.bind).c.setAdapter(this.e);
        ((LogoutReasonActivityBinding) this.bind).a.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                LogoutReasonActivity.this.z(view);
            }
        });
        ((LogoutReasonActivityBinding) this.bind).b.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                LogoutReasonActivity.this.A(view);
            }
        });
    }

    @Override
    public int myView() {
        return R$layout.logout_reason_activity;
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        SensorsHelper.g("logout");
    }

    @Override
    public void p() {
        ((LogoutReasonActivityViewModel) this.vm).b.observe(this, new Observer() {
            public final void onChanged(Object obj) {
                LogoutReasonActivity.this.B((ResultInfo) obj);
            }
        });
        ((LogoutReasonActivityViewModel) this.vm).c.observe(this, new Observer() {
            public final void onChanged(Object obj) {
                LogoutReasonActivity.this.C((DeregisterTypeInfo) obj);
            }
        });
    }
}