code cleanup.

This commit is contained in:
vsuryakumar
2023-01-25 11:29:20 +05:30
parent cb479589ca
commit 2c144e3e67
4 changed files with 10 additions and 13 deletions

View File

@@ -1,16 +1,11 @@
package com.example.refactoredapp
import android.app.Application
import android.graphics.Color
import android.graphics.PorterDuff
import android.view.View
import android.widget.Button
import com.example.refactoredapp.data.model.SampleDetails
class MyApplication : Application() {
private val sampleDetails = SampleDetails("Change it later");
fun getSampleDetails() : SampleDetails = sampleDetails
// private val sampleDetails = PatientDetails("Change it later");
// fun getSampleDetails() : PatientDetails = sampleDetails
// fun setSampleDetails(sample: SampleDetails) {sampleDetails = sample}
}

View File

@@ -6,6 +6,8 @@ object Constants {
const val WRITE_TIMEOUT_MILLIS = 60000 // 1 min
const val READ_TIMEOUT_MILLIS = 60000 // 1 min
// const val TEST_RIGHT_TOTAL_PIXEL = 3694
const val TEST_RIGHT_TOTAL_PIXEL = 12
const val TEST_RIGHT_TOTAL_PIXEL = 3694
// const val TEST_RIGHT_TOTAL_PIXEL = 12
const val MAXIMUM_TEST_ALLOWED_BEFORE_REFERENCE = 10
}

View File

@@ -4,5 +4,5 @@ object DataHolder {
var isStoragePermissionGranted = false
var isAppFolderCreated = false
var isReferenceTaken = false
// var isReferenceTaken = false
}

View File

@@ -5,11 +5,11 @@ import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.example.refactoredapp.R
import com.example.refactoredapp.data.model.SampleDetails
import com.example.refactoredapp.data.model.PatientData
class RVAdapter : RecyclerView.Adapter<RVAdapter.ViewHolder>() {
private val dataset = ArrayList<SampleDetails>()
private val dataset = ArrayList<PatientData>()
class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
@@ -30,7 +30,7 @@ class RVAdapter : RecyclerView.Adapter<RVAdapter.ViewHolder>() {
return dataset.size
}
fun updateDataSet(newDataSet: ArrayList<SampleDetails>) {
fun updateDataSet(newDataSet: ArrayList<PatientData>) {
dataset.clear()
dataset.addAll(newDataSet)
notifyDataSetChanged()