中建365-优化/bug修复

develop
wlh 1 year ago
parent ff29858c0a
commit e4ad478c07

@ -7,6 +7,7 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.tencent.qcloud.tuicore.TUIConstants import com.tencent.qcloud.tuicore.TUIConstants
import com.xty.base.fragment.BaseFragList import com.xty.base.fragment.BaseFragList
import com.xty.common.R
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.LoginOrRegisterEvent import com.xty.common.event.LoginOrRegisterEvent
@ -33,6 +34,7 @@ class MessageFragment : BaseFragList<MessageVm>() {
var bean = adapter.getItem(position) as SystemMsgBean var bean = adapter.getItem(position) as SystemMsgBean
bundle.clear() bundle.clear()
bundle.putInt("msgType",bean.type) bundle.putInt("msgType",bean.type)
bundle.putString("msgTitle",bean.name)
RouteManager.goAct(ARouterUrl.MESSAGE_TYPE,bundle) RouteManager.goAct(ARouterUrl.MESSAGE_TYPE,bundle)
} }
} }
@ -55,8 +57,47 @@ class MessageFragment : BaseFragList<MessageVm>() {
} }
initAdapter() initAdapter()
setRecycleRefresh(binding.mRecycle,binding.mRefresh) setRecycleRefresh(binding.mRecycle,binding.mRefresh)
// initTest()
} }
/*fun initTest(){
var titles = ArrayList<String>()
titles.add("胆经")
titles.add("肝经")
titles.add("肺经")
titles.add("大肠经")
titles.add("胃经")
titles.add("脾经")
titles.add("心经")
titles.add("小肠经")
titles.add("膀胱经")
titles.add("肾经")
titles.add("心包经")
titles.add("三焦经")
var img = ArrayList<Int>()
img.add(R.mipmap.ic_heart_1)
img.add(R.mipmap.ic_liver_1)
img.add(R.mipmap.ic_spleen_1)
img.add(R.mipmap.ic_lung_1)
img.add(R.mipmap.ic_kidney_1)
img.add(R.mipmap.ic_large_intestine_1)
img.add(R.mipmap.ic_small_intestine_1)
img.add(R.mipmap.ic_stomach_1)
img.add(R.mipmap.ic_lymph_1)
img.add(R.mipmap.ic_gallbladder_1)
img.add(R.mipmap.ic_bladder_1)
img.add(R.mipmap.ic_pericardium_1)
binding.clBody.healthBody.setMenuItemIconsAndTexts(img,titles)
// binding..healthBody.setMenuItemIconsAndTexts(img, titles)
}*/
override fun refresh() { override fun refresh() {
mViewModel.getSystemMsg() mViewModel.getSystemMsg()
} }

@ -14,7 +14,8 @@
<com.scwang.smart.refresh.layout.SmartRefreshLayout <com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/mRefresh" android:id="@+id/mRefresh"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
>
<com.scwang.smart.refresh.header.ClassicsHeader <com.scwang.smart.refresh.header.ClassicsHeader
android:layout_width="match_parent" android:layout_width="match_parent"

