正在查看: 爱心e站 v1.0.0 应用的 WeekPlanActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 爱心e站 v1.0.0 应用的 WeekPlanActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.newheyd.JZKFcanjiren.Activity;
import android.os.Bundle;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.igexin.assist.sdk.AssistPushConsts;
import com.newheyd.JZKFcanjiren.Adapter.DayPlanRecordAdapter;
import com.newheyd.JZKFcanjiren.BaseActivity;
import com.newheyd.JZKFcanjiren.Bean.DayPlanRecordBean;
import com.newheyd.JZKFcanjiren.Bean.RehabilitationTrainOrEffectEvaluationBean;
import com.newheyd.JZKFcanjiren.Bean.UserInfo;
import com.newheyd.JZKFcanjiren.MyApplication;
import com.newheyd.JZKFcanjiren.R;
import com.newheyd.JZKFcanjiren.Utils.DataUtil;
import com.newheyd.JZKFcanjiren.Utils.NewUtil;
import com.newheyd.JZKFcanjiren.Utils.StastisticUtil;
import com.newheyd.JZKFcanjiren.Utils.ToastUtils;
import com.newheyd.JZKFcanjiren.Utils.locationUtil.LocationAddrUtil;
import com.newheyd.JZKFcanjiren.View.TitleView;
import com.newheyd.JZKFcanjiren.config.NewHYConfig;
import com.newheyd.JZKFcanjiren.model.BaseResult;
import com.newheyd.JZKFcanjiren.model.DataParser;
import com.newheyd.JZKFcanjiren.net.CommonDataListTask;
import com.newheyd.JZKFcanjiren.net.NewHYTask;
import com.newheyd.JZKFcanjiren.net.RequestServiceList;
import java.util.ArrayList;
import java.util.HashMap;
public class WeekPlanActivity extends BaseActivity {
private String id;
private TitleView mTitleview;
private TextView mTvClass;
private TextView mTvContent;
private TextView mTvEndDate;
private TextView mTvIdcard;
private TextView mTvName;
private TextView mTvStartDate;
private TextView mTvTeacher;
private RehabilitationTrainOrEffectEvaluationBean rehabilitationTrainOrEffectEvaluationBean;
private UserInfo userInfo = null;
private ListView mListView = null;
private DayPlanRecordAdapter dayPlanRecordAdapter = null;
private ArrayList<DayPlanRecordBean> mData = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_week_plan);
super.onCreate(savedInstanceState);
this.userInfo = MyApplication.getInstance().getUserInfo();
getWeekPlan();
goStatistics();
}
public void goStatistics() {
HashMap<String, String> map = LocationAddrUtil.getInstance().getLocationParam(this.mContext);
StastisticUtil.getInstance().onEvent(this.mContext, "WeekPlanActivity", map);
}
public void getWeekPlan() {
HashMap<String, String> params = new HashMap<>();
params.put(AssistPushConsts.MSG_TYPE_TOKEN, this.userInfo == null ? "" : this.userInfo.getToken());
params.put("id", this.id);
NewHYTask task = new CommonDataListTask(RequestServiceList.SERVICE_VIEWWEEKPLAN, params, RehabilitationTrainOrEffectEvaluationBean.class);
executeRequest(task);
}
@Override
public void onResponseBefore(NewHYTask task) {
switch (task.getService()) {
case SERVICE_VIEWWEEKPLAN:
showProgress(NewHYConfig.LOADING_HINT, false);
break;
}
}
@Override
public void onResponseAfter(NewHYTask task) {
switch (task.getService()) {
case SERVICE_VIEWWEEKPLAN:
cancleProgress();
break;
}
}
@Override
public void onResponseSuccessful(NewHYTask task, BaseResult object) {
switch (task.getService()) {
case SERVICE_VIEWWEEKPLAN:
DataParser<RehabilitationTrainOrEffectEvaluationBean> mResult = (DataParser) object;
if (mResult.getObjects().size() != 0) {
this.rehabilitationTrainOrEffectEvaluationBean = mResult.getObjects().get(0);
freshData();
break;
}
break;
}
}
public void freshData() {
this.mTvName.setText(this.rehabilitationTrainOrEffectEvaluationBean.getName());
this.mTvIdcard.setText(this.rehabilitationTrainOrEffectEvaluationBean.getCitizenId());
this.mTvTeacher.setText(this.rehabilitationTrainOrEffectEvaluationBean.getServiceName());
this.mTvClass.setText(this.rehabilitationTrainOrEffectEvaluationBean.getServiceClass());
this.mTvStartDate.setText(DataUtil.formatDateOther(this.rehabilitationTrainOrEffectEvaluationBean.getStartDate()));
this.mTvEndDate.setText(DataUtil.formatDateOther(this.rehabilitationTrainOrEffectEvaluationBean.getEndDate()));
this.mTvContent.setText(this.rehabilitationTrainOrEffectEvaluationBean.getWeekContent());
this.mData = this.rehabilitationTrainOrEffectEvaluationBean.getmServiceDayList();
if (this.dayPlanRecordAdapter == null) {
this.dayPlanRecordAdapter = new DayPlanRecordAdapter(this.mContext, this.mData, R.layout.item_day_record);
this.dayPlanRecordAdapter.setEmptyHintStr("暂无记录");
this.mListView.setAdapter((ListAdapter) this.dayPlanRecordAdapter);
} else {
this.dayPlanRecordAdapter.notifyDataSetChanged();
}
NewUtil.setListViewHeightBasedOnChildren(this.mListView);
}
@Override
public void onResponseError(NewHYTask task, BaseResult object) {
switch (task.getService()) {
case SERVICE_VIEWWEEKPLAN:
ToastUtils.showShortToast(this.mContext, object.getMsg());
break;
}
}
@Override
public void onServerError(NewHYTask task, int failedType) {
switch (task.getService()) {
case SERVICE_VIEWWEEKPLAN:
onResultShow(failedType);
break;
}
}
@Override
public void getExtraParam() {
this.id = getIntent().getStringExtra("id");
}
@Override
public void initViews() {
this.mTitleview = (TitleView) findViewById(R.id.titleview);
this.mTvName = (TextView) findViewById(R.id.tv_name);
this.mTvIdcard = (TextView) findViewById(R.id.tv_idcard);
this.mTvTeacher = (TextView) findViewById(R.id.tv_teacher);
this.mTvClass = (TextView) findViewById(R.id.tv_class);
this.mTvStartDate = (TextView) findViewById(R.id.tv_start_date);
this.mTvEndDate = (TextView) findViewById(R.id.tv_end_date);
this.mTvContent = (TextView) findViewById(2131689891);
this.mListView = (ListView) findView(R.id.list);
}
@Override
public void setListener() {
this.mTitleview.setOnTitleClik(new TitleView.BackListenner() {
@Override
public void BackSet() {
WeekPlanActivity.this.finish();
}
}, null);
}
}