From bd84b7e54692a35fbd1f181b0882e8e7286b8e49 Mon Sep 17 00:00:00 2001
From: lizhanwei <Dana_Lee1016@126.com>
Date: 星期五, 08 五月 2020 13:19:52 +0800
Subject: [PATCH] 8201消息加入头像url;用picasso 2.5.2加载图片;驾考app增加从网络加载头像并显示;收到平台8201消息后,增加回复通用应答给平台
---
app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java b/app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java
index e013251..e4ff378 100644
--- a/app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java
+++ b/app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java
@@ -33,11 +33,11 @@
import com.anyun.exam.lib.AYSdk;
import com.anyun.exam.lib.MyLog;
+import com.squareup.picasso.Picasso;
import org.json.JSONException;
import org.json.JSONObject;
-import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
@@ -96,7 +96,7 @@
private TextView tv_speed,tv_total_score,tv_name,
tv_start_time,tv_coach_name;
private double speed=0.0;
- private ImageView iv_head;
+ private ImageView iv_head,iv_coach_head;
private int currTotalScore = 100;
private List<ScoreBean> mArrayList = new ArrayList<>();
@@ -461,10 +461,8 @@
mHandler.obtainMessage(ADD_DATA).sendToTarget();
if (examStatus.get(0).getStartExam() != Constant.NONE_BEEN_START_EXAM){
btn_start_exam.setText("缁撴潫鑰冭瘯");
- iv_head.getDrawable().setLevel(1);
}else{
btn_start_exam.setText("寮�濮嬭�冭瘯");
- iv_head.getDrawable().setLevel(0);
}
exam_type = examStatus.get(0).getStartExam();
}
@@ -481,11 +479,13 @@
MyLog.i(TAG, "onChanged: " + student.toString());
if (!TextUtils.isEmpty(student.getName())&&student.getStu_id()==ExamPlatformData.STU_ID){
tv_name.setText(getNameColor(student.getName()));
+ Picasso.with(_mActivity).load(student.getHead_url()).into(iv_head);
ExamPlatformData.getInstance().setId(student.getID());
tv_start_time.setText(getString(R.string.begin_time)+Utils.formatTimeYYMMDDHHmmSS(student.getBegin_time()));
}else if (!TextUtils.isEmpty(student.getName())&&student.getStu_id()==ExamPlatformData.COACH_ID){
ExamPlatformData.getInstance().setCoachID(student.getID());
tv_coach_name.setText(getNameColor(student.getName()));
+ Picasso.with(_mActivity).load(student.getHead_url()).into(iv_coach_head);
}
}
}
@@ -526,8 +526,6 @@
btn_ids.add(R.id.btn_9);
btn_ids.add(R.id.btn_10);
- view.findViewById(R.id.iv_head).setOnClickListener(this);
- view.findViewById(R.id.iv_coach_head).setOnClickListener(this);
((TextView)view.findViewById(R.id.tv_score_tip)).setText("褰撳墠鑰冭瘯寰楀垎");
av_curve = view.findViewById(R.id.av3);
av_park = view.findViewById(R.id.av2);
@@ -540,6 +538,9 @@
iv_head = view.findViewById(R.id.iv_head);
+ iv_head.setOnClickListener(this);
+ iv_coach_head = view.findViewById(R.id.iv_coach_head);
+ iv_coach_head.setOnClickListener(this);
tv_speed = view.findViewById(R.id.tv_speed);
tv_total_score = view.findViewById(R.id.tv_total_score);
@@ -627,6 +628,7 @@
case R.id.iv_head:
MyLog.i(TAG,"瀛﹀憳绛惧埌");
if (ExamPlatformData.getInstance().IsStuSign()){
+
ExamPlatformData.getInstance().setStuSign(false);
qrcode(1,false);
}else{
--
Gitblit v1.8.0