deviceData function called
This commit is contained in:
@@ -10,13 +10,13 @@ plugins {
|
||||
//apply plugin: 'kotlin-android'
|
||||
|
||||
android {
|
||||
compileSdk 33
|
||||
compileSdk 34
|
||||
namespace 'in.sminnovations.hpostesting'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "in.sminnovations.hpostesting"
|
||||
minSdk 21
|
||||
targetSdk 33
|
||||
targetSdk 34
|
||||
versionCode 2
|
||||
versionName "2.0.1"
|
||||
|
||||
|
||||
@@ -100,9 +100,12 @@ class HemoCubeFragment : Fragment() {
|
||||
binding.progressBar.visibility = View.GONE
|
||||
}
|
||||
|
||||
hemoCubeViewModel.getDeviceData(sharedPreferences.getString(Constants.USER_ID,""))
|
||||
|
||||
hemoCubeViewModel.deviceData.observe(viewLifecycleOwner) {
|
||||
currentDeviceData = it
|
||||
showToast(calculateRatio(0.17).toString())
|
||||
|
||||
}
|
||||
|
||||
hemoCubeViewModel.networkStatusLiveData.observe(viewLifecycleOwner) { isNetworkAvailable ->
|
||||
|
||||
@@ -62,8 +62,8 @@ class HemoCubeViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun getDeviceData(deviceId: String) = viewModelScope.launch {
|
||||
deviceData.postValue(repository.getDeviceDataById(deviceId))
|
||||
fun getDeviceData(deviceId: String?) = viewModelScope.launch {
|
||||
deviceData.postValue(deviceId?.let { repository.getDeviceDataById(it) })
|
||||
}
|
||||
|
||||
private fun addResultTestToDb() {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4" />
|
||||
app:layout_constraintTop_toBottomOf="@id/til_blood_group" />
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
@@ -79,10 +79,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_submit">
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/et_blood_group"
|
||||
@@ -90,7 +89,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/select_blood_group"
|
||||
android:inputType="none"
|
||||
android:visibility="gone"
|
||||
android:labelFor="@id/til_blood_group"
|
||||
app:simpleItems="@array/blood_group" />
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ buildscript {
|
||||
kotlin_version = '1.8.21'
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.1.0'
|
||||
classpath 'com.android.tools.build:gradle:8.0.2'
|
||||
classpath 'com.google.gms:google-services:4.3.15'
|
||||
classpath 'com.google.firebase:firebase-appdistribution-gradle:4.0.0'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user