Merge branch 'kitscan_fix' into Homocube
This commit is contained in:
@@ -18,8 +18,8 @@ android {
|
|||||||
applicationId "in.sminnovations.hpostesting"
|
applicationId "in.sminnovations.hpostesting"
|
||||||
minSdk 21
|
minSdk 21
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode 2
|
versionCode 3
|
||||||
versionName "2.0.1"
|
versionName "2.1.3"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.example.hpostesting.presentation.adapter.UserListAdapter
|
|||||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||||
import com.example.hpostesting.presentation.testRight.TestRightViewModel
|
import com.example.hpostesting.presentation.testRight.TestRightViewModel
|
||||||
import com.firebase.ui.firestore.FirestoreRecyclerOptions
|
import com.firebase.ui.firestore.FirestoreRecyclerOptions
|
||||||
|
import com.google.firebase.firestore.Query
|
||||||
import com.google.firebase.firestore.ktx.firestore
|
import com.google.firebase.firestore.ktx.firestore
|
||||||
import com.google.firebase.ktx.Firebase
|
import com.google.firebase.ktx.Firebase
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
@@ -90,7 +91,7 @@ class HomeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private fun loadUserData() {
|
private fun loadUserData() {
|
||||||
val query = Firebase.firestore.collection("patientData").whereEqualTo("testStatus", false)
|
val query = Firebase.firestore.collection("patientData").whereEqualTo("testStatus", false).orderBy("createdAt", Query.Direction.DESCENDING)
|
||||||
query.get().addOnSuccessListener {
|
query.get().addOnSuccessListener {
|
||||||
if (it.documents.isEmpty()) {
|
if (it.documents.isEmpty()) {
|
||||||
binding.pendingTest.visibility = View.VISIBLE
|
binding.pendingTest.visibility = View.VISIBLE
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import androidx.lifecycle.ViewModelProvider
|
|||||||
import com.example.hpostesting.presentation.dashboard.ui.slideshow.SlideshowViewModel
|
import com.example.hpostesting.presentation.dashboard.ui.slideshow.SlideshowViewModel
|
||||||
import `in`.sminnovations.hpostesting.databinding.FragmentSlideshowBinding
|
import `in`.sminnovations.hpostesting.databinding.FragmentSlideshowBinding
|
||||||
|
|
||||||
|
|
||||||
class SlideshowFragment : Fragment() {
|
class SlideshowFragment : Fragment() {
|
||||||
|
|
||||||
private var _binding: FragmentSlideshowBinding? = null
|
private var _binding: FragmentSlideshowBinding? = null
|
||||||
@@ -20,7 +21,7 @@ class SlideshowFragment : Fragment() {
|
|||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
inflater: LayoutInflater,
|
inflater: LayoutInflater,
|
||||||
container: ViewGroup?,
|
container: ViewGroup?,
|
||||||
savedInstanceState: Bundle?
|
savedInstanceState: Bundle?,
|
||||||
): View {
|
): View {
|
||||||
val slideshowViewModel =
|
val slideshowViewModel =
|
||||||
ViewModelProvider(this).get(SlideshowViewModel::class.java)
|
ViewModelProvider(this).get(SlideshowViewModel::class.java)
|
||||||
@@ -28,6 +29,12 @@ class SlideshowFragment : Fragment() {
|
|||||||
_binding = FragmentSlideshowBinding.inflate(inflater, container, false)
|
_binding = FragmentSlideshowBinding.inflate(inflater, container, false)
|
||||||
val root: View = binding.root
|
val root: View = binding.root
|
||||||
|
|
||||||
|
val pInfo = requireActivity().packageManager.getPackageInfo(
|
||||||
|
requireActivity().packageName, 0
|
||||||
|
)
|
||||||
|
val version = pInfo.versionName
|
||||||
|
binding.textSlideshow.text = version
|
||||||
|
|
||||||
// val textView: TextView = binding.textSlideshow
|
// val textView: TextView = binding.textSlideshow
|
||||||
// slideshowViewModel.text.observe(viewLifecycleOwner) {
|
// slideshowViewModel.text.observe(viewLifecycleOwner) {
|
||||||
// textView.text = it
|
// textView.text = it
|
||||||
|
|||||||
@@ -102,6 +102,11 @@ class HemoCubeFragment : Fragment() {
|
|||||||
(activity as HemocubeActivity).finish()
|
(activity as HemocubeActivity).finish()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
resetKitCount()
|
||||||
|
val intent = Intent(context, KitScanActivity::class.java)
|
||||||
|
startActivity(intent)
|
||||||
|
(activity as HemocubeActivity).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -377,7 +382,7 @@ class HemoCubeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (_: Exception) {
|
} catch (_: Exception) {
|
||||||
|
Toast.makeText( requireContext(), "Error while processing device data", Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user