added some log.d calls for testing
This commit is contained in:
@@ -72,6 +72,7 @@ class DashboardActivity : AppCompatActivity(), IDataCollector {
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
|
||||||
binding = ActivityDashboardBinding.inflate(layoutInflater)
|
binding = ActivityDashboardBinding.inflate(layoutInflater)
|
||||||
sharedPreferences = this.getSharedPreferences("HEMOCUBE", Context.MODE_PRIVATE)
|
sharedPreferences = this.getSharedPreferences("HEMOCUBE", Context.MODE_PRIVATE)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ import java.text.SimpleDateFormat
|
|||||||
import java.util.Calendar
|
import java.util.Calendar
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean
|
||||||
import java.util.zip.ZipEntry
|
import java.util.zip.ZipEntry
|
||||||
import java.util.zip.ZipInputStream
|
import java.util.zip.ZipInputStream
|
||||||
|
|
||||||
@@ -84,6 +85,7 @@ class HomeFragment : Fragment() {
|
|||||||
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?,
|
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?,
|
||||||
): View? {
|
): View? {
|
||||||
_binding = FragmentHomeBinding.inflate(inflater, container, false)
|
_binding = FragmentHomeBinding.inflate(inflater, container, false)
|
||||||
|
Log.d("OnCreate Home Fragment", "HomeFragment calls")
|
||||||
|
|
||||||
// Check if _binding is null
|
// Check if _binding is null
|
||||||
if (_binding == null) {
|
if (_binding == null) {
|
||||||
@@ -134,6 +136,7 @@ class HomeFragment : Fragment() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
viewModel.networkStatusLiveData?.observe(viewLifecycleOwner) { isConnected ->
|
viewModel.networkStatusLiveData?.observe(viewLifecycleOwner) { isConnected ->
|
||||||
|
Log.d("NETWORK OBSERVE", "OBSERVE CALLED")
|
||||||
if (isConnected) {
|
if (isConnected) {
|
||||||
binding.internetAvailableCL.visibility = View.VISIBLE
|
binding.internetAvailableCL.visibility = View.VISIBLE
|
||||||
binding.internetNotAvailableCL.visibility = View.GONE
|
binding.internetNotAvailableCL.visibility = View.GONE
|
||||||
@@ -146,6 +149,9 @@ class HomeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hemoCubeViewModel.allUserData.observe(viewLifecycleOwner) { originalUserDataList ->
|
hemoCubeViewModel.allUserData.observe(viewLifecycleOwner) { originalUserDataList ->
|
||||||
|
|
||||||
|
Log.d("LOCAL_DB OBSERVE", "OBSERVE CALLED")
|
||||||
|
|
||||||
val resultList = MolbioV2ResultRequest(mutableListOf())
|
val resultList = MolbioV2ResultRequest(mutableListOf())
|
||||||
originalUserDataList.forEach { userData ->
|
originalUserDataList.forEach { userData ->
|
||||||
Log.d(
|
Log.d(
|
||||||
@@ -197,6 +203,7 @@ class HomeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
binding.internetAvailableCL.visibility = View.GONE
|
binding.internetAvailableCL.visibility = View.GONE
|
||||||
binding.pendingTest.visibility = View.GONE
|
binding.pendingTest.visibility = View.GONE
|
||||||
@@ -441,6 +448,7 @@ class HomeFragment : Fragment() {
|
|||||||
hemoCubeViewModel.resultUpload.observe(viewLifecycleOwner) {
|
hemoCubeViewModel.resultUpload.observe(viewLifecycleOwner) {
|
||||||
when (it) {
|
when (it) {
|
||||||
is Result.Success -> {
|
is Result.Success -> {
|
||||||
|
Log.d("MOLBIO UPLOAD", "RESULT SUCCESS")
|
||||||
it.data.data?.forEach { id ->
|
it.data.data?.forEach { id ->
|
||||||
id.rawData?.let { it1 ->
|
id.rawData?.let { it1 ->
|
||||||
hemoCubeViewModel.updateMolbioFlag(
|
hemoCubeViewModel.updateMolbioFlag(
|
||||||
@@ -448,18 +456,22 @@ class HomeFragment : Fragment() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
is Result.Error -> {
|
is Result.Error -> {
|
||||||
binding.btnSubmit.visibility = View.VISIBLE
|
binding.btnSubmit.visibility = View.VISIBLE
|
||||||
//Remove this line of code while deploying to IOCL
|
//Remove this line of code while deploying to IOCL
|
||||||
|
|
||||||
it.exception.let { message ->
|
it.exception.let { message ->
|
||||||
Toast.makeText(activity, "An error occurred: $message", Toast.LENGTH_LONG)
|
Toast.makeText(activity, "An error occurred: $message", Toast.LENGTH_LONG)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {}
|
else -> {
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
|
|
||||||
fun uploadResult(molbioV2ResultRequest: MolbioV2ResultRequest) = viewModelScope.launch {
|
fun uploadResult(molbioV2ResultRequest: MolbioV2ResultRequest) = viewModelScope.launch {
|
||||||
resultUpload.postValue(Result.Loading())
|
resultUpload.postValue(Result.Loading())
|
||||||
|
Log.d("API CALL", "UPLOADED RESULT")
|
||||||
repository.uploadResults(molbioV2ResultRequest).let {
|
repository.uploadResults(molbioV2ResultRequest).let {
|
||||||
resultUpload.postValue(it)
|
resultUpload.postValue(it)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user