From 8d872c4dec5a6bed6991314991d6281686330e82 Mon Sep 17 00:00:00 2001 From: deeppp15 Date: Wed, 22 Jan 2025 17:46:31 -0500 Subject: [PATCH 1/4] examination list shows last update --- .../ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt index 7e3cdb78ad..4d2dc3bc78 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt @@ -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 @@ -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) From fcd264c6e6ad1a113ba29aa4b0576c2ad307d426 Mon Sep 17 00:00:00 2001 From: Gideon Okuro Date: Thu, 23 Jan 2025 16:18:45 +0300 Subject: [PATCH 2/4] Update MyHealthFragment.kt --- .../org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt index 4d2dc3bc78..e9f052aee7 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt @@ -71,7 +71,6 @@ 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 @@ -218,7 +217,8 @@ class MyHealthFragment : Fragment() { fragmentVitalSignBinding.rvRecords.apply { layoutManager = LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false) isNestedScrollingEnabled = false - adapter = adap } + adapter = adap + } fragmentVitalSignBinding.rvRecords.post { val lastPosition = (list?.size ?: 0) - 1 if (lastPosition >= 0) { From 1a4daa40d152ca0c4ecdf3621c9feb504504089a Mon Sep 17 00:00:00 2001 From: Gideon Okuro Date: Thu, 23 Jan 2025 16:19:13 +0300 Subject: [PATCH 3/4] Update MyHealthFragment.kt --- .../org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt index e9f052aee7..aa89629c56 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/myhealth/MyHealthFragment.kt @@ -217,7 +217,7 @@ class MyHealthFragment : Fragment() { fragmentVitalSignBinding.rvRecords.apply { layoutManager = LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false) isNestedScrollingEnabled = false - adapter = adap + adapter = adap } fragmentVitalSignBinding.rvRecords.post { val lastPosition = (list?.size ?: 0) - 1 From 5865f471c6bfd2269edd36506dfef1fe698cb13d Mon Sep 17 00:00:00 2001 From: deeppp15 Date: Thu, 23 Jan 2025 16:32:38 -0500 Subject: [PATCH 4/4] added scrollbar --- app/src/main/res/layout/fragment_vital_sign.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/layout/fragment_vital_sign.xml b/app/src/main/res/layout/fragment_vital_sign.xml index 1402f96336..a63c785e83 100644 --- a/app/src/main/res/layout/fragment_vital_sign.xml +++ b/app/src/main/res/layout/fragment_vital_sign.xml @@ -312,7 +312,8 @@ android:id="@+id/rv_records" android:layout_width="0dp" android:layout_height="match_parent" - android:layout_weight="1" /> + android:layout_weight="1" + android:scrollbars="horizontal" />