Commit 5a297706 by 刘鹏

feat : 接诊倒计时问题修复

parent 104a1fb8
...@@ -12,7 +12,7 @@ ext { ...@@ -12,7 +12,7 @@ ext {
"m-user-medical" : "0.0.61.94", "m-user-medical" : "0.0.61.94",
"m-home" : "0.0.22.70", "m-home" : "0.0.22.70",
"m-im" : "0.0.20.76", "m-im" : "0.0.20.76",
"m-im-medical" : "0.0.20.81", "m-im-medical" : "0.0.20.82",
"m-dynamic" : "0.0.7.28", "m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
...@@ -98,7 +98,7 @@ ext { ...@@ -98,7 +98,7 @@ ext {
"m-user-medical" : "0.0.61.94", "m-user-medical" : "0.0.61.94",
"m-home" : "0.0.22.70", "m-home" : "0.0.22.70",
"m-im" : "0.0.20.76", "m-im" : "0.0.20.76",
"m-im-medical" : "0.0.20.81", "m-im-medical" : "0.0.20.82",
"m-dynamic" : "0.0.7.28", "m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.8", "m-article" : "0.0.0.8",
......
...@@ -525,45 +525,41 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -525,45 +525,41 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
} }
if(timer != null){ if(timer != null){
timer.cancel(); timer.cancel();
}else { }
timer = new CountDownTimer(time * 1000, 1) { timer = new CountDownTimer(time * 1000, 1) {
@Override @Override
public void onTick(long millisUntilFinished) { public void onTick(long millisUntilFinished) {
//单位时 //单位时
long hour = millisUntilFinished / (1000 * 60 * 60); long hour = millisUntilFinished / (1000 * 60 * 60);
//单位分 //单位分
long minute = (millisUntilFinished - hour * (1000 * 60 * 60)) / (1000 * 60); long minute = (millisUntilFinished - hour * (1000 * 60 * 60)) / (1000 * 60);
//单位秒 //单位秒
long second = (millisUntilFinished - hour * (1000 * 60 * 60) - minute * (1000 * 60)) / 1000; long second = (millisUntilFinished - hour * (1000 * 60 * 60) - minute * (1000 * 60)) / 1000;
String timeStr = ""; String timeStr = "";
if (hour != 0) { if (hour != 0) {
timeStr = hour + "小时" + minute + "分" + second + "秒"; timeStr = hour + "小时" + minute + "分" + second + "秒";
} else if (hour == 0 && minute != 0) { } else if (hour == 0 && minute != 0) {
timeStr = minute + "分" + second + "秒"; timeStr = minute + "分" + second + "秒";
}else if (hour == 0 && minute == 0 && second != 0) { }else if (hour == 0 && minute == 0 && second != 0) {
timeStr = second + "秒"; timeStr = second + "秒";
}
if (!TextUtils.isEmpty(timeStr)){
String timeEnd = "后问诊结束";
SpannableStringBuilder spannable = new SpannableStringBuilder(timeStr + timeEnd);
spannable.setSpan(new ForegroundColorSpan(Color.parseColor("#007AFF")),
0,
timeStr.length(),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
);
time_count_down.setText(spannable);
}else {
time_count_down.setText("");
}
} }
if (!TextUtils.isEmpty(timeStr)){
@Override String timeEnd = "后问诊结束";
public void onFinish() { SpannableStringBuilder spannable = new SpannableStringBuilder(timeStr + timeEnd);
spannable.setSpan(new ForegroundColorSpan(Color.parseColor("#007AFF")),
0,
timeStr.length(),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
);
time_count_down.setText(spannable);
}else {
time_count_down.setText("");
} }
}; }
} @Override
public void onFinish() {
}
};
timer.start(); timer.start();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment