导航菜单

页面标题

页面副标题

自健身 v3.3.4 - FamilyAccountProtocolActivity.java 源代码

正在查看: 自健身 v3.3.4 应用的 FamilyAccountProtocolActivity.java JAVA 源代码文件

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


package com.mu.gymtrain.Activity;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.OnClick;
import com.blankj.utilcode.util.LogUtils;
import com.mu.gymtrain.Base.BaseActivity;
import com.mu.gymtrain.Bean.SucessBean;
import com.mu.gymtrain.Http.HttpCallBack;
import com.mu.gymtrain.Http.HttpHelper;
import com.mu.gymtrain.R;
import com.mu.gymtrain.Utils.ToastUtils;

public class FamilyAccountProtocolActivity extends BaseActivity {

    @BindView(R.id.title_middle)
    TextView mTitleMiddle;

    public int getContentLayout() {
        return R.layout.activity_family_protocol_layout;
    }

    public void initView() {
        this.mTitleMiddle.setText("协议书");
    }

    public void initData() {
        LogUtils.i(new Object[]{"进阿里了"});
    }

    @OnClick({R.id.title_left, R.id.tvOk, R.id.tvNo})
    public void onViewClicked(View view) {
        int id = view.getId();
        if (id == 2131297253) {
            finish();
        } else if (id == 2131297369) {
            finish();
        } else {
            if (id != 2131297374) {
                return;
            }
            requestAdd();
        }
    }

    private void requestAdd() {
        showProgress();
        HttpHelper.getInstance().getRetrofitService(this).createFamilyAccount(getToken()).enqueue(new HttpCallBack<SucessBean>() {
            @Override
            public void onSuccess(SucessBean sucessBean, String json) {
                FamilyAccountProtocolActivity.this.dismissProgress();
                LogUtils.i(new Object[]{json});
                if (sucessBean == null) {
                    return;
                }
                if (sucessBean.code == 10000) {
                    FamilyAccountProtocolActivity.this.startActivity(new Intent((Context) FamilyAccountProtocolActivity.this, (Class<?>) FamilyAccountMainActivity.class));
                    FamilyAccountProtocolActivity.this.finish();
                } else {
                    ToastUtils.show(FamilyAccountProtocolActivity.this, sucessBean.message);
                }
            }

            @Override
            public void onFail(String str) {
                FamilyAccountProtocolActivity.this.dismissProgress();
                LogUtils.i(new Object[]{str});
                ToastUtils.show(FamilyAccountProtocolActivity.this, str);
            }
        });
    }
}