Skip to content

Commit

Permalink
examination list shows last update
Browse files Browse the repository at this point in the history
  • Loading branch information
deeppp15 committed Jan 22, 2025
1 parent aacacd4 commit 8d872c4
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class MyHealthFragment : Fragment() {
}, now.get(Calendar.YEAR), now.get(Calendar.MONTH), now.get(Calendar.DAY_OF_MONTH))
dpd.show()
}

fragmentVitalSignBinding.rvRecords.addItemDecoration(DividerItemDecoration(activity, DividerItemDecoration.VERTICAL))
profileDbHandler = UserProfileDbHandler(alertMyPersonalBinding.root.context)
userId = if (TextUtils.isEmpty(profileDbHandler?.userModel?._id)) profileDbHandler?.userModel?.id else profileDbHandler?.userModel?._id
Expand Down Expand Up @@ -217,10 +218,12 @@ class MyHealthFragment : Fragment() {
fragmentVitalSignBinding.rvRecords.apply {
layoutManager = LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
isNestedScrollingEnabled = false
adapter = adap
}
adapter = adap }
fragmentVitalSignBinding.rvRecords.post {
fragmentVitalSignBinding.rvRecords.scrollToPosition(list?.size ?: (0 - 1))
val lastPosition = (list?.size ?: 0) - 1
if (lastPosition >= 0) {
fragmentVitalSignBinding.rvRecords.scrollToPosition(lastPosition)
}
}
} else {
fragmentVitalSignBinding.txtOtherNeed.text = getString(R.string.empty_text)
Expand Down

0 comments on commit 8d872c4

Please sign in to comment.