diff --git a/app/src/main/java/com/zj365/dc/fragment/MessageFragment.kt b/app/src/main/java/com/zj365/dc/fragment/MessageFragment.kt index b8c127b..a690cf8 100644 --- a/app/src/main/java/com/zj365/dc/fragment/MessageFragment.kt +++ b/app/src/main/java/com/zj365/dc/fragment/MessageFragment.kt @@ -7,6 +7,7 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager import androidx.recyclerview.widget.LinearLayoutManager import com.tencent.qcloud.tuicore.TUIConstants import com.xty.base.fragment.BaseFragList +import com.xty.common.R import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.RouteManager import com.xty.common.event.LoginOrRegisterEvent @@ -33,6 +34,7 @@ class MessageFragment : BaseFragList() { var bean = adapter.getItem(position) as SystemMsgBean bundle.clear() bundle.putInt("msgType",bean.type) + bundle.putString("msgTitle",bean.name) RouteManager.goAct(ARouterUrl.MESSAGE_TYPE,bundle) } } @@ -55,8 +57,47 @@ class MessageFragment : BaseFragList() { } initAdapter() setRecycleRefresh(binding.mRecycle,binding.mRefresh) + // initTest() } + + /*fun initTest(){ + var titles = ArrayList() + 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() + + 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() { mViewModel.getSystemMsg() } diff --git a/app/src/main/res/layout/frag_message.xml b/app/src/main/res/layout/frag_message.xml index 0274418..eafb345 100644 --- a/app/src/main/res/layout/frag_message.xml +++ b/app/src/main/res/layout/frag_message.xml @@ -14,7 +14,8 @@ + android:layout_height="match_parent" + > () + + //图标 + var mBodyImg= ArrayList() + + //数 + var mCount = 12 + + var mItemLayoutId: Int = R.layout.layout_health_body_child + + var mOnClicklistener: onItemClicked? = null + fun setMenuItemIconsAndTexts(images: ArrayList, texts: ArrayList) { + 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(R.id.img_body) + val tv = itemView.findViewById(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) + } +} \ No newline at end of file diff --git a/common/src/main/res/layout/layout_health_body.xml b/common/src/main/res/layout/layout_health_body.xml new file mode 100644 index 0000000..cc135e7 --- /dev/null +++ b/common/src/main/res/layout/layout_health_body.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/layout_health_body_child.xml b/common/src/main/res/layout/layout_health_body_child.xml new file mode 100644 index 0000000..44e7a8d --- /dev/null +++ b/common/src/main/res/layout/layout_health_body_child.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/common/src/main/res/mipmap-xhdpi/ic_bladder_1.png b/common/src/main/res/mipmap-xhdpi/ic_bladder_1.png index d873745..4fcacbc 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_bladder_1.png and b/common/src/main/res/mipmap-xhdpi/ic_bladder_1.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_bladder_2.png b/common/src/main/res/mipmap-xhdpi/ic_bladder_2.png index 52362b8..c19621d 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_bladder_2.png and b/common/src/main/res/mipmap-xhdpi/ic_bladder_2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_bladder_3.png b/common/src/main/res/mipmap-xhdpi/ic_bladder_3.png index d5367b9..7382b0a 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_bladder_3.png and b/common/src/main/res/mipmap-xhdpi/ic_bladder_3.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_bladder_4.png b/common/src/main/res/mipmap-xhdpi/ic_bladder_4.png index eee2a64..ae0e7fe 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_bladder_4.png and b/common/src/main/res/mipmap-xhdpi/ic_bladder_4.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_gallbladder_1.png b/common/src/main/res/mipmap-xhdpi/ic_gallbladder_1.png index 1fa3a20..9ab7425 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_gallbladder_1.png and b/common/src/main/res/mipmap-xhdpi/ic_gallbladder_1.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_gallbladder_2.png b/common/src/main/res/mipmap-xhdpi/ic_gallbladder_2.png index 963350a..6f3409f 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_gallbladder_2.png and b/common/src/main/res/mipmap-xhdpi/ic_gallbladder_2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_gallbladder_3.png b/common/src/main/res/mipmap-xhdpi/ic_gallbladder_3.png index 1eec9e5..4b4e64d 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_gallbladder_3.png and b/common/src/main/res/mipmap-xhdpi/ic_gallbladder_3.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_gallbladder_4.png b/common/src/main/res/mipmap-xhdpi/ic_gallbladder_4.png index ae68c56..e6e3052 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_gallbladder_4.png and b/common/src/main/res/mipmap-xhdpi/ic_gallbladder_4.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_heart_1.png b/common/src/main/res/mipmap-xhdpi/ic_heart_1.png index 5e4bc19..d05d3f6 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_heart_1.png and b/common/src/main/res/mipmap-xhdpi/ic_heart_1.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_heart_2.png b/common/src/main/res/mipmap-xhdpi/ic_heart_2.png index 07c06f3..30114d1 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_heart_2.png and b/common/src/main/res/mipmap-xhdpi/ic_heart_2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_heart_3.png b/common/src/main/res/mipmap-xhdpi/ic_heart_3.png index 99159e0..29f9ae0 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_heart_3.png and b/common/src/main/res/mipmap-xhdpi/ic_heart_3.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_heart_4.png b/common/src/main/res/mipmap-xhdpi/ic_heart_4.png index 43fdd79..7fc91d7 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_heart_4.png and b/common/src/main/res/mipmap-xhdpi/ic_heart_4.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_kidney_1.png b/common/src/main/res/mipmap-xhdpi/ic_kidney_1.png index 5541464..bc6dbe1 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_kidney_1.png and b/common/src/main/res/mipmap-xhdpi/ic_kidney_1.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_kidney_2.png b/common/src/main/res/mipmap-xhdpi/ic_kidney_2.png index 0662074..2aec197 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_kidney_2.png and b/common/src/main/res/mipmap-xhdpi/ic_kidney_2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_kidney_3.png b/common/src/main/res/mipmap-xhdpi/ic_kidney_3.png index 5055f5f..9715aff 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_kidney_3.png and b/common/src/main/res/mipmap-xhdpi/ic_kidney_3.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_kidney_4.png b/common/src/main/res/mipmap-xhdpi/ic_kidney_4.png index 99fd828..a407079 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_kidney_4.png and b/common/src/main/res/mipmap-xhdpi/ic_kidney_4.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_large_intestine_1.png b/common/src/main/res/mipmap-xhdpi/ic_large_intestine_1.png index 34decd7..7c6b176 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_large_intestine_1.png and b/common/src/main/res/mipmap-xhdpi/ic_large_intestine_1.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_large_intestine_2.png b/common/src/main/res/mipmap-xhdpi/ic_large_intestine_2.png index 8a3010b..681e4e4 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_large_intestine_2.png and b/common/src/main/res/mipmap-xhdpi/ic_large_intestine_2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_large_intestine_3.png b/common/src/main/res/mipmap-xhdpi/ic_large_intestine_3.png index cba2771..25d4a52 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_large_intestine_3.png and b/common/src/main/res/mipmap-xhdpi/ic_large_intestine_3.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_large_intestine_4.png b/common/src/main/res/mipmap-xhdpi/ic_large_intestine_4.png index b3feae9..ed7e669 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_large_intestine_4.png and b/common/src/main/res/mipmap-xhdpi/ic_large_intestine_4.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_liver_1.png b/common/src/main/res/mipmap-xhdpi/ic_liver_1.png index 15460e3..8cc9ff8 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_liver_1.png and b/common/src/main/res/mipmap-xhdpi/ic_liver_1.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_liver_2.png b/common/src/main/res/mipmap-xhdpi/ic_liver_2.png index 43d9aa7..fa2ea6a 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_liver_2.png and b/common/src/main/res/mipmap-xhdpi/ic_liver_2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_liver_3.png b/common/src/main/res/mipmap-xhdpi/ic_liver_3.png index c021435..9213176 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_liver_3.png and b/common/src/main/res/mipmap-xhdpi/ic_liver_3.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_liver_4.png b/common/src/main/res/mipmap-xhdpi/ic_liver_4.png index c4e026a..7945d63 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_liver_4.png and b/common/src/main/res/mipmap-xhdpi/ic_liver_4.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_lung_1.png b/common/src/main/res/mipmap-xhdpi/ic_lung_1.png index c96663f..6b4ca3b 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_lung_1.png and b/common/src/main/res/mipmap-xhdpi/ic_lung_1.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_lung_2.png b/common/src/main/res/mipmap-xhdpi/ic_lung_2.png index ec482d0..85fb12b 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_lung_2.png and b/common/src/main/res/mipmap-xhdpi/ic_lung_2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_lung_3.png b/common/src/main/res/mipmap-xhdpi/ic_lung_3.png index 310ff50..d41655f 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_lung_3.png and b/common/src/main/res/mipmap-xhdpi/ic_lung_3.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_lung_4.png b/common/src/main/res/mipmap-xhdpi/ic_lung_4.png index d969916..f0affb0 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_lung_4.png and b/common/src/main/res/mipmap-xhdpi/ic_lung_4.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_lymph_1.png b/common/src/main/res/mipmap-xhdpi/ic_lymph_1.png index 5977dc9..643cf02 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_lymph_1.png and b/common/src/main/res/mipmap-xhdpi/ic_lymph_1.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_lymph_2.png b/common/src/main/res/mipmap-xhdpi/ic_lymph_2.png index c1ac12d..a47acd1 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_lymph_2.png and b/common/src/main/res/mipmap-xhdpi/ic_lymph_2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_lymph_3.png b/common/src/main/res/mipmap-xhdpi/ic_lymph_3.png index 9eae74c..94ac8ff 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_lymph_3.png and b/common/src/main/res/mipmap-xhdpi/ic_lymph_3.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_lymph_4.png b/common/src/main/res/mipmap-xhdpi/ic_lymph_4.png index da27b09..e8dd19c 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_lymph_4.png and b/common/src/main/res/mipmap-xhdpi/ic_lymph_4.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_pericardium_1.png b/common/src/main/res/mipmap-xhdpi/ic_pericardium_1.png index a52fec7..22fb972 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_pericardium_1.png and b/common/src/main/res/mipmap-xhdpi/ic_pericardium_1.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_pericardium_2.png b/common/src/main/res/mipmap-xhdpi/ic_pericardium_2.png index d603d39..2e1e277 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_pericardium_2.png and b/common/src/main/res/mipmap-xhdpi/ic_pericardium_2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_pericardium_3.png b/common/src/main/res/mipmap-xhdpi/ic_pericardium_3.png index 1b79ed0..bfcece8 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_pericardium_3.png and b/common/src/main/res/mipmap-xhdpi/ic_pericardium_3.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_pericardium_4.png b/common/src/main/res/mipmap-xhdpi/ic_pericardium_4.png index cb37fe2..f9ea834 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_pericardium_4.png and b/common/src/main/res/mipmap-xhdpi/ic_pericardium_4.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_small_intestine_1.png b/common/src/main/res/mipmap-xhdpi/ic_small_intestine_1.png index 79becac..c2e3687 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_small_intestine_1.png and b/common/src/main/res/mipmap-xhdpi/ic_small_intestine_1.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_small_intestine_2.png b/common/src/main/res/mipmap-xhdpi/ic_small_intestine_2.png index 75af086..ef74433 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_small_intestine_2.png and b/common/src/main/res/mipmap-xhdpi/ic_small_intestine_2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_small_intestine_3.png b/common/src/main/res/mipmap-xhdpi/ic_small_intestine_3.png index c33d980..20b6b2f 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_small_intestine_3.png and b/common/src/main/res/mipmap-xhdpi/ic_small_intestine_3.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_small_intestine_4.png b/common/src/main/res/mipmap-xhdpi/ic_small_intestine_4.png index 608ebe4..b2cc204 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_small_intestine_4.png and b/common/src/main/res/mipmap-xhdpi/ic_small_intestine_4.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_spleen_1.png b/common/src/main/res/mipmap-xhdpi/ic_spleen_1.png index bd61687..ca46af3 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_spleen_1.png and b/common/src/main/res/mipmap-xhdpi/ic_spleen_1.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_spleen_2.png b/common/src/main/res/mipmap-xhdpi/ic_spleen_2.png index 861e3ab..c3c3d9f 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_spleen_2.png and b/common/src/main/res/mipmap-xhdpi/ic_spleen_2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_spleen_3.png b/common/src/main/res/mipmap-xhdpi/ic_spleen_3.png index ae5897b..a4cf96e 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_spleen_3.png and b/common/src/main/res/mipmap-xhdpi/ic_spleen_3.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_spleen_4.png b/common/src/main/res/mipmap-xhdpi/ic_spleen_4.png index 7f7ff93..23019eb 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_spleen_4.png and b/common/src/main/res/mipmap-xhdpi/ic_spleen_4.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_stomach_1.png b/common/src/main/res/mipmap-xhdpi/ic_stomach_1.png index a13007a..f079aa8 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_stomach_1.png and b/common/src/main/res/mipmap-xhdpi/ic_stomach_1.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_stomach_2.png b/common/src/main/res/mipmap-xhdpi/ic_stomach_2.png index 6a1ef3d..4f18ae4 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_stomach_2.png and b/common/src/main/res/mipmap-xhdpi/ic_stomach_2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_stomach_3.png b/common/src/main/res/mipmap-xhdpi/ic_stomach_3.png index d384879..dc45310 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_stomach_3.png and b/common/src/main/res/mipmap-xhdpi/ic_stomach_3.png differ diff --git a/common/src/main/res/mipmap-xhdpi/ic_stomach_4.png b/common/src/main/res/mipmap-xhdpi/ic_stomach_4.png index 22850d7..ba3fe0d 100644 Binary files a/common/src/main/res/mipmap-xhdpi/ic_stomach_4.png and b/common/src/main/res/mipmap-xhdpi/ic_stomach_4.png differ diff --git a/common/src/main/res/mipmap-xhdpi/icon_health_man_1.png b/common/src/main/res/mipmap-xhdpi/icon_health_man_1.png new file mode 100644 index 0000000..9424dc1 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/icon_health_man_1.png differ diff --git a/common/src/main/res/mipmap-xhdpi/icon_health_man_2.png b/common/src/main/res/mipmap-xhdpi/icon_health_man_2.png new file mode 100644 index 0000000..d463f68 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/icon_health_man_2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/icon_health_man_3.png b/common/src/main/res/mipmap-xhdpi/icon_health_man_3.png new file mode 100644 index 0000000..33ef424 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/icon_health_man_3.png differ diff --git a/common/src/main/res/mipmap-xhdpi/icon_health_man_4.png b/common/src/main/res/mipmap-xhdpi/icon_health_man_4.png new file mode 100644 index 0000000..15f46ba Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/icon_health_man_4.png differ diff --git a/common/src/main/res/mipmap-xhdpi/icon_health_women_1.png b/common/src/main/res/mipmap-xhdpi/icon_health_women_1.png new file mode 100644 index 0000000..fdd4248 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/icon_health_women_1.png differ diff --git a/common/src/main/res/mipmap-xhdpi/icon_health_women_2.png b/common/src/main/res/mipmap-xhdpi/icon_health_women_2.png new file mode 100644 index 0000000..ab44414 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/icon_health_women_2.png differ diff --git a/common/src/main/res/mipmap-xhdpi/icon_health_women_3.png b/common/src/main/res/mipmap-xhdpi/icon_health_women_3.png new file mode 100644 index 0000000..b8cbe0e Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/icon_health_women_3.png differ diff --git a/common/src/main/res/mipmap-xhdpi/icon_health_women_4.png b/common/src/main/res/mipmap-xhdpi/icon_health_women_4.png new file mode 100644 index 0000000..937f2e3 Binary files /dev/null and b/common/src/main/res/mipmap-xhdpi/icon_health_women_4.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/bg_health_body.png b/common/src/main/res/mipmap-xxhdpi/bg_health_body.png new file mode 100644 index 0000000..2ec4004 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/bg_health_body.png differ diff --git a/common/src/main/res/values/colors.xml b/common/src/main/res/values/colors.xml index 6225346..bdc7623 100644 --- a/common/src/main/res/values/colors.xml +++ b/common/src/main/res/values/colors.xml @@ -202,4 +202,6 @@ #F2F6F7 #3AD9BC #E3FCF6 + #F15C42 + #FFD04F \ No newline at end of file diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 130d80f..a61daa0 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -339,18 +339,18 @@ 建模中 暂无数据 - 心脏 - - - - 肝脏 - 脾脏 - 大肠 - 小肠 - 淋巴 - 胆囊 - 膀胱 - 心包 + 心经 + 胃经 + 肺经 + 肾经 + 肝经 + 脾经 + 大肠经 + 小肠经 + 三焦经 + 胆经 + 膀胱经 + 心包经 打卡列表 用户信息 diff --git a/health/src/main/java/com/zj365/health/act/HealthSkyHourReportAct.kt b/health/src/main/java/com/zj365/health/act/HealthSkyHourReportAct.kt index 76217bc..883486f 100644 --- a/health/src/main/java/com/zj365/health/act/HealthSkyHourReportAct.kt +++ b/health/src/main/java/com/zj365/health/act/HealthSkyHourReportAct.kt @@ -1510,33 +1510,66 @@ class HealthSkyHourReportAct : BaseVmAct() { } val bodyImgResId = if (statusInt == 2) { if (mViewModel.infoLive.value!!.data.user.sex == "1") { - R.mipmap.ic_male_body_warning + R.mipmap.icon_health_man_2 } else { - R.mipmap.ic_female_body_warning + R.mipmap.icon_health_women_2 } } else if (statusInt == 3) { if (mViewModel.infoLive.value!!.data.user.sex == "1") { - R.mipmap.ic_male_body_disease + R.mipmap.icon_health_man_3 } else { - R.mipmap.ic_female_body_disease + R.mipmap.icon_health_women_3 } } else if (statusInt == 1) { if (mViewModel.infoLive.value!!.data.user.sex == "1") { - R.mipmap.ic_male_body_health + R.mipmap.icon_health_man_1 } else { - R.mipmap.ic_female_body_health + R.mipmap.icon_health_women_1 } } else { if (mViewModel.infoLive.value!!.data.user.sex == "1") { - R.mipmap.ic_male_body_none_data + R.mipmap.icon_health_man_4 } 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 + var organName = ArrayList() + var organImg = ArrayList() + 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.mStomach.setInfo(getHealthStatus(organ.stomach.model), UserInfoDefin.stomachIcon) binding.mLung.setInfo(getHealthStatus(organ.lungs.model), UserInfoDefin.lungIcon) diff --git a/health/src/main/java/com/zj365/health/act/HealthWeekMonthHourReportAct.kt b/health/src/main/java/com/zj365/health/act/HealthWeekMonthHourReportAct.kt index c5b3fa7..3a0006b 100644 --- a/health/src/main/java/com/zj365/health/act/HealthWeekMonthHourReportAct.kt +++ b/health/src/main/java/com/zj365/health/act/HealthWeekMonthHourReportAct.kt @@ -17,6 +17,7 @@ import android.util.Log import android.view.Gravity import android.view.LayoutInflater import android.view.View +import android.view.View.OnClickListener import android.view.ViewGroup import android.widget.LinearLayout import android.widget.TextView @@ -45,6 +46,7 @@ import com.xty.base.utils.UserInfoDefin import com.xty.common.AESCrypt import com.xty.common.BuildConfig import com.xty.common.Const +import com.xty.common.LogUtils import com.xty.common.MMkvHelper import com.xty.common.TimeSelect 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.CommonUtils import com.xty.common.weight.CenterImageSpan +import com.xty.common.weight.HealthBodyView import com.zj365.health.R import com.zj365.health.act.exception.BaseExceptionDataAct import com.zj365.health.adapter.DayReportInfoAdapter @@ -2101,34 +2104,186 @@ class HealthWeekMonthHourReportAct : BaseVmAct() { } val bodyImgResId = if (statusInt == 2) { if (mViewModel.infoLive.value!!.data.user.sex == "1") { - R.mipmap.ic_male_body_warning + R.mipmap.icon_health_man_2 } else { - R.mipmap.ic_female_body_warning + R.mipmap.icon_health_women_2 } } else if (statusInt == 3) { if (mViewModel.infoLive.value!!.data.user.sex == "1") { - R.mipmap.ic_male_body_disease + R.mipmap.icon_health_man_3 } else { - R.mipmap.ic_female_body_disease + R.mipmap.icon_health_women_3 } } else if (statusInt == 1) { if (mViewModel.infoLive.value!!.data.user.sex == "1") { - R.mipmap.ic_male_body_health + R.mipmap.icon_health_man_1 } else { - R.mipmap.ic_female_body_health + R.mipmap.icon_health_women_1 } } else { if (mViewModel.infoLive.value!!.data.user.sex == "1") { - R.mipmap.ic_male_body_none_data + R.mipmap.icon_health_man_4 } 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 + + var organName = ArrayList() + var organImg = ArrayList() + 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( + organ.cholecyst.model, + binding.child.mGallbladder.viscera, + UserInfoDefin.gallIcon, + organ.cholecystListData + ) + /*refreshOrganHealthView( organ.heart.model, binding.child.mHeart.viscera, UserInfoDefin.heartIcon, @@ -2279,7 +2434,7 @@ class HealthWeekMonthHourReportAct : BaseVmAct() { UserInfoDefin.pericardiumIcon, organ.pericardiumListData ) - } + }*/ } private fun refreshOrganHealthView( diff --git a/health/src/main/res/drawable/shape_dot_04f.xml b/health/src/main/res/drawable/shape_dot_04f.xml new file mode 100644 index 0000000..53c810e --- /dev/null +++ b/health/src/main/res/drawable/shape_dot_04f.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/health/src/main/res/drawable/shape_dot_disease.xml b/health/src/main/res/drawable/shape_dot_disease.xml index 779e4e0..29117d6 100644 --- a/health/src/main/res/drawable/shape_dot_disease.xml +++ b/health/src/main/res/drawable/shape_dot_disease.xml @@ -2,7 +2,7 @@ - + diff --git a/health/src/main/res/layout/act_health_sky_hour_report.xml b/health/src/main/res/layout/act_health_sky_hour_report.xml index 89e29b6..efb9e79 100644 --- a/health/src/main/res/layout/act_health_sky_hour_report.xml +++ b/health/src/main/res/layout/act_health_sky_hour_report.xml @@ -353,7 +353,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/dp_16" - android:drawableStart="@drawable/shape_dot_96d" + android:drawableStart="@drawable/shape_dot_04f" android:drawablePadding="@dimen/dp_5" android:text="亚健康" android:textColor="@color/col_c7c" @@ -384,11 +384,21 @@ + + + + @@ -97,6 +107,7 @@ android:layout_width="0dp" android:layout_height="0dp" android:orientation="vertical" + android:visibility="gone" app:layout_constraintBottom_toBottomOf="@+id/mBody" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toLeftOf="@+id/mBody" @@ -162,6 +173,7 @@ android:layout_width="0dp" android:layout_height="0dp" android:orientation="vertical" + android:visibility="gone" app:layout_constraintBottom_toBottomOf="@+id/mBody" app:layout_constraintLeft_toRightOf="@+id/mBody" app:layout_constraintRight_toRightOf="parent" @@ -237,7 +249,7 @@ android:layout_marginTop="@dimen/dp_20" android:layout_marginEnd="@dimen/dp_16" android:background="@color/col_0f2" - app:layout_constraintTop_toBottomOf="@+id/mOrganNameLeftLay" /> + app:layout_constraintTop_toBottomOf="@+id/cl_body" /> () { override fun initView() { super.initView() + var title = intent.getStringExtra("msgTitle") binding.title.apply { statusBar(mView) - mTvTitle.text = getString(R.string.sys_message) + mTvTitle.text =title mTvRight.visibility = View.VISIBLE mTvRight.text = getString(R.string.message_manager) mTvRight.setTextColor(ContextCompat.getColor(this@MessageTypeListAct,R.color.col_02c))