@ -0,0 +1,187 @@
package com.xty.common.weight
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import com.xty.common.R
import kotlin.math.cos
import kotlin.math.roundToInt
import kotlin.math.sin
class HealthBodyView(context: Context, attrs: AttributeSet?) : ViewGroup(context, attrs) {
//圆形直径
var mRadius = 0
//该容器内child item 的默认尺寸
val RADIO_DEFAULT_CHILD_DIMESION = 1 / 6f
// 该容器的内边距无视padding属性 如需边距请用该变量
val RADIO_PADDING_LAYOUT = 1 / 12f
var mPadding = 0f
// 布局时的开始角度
var mStartAngle = 270.0
//文本
var mBodyText = ArrayList<String>()
//图标
var mBodyImg= ArrayList<Int>()
//数
var mCount = 12
var mItemLayoutId: Int = R.layout.layout_health_body_child
var mOnClicklistener: onItemClicked? = null
fun setMenuItemIconsAndTexts(images: ArrayList<Int>, texts: ArrayList<String>) {
require(!(images == null && texts == null)) { "菜单文本和图标至少设置其一" }
mBodyImg = images
mBodyText = texts
//初始化mMenucount
mCount = images.size
if (images != null && texts != null) {
mCount = Math.min(images.size, texts.size)
}
//构建菜单项
buildMenuItems()
}
private fun buildMenuItems() {
//根据用户设置的参数初始化menu item
for (i in 0 until mCount) {
val itemView = inflateMenuView(i)
initMenuItem(itemView, i)
addView(itemView)
}
}
private fun inflateMenuView(index: Int): View {
val mInflater = LayoutInflater.from(context)
val itemView: View = mInflater.inflate(mItemLayoutId, this, false)
itemView.setOnClickListener(object : OnClickListener{
override fun onClick(p0: View?) {
mOnClicklistener?.onPositionClicked(index)
}
})
return itemView
}
private fun initMenuItem(itemView: View, index: Int) {
val iv = itemView.findViewById<ImageView>(R.id.img_body)
val tv = itemView.findViewById<TextView>(R.id.tv_body)
iv.setImageResource(mBodyImg[index])
tv.setText(mBodyText[index])
}
fun setMenuItemLayoutId(mItemLayoutId: Int) {
this.mItemLayoutId = mItemLayoutId
}
fun setOnClicklisteners(mOnClicklistener: onItemClicked) {
this. mOnClicklistener = mOnClicklistener
}
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
// 测量自己
measureSelf(widthMeasureSpec, heightMeasureSpec)
// 测量菜单
measureChildViews()
}
private fun measureSelf(widthMeasureSpec: Int, heightMeasureSpec: Int) {
var resWidth = 0
var resHeight = 0
val width = MeasureSpec.getSize(widthMeasureSpec)
val widthMode = MeasureSpec.getMode(widthMeasureSpec)
val heigh = MeasureSpec.getSize(heightMeasureSpec)
val heightMode = MeasureSpec.getMode(heightMeasureSpec)
//如果宽或者高的测量模式非精确值
/* if (widthMode != MeasureSpec.EXACTLY ||
heightMode != MeasureSpec.EXACTLY
) {
//设置为背景图的宽高
resWidth = suggestedMinimumWidth
//如果未设置背景图,则设置为屏幕宽高的默认值
resWidth = if (resWidth == 0) getDefaultWidth() else resWidth
resHeight = if (resHeight == 0) getDefaultWidth() else resHeight
} else {*/
resHeight = Math.min(width, heigh)
resWidth = resHeight
// }
setMeasuredDimension(resWidth, resHeight)
}
private fun getDefaultWidth(): Int {
return (mRadius * RADIO_DEFAULT_CHILD_DIMESION).toInt()
}
private fun measureChildViews() {
//获得半径
mRadius = Math.max(measuredWidth, measuredWidth)
//menu item 数量
val count = childCount
//menu 尺寸
val childSize = (mRadius * RADIO_DEFAULT_CHILD_DIMESION).toInt()
// menu item 测量模式
val childMode = MeasureSpec.EXACTLY
//迭代测量
for (i in 0 until count) {
val child = getChildAt(i)
if (child.visibility == GONE) {
continue
}
// 计算menu item 的尺寸 以及设置好的模式去对item进行测量
var makeMeasureSpec = -1
makeMeasureSpec = MeasureSpec.makeMeasureSpec(childSize, childMode)
child.measure(makeMeasureSpec, makeMeasureSpec)
}
//mPadding = RADIO_PADDING_LAYOUT * mRadius
}
override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
val childCount = childCount
var left: Int
var top: Int
// menu item 的尺寸
val itemWidth = (mRadius * RADIO_DEFAULT_CHILD_DIMESION).toInt()
// 根据menuitem 的个数 计算item的布局占用的角度
if(childCount > 0){
val angleDelay = (360 / childCount).toFloat()
// 遍历所有菜单 设置它们的位置
for (i in 0 until childCount) {
val child = getChildAt(i)
if (child.visibility == GONE) {
continue
}
//菜单的起始角度
mStartAngle %= 360.0
//计算 中心点到menuitem 中心的距离
val distanceFromCenter = mRadius / 2f - itemWidth / 2 - mPadding
left =
mRadius / 2 + (distanceFromCenter * cos(Math.toRadians(mStartAngle)) - 1 / 2f * itemWidth).roundToInt()
top =
mRadius / 2 + (distanceFromCenter * sin(Math.toRadians(mStartAngle)) - 1 / 2f * itemWidth).roundToInt()
child.layout(left, top, left + itemWidth, top + itemWidth)
mStartAngle += angleDelay.toDouble()
}
}
}
interface onItemClicked{
fun onPositionClicked(postion:Int)
}
}

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center">
<ImageView
android:layout_width="@dimen/dp_122"
android:layout_height="@dimen/dp_122"
android:background="#8CFFEFDF"
android:layout_gravity="center"/>
<ImageView
android:id="@+id/img_sex_body"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_100"
android:layout_gravity="center"
tools:background="@mipmap/icon_health_women_1"/>
<ImageView
android:layout_width="@dimen/dp_260"
android:layout_height="@dimen/dp_260"
android:layout_gravity="center"
android:background="@mipmap/bg_health_body"/>
<com.xty.common.weight.HealthBodyView
android:id="@+id/healthBody"
android:layout_width="match_parent"
android:layout_gravity="center"
android:layout_height="@dimen/dp_500"
/>
</FrameLayout>

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_30"
android:layout_height="@dimen/dp_30"
android:id="@+id/img_body"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_333"
android:textSize="@dimen/sp_10"
android:id="@+id/tv_body"/>
</LinearLayout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 KiB

@ -202,4 +202,6 @@
<color name="col_f2f">#F2F6F7</color> <color name="col_f2f">#F2F6F7</color>
<color name="col_3ad">#3AD9BC</color> <color name="col_3ad">#3AD9BC</color>
<color name="col_e3f">#E3FCF6</color> <color name="col_e3f">#E3FCF6</color>
<color name="col_f15">#F15C42</color>
<color name="col_04f">#FFD04F</color>
</resources> </resources>

@ -339,18 +339,18 @@
<string name="status_4">建模中</string> <string name="status_4">建模中</string>
<string name="line_chart_not_data">暂无数据</string> <string name="line_chart_not_data">暂无数据</string>
<string name="heart"></string> <string name="heart"></string>
<string name="stomach"></string> <string name="stomach"></string>
<string name="lung"></string> <string name="lung"></string>
<string name="kidney"></string> <string name="kidney"></string>
<string name="liver"></string> <string name="liver"></string>
<string name="spleen"></string> <string name="spleen"></string>
<string name="large_intestine">大肠</string> <string name="large_intestine">大肠</string>
<string name="small_intestine">小肠</string> <string name="small_intestine">小肠</string>
<string name="lymph">淋巴</string> <string name="lymph">三焦经</string>
<string name="gallbladder"></string> <string name="gallbladder"></string>
<string name="bladder">膀胱</string> <string name="bladder">膀胱</string>
<string name="pericardium">心包</string> <string name="pericardium">心包</string>
<string name="sign_info">打卡列表</string> <string name="sign_info">打卡列表</string>
<string name="user_info">用户信息</string> <string name="user_info">用户信息</string>

