导航菜单

页面标题

页面副标题

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

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

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


package com.mu.gymtrain.Activity.MainPackage;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import com.blankj.utilcode.util.LogUtils;
import com.mu.gymtrain.Adapter.EquipStepAdapter;
import com.mu.gymtrain.Base.BaseActivity;
import com.mu.gymtrain.Bean.EquipDetailBean;
import com.mu.gymtrain.Http.HttpCallBack;
import com.mu.gymtrain.Http.HttpHelper;
import com.mu.gymtrain.R;
import com.mu.gymtrain.Utils.GlideUtils;
import com.mu.gymtrain.Utils.UrlConfig;
import com.mu.gymtrain.Widget.LinearLayoutForScrollView;

public class EquipDetailActivity extends BaseActivity {

    @BindView(R.id.iv_equipimg)
    ImageView ivEquipimg;
    EquipStepAdapter mAdapter;

    @BindView(R.id.recy_desc)
    RecyclerView recv_desc;

    @BindView(R.id.title_left)
    ImageView titleLeft;

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

    @BindView(R.id.tv_desc)
    TextView tvDesc;

    @BindView(R.id.tv_name)
    TextView tvName;

    @BindView(R.id.tv_nums)
    TextView tvNums;

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

    public void initData() {
        showProgress();
        HttpHelper.getInstance().getRetrofitService(this).getEquipDetail(getToken(), getGymIdFromSP(), getIntent().getStringExtra("id")).enqueue(new HttpCallBack<EquipDetailBean>() {
            @Override
            public void onSuccess(EquipDetailBean adBeen, String json) {
                EquipDetailActivity.this.dismissProgress();
                GlideUtils.withReplaceNoHolder(UrlConfig.Path.IMG_URL + adBeen.getData().getEquip_main_photo(), EquipDetailActivity.this.ivEquipimg, EquipDetailActivity.this.mActivity);
                EquipDetailActivity.this.tvName.setText("名称:" + adBeen.getData().getEquip_name());
                EquipDetailActivity.this.titleMiddle.setText(adBeen.getData().getEquip_name());
                EquipDetailActivity.this.tvNums.setText("数量:" + adBeen.getData().getEquip_count());
                EquipDetailActivity.this.tvDesc.setText("功能:\n" + adBeen.getData().getEquip_function());
                if (adBeen.getData().getDescript_type().equals("2")) {
                    EquipDetailActivity.this.mAdapter.setNewData(adBeen.getData().getDescript_file());
                }
            }

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

    public void initView() {
        this.recv_desc.setLayoutManager(new LinearLayoutForScrollView((Context) this));
        this.recv_desc.setHasFixedSize(true);
        this.recv_desc.setNestedScrollingEnabled(false);
        EquipStepAdapter equipStepAdapter = new EquipStepAdapter();
        this.mAdapter = equipStepAdapter;
        this.recv_desc.setAdapter(equipStepAdapter);
        this.titleLeft.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                EquipDetailActivity.this.finish();
            }
        });
    }
}