feat(home): 新增首页手表监测数据展示模块
- 新增 HomeWatchView 自定义 View,在首页展示手表监测数据概览 - 新增 WatchItemFragment 用于展示步数、心率、血氧、睡眠、压力等指标 - 新增两个 API 接口:查询用户手表绑定状态、获取当日全量手表数据 - HomeFragment 集成手表 View,登录后自动拉取手表信息及当日数据 - 新增 WatchDataChangeEvent 用于手表数据变更通知 - 新增相关布局、Tab 图标及 Drawable 资源文件 - 清理废弃颜色文件(color_child_tab_*.xml)及冗余布局 注:当前 UrlConfig 环境为 DEBUG,正式发布前请切换回 PRODUCT Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
960791ff4d
commit
53f33b35e0
@@ -0,0 +1,25 @@
|
|||||||
|
package com.xjjk.healthyclients.bean.home
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页-手表数据
|
||||||
|
*/
|
||||||
|
class HomeWatchAllDataBean {
|
||||||
|
var name: String? = null
|
||||||
|
var latest: String? = null
|
||||||
|
var max: String? = null
|
||||||
|
var min: String? = null
|
||||||
|
var avg: String? = null
|
||||||
|
var type: Int? = null
|
||||||
|
|
||||||
|
var latestTime: String? = null
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
data class WatchInfoBean(
|
||||||
|
val bindDate: String,
|
||||||
|
val hasWatch: Boolean,
|
||||||
|
val lastUploadDate: String,
|
||||||
|
val watchModel: String,
|
||||||
|
val watchNo: String
|
||||||
|
)
|
||||||
@@ -2,6 +2,8 @@ package com.xjjk.healthyclients.data.api
|
|||||||
|
|
||||||
import com.xjjk.healthyclients.bean.home.HomeBannerBean
|
import com.xjjk.healthyclients.bean.home.HomeBannerBean
|
||||||
import com.xjjk.healthyclients.bean.home.HomeNoticeBean
|
import com.xjjk.healthyclients.bean.home.HomeNoticeBean
|
||||||
|
import com.xjjk.healthyclients.bean.home.HomeWatchAllDataBean
|
||||||
|
import com.xjjk.healthyclients.bean.home.WatchInfoBean
|
||||||
import com.xjjk.healthyclients.bean.user.CheckInBean
|
import com.xjjk.healthyclients.bean.user.CheckInBean
|
||||||
import com.xjjk.healthyclients.bean.user.PointDetailBean
|
import com.xjjk.healthyclients.bean.user.PointDetailBean
|
||||||
import com.xjjk.healthyclients.bean.user.PointRank
|
import com.xjjk.healthyclients.bean.user.PointRank
|
||||||
@@ -71,4 +73,17 @@ interface HomeApi {
|
|||||||
@GET("/health-consultation/consultation/conSession/getPicUrl")
|
@GET("/health-consultation/consultation/conSession/getPicUrl")
|
||||||
suspend fun getConSessionPicUrl(@QueryMap params: MutableMap<String, Any?>): ApiResponse<String>
|
suspend fun getConSessionPicUrl(@QueryMap params: MutableMap<String, Any?>): ApiResponse<String>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页-用户手表数据
|
||||||
|
*/
|
||||||
|
@GET("/health-watch/api/watchData/userWatchDataAll")
|
||||||
|
suspend fun getHomeWatchData(@QueryMap params: MutableMap<String, Any?>): ApiResponse<MutableList<HomeWatchAllDataBean>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页-用户是否有手表
|
||||||
|
*/
|
||||||
|
@GET("/health-watch/api/watchData/findWatchInfo")
|
||||||
|
suspend fun getHomeWatchInfo(@QueryMap params: MutableMap<String, Any?>): ApiResponse<WatchInfoBean>
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,8 @@ package com.xjjk.healthyclients.data.repository
|
|||||||
import com.xjjk.healthyclients.base.repository.BaseRepository
|
import com.xjjk.healthyclients.base.repository.BaseRepository
|
||||||
import com.xjjk.healthyclients.bean.home.HomeBannerBean
|
import com.xjjk.healthyclients.bean.home.HomeBannerBean
|
||||||
import com.xjjk.healthyclients.bean.home.HomeNoticeBean
|
import com.xjjk.healthyclients.bean.home.HomeNoticeBean
|
||||||
|
import com.xjjk.healthyclients.bean.home.HomeWatchAllDataBean
|
||||||
|
import com.xjjk.healthyclients.bean.home.WatchInfoBean
|
||||||
import com.xjjk.healthyclients.bean.user.CheckInBean
|
import com.xjjk.healthyclients.bean.user.CheckInBean
|
||||||
import com.xjjk.healthyclients.bean.user.PointDetailBean
|
import com.xjjk.healthyclients.bean.user.PointDetailBean
|
||||||
import com.xjjk.healthyclients.bean.user.PointRank
|
import com.xjjk.healthyclients.bean.user.PointRank
|
||||||
@@ -80,4 +82,22 @@ object HomeRepository : BaseRepository() {
|
|||||||
val map = mutableMapOf<String, Any?>()
|
val map = mutableMapOf<String, Any?>()
|
||||||
return apiCall { service.getConSessionPicUrl(map) }
|
return apiCall { service.getConSessionPicUrl(map) }
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 首页-用户手表数据
|
||||||
|
*/
|
||||||
|
suspend fun getHomeWatchData(date:String): ApiResponse<MutableList<HomeWatchAllDataBean>> {
|
||||||
|
return apiCall {
|
||||||
|
val map = mutableMapOf<String, Any?>()
|
||||||
|
map["date"] = date
|
||||||
|
service.getHomeWatchData(map)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
suspend fun getHomeWatchInfo(userId: String?): ApiResponse<WatchInfoBean> {
|
||||||
|
return apiCall {
|
||||||
|
val map = mutableMapOf<String, Any?>()
|
||||||
|
map["userId"] = userId
|
||||||
|
service.getHomeWatchInfo(map)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.xjjk.healthyclients.event
|
||||||
|
|
||||||
|
import com.xjjk.healthyclients.bean.home.HomeWatchAllDataBean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手表数据变更事件
|
||||||
|
* 用于 HomeWatchView → WatchItemFragment 的数据通知
|
||||||
|
* @param dataList 接口返回的手表各项健康数据列表(按索引对应各 Tab)
|
||||||
|
*/
|
||||||
|
class WatchDataChangeEvent {
|
||||||
|
var dataList: MutableList<HomeWatchAllDataBean>? = null
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
import com.sw.healthyclients.data.local.DataStoreManager
|
import com.sw.healthyclients.data.local.DataStoreManager
|
||||||
|
import com.sw.healthyclients.utils.DateUtil
|
||||||
import com.tencent.qcloud.tuikit.tuichat.bean.WorkBean
|
import com.tencent.qcloud.tuikit.tuichat.bean.WorkBean
|
||||||
import com.xjjk.healthyclients.R
|
import com.xjjk.healthyclients.R
|
||||||
import com.xjjk.healthyclients.adapter.common.MultiItemTypeAdapter
|
import com.xjjk.healthyclients.adapter.common.MultiItemTypeAdapter
|
||||||
@@ -23,6 +24,7 @@ import com.xjjk.healthyclients.superfuntion.startGroupChat
|
|||||||
import com.xjjk.healthyclients.superfuntion.startLoginActivity
|
import com.xjjk.healthyclients.superfuntion.startLoginActivity
|
||||||
import com.xjjk.healthyclients.superfuntion.startMyGuidanceActivity
|
import com.xjjk.healthyclients.superfuntion.startMyGuidanceActivity
|
||||||
import com.xjjk.healthyclients.ui.activity.EmptyActivity
|
import com.xjjk.healthyclients.ui.activity.EmptyActivity
|
||||||
|
import com.xjjk.healthyclients.ui.activity.LoginActivity
|
||||||
import com.xjjk.healthyclients.ui.activity.guidance.adapter.GuidanceFragmentDoctorAdapter
|
import com.xjjk.healthyclients.ui.activity.guidance.adapter.GuidanceFragmentDoctorAdapter
|
||||||
import com.xjjk.healthyclients.ui.activity.home.HomeBannerDetailActivity
|
import com.xjjk.healthyclients.ui.activity.home.HomeBannerDetailActivity
|
||||||
import com.xjjk.healthyclients.ui.activity.home.HomeNoticeListActivity
|
import com.xjjk.healthyclients.ui.activity.home.HomeNoticeListActivity
|
||||||
@@ -111,7 +113,7 @@ class HomeFragment :
|
|||||||
|
|
||||||
})
|
})
|
||||||
mBinding.layoutItem3.fragmentGuidanceRvDoctor.adapter = mGuidanceFragmentDoctorAdapter
|
mBinding.layoutItem3.fragmentGuidanceRvDoctor.adapter = mGuidanceFragmentDoctorAdapter
|
||||||
|
mBinding.watchView.init(this@HomeFragment)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun bindEvent() {
|
override fun bindEvent() {
|
||||||
@@ -128,6 +130,13 @@ class HomeFragment :
|
|||||||
layoutItem1.homeHeadTab4, layoutItem3.tvDoctorMore
|
layoutItem1.homeHeadTab4, layoutItem3.tvDoctorMore
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
mBinding.watchView.mBinding.layoutWatchMore.setOnClickListener{
|
||||||
|
if (DataStoreManager.isLogin()) {
|
||||||
|
EventBus.getDefault().post(HomeTabChangeEvent().apply { index = 3 })
|
||||||
|
} else {
|
||||||
|
toActivity(LoginActivity::class.java)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onClick(v: View?) {
|
override fun onClick(v: View?) {
|
||||||
@@ -297,23 +306,41 @@ class HomeFragment :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
lifecycleScope.launch{
|
||||||
|
repeatOnLifecycle(Lifecycle.State.CREATED){
|
||||||
|
mViewModel.watchInfo.collectLatest { bean ->
|
||||||
|
mBinding.watchView.setWatchInfo(bean)
|
||||||
|
if (bean?.hasWatch==true) {//有手表的情况下去获取手表数据
|
||||||
|
mViewModel.getHomeWatchData(DateUtil.nowStringDateShort)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lifecycleScope.launch{
|
||||||
|
repeatOnLifecycle(Lifecycle.State.CREATED){
|
||||||
|
mViewModel.watchAllData.collectLatest { bean ->
|
||||||
|
mBinding.watchView.setWatchAllData(bean)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun initData() {
|
override fun initData() {
|
||||||
mViewModel.getHomeBannerList()
|
mViewModel.getHomeBannerList()
|
||||||
if (ConstantUtils.mCheckToken) {
|
|
||||||
mViewModel.selectDoctorRecommendHome()
|
mViewModel.selectDoctorRecommendHome()
|
||||||
}
|
|
||||||
if (DataStoreManager.isLogin()) {
|
if (DataStoreManager.isLogin()) {
|
||||||
homeNoticeStartRepeat()
|
homeNoticeStartRepeat()
|
||||||
|
mViewModel.getHomeWatchInfo(DataStoreManager.getUserId())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun homeNoticeStartRepeat() {
|
private fun homeNoticeStartRepeat() {
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
repeat(100) {
|
repeat(500) {
|
||||||
mViewModel.getHomeNoticeListRepeat()
|
mViewModel.getHomeNoticeListRepeat()
|
||||||
delay(noticeTime)
|
delay(noticeTime)
|
||||||
}
|
}
|
||||||
@@ -329,6 +356,7 @@ class HomeFragment :
|
|||||||
}
|
}
|
||||||
if (DataStoreManager.isLogin()) {
|
if (DataStoreManager.isLogin()) {
|
||||||
mViewModel.getHomeNoticeListRepeat()
|
mViewModel.getHomeNoticeListRepeat()
|
||||||
|
mViewModel.getHomeWatchInfo(DataStoreManager.getUserId())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,144 @@
|
|||||||
|
package com.xjjk.healthyclients.fragment
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.text.TextUtils
|
||||||
|
import android.view.View
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import com.sw.healthyclients.utils.DateUtil
|
||||||
|
import com.xjjk.healthyclients.R
|
||||||
|
import com.xjjk.healthyclients.base.BaseVMBFragment
|
||||||
|
import com.xjjk.healthyclients.bean.home.HomeWatchAllDataBean
|
||||||
|
import com.xjjk.healthyclients.databinding.FragmentItemWatchBinding
|
||||||
|
import com.xjjk.healthyclients.event.WatchDataChangeEvent
|
||||||
|
import com.xjjk.healthyclients.superfuntion.orEmptyDefault
|
||||||
|
import com.xjjk.healthyclients.ui.viewmodel.HomeViewModel
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手表item
|
||||||
|
* 数据类型:0=心率 1=血氧 2=压力 3=体温 4=睡眠
|
||||||
|
*/
|
||||||
|
class WatchItemFragment :
|
||||||
|
BaseVMBFragment<HomeViewModel, FragmentItemWatchBinding>(R.layout.fragment_item_watch) {
|
||||||
|
var position: Int? = -1
|
||||||
|
|
||||||
|
fun newInstance(position: Int): Fragment {
|
||||||
|
val args = Bundle()
|
||||||
|
args.putInt("position", position)
|
||||||
|
val fragment = WatchItemFragment()
|
||||||
|
fragment.arguments = args
|
||||||
|
return fragment
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun initView(root: View?, savedInstanceState: Bundle?) {
|
||||||
|
position = arguments?.getInt("position")
|
||||||
|
mBinding.watchTypeImg.setImageResource(getWatchTypeImg(position))
|
||||||
|
|
||||||
|
if (position != 4) {
|
||||||
|
mBinding.watchType.text = "" + mBinding.watchType.getText() + getWatchTypeText(position)
|
||||||
|
mBinding.watchLeftText.text = getWatchTypeText(position) +"范围"
|
||||||
|
mBinding.watchRightText.text = "平均"+getWatchTypeText(position)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
mBinding.watchType.text = "睡眠总时长"
|
||||||
|
mBinding.watchLeftText.text = "深睡时长"
|
||||||
|
mBinding.watchRightText.text = "浅睡时长"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
mBinding.watchValueUnit.text = getWatchUnitText(position)
|
||||||
|
mBinding.watchLeftUnit.text = getWatchUnitText(position)
|
||||||
|
mBinding.watchRightUnit.text = getWatchUnitText(position)
|
||||||
|
|
||||||
|
refreshWatchData(null)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun bindEvent() {
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onClick(v: View?) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收手表数据变更事件,按当前 Tab position 取出对应数据并刷新界面
|
||||||
|
*/
|
||||||
|
override fun onMessageEvent(event: Any?) {
|
||||||
|
super.onMessageEvent(event)
|
||||||
|
if (event is WatchDataChangeEvent) {
|
||||||
|
event.dataList?.sortBy { it.type }
|
||||||
|
val bean = event.dataList?.getOrNull(position ?: -1)
|
||||||
|
refreshWatchData(bean)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将接口数据填充到各 UI 控件
|
||||||
|
* @param bean 当前 Tab 对应的一条手表健康数据
|
||||||
|
*/
|
||||||
|
private fun refreshWatchData(bean: HomeWatchAllDataBean?) {
|
||||||
|
// 采集时间
|
||||||
|
mBinding.watchTime.text = bean?.latestTime.orEmptyDefault()
|
||||||
|
|
||||||
|
if (position != 4) {
|
||||||
|
// 最新值 + 单位
|
||||||
|
mBinding.watchValue.text = bean?.latest.orEmptyDefault()
|
||||||
|
// 范围:min ~ max
|
||||||
|
if (TextUtils.isEmpty(bean?.min)) {
|
||||||
|
mBinding.watchLeftValue.text = "--"
|
||||||
|
} else {
|
||||||
|
mBinding.watchLeftValue.text = "${bean?.min.orEmptyDefault()}-${bean?.max.orEmptyDefault()}"
|
||||||
|
}
|
||||||
|
// 平均值
|
||||||
|
mBinding.watchRightValue.text = bean?.avg.orEmptyDefault()
|
||||||
|
} else {
|
||||||
|
//睡眠数据单独处理
|
||||||
|
if (bean == null) {
|
||||||
|
mBinding.watchValue.text = "--"
|
||||||
|
mBinding.watchLeftValue.text = "--"
|
||||||
|
mBinding.watchRightValue.text = "--"
|
||||||
|
|
||||||
|
} else {
|
||||||
|
mBinding.watchValue.text =
|
||||||
|
DateUtil.timeDiff(bean.latest!!.toLong() * 1000 * 60).orEmptyDefault()
|
||||||
|
mBinding.watchLeftValue.text =
|
||||||
|
DateUtil.timeDiff(bean.max!!.toLong() * 1000 * 60).orEmptyDefault()
|
||||||
|
mBinding.watchRightValue.text =
|
||||||
|
DateUtil.timeDiff(bean.min!!.toLong() * 1000 * 60).orEmptyDefault()
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getWatchTypeImg(type: Int?): Int {
|
||||||
|
return when (type) {
|
||||||
|
0 -> R.mipmap.ic_home_watch_tab1
|
||||||
|
1 -> R.mipmap.ic_home_watch_tab2
|
||||||
|
2 -> R.mipmap.ic_home_watch_tab3
|
||||||
|
3 -> R.mipmap.ic_home_watch_tab4
|
||||||
|
4 -> R.mipmap.ic_home_watch_tab5
|
||||||
|
else -> R.mipmap.ic_home_watch_tab1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getWatchTypeText(type: Int?): String {
|
||||||
|
return when (type) {
|
||||||
|
0 -> "心率"
|
||||||
|
1 -> "血氧"
|
||||||
|
2 -> "压力"
|
||||||
|
3 -> "体温"
|
||||||
|
else -> ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getWatchUnitText(type: Int?): String {
|
||||||
|
return when (type) {
|
||||||
|
0 -> "次/分钟"
|
||||||
|
1 -> "%"
|
||||||
|
2 -> ""
|
||||||
|
3 -> "℃"
|
||||||
|
|
||||||
|
else -> ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -11,6 +11,7 @@ import android.view.View
|
|||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.Window
|
import android.view.Window
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
|
import android.widget.RelativeLayout
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
@@ -523,7 +524,7 @@ fun ViewPager2.init(
|
|||||||
*/
|
*/
|
||||||
fun TabLayout.onCreateTab(
|
fun TabLayout.onCreateTab(
|
||||||
tabList: Array<String>,
|
tabList: Array<String>,
|
||||||
tabStyle: Int = 2,
|
tabStyle: Int = 1,
|
||||||
listener: (TabLayout.Tab?) -> Unit
|
listener: (TabLayout.Tab?) -> Unit
|
||||||
) {
|
) {
|
||||||
for (tabTitle in tabList) {
|
for (tabTitle in tabList) {
|
||||||
@@ -547,11 +548,12 @@ fun TabLayout.onCreateTab(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun onConfigureTab(context: Context, tab: TabLayout.Tab, tabTitle: String, tabStyle: Int) {
|
private fun onConfigureTab(context: Context,tab: TabLayout.Tab, tabTitle: String,tabStyle: Int) {
|
||||||
val textView = LayoutInflater.from(context)
|
val tabView = LayoutInflater.from(context)
|
||||||
.inflate(getTabStyle(tabStyle), null) as TextView
|
.inflate(getTabStyle(tabStyle), null) as RelativeLayout
|
||||||
textView.text = tabTitle
|
val tabText = tabView.findViewById<TextView>(R.id.tv_text)
|
||||||
tab.customView = textView
|
tabText.text = tabTitle
|
||||||
|
tab.customView = tabView
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -583,13 +585,11 @@ fun TabLayout.attachViewPager(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* tab 样式
|
* tab 样式
|
||||||
* 1:通用样式 2:癌症结论tab样式
|
* 1:通用样式 绿色/灰色
|
||||||
*/
|
*/
|
||||||
fun getTabStyle(i: Int): Int {
|
fun getTabStyle(i: Int): Int {
|
||||||
return when (i) {
|
return when (i) {
|
||||||
1 -> R.layout.item_tablayout_group_title
|
1 -> R.layout.item_tablayout_group_title
|
||||||
2 -> R.layout.item_tablayout_group_title2
|
|
||||||
102 -> R.layout.item_home_tab_group//首页
|
|
||||||
else -> R.layout.item_tablayout_group_title
|
else -> R.layout.item_tablayout_group_title
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.xjjk.healthyclients.ui.activity
|
|||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.text.TextUtils
|
import android.text.TextUtils
|
||||||
|
import android.util.Log
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.webkit.WebChromeClient
|
import android.webkit.WebChromeClient
|
||||||
import android.webkit.WebView
|
import android.webkit.WebView
|
||||||
@@ -109,6 +110,7 @@ class InterventionWebActivity() :
|
|||||||
// Log.e("mzf","file:///android_asset/dist/index.html?p=$path&r=${url}&t=${mToken}&id=${mUserId}&d=${date}")
|
// Log.e("mzf","file:///android_asset/dist/index.html?p=$path&r=${url}&t=${mToken}&id=${mUserId}&d=${date}")
|
||||||
// Log.e("mzf", "$localAdress&d=${date}")
|
// Log.e("mzf", "$localAdress&d=${date}")
|
||||||
mBinding.webView.loadUrl("$localAdress&d=${date}&h=${urlType}")
|
mBinding.webView.loadUrl("$localAdress&d=${date}&h=${urlType}")
|
||||||
|
Log.i("InterventionWebActivity", "url: "+mBinding.webView.url)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getTitleText(path: String?): String {
|
private fun getTitleText(path: String?): String {
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import com.xjjk.healthyclients.base.viewmodel.BaseViewModel
|
|||||||
import com.xjjk.healthyclients.bean.guidance.GuidanceListBean
|
import com.xjjk.healthyclients.bean.guidance.GuidanceListBean
|
||||||
import com.xjjk.healthyclients.bean.home.HomeBannerBean
|
import com.xjjk.healthyclients.bean.home.HomeBannerBean
|
||||||
import com.xjjk.healthyclients.bean.home.HomeNoticeBean
|
import com.xjjk.healthyclients.bean.home.HomeNoticeBean
|
||||||
|
import com.xjjk.healthyclients.bean.home.HomeWatchAllDataBean
|
||||||
|
import com.xjjk.healthyclients.bean.home.WatchInfoBean
|
||||||
import com.xjjk.healthyclients.data.repository.GuidanceRepository
|
import com.xjjk.healthyclients.data.repository.GuidanceRepository
|
||||||
import com.xjjk.healthyclients.data.repository.HomeRepository
|
import com.xjjk.healthyclients.data.repository.HomeRepository
|
||||||
import com.xjjk.healthyclients.superfuntion.handleRequest
|
import com.xjjk.healthyclients.superfuntion.handleRequest
|
||||||
@@ -21,6 +23,10 @@ class HomeViewModel : BaseViewModel() {
|
|||||||
var homeBannerList = MutableSharedFlow<MutableList<HomeBannerBean>?>()
|
var homeBannerList = MutableSharedFlow<MutableList<HomeBannerBean>?>()
|
||||||
var sessionPicUrl = MutableSharedFlow<String?>()
|
var sessionPicUrl = MutableSharedFlow<String?>()
|
||||||
|
|
||||||
|
//手表
|
||||||
|
var watchInfo = MutableSharedFlow<WatchInfoBean?>()
|
||||||
|
var watchAllData = MutableSharedFlow<MutableList<HomeWatchAllDataBean>?>()
|
||||||
|
|
||||||
|
|
||||||
var isRefreshing = MutableStateFlow(false)
|
var isRefreshing = MutableStateFlow(false)
|
||||||
var isLoadMoreEnd = MutableSharedFlow<Boolean>()
|
var isLoadMoreEnd = MutableSharedFlow<Boolean>()
|
||||||
@@ -34,7 +40,6 @@ class HomeViewModel : BaseViewModel() {
|
|||||||
fun selectDoctorRecommendHome() {
|
fun selectDoctorRecommendHome() {
|
||||||
launch(
|
launch(
|
||||||
{
|
{
|
||||||
|
|
||||||
handleRequest(
|
handleRequest(
|
||||||
GuidanceRepository.selectDoctorRecommend(1,3),
|
GuidanceRepository.selectDoctorRecommend(1,3),
|
||||||
successBlock = {
|
successBlock = {
|
||||||
@@ -135,5 +140,29 @@ class HomeViewModel : BaseViewModel() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getHomeWatchData(date:String) {
|
||||||
|
launch(
|
||||||
|
{
|
||||||
|
handleRequest(
|
||||||
|
HomeRepository.getHomeWatchData(date),
|
||||||
|
successBlock = {
|
||||||
|
watchAllData.emit(it.result)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getHomeWatchInfo(userId: String?) {
|
||||||
|
launch(
|
||||||
|
{
|
||||||
|
handleRequest(
|
||||||
|
HomeRepository.getHomeWatchInfo(userId),
|
||||||
|
successBlock = {
|
||||||
|
watchInfo.emit(it.result)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package com.xjjk.healthyclients.view
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.RelativeLayout
|
||||||
|
import androidx.databinding.DataBindingUtil
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import com.sw.healthyclients.adapter.common.ViewPagerAdapter
|
||||||
|
import com.sw.healthyclients.bean.common.TabItemBean
|
||||||
|
import com.xjjk.healthyclients.R
|
||||||
|
import com.xjjk.healthyclients.bean.home.HomeWatchAllDataBean
|
||||||
|
import com.xjjk.healthyclients.bean.home.WatchInfoBean
|
||||||
|
import com.xjjk.healthyclients.databinding.LayoutHomeItemWatchBinding
|
||||||
|
import com.xjjk.healthyclients.event.WatchDataChangeEvent
|
||||||
|
import com.xjjk.healthyclients.fragment.WatchItemFragment
|
||||||
|
import com.xjjk.healthyclients.superfuntion.init
|
||||||
|
import com.xjjk.healthyclients.superfuntion.onCreateTab
|
||||||
|
import org.greenrobot.eventbus.EventBus
|
||||||
|
|
||||||
|
class HomeWatchView(context: Context?, attrs: AttributeSet?) :
|
||||||
|
RelativeLayout(context, attrs, 0), ViewPagerAdapter.OnCreateFragmentListener {
|
||||||
|
|
||||||
|
var mContext: Context? = context
|
||||||
|
var mBinding: LayoutHomeItemWatchBinding = DataBindingUtil.inflate(
|
||||||
|
LayoutInflater.from(context),
|
||||||
|
R.layout.layout_home_item_watch, this, true
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
fun init(fragment: Fragment) {
|
||||||
|
val arrayOf = arrayOf("心脑血管", "癌症", "慢呼", "糖尿病", "亚健康")
|
||||||
|
mBinding.watchTabLayout.onCreateTab(arrayOf, 1) {tab->
|
||||||
|
if (tab?.position != 0) {
|
||||||
|
mBinding.emptyText.visibility = View.VISIBLE
|
||||||
|
mBinding.emptyText.text = "开发中"
|
||||||
|
mBinding.viewPager.visibility = View.GONE
|
||||||
|
} else {
|
||||||
|
mBinding.viewPager.visibility = View.VISIBLE
|
||||||
|
mBinding.emptyText.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
val tabList: MutableList<TabItemBean> = mutableListOf()
|
||||||
|
(0..4).forEach { _ ->
|
||||||
|
tabList.add(TabItemBean())
|
||||||
|
}
|
||||||
|
mBinding.viewPager.init(fragment, tabList.toTypedArray(), this, 5)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setWatchInfo(watchInfo: WatchInfoBean?) {
|
||||||
|
if (watchInfo?.hasWatch == true) {
|
||||||
|
mBinding.viewPager.visibility = View.VISIBLE
|
||||||
|
mBinding.watchName.visibility = View.VISIBLE
|
||||||
|
mBinding.emptyText.visibility = View.GONE
|
||||||
|
mBinding.watchName.text = "监测工具编码:${watchInfo.watchNo}"
|
||||||
|
} else {
|
||||||
|
mBinding.viewPager.visibility = View.GONE
|
||||||
|
mBinding.watchName.visibility = View.GONE
|
||||||
|
mBinding.emptyText.visibility = View.VISIBLE
|
||||||
|
mBinding.emptyText.text = "您目前未配备智能穿戴设备"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收手表详细数据并通过 EventBus 通知各 WatchItemFragment 刷新
|
||||||
|
* @param dataList 接口返回的手表各项健康数据列表(索引与 Tab position 对应)
|
||||||
|
*/
|
||||||
|
fun setWatchAllData(dataList: MutableList<HomeWatchAllDataBean>?) {
|
||||||
|
EventBus.getDefault().post(WatchDataChangeEvent().apply {
|
||||||
|
this.dataList = dataList
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun createFragment(position: Int): Fragment {
|
||||||
|
return WatchItemFragment().newInstance(position)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item android:color="@color/text_black_33" android:state_selected="true" />
|
|
||||||
<item android:color="#77849E" android:state_selected="false"/>
|
|
||||||
<item android:color="#77849E"/>
|
|
||||||
</selector>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item android:color="#117474" android:state_selected="true" />
|
|
||||||
<item android:color="#83CDCD" android:state_selected="false"/>
|
|
||||||
<item android:color="#83CDCD"/>
|
|
||||||
</selector>
|
|
||||||
@@ -4,5 +4,5 @@
|
|||||||
<item android:drawable="@drawable/rectangle_round_corner20_theme" android:state_checked="true"/>
|
<item android:drawable="@drawable/rectangle_round_corner20_theme" android:state_checked="true"/>
|
||||||
<item android:drawable="@drawable/rectangle_round_corner20_theme" android:state_selected="true"/>
|
<item android:drawable="@drawable/rectangle_round_corner20_theme" android:state_selected="true"/>
|
||||||
<!-- 默认状态-->
|
<!-- 默认状态-->
|
||||||
<item android:drawable="@drawable/rectangle_round_corner20_white"/>
|
<item android:drawable="@drawable/rectangle_round_corner20_white_home"/>
|
||||||
</selector>
|
</selector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle"
|
||||||
|
android:useLevel="false">
|
||||||
|
|
||||||
|
<solid android:color="#30A9FF" />
|
||||||
|
<size
|
||||||
|
android:width="4dp"
|
||||||
|
android:height="11dp" />
|
||||||
|
<corners android:radius="@dimen/dp_2" />
|
||||||
|
</shape>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle"
|
||||||
|
android:useLevel="false">
|
||||||
|
|
||||||
|
<solid android:color="#43D0B0" />
|
||||||
|
<size
|
||||||
|
android:width="4dp"
|
||||||
|
android:height="11dp" />
|
||||||
|
<corners android:radius="@dimen/dp_2" />
|
||||||
|
</shape>
|
||||||
@@ -88,6 +88,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="5dp"
|
android:layout_height="5dp"
|
||||||
android:background="@drawable/imaginary_line"/>
|
android:background="@drawable/imaginary_line"/>
|
||||||
|
<include layout="@layout/item_bank_points"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -111,6 +111,10 @@
|
|||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
android:layout_marginHorizontal="12dp"
|
android:layout_marginHorizontal="12dp"
|
||||||
android:layout_marginTop="10dp" />
|
android:layout_marginTop="10dp" />
|
||||||
|
<com.xjjk.healthyclients.view.HomeWatchView
|
||||||
|
android:id="@+id/watch_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
<com.youth.banner.Banner
|
<com.youth.banner.Banner
|
||||||
android:id="@+id/banner3"
|
android:id="@+id/banner3"
|
||||||
|
|||||||
@@ -0,0 +1,196 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="15dp">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/watch_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="10dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/watch_type_img"
|
||||||
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:src="@mipmap/ic_home_watch_tab1"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/watch_type"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="12dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:text="最新"
|
||||||
|
android:textColor="@color/text_black_33"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/watch_type_img"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/watch_time"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="12dp"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:textColor="#77849E"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/watch_type_img"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/watch_type" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/watch_value"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:paddingRight="2dp"
|
||||||
|
android:textColor="@color/text_black_33"
|
||||||
|
android:textSize="25sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintRight_toLeftOf="@+id/watch_value_unit"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/watch_value_unit"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:textColor="#77849E"
|
||||||
|
android:textSize="11sp"
|
||||||
|
app:layout_constraintBaseline_toBaselineOf="@+id/watch_value"
|
||||||
|
app:layout_constraintRight_toRightOf="parent" />
|
||||||
|
|
||||||
|
<com.allen.library.shape.ShapeRelativeLayout
|
||||||
|
android:id="@+id/watch_layout_left"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginTop="21dp"
|
||||||
|
android:layout_marginRight="7dp"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toLeftOf="@+id/watch_layout_right"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/watch_type_img"
|
||||||
|
app:shapeCornersRadius="8dp"
|
||||||
|
app:shapeSolidColor="#F6F6F6">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/watch_left_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:layout_marginRight="7dp"
|
||||||
|
android:drawableLeft="@drawable/rect_line_green"
|
||||||
|
android:drawablePadding="6dp"
|
||||||
|
android:text="范围"
|
||||||
|
android:textColor="@color/text_black_33"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/watch_left_value"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/watch_left_text"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginBottom="15dp"
|
||||||
|
android:drawablePadding="6dp"
|
||||||
|
android:textColor="@color/text_black_33"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/watch_left_unit"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBaseline="@+id/watch_left_value"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginRight="7dp"
|
||||||
|
android:layout_toRightOf="@+id/watch_left_value"
|
||||||
|
android:drawablePadding="6dp"
|
||||||
|
android:textColor="@color/text_black_33"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
|
||||||
|
</com.allen.library.shape.ShapeRelativeLayout>
|
||||||
|
|
||||||
|
<com.allen.library.shape.ShapeRelativeLayout
|
||||||
|
android:id="@+id/watch_layout_right"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="7dp"
|
||||||
|
android:layout_marginTop="21dp"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
app:layout_constraintLeft_toRightOf="@+id/watch_layout_left"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/watch_type_img"
|
||||||
|
app:shapeCornersRadius="8dp"
|
||||||
|
app:shapeSolidColor="#F6F6F6">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/watch_right_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:layout_marginRight="7dp"
|
||||||
|
android:drawableLeft="@drawable/rect_line_blue"
|
||||||
|
android:drawablePadding="6dp"
|
||||||
|
android:text="平均"
|
||||||
|
android:textColor="@color/text_black_33"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/watch_right_value"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/watch_right_text"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginBottom="15dp"
|
||||||
|
android:drawablePadding="6dp"
|
||||||
|
android:textColor="@color/text_black_33"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/watch_right_unit"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBaseline="@+id/watch_right_value"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginRight="7dp"
|
||||||
|
android:layout_toRightOf="@+id/watch_right_value"
|
||||||
|
android:drawablePadding="6dp"
|
||||||
|
android:textColor="@color/text_black_33"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
|
||||||
|
</com.allen.library.shape.ShapeRelativeLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</layout>
|
||||||
|
|
||||||
|
|
||||||
@@ -1,13 +1,19 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/tv_tab_layout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_text"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="5dp"
|
||||||
android:background="@drawable/bg_child_tab_layout_item"
|
android:background="@drawable/bg_child_tab_layout_item"
|
||||||
android:paddingVertical="@dimen/dp_7"
|
|
||||||
android:paddingHorizontal="@dimen/dp_15"
|
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="@color/color_child_tab_layout_text"
|
android:includeFontPadding="false"
|
||||||
android:textSize="@dimen/txt13"
|
android:paddingHorizontal="@dimen/dp_10"
|
||||||
android:id="@+id/tv_tab_layout">
|
android:paddingVertical="@dimen/dp_7"
|
||||||
</TextView>
|
android:textColor="@color/color_child_tab_layout_text_home"
|
||||||
|
android:textSize="@dimen/txt13" />
|
||||||
|
</RelativeLayout>
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:id="@+id/tv_tab_layout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@drawable/bg_child_tab_layout_item2"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:paddingVertical="8dp"
|
|
||||||
android:textColor="@color/color_child_tab_etiological_result"
|
|
||||||
android:textSize="@dimen/txt13">
|
|
||||||
|
|
||||||
</TextView>
|
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_marginHorizontal="12dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="15dp">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/layout_watch_more"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:background="@mipmap/ic_home_item_head_bg"
|
||||||
|
android:scaleType="fitXY">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:text="健康监测"
|
||||||
|
android:textColor="@color/text_black_33"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/watch_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginRight="36dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:textColor="#14BEBE"
|
||||||
|
android:textSize="13sp"
|
||||||
|
tools:text="监测工具编码:4PMBB25A28100553" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:background="@drawable/arrow_right"
|
||||||
|
android:padding="10dp" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<com.allen.library.shape.ShapeRelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="40dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:shadowCornersBottomRightRadius="12dp"
|
||||||
|
app:shapeCornersBottomLeftRadius="12dp"
|
||||||
|
app:shapeSolidColor="@color/white">
|
||||||
|
|
||||||
|
<com.google.android.material.tabs.TabLayout
|
||||||
|
android:id="@+id/watch_tab_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_below="@+id/toolbar_lay"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:background="@color/white"
|
||||||
|
app:tabIndicatorFullWidth="false"
|
||||||
|
app:tabIndicatorHeight="@dimen/dp_0"
|
||||||
|
app:tabMinWidth="@dimen/dp_0"
|
||||||
|
app:tabMode="auto"
|
||||||
|
app:tabPaddingEnd="@dimen/dp_0"
|
||||||
|
app:tabPaddingStart="@dimen/dp_0"
|
||||||
|
app:tabRippleColor="@null" />
|
||||||
|
|
||||||
|
<androidx.viewpager2.widget.ViewPager2
|
||||||
|
android:id="@+id/viewPager"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/watch_tab_layout"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
</androidx.viewpager2.widget.ViewPager2>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/empty_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="45dp"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="55dp"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="暂未登录"
|
||||||
|
android:textColor="#77849E"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
</com.allen.library.shape.ShapeRelativeLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</layout>
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Reference in New Issue
Block a user