@ -1510,33 +1510,66 @@ class HealthSkyHourReportAct : BaseVmAct<ReportVm>() {
} }
val bodyImgResId = if (statusInt == 2) { val bodyImgResId = if (statusInt == 2) {
if (mViewModel.infoLive.value!!.data.user.sex == "1") { if (mViewModel.infoLive.value!!.data.user.sex == "1") {
R.mipmap.ic_male_body_warning R.mipmap.icon_health_man_2
} else { } else {
R.mipmap.ic_female_body_warning R.mipmap.icon_health_women_2
} }
} else if (statusInt == 3) { } else if (statusInt == 3) {
if (mViewModel.infoLive.value!!.data.user.sex == "1") { if (mViewModel.infoLive.value!!.data.user.sex == "1") {
R.mipmap.ic_male_body_disease R.mipmap.icon_health_man_3
} else { } else {
R.mipmap.ic_female_body_disease R.mipmap.icon_health_women_3
} }
} else if (statusInt == 1) { } else if (statusInt == 1) {
if (mViewModel.infoLive.value!!.data.user.sex == "1") { if (mViewModel.infoLive.value!!.data.user.sex == "1") {
R.mipmap.ic_male_body_health R.mipmap.icon_health_man_1
} else { } else {
R.mipmap.ic_female_body_health R.mipmap.icon_health_women_1
} }
} else { } else {
if (mViewModel.infoLive.value!!.data.user.sex == "1") { if (mViewModel.infoLive.value!!.data.user.sex == "1") {
R.mipmap.ic_male_body_none_data R.mipmap.icon_health_man_4
} else { } else {
R.mipmap.ic_female_body_none_data R.mipmap.icon_health_women_4
} }
} }
binding.mBody.setImageResource(bodyImgResId) binding.clBody.imgSexBody.setImageResource(bodyImgResId)
val organ = mViewModel.infoLive.value!!.data.organ val organ = mViewModel.infoLive.value!!.data.organ
var organName = ArrayList<String>()
var organImg = ArrayList<Int>()
organName.add("胆经")
organName.add("肝经")
organName.add("肺经")
organName.add("大肠经")
organName.add("胃经")
organName.add("脾经")
organName.add("心经")
organName.add("小肠经")
organName.add("膀胱经")
organName.add("肾经")
organName.add("心包经")
organName.add("三焦经")
organImg.add(UserInfoDefin.gallIcon[getHealthStatus(organ.cholecyst.model)])
organImg.add(UserInfoDefin.liverIcon[getHealthStatus(organ.liver.model)])
organImg.add(UserInfoDefin.lungIcon[getHealthStatus(organ.lungs.model)])
organImg.add(UserInfoDefin.largeIcon[getHealthStatus(organ.largeIntestine.model)])
organImg.add(UserInfoDefin.stomachIcon[getHealthStatus(organ.stomach.model)])
organImg.add(UserInfoDefin.spleenIcon[getHealthStatus(organ.spleen.model)])
organImg.add(UserInfoDefin.heartIcon[getHealthStatus(organ.heart.model)])
organImg.add(UserInfoDefin.smallIcon[getHealthStatus(organ.smallIntestine.model)])
organImg.add(UserInfoDefin.bladderIcon[getHealthStatus(organ.bladder.model)])
organImg.add(UserInfoDefin.kidneyIcon[getHealthStatus(organ.kidney.model)])
organImg.add(UserInfoDefin.pericardiumIcon[getHealthStatus(organ.pericardium.model)])
organImg.add(UserInfoDefin.lymphIcon[getHealthStatus(organ.lymph.model)])
binding.clBody.healthBody.setMenuItemIconsAndTexts(organImg,organName)
binding.mHeart.setInfo(getHealthStatus(organ.heart.model), UserInfoDefin.heartIcon) binding.mHeart.setInfo(getHealthStatus(organ.heart.model), UserInfoDefin.heartIcon)
binding.mStomach.setInfo(getHealthStatus(organ.stomach.model), UserInfoDefin.stomachIcon) binding.mStomach.setInfo(getHealthStatus(organ.stomach.model), UserInfoDefin.stomachIcon)
binding.mLung.setInfo(getHealthStatus(organ.lungs.model), UserInfoDefin.lungIcon) binding.mLung.setInfo(getHealthStatus(organ.lungs.model), UserInfoDefin.lungIcon)

