导航菜单

页面标题

页面副标题

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

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

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


package com.mu.gymtrain.Activity.PersonPackage;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.OnClick;
import com.mu.gymtrain.Activity.OnlyListActivity;
import com.mu.gymtrain.Base.BaseActivity;
import com.mu.gymtrain.Bean.AchieveBean;
import com.mu.gymtrain.Http.CreatMap;
import com.mu.gymtrain.Http.HttpHelper;
import com.mu.gymtrain.Http.ResponseFunc;
import com.mu.gymtrain.R;
import com.mu.gymtrain.Utils.FinalTools;
import com.mu.gymtrain.Utils.GlideUtils;
import com.mu.gymtrain.Utils.UrlConfig;
import com.mu.gymtrain.Widget.CircleImageView;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

public class PersonalAchieveActivity extends BaseActivity {

    @BindView(R.id.civ_head)
    CircleImageView civHead;

    @BindView(R.id.progress_timelong)
    ProgressBar progressTimelong;

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

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

    @BindView(R.id.tv_achieve_private)
    TextView tvAchievePrivate;

    @BindView(R.id.tv_achieve_public)
    TextView tvAchievePublic;

    @BindView(R.id.tv_achieve_weight)
    TextView tvAchieveWeight;

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

    @BindView(R.id.tv_share_qq)
    TextView tvShareQq;

    @BindView(R.id.tv_share_qqzone)
    TextView tvShareQqzone;

    @BindView(R.id.tv_share_wxchat)
    TextView tvShareWxchat;

    @BindView(R.id.tv_share_wxzone)
    TextView tvShareWxzone;

    @BindView(R.id.tv_timelong)
    TextView tvTimelong;

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

    public void initData() {
        HttpHelper.getInstance().getRetrofitService(this).getPerAchieve(new CreatMap.Builder().build().getParam()).observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io()).map(new ResponseFunc()).subscribe(new Subscriber<AchieveBean>() {
            public void onCompleted() {
            }

            public void onError(Throwable throwable) {
            }

            public void onNext(AchieveBean adBeen) {
                GlideUtils.withReplaceNoHolder(UrlConfig.Path.IMG_URL + adBeen.getAvatar(), PersonalAchieveActivity.this.civHead, PersonalAchieveActivity.this.mActivity);
                PersonalAchieveActivity.this.progressTimelong.setProgress(Integer.parseInt(adBeen.getDuration()));
                PersonalAchieveActivity.this.tvAchieveWeight.setText(adBeen.getWeight() + "KG");
                PersonalAchieveActivity.this.tvAchievePrivate.setText(adBeen.getSk_count() + "节");
                PersonalAchieveActivity.this.tvAchievePublic.setText(adBeen.getCk_count() + "节");
            }
        });
    }

    public void initView() {
        this.titleMiddle.setText(getString(R.string.person_achieve));
    }

    @OnClick({R.id.title_left, R.id.tv_achieve_weight, R.id.tv_achieve_public, R.id.tv_achieve_private, R.id.tv_share_wxchat, R.id.tv_share_wxzone, R.id.tv_share_qq, R.id.tv_share_qqzone})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.title_left:
                finish();
                break;
            case R.id.tv_achieve_private:
                startActivity(new Intent((Context) this, (Class<?>) OnlyListActivity.class).putExtra(FinalTools.INTENT_TYPE, FinalTools.INTENT_ACHIEVE_PRIVATE).putExtra(FinalTools.INTENT_TITLE, getString(R.string.person_achieve_privatecourse)));
                break;
            case R.id.tv_achieve_public:
                startActivity(new Intent((Context) this, (Class<?>) OnlyListActivity.class).putExtra(FinalTools.INTENT_TYPE, FinalTools.INTENT_ACHIEVE_PUBLIC).putExtra(FinalTools.INTENT_TITLE, getString(R.string.person_achieve_publiccourse)));
                break;
            case R.id.tv_achieve_weight:
                startActivity(new Intent((Context) this, (Class<?>) OnlyListActivity.class).putExtra(FinalTools.INTENT_TYPE, FinalTools.INTENT_ACHIEVE_WEIGHT).putExtra(FinalTools.INTENT_TITLE, getString(R.string.person_achieve_weight)));
                break;
        }
    }
}