Merge branch 'develop' into dev_second

develop
wlh 1 year ago
commit 92f3f6f0f0

@ -763,6 +763,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
binding.mHeader.tvNowTime.text = bean.nowDay
binding.mHeader.tvLanuDate.text = bean.chinaDay
sex = bean.user.sex.toString()
//设置用户头像
setUserImage(bean.user.id.toString(), bean.user.image, bean.user.sex.toString())
binding.mHeader.tvUserName.text = bean.user.name

@ -72,6 +72,7 @@ class AppUpdateDialog(
)
//0:非强制更新 1强制更新
isUpdate = (updateFlag == 1)
binding.mProgress.progress = 0
//如果当前地址用户忽略取消过并且当前版本非强制更新则不弹出dialog
if (MMkvHelper.getString(Const.IS_UPDATE_URL_FLAG) == url && !isUpdate) {
isShow.invoke(false)

@ -5,6 +5,7 @@ import androidx.core.content.ContextCompat
import com.azhon.appupdate.config.UpdateConfiguration
import com.azhon.appupdate.listener.OnDownloadListener
import com.azhon.appupdate.manager.DownloadManager
import com.hjq.toast.ToastUtils
import com.xty.base.R
import java.io.File
@ -46,7 +47,9 @@ class AppUpdate(var context: Activity) {
}
override fun error(e: Exception?) {
ToastUtils.show(e.toString())
error.invoke()
}
})
}

