navigation is done

This commit is contained in:
smileomi18@gmail.com
2023-08-04 13:41:51 +05:30
parent 1b893c5730
commit a491343a43
3 changed files with 46 additions and 0 deletions

View File

@@ -13,12 +13,15 @@ import android.view.ViewGroup
import android.widget.Toast
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.navigation.fragment.findNavController
import com.example.hpostesting.data.DataHolder
import com.example.hpostesting.data.constant.Constants
import com.example.hpostesting.data.constant.HemoCubeCommands
import com.example.hpostesting.data.model.patient.DeviceData
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
import com.example.hpostesting.presentation.UsbServiceListener
import com.example.hpostesting.presentation.dashboard.HomeFragment
import com.example.hpostesting.presentation.testRight.TestRightExpSample
import com.example.hpostesting.presentation.utils.MyDialogListener
import com.example.hpostesting.presentation.utils.UIUtils
import `in`.sminnovations.hpostesting.R
@@ -72,6 +75,9 @@ class HemoCubeFragment : Fragment() {
Toast.makeText(
requireContext(), "Test Results Uploaded Successfully", Toast.LENGTH_SHORT
).show()
findNavController().navigate(R.id.action_hemocubeFragment_to_homeFragment)
}
binding.progressBar.visibility = View.GONE
}
@@ -132,6 +138,7 @@ class HemoCubeFragment : Fragment() {
binding.btnSubmit.setOnClickListener {
binding.progressBar.visibility = View.VISIBLE
getResult()
}
binding.btnSubmit.isEnabled = true
@@ -139,6 +146,8 @@ class HemoCubeFragment : Fragment() {
binding.btnBuffer.setOnClickListener {
startBuffer()
}
}
private fun listenToHemoCube() {

View File

@@ -71,6 +71,29 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_blood_group"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btn_submit">
<AutoCompleteTextView
android:id="@+id/et_blood_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/select_blood_group"
android:inputType="none"
android:labelFor="@id/til_blood_group"
app:simpleItems="@array/blood_group" />
</com.google.android.material.textfield.TextInputLayout>
<Button
android:id="@+id/btn_kit"
android:layout_width="wrap_content"

View File

@@ -47,4 +47,18 @@
app:popUpTo="@id/mobile_navigation"
app:popUpToInclusive="true"/>
</fragment>
<fragment
android:id="@+id/hemocubeFragment"
android:name="com.example.hpostesting.presentation.hemocube.HemoCubeFragment"
android:label="fragment_hemocube"
tools:layout="@layout/fragment_hemo_cube_reference" >
<action
android:id="@+id/action_hemocubeFragment_to_homeFragment"
app:destination="@id/nav_home"
app:popUpTo="@id/mobile_navigation"
app:popUpToInclusive="true"/>
</fragment>
</navigation>