@ -17,6 +17,7 @@ import android.util.Log
import android.view.Gravity import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.View.OnClickListener
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
@ -45,6 +46,7 @@ import com.xty.base.utils.UserInfoDefin
import com.xty.common.AESCrypt import com.xty.common.AESCrypt
import com.xty.common.BuildConfig import com.xty.common.BuildConfig
import com.xty.common.Const import com.xty.common.Const
import com.xty.common.LogUtils
import com.xty.common.MMkvHelper import com.xty.common.MMkvHelper
import com.xty.common.TimeSelect import com.xty.common.TimeSelect
import com.xty.common.WxUtils import com.xty.common.WxUtils
@ -57,6 +59,7 @@ import com.xty.common.setOrganStatus
import com.xty.common.util.CommonToastUtils import com.xty.common.util.CommonToastUtils
import com.xty.common.util.CommonUtils import com.xty.common.util.CommonUtils
import com.xty.common.weight.CenterImageSpan import com.xty.common.weight.CenterImageSpan
import com.xty.common.weight.HealthBodyView
import com.zj365.health.R import com.zj365.health.R
import com.zj365.health.act.exception.BaseExceptionDataAct import com.zj365.health.act.exception.BaseExceptionDataAct
import com.zj365.health.adapter.DayReportInfoAdapter import com.zj365.health.adapter.DayReportInfoAdapter
@ -2101,34 +2104,186 @@ class HealthWeekMonthHourReportAct : BaseVmAct<ReportVm>() {
} }
val bodyImgResId = if (statusInt == 2) { val bodyImgResId = if (statusInt == 2) {
if (mViewModel.infoLive.value!!.data.user.sex == "1") { if (mViewModel.infoLive.value!!.data.user.sex == "1") {
R.mipmap.ic_male_body_warning R.mipmap.icon_health_man_2
} else { } else {
R.mipmap.ic_female_body_warning R.mipmap.icon_health_women_2
} }
} else if (statusInt == 3) { } else if (statusInt == 3) {
if (mViewModel.infoLive.value!!.data.user.sex == "1") { if (mViewModel.infoLive.value!!.data.user.sex == "1") {
R.mipmap.ic_male_body_disease R.mipmap.icon_health_man_3
} else { } else {
R.mipmap.ic_female_body_disease R.mipmap.icon_health_women_3
} }
} else if (statusInt == 1) { } else if (statusInt == 1) {
if (mViewModel.infoLive.value!!.data.user.sex == "1") { if (mViewModel.infoLive.value!!.data.user.sex == "1") {
R.mipmap.ic_male_body_health R.mipmap.icon_health_man_1
} else { } else {
R.mipmap.ic_female_body_health R.mipmap.icon_health_women_1
} }
} else { } else {
if (mViewModel.infoLive.value!!.data.user.sex == "1") { if (mViewModel.infoLive.value!!.data.user.sex == "1") {
R.mipmap.ic_male_body_none_data R.mipmap.icon_health_man_4
} else { } else {
R.mipmap.ic_female_body_none_data R.mipmap.icon_health_women_4
} }
} }
binding.child.mBody.setImageResource(bodyImgResId) binding.child.clBody.imgSexBody.setImageResource(bodyImgResId)
val organ = mViewModel.infoLive.value!!.data.organ val organ = mViewModel.infoLive.value!!.data.organ
var organName = ArrayList<String>()
var organImg = ArrayList<Int>()
organName.add("胆经")
organName.add("肝经")
organName.add("肺经")
organName.add("大肠经")
organName.add("胃经")
organName.add("脾经")
organName.add("心经")
organName.add("小肠经")
organName.add("膀胱经")
organName.add("肾经")
organName.add("心包经")
organName.add("三焦经")
organImg.add(UserInfoDefin.gallIcon[getHealthStatus(organ.cholecyst.model)])
organImg.add(UserInfoDefin.liverIcon[getHealthStatus(organ.liver.model)])
organImg.add(UserInfoDefin.lungIcon[getHealthStatus(organ.lungs.model)])
organImg.add(UserInfoDefin.largeIcon[getHealthStatus(organ.largeIntestine.model)])
organImg.add(UserInfoDefin.stomachIcon[getHealthStatus(organ.stomach.model)])
organImg.add(UserInfoDefin.spleenIcon[getHealthStatus(organ.spleen.model)])
organImg.add(UserInfoDefin.heartIcon[getHealthStatus(organ.heart.model)])
organImg.add(UserInfoDefin.smallIcon[getHealthStatus(organ.smallIntestine.model)])
organImg.add(UserInfoDefin.bladderIcon[getHealthStatus(organ.bladder.model)])
organImg.add(UserInfoDefin.kidneyIcon[getHealthStatus(organ.kidney.model)])
organImg.add(UserInfoDefin.pericardiumIcon[getHealthStatus(organ.pericardium.model)])
organImg.add(UserInfoDefin.lymphIcon[getHealthStatus(organ.lymph.model)])
binding.child.clBody.healthBody.setOnClicklisteners(object : HealthBodyView.onItemClicked{
override fun onPositionClicked(postion: Int) {
LogUtils.e("healthBody","view:${postion}")
when(postion){
0 ->{
refreshOrganHealthView(
organ.cholecyst.model,
binding.child.mGallbladder.viscera,
UserInfoDefin.gallIcon,
organ.cholecystListData
)
}
1->{
refreshOrganHealthView(
organ.liver.model,
binding.child.mLiver.viscera,
UserInfoDefin.liverIcon,
organ.liverListData
)
}
2->{
refreshOrganHealthView(
organ.lungs.model,
binding.child.mLung.viscera,
UserInfoDefin.lungIcon,
organ.lungsListData
)
}
3->{
refreshOrganHealthView(
organ.largeIntestine.model,
binding.child.mLarge.viscera,
UserInfoDefin.largeIcon,
organ.largeIntestineListData
)
}
4->{
refreshOrganHealthView(
organ.stomach.model,
binding.child.mStomach.viscera,
UserInfoDefin.stomachIcon,
organ.stomachListData
)
}
5->{
refreshOrganHealthView(
organ.spleen.model,
binding.child.mSpleen.viscera,
UserInfoDefin.spleenIcon,
organ.spleenListData
)
}
6->{
refreshOrganHealthView(
organ.heart.model,
binding.child.mHeart.viscera,
UserInfoDefin.heartIcon,
organ.heartListData
)
}
7->{
refreshOrganHealthView(
organ.smallIntestine.model,
binding.child.mSmall.viscera,
UserInfoDefin.smallIcon,
organ.smallIntestineListData
)
}
8->{
refreshOrganHealthView(
organ.bladder.model,
binding.child.mBladder.viscera,
UserInfoDefin.bladderIcon,
organ.bladderListData
)
}
9->{
refreshOrganHealthView(
organ.kidney.model,
binding.child.mKidney.viscera,
UserInfoDefin.kidneyIcon,
organ.kidneyListData
)
}
10->{
refreshOrganHealthView(
organ.pericardium.model,
binding.child.mPericardium.viscera,
UserInfoDefin.pericardiumIcon,
organ.pericardiumListData
)
}
11->{
refreshOrganHealthView(
organ.lymph.model,
binding.child.mLymph.viscera,
UserInfoDefin.lymphIcon,
organ.lymphListData
)
}
}
}
})
binding.child.clBody.healthBody.setMenuItemIconsAndTexts(organImg,organName)
refreshOrganHealthView( refreshOrganHealthView(
organ.cholecyst.model,
binding.child.mGallbladder.viscera,
UserInfoDefin.gallIcon,
organ.cholecystListData
)
/*refreshOrganHealthView(
organ.heart.model, organ.heart.model,
binding.child.mHeart.viscera, binding.child.mHeart.viscera,
UserInfoDefin.heartIcon, UserInfoDefin.heartIcon,
@ -2279,7 +2434,7 @@ class HealthWeekMonthHourReportAct : BaseVmAct<ReportVm>() {
UserInfoDefin.pericardiumIcon, UserInfoDefin.pericardiumIcon,
organ.pericardiumListData organ.pericardiumListData
) )
} }*/
} }
private fun refreshOrganHealthView( private fun refreshOrganHealthView(

@ -0,0 +1,8 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/col_04f" />
<size
android:width="@dimen/dp_7"
android:height="@dimen/dp_7"/>
</shape>

@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"> android:shape="oval">
<solid android:color="@color/col_FDA481" /> <solid android:color="@color/col_f15" />
<size <size
android:width="@dimen/dp_7" android:width="@dimen/dp_7"
android:height="@dimen/dp_7"/> android:height="@dimen/dp_7"/>

@ -353,7 +353,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_16" android:layout_marginEnd="@dimen/dp_16"
android:drawableStart="@drawable/shape_dot_96d" android:drawableStart="@drawable/shape_dot_04f"
android:drawablePadding="@dimen/dp_5" android:drawablePadding="@dimen/dp_5"
android:text="亚健康" android:text="亚健康"
android:textColor="@color/col_c7c" android:textColor="@color/col_c7c"
@ -384,11 +384,21 @@
</LinearLayout> </LinearLayout>
<include
android:id= "@+id/cl_body"
layout="@layout/layout_health_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/llHint"/>
<ImageView <ImageView
android:id="@+id/mBody" android:id="@+id/mBody"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20" android:layout_marginTop="@dimen/dp_20"
android:visibility="gone"
android:src="@mipmap/ic_male_body_health" android:src="@mipmap/ic_male_body_health"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
@ -398,6 +408,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/mBody" app:layout_constraintBottom_toBottomOf="@+id/mBody"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/mBody" app:layout_constraintRight_toLeftOf="@+id/mBody"
@ -463,6 +474,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/mBody" app:layout_constraintBottom_toBottomOf="@+id/mBody"
app:layout_constraintLeft_toRightOf="@+id/mBody" app:layout_constraintLeft_toRightOf="@+id/mBody"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"

@ -52,7 +52,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_16" android:layout_marginEnd="@dimen/dp_16"
android:drawableStart="@drawable/shape_dot_96d" android:drawableStart="@drawable/shape_dot_04f"
android:drawablePadding="@dimen/dp_5" android:drawablePadding="@dimen/dp_5"
android:text="亚健康" android:text="亚健康"
android:textColor="@color/col_c7c" android:textColor="@color/col_c7c"
@ -82,12 +82,22 @@
</LinearLayout> </LinearLayout>
<include
android:id= "@+id/cl_body"
layout="@layout/layout_health_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/llHint"/>
<ImageView <ImageView
android:id="@+id/mBody" android:id="@+id/mBody"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20" android:layout_marginTop="@dimen/dp_20"
android:src="@mipmap/ic_male_body_health" android:src="@mipmap/ic_male_body_health"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/llHint" /> app:layout_constraintTop_toBottomOf="@+id/llHint" />
@ -97,6 +107,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/mBody" app:layout_constraintBottom_toBottomOf="@+id/mBody"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/mBody" app:layout_constraintRight_toLeftOf="@+id/mBody"
@ -162,6 +173,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/mBody" app:layout_constraintBottom_toBottomOf="@+id/mBody"
app:layout_constraintLeft_toRightOf="@+id/mBody" app:layout_constraintLeft_toRightOf="@+id/mBody"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
@ -237,7 +249,7 @@
android:layout_marginTop="@dimen/dp_20" android:layout_marginTop="@dimen/dp_20"
android:layout_marginEnd="@dimen/dp_16" android:layout_marginEnd="@dimen/dp_16"
android:background="@color/col_0f2" android:background="@color/col_0f2"
app:layout_constraintTop_toBottomOf="@+id/mOrganNameLeftLay" /> app:layout_constraintTop_toBottomOf="@+id/cl_body" />
<FrameLayout <FrameLayout
android:id="@+id/mOrganSelectNameLay" android:id="@+id/mOrganSelectNameLay"

@ -39,10 +39,13 @@
android:layout_marginLeft="@dimen/dp_14"/> android:layout_marginLeft="@dimen/dp_14"/>
<TextView <TextView
android:id="@+id/tv_relation" android:id="@+id/tv_relation"
android:layout_width="@dimen/dp_27" android:layout_width="wrap_content"
android:layout_height="@dimen/dp_15" android:layout_height="@dimen/dp_15"
android:textSize="@dimen/sp_9" android:textSize="@dimen/sp_9"
android:textColor="@color/col_6ea" android:textColor="@color/col_6ea"
android:paddingLeft="@dimen/dp_5"
android:paddingRight="@dimen/dp_5"
android:minWidth="@dimen/dp_27"
android:gravity="center" android:gravity="center"
android:background="@drawable/shape_r7_3fe_8f6" android:background="@drawable/shape_r7_3fe_8f6"
tools:text="本人" tools:text="本人"

@ -58,9 +58,10 @@ class MessageTypeListAct : BaseListAct<MessageVm>() {
override fun initView() { override fun initView() {
super.initView() super.initView()
var title = intent.getStringExtra("msgTitle")
binding.title.apply { binding.title.apply {
statusBar(mView) statusBar(mView)
mTvTitle.text = getString(R.string.sys_message) mTvTitle.text =title
mTvRight.visibility = View.VISIBLE mTvRight.visibility = View.VISIBLE
mTvRight.text = getString(R.string.message_manager) mTvRight.text = getString(R.string.message_manager)
mTvRight.setTextColor(ContextCompat.getColor(this@MessageTypeListAct,R.color.col_02c)) mTvRight.setTextColor(ContextCompat.getColor(this@MessageTypeListAct,R.color.col_02c))

Loading…
Cancel
Save