@ -476,14 +476,14 @@ class BreathFrag : BaseVmFrag<BreathVm>() {
1 ->
{
highTime++
highList.add(statu.toString())
highList.add(statu.toInt().toString())
highListTime.add(model.time!!)
}
2 ->
{
lowTime++
lowList.add(statu.toString())
lowList.add(statu.toInt().toString())
lowListTime.add(model.time!!)
}
else ->

@ -1,11 +1,13 @@
package com.zj365.health.fragment
import android.annotation.SuppressLint
import android.content.res.ColorStateList
import android.graphics.Color
import android.graphics.Typeface
import android.os.Build
import android.os.Bundle
import android.text.TextUtils
import android.util.SparseArray
import android.view.LayoutInflater
import android.view.View
import android.widget.TextView
@ -24,6 +26,9 @@ import com.xty.common.*
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.audioUtils.RecordAudio
import com.xty.common.weight.tablayout.TabEntity
import com.xty.common.weight.tablayout.listener.CustomTabEntity
import com.xty.common.weight.tablayout.listener.OnTabSelectListener
import com.zj365.health.R
import com.zj365.health.act.HealthMainAct
import com.zj365.health.databinding.FragSleepNewBinding
@ -51,17 +56,17 @@ class SleepFrag : BaseVmFrag<SleepVm>() {
private val musicInfoBinding by lazy { SleepMusicInfoBinding.bind(binding.root)}
val timeDaySelect by lazy{TimeSelect(requireContext()){
var time=binding.mTime.text.toString()
var time=binding.tvShowDate.text.toString()
getData(time)
}}
val timeMonthSelect by lazy{TimeSelect(requireContext()){
var time=binding.mTime.text.toString()
var time=binding.tvShowDate.text.toString()
getData(time)
}}
val timeYearSelect by lazy{TimeSelect(requireContext()){
var time=binding.mTime.text.toString()
var time=binding.tvShowDate.text.toString()
getData(time)
}}
@ -101,8 +106,86 @@ class SleepFrag : BaseVmFrag<SleepVm>() {
private val activeSize = 15F
private val normalSize = 15F
private val mTabEntities: ArrayList<CustomTabEntity> = ArrayList()
private val mTitles = arrayOf(
"", "", "", ""
)
private fun initTab() {
mTabEntities.clear()
listFrag.clear()
if (id.isNullOrEmpty()) {
listFrag.add(SleepStaticDayFrag())
listFrag.add(SleepStatisticWeekFrag())
listFrag.add(SleepStatisticMonthFrag())
listFrag.add(SleepStatisticYearFrag())
} else {
listFrag.add(setArgumentFrag(SleepStaticDayFrag(), id))
listFrag.add(setArgumentFrag(SleepStatisticWeekFrag(), id))
listFrag.add(setArgumentFrag(SleepStatisticMonthFrag(), id))
listFrag.add(setArgumentFrag(SleepStatisticYearFrag(), id))
}
binding.mVp2.adapter = MyAdapter(this,listFrag,requireActivity(),childFragmentManager)
binding.mVp2.isUserInputEnabled =false
mTitles.forEach {
mTabEntities.add(
TabEntity(
it, android.R.drawable.ic_delete, android.R.drawable.ic_delete
)
)
}
binding.commonTabLayout.setTabData(mTabEntities)
binding.commonTabLayout.setOnTabSelectListener(object : OnTabSelectListener {
@SuppressLint("SetTextI18n")
override fun onTabSelect(position: Int) {
binding.commonTabLayout.currentTab = position
binding.mVp2.setCurrentItem(position, false)
showSelectTime()
//这个view是的fragment。
if (initFrag){
initFrag = false
return
}
val view = listFrag[position].view
view?.let {
updatePagerHeightForChild(view)
}
/* when (position) {
0 -> {
// binding.tvShowDate.text = dayDate
showSelectTime()
}
1 -> {
// binding.tvShowDate.text = weekDate
showSelectTime()
}
2 -> {
// binding.tvShowDate.text = mouthDate
showSelectTime()
}
3 -> {
// binding.tvShowDate.text = yearDate
showSelectTime()
}
}*/
}
override fun onTabReselect(position: Int) {
}
})
/*binding.mVp2.post {
binding.commonTabLayout.
}*/
}
private fun initTabVp2() {
var mediator = TabLayoutMediator(
binding.tabLayout, binding.mVp2
@ -119,7 +202,7 @@ class SleepFrag : BaseVmFrag<SleepVm>() {
}else{
tabView.setText(tabs[position])
}
tabView.setTextSize(normalSize)
// tabView.setTextSize(normalSize)
tabView.setTextColor(colorStateList)
tab.setCustomView(tabView)
}
@ -146,10 +229,10 @@ class SleepFrag : BaseVmFrag<SleepVm>() {
val tab: TabLayout.Tab = binding.tabLayout.getTabAt(i)!!
val tabView = tab.customView as TextView?
if (tab.position == position) {
tabView!!.textSize = activeSize.toFloat()
//tabView!!.textSize = activeSize.toFloat()
tabView!!.setTypeface(Typeface.DEFAULT_BOLD)
} else {
tabView!!.textSize = normalSize
// tabView!!.textSize = normalSize
tabView!!.setTypeface(Typeface.DEFAULT)
}
}
@ -200,7 +283,8 @@ class SleepFrag : BaseVmFrag<SleepVm>() {
super.initView()
isDemonstrate = (requireActivity() as HealthMainAct).isDemonstrate
// mViewModel.getSetting(Const.SLEEP_SETTING)
initTabVp2()
// initTabVp2()
initTab()
initTimeSelect()
val assets = context?.assets?.open("forest.mp3")
//保存到手机的路劲
@ -283,7 +367,7 @@ class SleepFrag : BaseVmFrag<SleepVm>() {
}
)
showSelectTime()
binding.mTime.setOnClickListener {
binding.tvShowDate.setOnClickListener {
val currentFragment = getCurrentFragment()
if (currentFragment is SleepStaticDayFrag){
timeDaySelect.selectTime(it,"yyyy-MM-dd")
@ -296,6 +380,19 @@ class SleepFrag : BaseVmFrag<SleepVm>() {
}
}
/* binding.ivPosition.setOnClickListener {
val currentFragment = getCurrentFragment()
if (currentFragment is SleepStaticDayFrag){
timeDaySelect.selectTime(it,"yyyy-MM-dd")
} else if (currentFragment is SleepStatisticWeekFrag) {
bottomSheetDialog?.show()
} else if (currentFragment is SleepStatisticMonthFrag) {
timeMonthSelect.selectTimeWithYearMonth(it,"yyyy-MM")
} else if (currentFragment is SleepStatisticYearFrag) {
timeYearSelect.selectTimeWithYear(it,"yyyy")
}
}*/
initBottomDialog()
}
@ -328,7 +425,9 @@ class SleepFrag : BaseVmFrag<SleepVm>() {
timeYearSelect.selectTime
}
}
binding.mTime.text = showTime
// binding.mTime.text = showTime
binding.tvShowDate.text = showTime
}
override fun onDestroy() {

@ -629,7 +629,7 @@ class UricAcidFrag : BaseVmFrag<UricAcidVm>() {
2 -> {
highTime++
highList.add(data.uaValue.toString())
highList.add(data.uaValue.toInt().toString())
highListTime.add(data.time)
}

@ -489,13 +489,13 @@ class XinlvFrag : BaseVmFrag<XlVm>() {
when (OrganStatusCalcUtil.heartStatu(hrData.toInt())) {//0:正常 1过缓 2过速
1 -> {
lowTime++
lowList.add(hrData.toString())
lowList.add(hrData.toInt().toString())
lowListTime.add(data.time)
}
2 -> {
highTime++
highList.add(hrData.toString())
highList.add(hrData.toInt().toString())
highListTime.add(data.time)
}

@ -533,13 +533,13 @@ class XueyaFrag : BaseVmFrag<XyaVm>() {
when (OrganStatusCalcUtil.bloodStatu(statu.toFloat())) {//0:正常 1低血压 2:1级高血压 3:2级高血压 4:3级高血压
1 -> {
lowTime++
lowList.add(statu.toString() + "/" + model.lowDbp)
lowList.add(statu.toInt().toString() + "/" + model.lowDbp.toInt())
lowListTime.add(model.time)
}
2, 3, 4 -> {
highTime++
highList.add(statu.toString() + "/" + model.lowDbp)
highList.add(statu.toInt().toString() + "/" + model.lowDbp.toInt())
highListTime.add(model.time)
}

@ -487,13 +487,13 @@ class XueyangFrag : BaseVmFrag<XyVm>() {
1 ->
{
lowTime++
lowList.add(statu.toString())
lowList.add(statu.toInt().toString())
lowListTime.add(model.time)
}
2 -> {
highTime++
highList.add(statu.toString())
highList.add(statu.toInt().toString())
highListTime.add(model.time)
}
else ->

@ -79,11 +79,14 @@ class IMarkView(context: Context?, layoutResource: Int, var unit: String, var pa
tvValue.text = "${changeDecimals(datas[2], 0)} /${changeDecimals(datas[3], 0)} $unit"
}
MarkPage.Temp,
MarkPage.XTang, MarkPage.UricAcid -> {
MarkPage.XTang-> {
tvValue.text = "${changeDecimals(e!!.y.toString(), 1)} $unit"
tvTime.text = "${e!!.data as String}"
}
MarkPage.UricAcid ->{
tvValue.text = "${e!!.y.toInt()} $unit"
tvTime.text = "${e!!.data as String}"
}
MarkPage.Tc, MarkPage.Tg, MarkPage.Hdl, MarkPage.Ldl ->{
tvValue.text = "${changeDecimals(e!!.y.toString(), 2)} $unit"
tvTime.text = "${e!!.data as String}"

@ -60,34 +60,97 @@
</LinearLayout>
<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40"
android:background="@color/white"
android:orientation="horizontal">
<com.xty.common.weight.tablayout.CommonTabLayout
android:id="@+id/commonTabLayout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/dp_12"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/tvHideDate"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tl_iconVisible="false"
app:tl_indicator_color="@color/col_02c"
app:tl_indicator_corner_radius="@dimen/dp_2"
app:tl_indicator_height="@dimen/dp_3"
app:tl_indicator_width="@dimen/dp_16"
app:tl_textSelectColor="@color/col_02c"
app:tl_textUnselectColor="#7C7C7C"
app:tl_textsize="@dimen/sp_15"
app:tl_textsizeSelected="@dimen/sp_15" />
<ImageView
android:id="@+id/ivPosition"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="9dp"
android:padding="5dp"
android:src="@mipmap/ic_arrow_down"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvHideDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2023-02-24 至 2023-02-24"
android:textColor="#313131"
android:textSize="@dimen/sp_12"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/ivPosition"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvShowDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2023-02-24"
android:textColor="#313131"
android:textSize="@dimen/sp_12"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/ivPosition"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingRight="5dp"
android:paddingRight="@dimen/dp_5"
android:visibility="gone"
>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_width="0dp"
android:layout_height="@dimen/dp_40"
android:visibility="visible"
app:tabGravity="center"
app:tabIndicator="@drawable/shape_tab_indicator"
app:tabIndicatorColor="@color/col_02c"
app:tabIndicatorFullWidth="false"
app:tabIndicatorHeight="2dp"
app:tabMaxWidth="40dp"
app:tabIndicatorHeight="@dimen/dp_2"
app:tabMaxWidth="@dimen/dp_40"
app:tabMode="scrollable"
app:tabSelectedTextColor="@color/col_02c"
app:tabUnboundedRipple="true" />
app:tabTextSize="@dimen/sp_15"
app:tabUnboundedRipple="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/mTime"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="@+id/mTime"
@ -100,11 +163,13 @@
android:paddingBottom="@dimen/dp_10"
android:textColor="@color/black"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/mImage"
android:text="2023-02-24 至 2023-02-24"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/mImage" />
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/mVp2"

@ -75,6 +75,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">

Loading…
Cancel
Save