Commit 5a297706 by 刘鹏

feat : 接诊倒计时问题修复

parent 104a1fb8
......@@ -12,7 +12,7 @@ ext {
"m-user-medical" : "0.0.61.94",
"m-home" : "0.0.22.70",
"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-article" : "0.0.0.10",
......@@ -98,7 +98,7 @@ ext {
"m-user-medical" : "0.0.61.94",
"m-home" : "0.0.22.70",
"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-article" : "0.0.0.8",
......
......@@ -525,45 +525,41 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
if(timer != null){
timer.cancel();
}else {
timer = new CountDownTimer(time * 1000, 1) {
@Override
public void onTick(long millisUntilFinished) {
//单位时
long hour = millisUntilFinished / (1000 * 60 * 60);
//单位分
long minute = (millisUntilFinished - hour * (1000 * 60 * 60)) / (1000 * 60);
//单位秒
long second = (millisUntilFinished - hour * (1000 * 60 * 60) - minute * (1000 * 60)) / 1000;
String timeStr = "";
if (hour != 0) {
timeStr = hour + "小时" + minute + "分" + second + "秒";
} else if (hour == 0 && minute != 0) {
timeStr = minute + "分" + second + "秒";
}else if (hour == 0 && minute == 0 && second != 0) {
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("");
}
}
timer = new CountDownTimer(time * 1000, 1) {
@Override
public void onTick(long millisUntilFinished) {
//单位时
long hour = millisUntilFinished / (1000 * 60 * 60);
//单位分
long minute = (millisUntilFinished - hour * (1000 * 60 * 60)) / (1000 * 60);
//单位秒
long second = (millisUntilFinished - hour * (1000 * 60 * 60) - minute * (1000 * 60)) / 1000;
String timeStr = "";
if (hour != 0) {
timeStr = hour + "小时" + minute + "分" + second + "秒";
} else if (hour == 0 && minute != 0) {
timeStr = minute + "分" + second + "秒";
}else if (hour == 0 && minute == 0 && second != 0) {
timeStr = second + "秒";
}
@Override
public void onFinish() {
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("");
}
};
}
}
@Override
public void onFinish() {
}
};
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