From 541b555c052e23986b7598eb8d256c08a40722be Mon Sep 17 00:00:00 2001 From: Mariya Date: Sat, 23 Mar 2024 17:22:32 +0530 Subject: [PATCH] Panel screen specific options will only visible to ADMIN only --- .../presentation/dashboard/GalleryFragment.kt | 24 +++++++++++++++++++ .../presentation/dashboard/HomeFragment.kt | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/example/hpostesting/presentation/dashboard/GalleryFragment.kt b/app/src/main/java/com/example/hpostesting/presentation/dashboard/GalleryFragment.kt index 439fde8..5b78352 100644 --- a/app/src/main/java/com/example/hpostesting/presentation/dashboard/GalleryFragment.kt +++ b/app/src/main/java/com/example/hpostesting/presentation/dashboard/GalleryFragment.kt @@ -72,7 +72,31 @@ class GalleryFragment : Fragment() { ) { binding.btnDeviceProvision.visibility = View.VISIBLE } else { + binding.btnDeviceProvision.visibility = View.GONE + } + + if (sharedPreference.getString(Constants.USER_ID, "").toString() == "ADMIN") { binding.btnDeviceProvision.visibility = View.VISIBLE + binding.btnAutoDac.visibility = View.VISIBLE + binding.btnDeviceProvision.visibility = View.VISIBLE + binding.btnDiagnostics.visibility = View.VISIBLE + binding.btnFiles.visibility = View.VISIBLE + binding.btnFirefox.visibility = View.VISIBLE + binding.btnCalibration.visibility = View.VISIBLE + binding.btnUsbTerminal.visibility = View.VISIBLE + binding.btnSubmit.visibility = View.VISIBLE + binding.btnDeviceInfo.visibility = View.VISIBLE + }else{ + binding.btnDeviceProvision.visibility = View.GONE + binding.btnAutoDac.visibility = View.GONE + binding.btnDeviceProvision.visibility = View.GONE + binding.btnDiagnostics.visibility = View.GONE + binding.btnFiles.visibility = View.GONE + binding.btnFirefox.visibility = View.GONE + binding.btnCalibration.visibility = View.GONE + binding.btnUsbTerminal.visibility = View.GONE + binding.btnSubmit.visibility = View.GONE + binding.btnDeviceInfo.visibility = View.VISIBLE } binding.btnDeviceProvision.setOnClickListener { diff --git a/app/src/main/java/com/example/hpostesting/presentation/dashboard/HomeFragment.kt b/app/src/main/java/com/example/hpostesting/presentation/dashboard/HomeFragment.kt index 2981020..32372bf 100644 --- a/app/src/main/java/com/example/hpostesting/presentation/dashboard/HomeFragment.kt +++ b/app/src/main/java/com/example/hpostesting/presentation/dashboard/HomeFragment.kt @@ -305,7 +305,7 @@ class HomeFragment : Fragment() { apply() } startActivity(Intent(requireContext(), KitScanActivity::class.java)) - // requireActivity().finish() + requireActivity().finish() } @@ -316,7 +316,7 @@ class HomeFragment : Fragment() { apply() } startActivity(Intent(requireContext(), KitScanActivity::class.java)) - // requireActivity().finish() + requireActivity().finish() } binding.btnQuickCapture.setOnClickListener { DataHolder.hemoCubeTestData = HemoCubeTestData()