|
|
@ -43,6 +43,7 @@ import com.xty.common.TimeSelect
|
|
|
|
import com.xty.common.arouter.ARouterUrl
|
|
|
|
import com.xty.common.arouter.ARouterUrl
|
|
|
|
import com.xty.common.arouter.RouteManager
|
|
|
|
import com.xty.common.arouter.RouteManager
|
|
|
|
import com.xty.common.event.BloodFilipOpenSuccessEvent
|
|
|
|
import com.xty.common.event.BloodFilipOpenSuccessEvent
|
|
|
|
|
|
|
|
import com.xty.common.util.CommonToastUtils
|
|
|
|
import com.xty.common.util.SpannableUtils
|
|
|
|
import com.xty.common.util.SpannableUtils
|
|
|
|
import com.xty.common.weight.tablayout.TabEntity
|
|
|
|
import com.xty.common.weight.tablayout.TabEntity
|
|
|
|
import com.xty.common.weight.tablayout.listener.CustomTabEntity
|
|
|
|
import com.xty.common.weight.tablayout.listener.CustomTabEntity
|
|
|
@ -81,7 +82,7 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
val fomartStr by lazy { arrayOf("HH:mm", "HH:mm", "MM-dd", "MM-dd", "yy-MM") }
|
|
|
|
val fomartStr by lazy { arrayOf("HH:mm", "HH:mm", "MM-dd", "MM-dd", "yy-MM") }
|
|
|
|
private val weekStr by lazy { resources.getStringArray(R.array.week_day) }
|
|
|
|
private val weekStr by lazy { resources.getStringArray(R.array.week_day) }
|
|
|
|
val dialogBind by lazy {
|
|
|
|
val dialogBind by lazy {
|
|
|
|
DialogTip(requireContext(), "需绑定中健三六五健康手表,才能查看", "去绑定") {
|
|
|
|
DialogTip(requireContext(), "需绑定安瑜健康手表,才能查看", "去绑定") {
|
|
|
|
RouteManager.goAct(ARouterUrl.DEVICE_CHOICE)
|
|
|
|
RouteManager.goAct(ARouterUrl.DEVICE_CHOICE)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -97,7 +98,7 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
type = 1
|
|
|
|
type = 1
|
|
|
|
dayDate = binding.tvShowDate.text.toString()
|
|
|
|
dayDate = binding.tvShowDate.text.toString()
|
|
|
|
mViewModel.getBloodFatInfo(type, binding.tvShowDate.text.toString(), id, isDemonstrate)
|
|
|
|
mViewModel.getBloodFatInfo(type, binding.tvShowDate.text.toString(), id, isDemonstrate)
|
|
|
|
mViewModel.getBloodFatInfo(type, binding.tvShowDate.text.toString(), id, isDemonstrate)
|
|
|
|
// mViewModel.getBloodFatInfo(type, binding.tvShowDate.text.toString(), id, isDemonstrate)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -106,7 +107,6 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
type = 3
|
|
|
|
type = 3
|
|
|
|
mouthDate = binding.tvShowDate.text.toString()
|
|
|
|
mouthDate = binding.tvShowDate.text.toString()
|
|
|
|
mViewModel.getBloodFatInfo(type, binding.tvShowDate.text.toString(), id, isDemonstrate)
|
|
|
|
mViewModel.getBloodFatInfo(type, binding.tvShowDate.text.toString(), id, isDemonstrate)
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -121,7 +121,7 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var tips = ""
|
|
|
|
private var tips = ""
|
|
|
|
val tipDialog by lazy {
|
|
|
|
val tipDialog by lazy {
|
|
|
|
HealthDialog(requireContext(), true, tips) {
|
|
|
|
HealthDialog(requireContext(), true, tips) {
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -155,6 +155,7 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressLint("SetTextI18n")
|
|
|
|
override fun initView() {
|
|
|
|
override fun initView() {
|
|
|
|
super.initView()
|
|
|
|
super.initView()
|
|
|
|
binding.tgLayout.tvBloodValue.text = "甘油三酯 (TG)"
|
|
|
|
binding.tgLayout.tvBloodValue.text = "甘油三酯 (TG)"
|
|
|
@ -239,12 +240,11 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
|
|
|
|
|
|
|
|
binding.tvBloodLipidAdjust.setOnClickListener {
|
|
|
|
binding.tvBloodLipidAdjust.setOnClickListener {
|
|
|
|
if (bloodFatStatus == 1) {
|
|
|
|
if (bloodFatStatus == 1) {
|
|
|
|
// val tip = "尿酸建模出值重要提示:\n" +
|
|
|
|
tips = "1、建模期间,累计有效佩戴满72小时;\n" +
|
|
|
|
// "1、建模期间,累计有效佩戴满72小时;\n" +
|
|
|
|
"2、建模完成后,每天18:00至第二天6:00期间,佩戴时长累计满6小时,APP出具血脂值;\n" +
|
|
|
|
// "2、建模完成后,每天18:00至第二天6:00期间,佩戴时长累计满6小时,APP出具尿酸值;\n" +
|
|
|
|
"3、血脂值每天7:00出值。本次值为前一天18:00到当天早上6:00血脂平均值。"
|
|
|
|
// "3、尿酸值每天7:00出值。本次值为前一天18:00到当天早上6:00尿酸平均值。"
|
|
|
|
tipDialog.setContent(tips)
|
|
|
|
// tipDialog.setContent(tip)
|
|
|
|
tipDialog.show()
|
|
|
|
// tipDialog.show()
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
RouteManager.goAct(ARouterUrl.BL_ADJUST)
|
|
|
|
RouteManager.goAct(ARouterUrl.BL_ADJUST)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -260,13 +260,20 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
|
|
|
|
|
|
|
|
private fun setKindLayoutClickListener(view: BloodFatChartBinding) {
|
|
|
|
private fun setKindLayoutClickListener(view: BloodFatChartBinding) {
|
|
|
|
view.mLineChart.setNoDataText(getString(R.string.line_chart_not_data))
|
|
|
|
view.mLineChart.setNoDataText(getString(R.string.line_chart_not_data))
|
|
|
|
|
|
|
|
|
|
|
|
view.mLineChart.setNoDataTextColor(
|
|
|
|
view.mLineChart.setNoDataTextColor(
|
|
|
|
ContextCompat.getColor(
|
|
|
|
ContextCompat.getColor(
|
|
|
|
requireContext(),
|
|
|
|
requireContext(),
|
|
|
|
R.color.col_455
|
|
|
|
R.color.col_455
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
view.mBarChart.setNoDataText(getString(R.string.line_chart_not_data))
|
|
|
|
|
|
|
|
view.mBarChart.setNoDataTextColor(
|
|
|
|
|
|
|
|
ContextCompat.getColor(
|
|
|
|
|
|
|
|
requireContext(),
|
|
|
|
|
|
|
|
R.color.col_455
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
view.zhexianTv.setOnClickListener {
|
|
|
|
view.zhexianTv.setOnClickListener {
|
|
|
|
view.mLineChart.visibility = View.VISIBLE
|
|
|
|
view.mLineChart.visibility = View.VISIBLE
|
|
|
|
view.mBarChart.visibility = View.GONE
|
|
|
|
view.mBarChart.visibility = View.GONE
|
|
|
@ -352,22 +359,23 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
RouteManager.goAct(ARouterUrl.BL_FAT_EXCEPTION_DATA, bundle)
|
|
|
|
RouteManager.goAct(ARouterUrl.BL_FAT_EXCEPTION_DATA, bundle)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressLint("SetTextI18n", "SimpleDateFormat")
|
|
|
|
override fun observer() {
|
|
|
|
override fun observer() {
|
|
|
|
mViewModel.bloodFatHeadInfo.observe(this) {
|
|
|
|
mViewModel.bloodFatHeadInfo.observe(this) {
|
|
|
|
expireTimeStr = it.data.expireTime
|
|
|
|
expireTimeStr = it.data.expireTime
|
|
|
|
bloodFatStatus = it.data.status
|
|
|
|
bloodFatStatus = it.data.status
|
|
|
|
if (!TextUtils.isEmpty(expireTimeStr)) {
|
|
|
|
if (!TextUtils.isEmpty(expireTimeStr)) {
|
|
|
|
binding.tvEndTime.text = "到期时间:${expireTimeStr}"
|
|
|
|
binding.tvEndTime.text = "到期时间:${expireTimeStr}"
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
binding.tvEndTime.text = ""
|
|
|
|
binding.tvEndTime.text = ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
when (it.data.status) {
|
|
|
|
when (it.data.status) {
|
|
|
|
0 -> { //没有开通
|
|
|
|
0 -> { //没有开通
|
|
|
|
setNoOpenBloodLipid(0)
|
|
|
|
setNoOpenBloodLipid(0, it.data.data)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
1 -> { //建模中
|
|
|
|
1 -> { //建模中
|
|
|
|
setNoOpenBloodLipid(1)
|
|
|
|
setNoOpenBloodLipid(1, it.data.data)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
else -> {
|
|
|
|
else -> {
|
|
|
@ -477,7 +485,6 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//设置数据
|
|
|
|
//设置数据
|
|
|
|
private fun setValuss(
|
|
|
|
private fun setValuss(
|
|
|
|
daysModelList: MutableList<BloodFatBean.Model>,
|
|
|
|
daysModelList: MutableList<BloodFatBean.Model>,
|
|
|
@ -549,6 +556,45 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (selectDay()) {
|
|
|
|
|
|
|
|
setOrganStatus(chartType)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
when (chartType) {
|
|
|
|
|
|
|
|
0 -> {
|
|
|
|
|
|
|
|
binding.tcLayout.mLineChart.clear()
|
|
|
|
|
|
|
|
binding.tcLayout.mBarChart.clear()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 -> {
|
|
|
|
|
|
|
|
binding.tgLayout.mLineChart.clear()
|
|
|
|
|
|
|
|
binding.tgLayout.mBarChart.clear()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 -> {
|
|
|
|
|
|
|
|
binding.hdlLayout.mLineChart.clear()
|
|
|
|
|
|
|
|
binding.hdlLayout.mBarChart.clear()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else -> {
|
|
|
|
|
|
|
|
binding.ldlLayout.mLineChart.clear()
|
|
|
|
|
|
|
|
binding.ldlLayout.mBarChart.clear()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (list.isNullOrEmpty()) {
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for ((index, modelCompare) in list.withIndex()) {
|
|
|
|
|
|
|
|
modelCompare.index = index
|
|
|
|
|
|
|
|
// modelCompare.uaValue = if (modelCompare.uaValue > 0f) {
|
|
|
|
|
|
|
|
// modelCompare.uaValue
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// Float.NaN
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (i in list.indices) {
|
|
|
|
for (i in list.indices) {
|
|
|
|
//中间两端在x轴显示尺度 其他情况下不显示
|
|
|
|
//中间两端在x轴显示尺度 其他情况下不显示
|
|
|
|
lineValue.add(
|
|
|
|
lineValue.add(
|
|
|
@ -569,26 +615,34 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
|
|
|
|
|
|
|
|
when (chartType) {
|
|
|
|
when (chartType) {
|
|
|
|
0 -> {
|
|
|
|
0 -> {
|
|
|
|
binding.tcLayout.mLineChart.clear()
|
|
|
|
// binding.tcLayout.mLineChart.clear()
|
|
|
|
binding.tcLayout.mBarChart.clear()
|
|
|
|
// binding.tcLayout.mBarChart.clear()
|
|
|
|
initChart(list, bean.value.minTc, bean.value.maxTc, chartType, lineValue, barValue)
|
|
|
|
initChart(
|
|
|
|
if (selectDay()) {
|
|
|
|
list,
|
|
|
|
setOrganStatus(chartType)
|
|
|
|
bean.value.minTc,
|
|
|
|
}
|
|
|
|
bean.value.maxTc,
|
|
|
|
|
|
|
|
chartType,
|
|
|
|
|
|
|
|
lineValue,
|
|
|
|
|
|
|
|
barValue
|
|
|
|
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
1 -> {
|
|
|
|
1 -> {
|
|
|
|
binding.tgLayout.mLineChart.clear()
|
|
|
|
// binding.tgLayout.mLineChart.clear()
|
|
|
|
binding.tgLayout.mBarChart.clear()
|
|
|
|
// binding.tgLayout.mBarChart.clear()
|
|
|
|
initChart(list, bean.value.minTg, bean.value.maxTg, chartType, lineValue, barValue)
|
|
|
|
initChart(
|
|
|
|
if (selectDay()) {
|
|
|
|
list,
|
|
|
|
setOrganStatus(chartType)
|
|
|
|
bean.value.minTg,
|
|
|
|
}
|
|
|
|
bean.value.maxTg,
|
|
|
|
|
|
|
|
chartType,
|
|
|
|
|
|
|
|
lineValue,
|
|
|
|
|
|
|
|
barValue
|
|
|
|
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
2 -> {
|
|
|
|
2 -> {
|
|
|
|
binding.hdlLayout.mLineChart.clear()
|
|
|
|
// binding.hdlLayout.mLineChart.clear()
|
|
|
|
binding.hdlLayout.mBarChart.clear()
|
|
|
|
// binding.hdlLayout.mBarChart.clear()
|
|
|
|
initChart(
|
|
|
|
initChart(
|
|
|
|
list,
|
|
|
|
list,
|
|
|
|
bean.value.minHdl,
|
|
|
|
bean.value.minHdl,
|
|
|
@ -597,15 +651,11 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
lineValue,
|
|
|
|
lineValue,
|
|
|
|
barValue
|
|
|
|
barValue
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if (selectDay()) {
|
|
|
|
|
|
|
|
setOrganStatus(chartType)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
else -> {
|
|
|
|
else -> {
|
|
|
|
binding.ldlLayout.mLineChart.clear()
|
|
|
|
// binding.ldlLayout.mLineChart.clear()
|
|
|
|
binding.ldlLayout.mBarChart.clear()
|
|
|
|
// binding.ldlLayout.mBarChart.clear()
|
|
|
|
|
|
|
|
|
|
|
|
initChart(
|
|
|
|
initChart(
|
|
|
|
list,
|
|
|
|
list,
|
|
|
|
bean.value.minLdl,
|
|
|
|
bean.value.minLdl,
|
|
|
@ -614,9 +664,6 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
lineValue,
|
|
|
|
lineValue,
|
|
|
|
barValue
|
|
|
|
barValue
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if (selectDay()) {
|
|
|
|
|
|
|
|
setOrganStatus(chartType)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -650,17 +697,17 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
): String {
|
|
|
|
): String {
|
|
|
|
when (type) {
|
|
|
|
when (type) {
|
|
|
|
1 -> {
|
|
|
|
1 -> {
|
|
|
|
/*if (bean.uaValue == 0f) {
|
|
|
|
// if (bean.uaValue == 0f) {
|
|
|
|
bean.uaValue = Float.NaN
|
|
|
|
// bean.uaValue = Float.NaN
|
|
|
|
}*/
|
|
|
|
// }
|
|
|
|
return bean.formatTime
|
|
|
|
return bean.time
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
3 -> {
|
|
|
|
3 -> {
|
|
|
|
/* if (bean.uaValue == 0f) {
|
|
|
|
/* if (bean.uaValue == 0f) {
|
|
|
|
bean.uaValue = Float.NaN
|
|
|
|
bean.uaValue = Float.NaN
|
|
|
|
}*/
|
|
|
|
}*/
|
|
|
|
return bean.time
|
|
|
|
return bean.formatTime
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
2 -> {
|
|
|
|
2 -> {
|
|
|
@ -711,7 +758,6 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
1 -> {
|
|
|
|
1 -> {
|
|
|
|
|
|
|
|
|
|
|
|
when (OrganStatusCalcUtil.tgStatus(data.tg)) {
|
|
|
|
when (OrganStatusCalcUtil.tgStatus(data.tg)) {
|
|
|
|
1 -> {
|
|
|
|
1 -> {
|
|
|
|
tgAbNormalTime++
|
|
|
|
tgAbNormalTime++
|
|
|
@ -726,7 +772,6 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
2 -> {
|
|
|
|
2 -> {
|
|
|
|
|
|
|
|
|
|
|
|
when (OrganStatusCalcUtil.hdlStatus(data.hdl)) {
|
|
|
|
when (OrganStatusCalcUtil.hdlStatus(data.hdl)) {
|
|
|
|
1 -> {
|
|
|
|
1 -> {
|
|
|
|
hdlAbNormalTime++
|
|
|
|
hdlAbNormalTime++
|
|
|
@ -828,26 +873,18 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
|
|
|
|
|
|
|
|
val barsetsNew = ArrayList<ILineDataSet>()
|
|
|
|
val barsetsNew = ArrayList<ILineDataSet>()
|
|
|
|
val segments = splitDataIntoSegments(list)
|
|
|
|
val segments = splitDataIntoSegments(list)
|
|
|
|
|
|
|
|
// if (segments.size > 0) {
|
|
|
|
|
|
|
|
// segments = checkData(segments)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
val dataSets = segments.mapNotNull { segment ->
|
|
|
|
val dataSets = segments.mapNotNull { segment ->
|
|
|
|
if (segment.isEmpty()) return@mapNotNull null
|
|
|
|
if (segment.isEmpty()) return@mapNotNull null
|
|
|
|
|
|
|
|
|
|
|
|
val entries = segment.mapIndexed { index, model ->
|
|
|
|
val entries = segment.mapIndexed { index, model ->
|
|
|
|
val time = if (type == 1 || type == 2 || type == 3) {
|
|
|
|
|
|
|
|
model.formatTime
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
model.time
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var indes = 0
|
|
|
|
|
|
|
|
list.forEachIndexed { index, modelCompare ->
|
|
|
|
|
|
|
|
if (time == modelCompare.formatTime || time == modelCompare.time) {
|
|
|
|
|
|
|
|
indes = index
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Entry(
|
|
|
|
Entry(
|
|
|
|
indes.toFloat(),
|
|
|
|
model.index.toFloat(),
|
|
|
|
model.uaValue,
|
|
|
|
model.uaValue,
|
|
|
|
lineValue[indes].data
|
|
|
|
lineValue[model.index].data
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return@mapNotNull setData(entries, chartType)
|
|
|
|
return@mapNotNull setData(entries, chartType)
|
|
|
@ -893,23 +930,10 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
if (segment.isEmpty()) return@mapNotNull null
|
|
|
|
if (segment.isEmpty()) return@mapNotNull null
|
|
|
|
|
|
|
|
|
|
|
|
val entries = segment.mapIndexed { index, model ->
|
|
|
|
val entries = segment.mapIndexed { index, model ->
|
|
|
|
|
|
|
|
|
|
|
|
val time = if (type == 1 || type == 2 || type == 3) {
|
|
|
|
|
|
|
|
model.formatTime
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
model.time
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var indes = 0
|
|
|
|
|
|
|
|
list.forEachIndexed { index, modelCompare ->
|
|
|
|
|
|
|
|
if (time == modelCompare.formatTime || time == modelCompare.time) {
|
|
|
|
|
|
|
|
indes = index
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BarEntry(
|
|
|
|
BarEntry(
|
|
|
|
indes.toFloat(),
|
|
|
|
model.index.toFloat(),
|
|
|
|
model.uaValue,
|
|
|
|
model.uaValue,
|
|
|
|
barValue[indes].data
|
|
|
|
barValue[model.index].data
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return@mapNotNull setBarData(entries, chartType)
|
|
|
|
return@mapNotNull setBarData(entries, chartType)
|
|
|
@ -980,22 +1004,25 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
return max(minimumBarWidth, min(maximumBarWidth, calculatedBarWidth))
|
|
|
|
return max(minimumBarWidth, min(maximumBarWidth, calculatedBarWidth))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun splitDataIntoSegments(dataList: MutableList<BloodFatBean.ModelCompare>): MutableList<MutableList<BloodFatBean.ModelCompare>> {
|
|
|
|
fun splitDataIntoSegments(
|
|
|
|
|
|
|
|
dataList: MutableList<BloodFatBean.ModelCompare>
|
|
|
|
|
|
|
|
): MutableList<MutableList<BloodFatBean.ModelCompare>> {
|
|
|
|
val segments = mutableListOf<MutableList<BloodFatBean.ModelCompare>>()
|
|
|
|
val segments = mutableListOf<MutableList<BloodFatBean.ModelCompare>>()
|
|
|
|
var currentSegment = mutableListOf<BloodFatBean.ModelCompare>()
|
|
|
|
var currentSegment = mutableListOf<BloodFatBean.ModelCompare>()
|
|
|
|
|
|
|
|
|
|
|
|
for (model in dataList) {
|
|
|
|
for (model in dataList) {
|
|
|
|
if (model.uaValue.isNaN()) {
|
|
|
|
// if (model.uaValue.isNaN()) {
|
|
|
|
// 遇到 Float.NaN,如果当前线段不为空,则添加到结果中,并开始新的线段
|
|
|
|
// // 遇到 Float.NaN,如果当前线段不为空,则添加到结果中,并开始新的线段
|
|
|
|
if (currentSegment.isNotEmpty()) {
|
|
|
|
// if (currentSegment.isNotEmpty()) {
|
|
|
|
segments.add(currentSegment)
|
|
|
|
// segments.add(currentSegment)
|
|
|
|
currentSegment = mutableListOf()
|
|
|
|
// currentSegment = mutableListOf()
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
} else {
|
|
|
|
// } else {
|
|
|
|
// 遇到有效数据,将其添加到当前线段中
|
|
|
|
// // 遇到有效数据,将其添加到当前线段中
|
|
|
|
|
|
|
|
// currentSegment.add(model)
|
|
|
|
|
|
|
|
// }
|
|
|
|
currentSegment.add(model)
|
|
|
|
currentSegment.add(model)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 将最后一个线段添加到结果中
|
|
|
|
// 将最后一个线段添加到结果中
|
|
|
|
if (currentSegment.isNotEmpty()) {
|
|
|
|
if (currentSegment.isNotEmpty()) {
|
|
|
@ -1005,12 +1032,14 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
return segments
|
|
|
|
return segments
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun checkData(segmentsCompare: MutableList<MutableList<BloodFatBean.ModelCompare>>): MutableList<MutableList<BloodFatBean.ModelCompare>> {
|
|
|
|
private fun checkData(
|
|
|
|
|
|
|
|
segmentsCompare: MutableList<MutableList<BloodFatBean.ModelCompare>>
|
|
|
|
|
|
|
|
): MutableList<MutableList<BloodFatBean.ModelCompare>> {
|
|
|
|
when (type) {
|
|
|
|
when (type) {
|
|
|
|
1 -> {
|
|
|
|
1 -> {
|
|
|
|
if (segmentsCompare[0][0].time != "00:00") {
|
|
|
|
if (segmentsCompare[0][0].time != "05:00") {
|
|
|
|
val d = mutableListOf<BloodFatBean.ModelCompare>()
|
|
|
|
val d = mutableListOf<BloodFatBean.ModelCompare>()
|
|
|
|
val b = BloodFatBean.ModelCompare(0f, "00:00")
|
|
|
|
val b = BloodFatBean.ModelCompare(0f, "05:00")
|
|
|
|
d.add(b)
|
|
|
|
d.add(b)
|
|
|
|
segmentsCompare.add(d)
|
|
|
|
segmentsCompare.add(d)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1018,10 +1047,11 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
binding.tvShowDate.text.toString(),
|
|
|
|
binding.tvShowDate.text.toString(),
|
|
|
|
SimpleDateFormat("yyyy-MM-dd")
|
|
|
|
SimpleDateFormat("yyyy-MM-dd")
|
|
|
|
) &&
|
|
|
|
) &&
|
|
|
|
segmentsCompare[segmentsCompare.size - 1][segmentsCompare[segmentsCompare.size - 1].size - 1].time != "23:50"
|
|
|
|
segmentsCompare[segmentsCompare.size - 1]
|
|
|
|
|
|
|
|
[segmentsCompare[segmentsCompare.size - 1].size - 1].time != "09:00"
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
val d = mutableListOf<BloodFatBean.ModelCompare>()
|
|
|
|
val d = mutableListOf<BloodFatBean.ModelCompare>()
|
|
|
|
val b = BloodFatBean.ModelCompare(0f, "23:50")
|
|
|
|
val b = BloodFatBean.ModelCompare(0f, "09:00")
|
|
|
|
d.add(b)
|
|
|
|
d.add(b)
|
|
|
|
segmentsCompare.add(d)
|
|
|
|
segmentsCompare.add(d)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1191,7 +1221,7 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
values,
|
|
|
|
values,
|
|
|
|
lineChart,
|
|
|
|
lineChart,
|
|
|
|
2.5f,
|
|
|
|
2.5f,
|
|
|
|
2f,
|
|
|
|
4f,
|
|
|
|
true
|
|
|
|
true
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1407,16 +1437,19 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
when (chartType) {
|
|
|
|
when (chartType) {
|
|
|
|
0 -> {
|
|
|
|
0 -> {
|
|
|
|
binding.clCurTc.mOrganView.tvFirstValue.text = SpannableUtils.setSpan(
|
|
|
|
binding.clCurTc.mOrganView.tvFirstValue.text = SpannableUtils.setSpan(
|
|
|
|
tcNormalTime, Color.parseColor("#313131")
|
|
|
|
tcNormalTime,
|
|
|
|
|
|
|
|
Color.parseColor("#313131")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if (tcNormalTime > 0) {
|
|
|
|
if (tcNormalTime >= 0) {
|
|
|
|
binding.clCurTc.mOrganView.ivFirst.visibility = View.VISIBLE
|
|
|
|
binding.clCurTc.mOrganView.ivFirst.visibility = View.VISIBLE
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
binding.clCurTc.mOrganView.ivFirst.visibility = View.INVISIBLE
|
|
|
|
binding.clCurTc.mOrganView.ivFirst.visibility = View.INVISIBLE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
binding.clCurTc.mOrganView.tvSecondValue.text =
|
|
|
|
binding.clCurTc.mOrganView.tvSecondValue.text = SpannableUtils.setSpan(
|
|
|
|
SpannableUtils.setSpan(tcAbNormalTime, Color.parseColor("#313131"))
|
|
|
|
tcAbNormalTime,
|
|
|
|
|
|
|
|
Color.parseColor("#313131")
|
|
|
|
|
|
|
|
)
|
|
|
|
if (tcAbNormalTime > 0) {
|
|
|
|
if (tcAbNormalTime > 0) {
|
|
|
|
binding.clCurTc.mOrganView.ivSecond.visibility = View.VISIBLE
|
|
|
|
binding.clCurTc.mOrganView.ivSecond.visibility = View.VISIBLE
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -1425,9 +1458,11 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
1 -> {
|
|
|
|
1 -> {
|
|
|
|
binding.clCurTg.mOrganView.tvFirstValue.text =
|
|
|
|
binding.clCurTg.mOrganView.tvFirstValue.text = SpannableUtils.setSpan(
|
|
|
|
SpannableUtils.setSpan(tgNormalTime, Color.parseColor("#313131"))
|
|
|
|
tgNormalTime,
|
|
|
|
if (tgNormalTime > 0) {
|
|
|
|
Color.parseColor("#313131")
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
if (tgNormalTime >= 0) {
|
|
|
|
binding.clCurTg.mOrganView.ivFirst.visibility = View.VISIBLE
|
|
|
|
binding.clCurTg.mOrganView.ivFirst.visibility = View.VISIBLE
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
binding.clCurTg.mOrganView.ivFirst.visibility = View.INVISIBLE
|
|
|
|
binding.clCurTg.mOrganView.ivFirst.visibility = View.INVISIBLE
|
|
|
@ -1445,7 +1480,7 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
2 -> {
|
|
|
|
2 -> {
|
|
|
|
binding.clCurHdl.mOrganView.tvFirstValue.text =
|
|
|
|
binding.clCurHdl.mOrganView.tvFirstValue.text =
|
|
|
|
SpannableUtils.setSpan(hdlNormalTime, Color.parseColor("#313131"))
|
|
|
|
SpannableUtils.setSpan(hdlNormalTime, Color.parseColor("#313131"))
|
|
|
|
if (hdlNormalTime > 0) {
|
|
|
|
if (hdlNormalTime >= 0) {
|
|
|
|
binding.clCurHdl.mOrganView.ivFirst.visibility = View.VISIBLE
|
|
|
|
binding.clCurHdl.mOrganView.ivFirst.visibility = View.VISIBLE
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
binding.clCurHdl.mOrganView.ivFirst.visibility = View.INVISIBLE
|
|
|
|
binding.clCurHdl.mOrganView.ivFirst.visibility = View.INVISIBLE
|
|
|
@ -1463,7 +1498,7 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
else -> {
|
|
|
|
else -> {
|
|
|
|
binding.clCurLdl.mOrganView.tvFirstValue.text =
|
|
|
|
binding.clCurLdl.mOrganView.tvFirstValue.text =
|
|
|
|
SpannableUtils.setSpan(ldlNormalTime, Color.parseColor("#313131"))
|
|
|
|
SpannableUtils.setSpan(ldlNormalTime, Color.parseColor("#313131"))
|
|
|
|
if (ldlNormalTime > 0) {
|
|
|
|
if (ldlNormalTime >= 0) {
|
|
|
|
binding.clCurLdl.mOrganView.ivFirst.visibility = View.VISIBLE
|
|
|
|
binding.clCurLdl.mOrganView.ivFirst.visibility = View.VISIBLE
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
binding.clCurLdl.mOrganView.ivFirst.visibility = View.INVISIBLE
|
|
|
|
binding.clCurLdl.mOrganView.ivFirst.visibility = View.INVISIBLE
|
|
|
@ -1481,91 +1516,172 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressLint("SetTextI18n")
|
|
|
|
@SuppressLint("SetTextI18n")
|
|
|
|
fun setNoOpenBloodLipid(status: Int) {
|
|
|
|
fun setNoOpenBloodLipid(status: Int, data: BloodFatHeadInfo.Data?) {
|
|
|
|
var valueDesc = ""
|
|
|
|
var valueDesc = ""
|
|
|
|
if (status == 0) {
|
|
|
|
if (status == 0) {
|
|
|
|
|
|
|
|
if (TextUtils.isEmpty(expireTimeStr)) {
|
|
|
|
valueDesc = "未开通"
|
|
|
|
valueDesc = "未开通"
|
|
|
|
|
|
|
|
binding.tvOpen.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
binding.tvRenew.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.compareTv.visibility = View.GONE
|
|
|
|
binding.llRenew.visibility = View.GONE
|
|
|
|
binding.llRenew.visibility = View.GONE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binding.tcLayout.llEmpty.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
binding.tgLayout.llEmpty.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
binding.hdlLayout.llEmpty.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
binding.ldlLayout.llEmpty.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
binding.tcLayout.mBarChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tcLayout.mLineChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tgLayout.mBarChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tgLayout.mLineChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.hdlLayout.mBarChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.hdlLayout.mLineChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.ldlLayout.mBarChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.ldlLayout.mLineChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tcLayout.zhexianTv.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tcLayout.zhuzhuanTv.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tcLayout.mDesc.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tgLayout.zhexianTv.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tgLayout.zhuzhuanTv.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tgLayout.mDesc.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.hdlLayout.zhexianTv.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.hdlLayout.zhuzhuanTv.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.hdlLayout.mDesc.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.ldlLayout.zhexianTv.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.ldlLayout.zhuzhuanTv.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.ldlLayout.mDesc.visibility = View.GONE
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
valueDesc = "--"
|
|
|
|
|
|
|
|
binding.tvOpen.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.compareTv.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
binding.tvRenew.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
binding.llRenew.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (status == 1) {
|
|
|
|
} else if (status == 1) {
|
|
|
|
valueDesc = "建模中"
|
|
|
|
valueDesc = "建模中"
|
|
|
|
binding.llRenew.visibility = View.VISIBLE
|
|
|
|
binding.llRenew.visibility = View.VISIBLE
|
|
|
|
binding.tvRenew.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tvBloodLipidAdjust.text = "建模说明"
|
|
|
|
binding.tvBloodLipidAdjust.text = "建模说明"
|
|
|
|
}
|
|
|
|
binding.tvRenew.visibility = View.GONE
|
|
|
|
binding.tvOpen.visibility = View.VISIBLE
|
|
|
|
binding.tvOpen.visibility = View.GONE
|
|
|
|
binding.compareTv.visibility = View.GONE
|
|
|
|
binding.compareTv.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binding.tcLayout.llEmpty.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
binding.tgLayout.llEmpty.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
binding.hdlLayout.llEmpty.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
binding.ldlLayout.llEmpty.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
binding.tcLayout.mBarChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tcLayout.mLineChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tgLayout.mBarChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tgLayout.mLineChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.hdlLayout.mBarChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.hdlLayout.mLineChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.ldlLayout.mBarChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.ldlLayout.mLineChart.visibility = View.GONE
|
|
|
|
binding.tcLayout.zhexianTv.visibility = View.GONE
|
|
|
|
binding.tcLayout.zhexianTv.visibility = View.GONE
|
|
|
|
binding.tcLayout.zhuzhuanTv.visibility = View.GONE
|
|
|
|
binding.tcLayout.zhuzhuanTv.visibility = View.GONE
|
|
|
|
binding.tcLayout.mDesc.visibility = View.GONE
|
|
|
|
binding.tcLayout.mDesc.visibility = View.GONE
|
|
|
|
binding.tcLayout.mBarChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tcLayout.mLineChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tcLayout.llEmpty.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binding.tgLayout.zhexianTv.visibility = View.GONE
|
|
|
|
binding.tgLayout.zhexianTv.visibility = View.GONE
|
|
|
|
binding.tgLayout.zhuzhuanTv.visibility = View.GONE
|
|
|
|
binding.tgLayout.zhuzhuanTv.visibility = View.GONE
|
|
|
|
binding.tgLayout.mDesc.visibility = View.GONE
|
|
|
|
binding.tgLayout.mDesc.visibility = View.GONE
|
|
|
|
binding.tgLayout.mBarChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tgLayout.mLineChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tgLayout.llEmpty.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binding.hdlLayout.zhexianTv.visibility = View.GONE
|
|
|
|
binding.hdlLayout.zhexianTv.visibility = View.GONE
|
|
|
|
binding.hdlLayout.zhuzhuanTv.visibility = View.GONE
|
|
|
|
binding.hdlLayout.zhuzhuanTv.visibility = View.GONE
|
|
|
|
binding.hdlLayout.mDesc.visibility = View.GONE
|
|
|
|
binding.hdlLayout.mDesc.visibility = View.GONE
|
|
|
|
binding.hdlLayout.mBarChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.hdlLayout.mLineChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.hdlLayout.llEmpty.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binding.ldlLayout.zhexianTv.visibility = View.GONE
|
|
|
|
binding.ldlLayout.zhexianTv.visibility = View.GONE
|
|
|
|
binding.ldlLayout.zhuzhuanTv.visibility = View.GONE
|
|
|
|
binding.ldlLayout.zhuzhuanTv.visibility = View.GONE
|
|
|
|
binding.ldlLayout.mDesc.visibility = View.GONE
|
|
|
|
binding.ldlLayout.mDesc.visibility = View.GONE
|
|
|
|
binding.ldlLayout.mBarChart.visibility = View.GONE
|
|
|
|
}
|
|
|
|
binding.ldlLayout.mLineChart.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.ldlLayout.llEmpty.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binding.clCurTc.tvBloodValue.text = valueDesc
|
|
|
|
binding.clCurTc.tvBloodValue.text = if (data != null) {
|
|
|
|
|
|
|
|
if (data.tc > 0) {
|
|
|
|
|
|
|
|
data.tc.toString()
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
valueDesc
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
valueDesc
|
|
|
|
|
|
|
|
}
|
|
|
|
binding.clCurTc.tvTestTime.text = "mmol/L ${
|
|
|
|
binding.clCurTc.tvTestTime.text = "mmol/L ${
|
|
|
|
Dateutils.formatTime(System.currentTimeMillis(), Dateutils.HH_MM_Format)
|
|
|
|
Dateutils.formatTime(System.currentTimeMillis(), Dateutils.HH_MM_Format)
|
|
|
|
}"
|
|
|
|
}"
|
|
|
|
binding.clCurTc.mOrganView.tvFirstValue.text = SpannableUtils.setSpan(
|
|
|
|
binding.clCurTc.mOrganView.tvFirstValue.text = SpannableUtils.setSpan(
|
|
|
|
0, Color.parseColor("#313131")
|
|
|
|
0,
|
|
|
|
|
|
|
|
Color.parseColor("#313131")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
binding.clCurTc.mOrganView.tvSecondValue.text = SpannableUtils.setSpan(
|
|
|
|
binding.clCurTc.mOrganView.tvSecondValue.text = SpannableUtils.setSpan(
|
|
|
|
0, Color.parseColor("#313131")
|
|
|
|
tcAbNormalTime,
|
|
|
|
|
|
|
|
Color.parseColor("#313131")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
binding.clCurTg.tvBloodValue.text = valueDesc
|
|
|
|
binding.clCurTg.tvBloodValue.text = if (data != null) {
|
|
|
|
|
|
|
|
if (data.tg > 0) {
|
|
|
|
|
|
|
|
data.tg.toString()
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
valueDesc
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
valueDesc
|
|
|
|
|
|
|
|
}
|
|
|
|
binding.clCurTg.tvTestTime.text = "mmol/L ${
|
|
|
|
binding.clCurTg.tvTestTime.text = "mmol/L ${
|
|
|
|
Dateutils.formatTime(System.currentTimeMillis(), Dateutils.HH_MM_Format)
|
|
|
|
Dateutils.formatTime(
|
|
|
|
|
|
|
|
System.currentTimeMillis(),
|
|
|
|
|
|
|
|
Dateutils.HH_MM_Format
|
|
|
|
|
|
|
|
)
|
|
|
|
}"
|
|
|
|
}"
|
|
|
|
binding.clCurTg.mOrganView.tvFirstValue.text = SpannableUtils.setSpan(
|
|
|
|
binding.clCurTg.mOrganView.tvFirstValue.text = SpannableUtils.setSpan(
|
|
|
|
0, Color.parseColor("#313131")
|
|
|
|
0,
|
|
|
|
|
|
|
|
Color.parseColor("#313131")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
binding.clCurTg.mOrganView.tvSecondValue.text = SpannableUtils.setSpan(
|
|
|
|
binding.clCurTg.mOrganView.tvSecondValue.text = SpannableUtils.setSpan(
|
|
|
|
0, Color.parseColor("#313131")
|
|
|
|
tgAbNormalTime,
|
|
|
|
|
|
|
|
Color.parseColor("#313131")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
binding.clCurHdl.tvBloodValue.text = valueDesc
|
|
|
|
binding.clCurHdl.tvBloodValue.text = if (data != null) {
|
|
|
|
|
|
|
|
if (data.hdl > 0) {
|
|
|
|
|
|
|
|
data.hdl.toString()
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
valueDesc
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
valueDesc
|
|
|
|
|
|
|
|
}
|
|
|
|
binding.clCurHdl.tvTestTime.text = "mmol/L ${
|
|
|
|
binding.clCurHdl.tvTestTime.text = "mmol/L ${
|
|
|
|
Dateutils.formatTime(System.currentTimeMillis(), Dateutils.HH_MM_Format)
|
|
|
|
Dateutils.formatTime(
|
|
|
|
|
|
|
|
System.currentTimeMillis(),
|
|
|
|
|
|
|
|
Dateutils.HH_MM_Format
|
|
|
|
|
|
|
|
)
|
|
|
|
}"
|
|
|
|
}"
|
|
|
|
binding.clCurHdl.mOrganView.tvFirstValue.text = SpannableUtils.setSpan(
|
|
|
|
binding.clCurHdl.mOrganView.tvFirstValue.text = SpannableUtils.setSpan(
|
|
|
|
0, Color.parseColor("#313131")
|
|
|
|
0,
|
|
|
|
|
|
|
|
Color.parseColor("#313131")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
binding.clCurHdl.mOrganView.tvSecondValue.text = SpannableUtils.setSpan(
|
|
|
|
binding.clCurHdl.mOrganView.tvSecondValue.text = SpannableUtils.setSpan(
|
|
|
|
0, Color.parseColor("#313131")
|
|
|
|
hdlAbNormalTime,
|
|
|
|
|
|
|
|
Color.parseColor("#313131")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
binding.clCurLdl.tvBloodValue.text = valueDesc
|
|
|
|
binding.clCurLdl.tvBloodValue.text = if (data != null) {
|
|
|
|
|
|
|
|
if (data.ldl > 0) {
|
|
|
|
|
|
|
|
data.ldl.toString()
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
valueDesc
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
valueDesc
|
|
|
|
|
|
|
|
}
|
|
|
|
binding.clCurLdl.tvTestTime.text = "mmol/L ${
|
|
|
|
binding.clCurLdl.tvTestTime.text = "mmol/L ${
|
|
|
|
Dateutils.formatTime(System.currentTimeMillis(), Dateutils.HH_MM_Format)
|
|
|
|
Dateutils.formatTime(
|
|
|
|
|
|
|
|
System.currentTimeMillis(),
|
|
|
|
|
|
|
|
Dateutils.HH_MM_Format
|
|
|
|
|
|
|
|
)
|
|
|
|
}"
|
|
|
|
}"
|
|
|
|
binding.clCurLdl.mOrganView.tvFirstValue.text = SpannableUtils.setSpan(
|
|
|
|
binding.clCurLdl.mOrganView.tvFirstValue.text = SpannableUtils.setSpan(
|
|
|
|
0, Color.parseColor("#313131")
|
|
|
|
0,
|
|
|
|
|
|
|
|
Color.parseColor("#313131")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
binding.clCurLdl.mOrganView.tvSecondValue.text = SpannableUtils.setSpan(
|
|
|
|
binding.clCurLdl.mOrganView.tvSecondValue.text = SpannableUtils.setSpan(
|
|
|
|
0, Color.parseColor("#313131")
|
|
|
|
ldlAbNormalTime,
|
|
|
|
|
|
|
|
Color.parseColor("#313131")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1575,6 +1691,7 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
|
|
|
|
binding.tvRenew.visibility = View.GONE
|
|
|
|
binding.tvRenew.visibility = View.GONE
|
|
|
|
binding.compareTv.visibility = View.VISIBLE
|
|
|
|
binding.compareTv.visibility = View.VISIBLE
|
|
|
|
binding.llRenew.visibility = View.GONE
|
|
|
|
binding.llRenew.visibility = View.GONE
|
|
|
|
|
|
|
|
binding.tvEndTime.text = "2088-12-21 18:00:00"
|
|
|
|
|
|
|
|
|
|
|
|
binding.clCurTc.tvBloodValue.text = "5.07"
|
|
|
|
binding.clCurTc.tvBloodValue.text = "5.07"
|
|
|
|
binding.clCurTc.tvTestTime.text = "mmol/L ${
|
|
|
|
binding.clCurTc.tvTestTime.text = "mmol/L ${
|
|
|
|