Функционал механика ч.2
This commit is contained in:
parent
9b567ff5f8
commit
cac9026c88
@ -64,6 +64,7 @@
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:ignore="GoogleAppIndexingWarning">
|
||||
|
||||
@ -78,6 +79,8 @@
|
||||
|
||||
<activity
|
||||
android:name="ru.tele2med.mobile.presentation.ui.splash.SplashActivity"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
@ -100,6 +103,7 @@
|
||||
|
||||
<activity
|
||||
android:name="ru.tele2med.mobile.presentation.ui.auth0.SplashAuth0Activity"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter
|
||||
|
@ -304,6 +304,32 @@ interface ApiService {
|
||||
): Single<TechResponse>
|
||||
|
||||
|
||||
|
||||
@Multipart
|
||||
@POST("${API_BASE_URL}waybills/tech_control/update/{uniq_id}")
|
||||
fun updateTech(
|
||||
@Path("uniq_id") uuid: String,
|
||||
@Part("uniq_id") uuidPart: RequestBody,
|
||||
@Part("vehicle_id") vehicleId: RequestBody?,
|
||||
@Part("date_") date: RequestBody?,
|
||||
@Part("time_") time: RequestBody?,
|
||||
@Part("result_id") resultId: RequestBody?,
|
||||
@Header("token") token: String? = "iddqd",
|
||||
@Header("Authorization") tokenUser: String?
|
||||
): Single<TechUpdateListResponse>
|
||||
|
||||
|
||||
@Multipart
|
||||
@POST("${API_BASE_URL}waybills/checklist/show/{uniq_id}")
|
||||
fun show(
|
||||
@Path("uniq_id") uuid: String,
|
||||
@Part("uniq_id") uuidPart: RequestBody,
|
||||
@Header("token") token: String? = "iddqd",
|
||||
@Header("Authorization") tokenUser: String?
|
||||
): Single<TechShowListResponse>
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*-- Дальше OLD --*/
|
||||
|
@ -0,0 +1 @@
|
||||
package ru.tele2med.mobile.data.api.entity.response
import ru.tele2med.mobile.domain.entity.DataCheckup
import ru.tele2med.mobile.domain.entity.DataTechCheckup
import ru.tele2med.mobile.domain.entity.DataTechShow
import ru.tele2med.mobile.domain.entity.DataTechUpdate
data class TechShowListResponse(
val af: String,
val status: String,
val message: String,
val data: DataTechShow
)
|
@ -0,0 +1 @@
|
||||
package ru.tele2med.mobile.data.api.entity.response
import ru.tele2med.mobile.domain.entity.DataCheckup
import ru.tele2med.mobile.domain.entity.DataTechCheckup
import ru.tele2med.mobile.domain.entity.DataTechUpdate
data class TechUpdateListResponse(
val af: String,
val status: String,
val message: String,
val data: DataTechUpdate
)
|
@ -79,6 +79,23 @@ class DataConverter {
|
||||
)
|
||||
|
||||
|
||||
fun toTechUpdate(list: TechUpdateListResponse): TechUpdateList =
|
||||
TechUpdateList(
|
||||
af = list.af,
|
||||
status = list.status,
|
||||
data = list.data,
|
||||
message = list.message
|
||||
)
|
||||
|
||||
fun toTechShow(list: TechShowListResponse): TechShowList =
|
||||
TechShowList(
|
||||
af = list.af,
|
||||
status = list.status,
|
||||
data = list.data,
|
||||
message = list.message
|
||||
)
|
||||
|
||||
|
||||
fun toTech(tech: TechResponse): Tech =
|
||||
Tech(
|
||||
af = tech.af,
|
||||
|
@ -1,15 +1,12 @@
|
||||
package ru.tele2med.mobile.data.repository
|
||||
|
||||
import ru.tele2med.mobile.domain.entity.MedicalCheckupList
|
||||
import ru.tele2med.mobile.domain.entity.QR
|
||||
import ru.tele2med.mobile.domain.repository.QRRepository
|
||||
import ru.tele2med.mobile.presentation.util.Prefs
|
||||
import io.reactivex.Single
|
||||
import okhttp3.MediaType
|
||||
import okhttp3.RequestBody
|
||||
import ru.tele2med.mobile.data.api.ApiService
|
||||
import ru.tele2med.mobile.domain.entity.Tech
|
||||
import ru.tele2med.mobile.domain.entity.TechCheckupList
|
||||
import ru.tele2med.mobile.domain.entity.*
|
||||
import ru.tele2med.mobile.domain.repository.TechRepository
|
||||
|
||||
|
||||
@ -69,4 +66,47 @@ class TechRepositoryImpl(
|
||||
.map(dataConverter::toTechCheckupListAll)
|
||||
|
||||
|
||||
override fun updateTech(
|
||||
id: String,
|
||||
vehicleId: String,
|
||||
date: String,
|
||||
time: String,
|
||||
resultId: String
|
||||
): Single<TechUpdateList> =
|
||||
apiService
|
||||
.updateTech(
|
||||
uuid = id,
|
||||
uuidPart = RequestBody.create(
|
||||
MediaType.parse("text/plain"), id
|
||||
),
|
||||
vehicleId = RequestBody.create(
|
||||
MediaType.parse("text/plain"), vehicleId
|
||||
),
|
||||
date = RequestBody.create(
|
||||
MediaType.parse("text/plain"), date
|
||||
),
|
||||
time = RequestBody.create(
|
||||
MediaType.parse("text/plain"), time
|
||||
),
|
||||
resultId = RequestBody.create(
|
||||
MediaType.parse("text/plain"), resultId
|
||||
),
|
||||
tokenUser = "Bearer ${prefs.getTokenUser().toString()}"
|
||||
)
|
||||
.map(dataConverter::toTechUpdate)
|
||||
|
||||
override fun showTech(
|
||||
id: String
|
||||
): Single<TechShowList> =
|
||||
apiService
|
||||
.show(
|
||||
uuid = id,
|
||||
uuidPart = RequestBody.create(
|
||||
MediaType.parse("text/plain"), id
|
||||
),
|
||||
tokenUser = "Bearer ${prefs.getTokenUser().toString()}"
|
||||
)
|
||||
.map(dataConverter::toTechShow)
|
||||
|
||||
|
||||
}
|
@ -14,9 +14,13 @@ import org.kodein.di.generic.singleton
|
||||
import retrofit2.Retrofit
|
||||
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
|
||||
import retrofit2.converter.gson.GsonConverterFactory
|
||||
import java.security.KeyStore
|
||||
import java.security.SecureRandom
|
||||
import java.security.cert.CertificateException
|
||||
import java.security.cert.X509Certificate
|
||||
import java.util.*
|
||||
import java.util.concurrent.TimeUnit
|
||||
import javax.net.ssl.SSLSession
|
||||
import javax.net.ssl.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
|
||||
@ -55,7 +59,6 @@ fun verify(hostname: String?, session: SSLSession?): Boolean {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private fun provideOkHttpClient(network: Interceptor, query: Interceptor): OkHttpClient =
|
||||
OkHttpClient.Builder()
|
||||
.connectTimeout(TIMEOUT, TimeUnit.SECONDS)
|
||||
@ -68,17 +71,68 @@ private fun provideOkHttpClient(network: Interceptor, query: Interceptor): OkHtt
|
||||
.build()
|
||||
|
||||
|
||||
private fun getUnsafeOkHttpClient(): OkHttpClient? {
|
||||
return try {
|
||||
// Create a trust manager that does not validate certificate chains
|
||||
val trustAllCerts = arrayOf<TrustManager>(
|
||||
object : X509TrustManager {
|
||||
@Throws(CertificateException::class)
|
||||
override fun checkClientTrusted(
|
||||
chain: Array<X509Certificate?>?,
|
||||
authType: String?
|
||||
) {
|
||||
}
|
||||
|
||||
@Throws(CertificateException::class)
|
||||
override fun checkServerTrusted(
|
||||
chain: Array<X509Certificate?>?,
|
||||
authType: String?
|
||||
) {
|
||||
}
|
||||
|
||||
override fun getAcceptedIssuers(): Array<X509Certificate?>? {
|
||||
return arrayOf()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
// Install the all-trusting trust manager
|
||||
val sslContext = SSLContext.getInstance("SSL")
|
||||
sslContext.init(null, trustAllCerts, SecureRandom())
|
||||
// Create an ssl socket factory with our all-trusting manager
|
||||
val sslSocketFactory = sslContext.socketFactory
|
||||
val trustManagerFactory: TrustManagerFactory =
|
||||
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm())
|
||||
trustManagerFactory.init(null as KeyStore?)
|
||||
val trustManagers: Array<TrustManager> =
|
||||
trustManagerFactory.trustManagers
|
||||
check(!(trustManagers.size != 1 || trustManagers[0] !is X509TrustManager)) {
|
||||
"Unexpected default trust managers:" + trustManagers.contentToString()
|
||||
}
|
||||
|
||||
val trustManager =
|
||||
trustManagers[0] as X509TrustManager
|
||||
|
||||
|
||||
val builder = OkHttpClient.Builder()
|
||||
builder.sslSocketFactory(sslSocketFactory, trustManager)
|
||||
builder.hostnameVerifier(HostnameVerifier { _, _ -> true })
|
||||
builder.build()
|
||||
} catch (e: Exception) {
|
||||
throw RuntimeException(e)
|
||||
}
|
||||
}
|
||||
|
||||
private fun provideRetrofit(client: OkHttpClient, gson: Gson): Retrofit =
|
||||
Retrofit.Builder()
|
||||
.addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
|
||||
.client(client)
|
||||
.client(getUnsafeOkHttpClient())
|
||||
//.client(client)
|
||||
.baseUrl(serverUrl)
|
||||
.build()
|
||||
|
||||
|
||||
|
||||
|
||||
private class SessionCookieJar : CookieJar {
|
||||
private var cookies: List<Cookie>? = null
|
||||
override fun saveFromResponse(url: HttpUrl, cookies: List<Cookie>) {
|
||||
|
@ -0,0 +1,23 @@
|
||||
package ru.tele2med.mobile.domain.entity
|
||||
|
||||
data class DataShow(
|
||||
val id: String,
|
||||
val uniq_id: String,
|
||||
val template_checklist_uniq_id: String,
|
||||
val name: String?,
|
||||
val type_id: String?,
|
||||
val type_name: String?,
|
||||
val required_field: String?,
|
||||
val need_photo_if_no: String?,
|
||||
val order: String,
|
||||
val comment: String,
|
||||
val date_create: String,
|
||||
val date_update: String,
|
||||
val date_delete: String,
|
||||
val enabled: String,
|
||||
val tree: String?,
|
||||
val clf_uniq_id: String,
|
||||
val has_data: String,
|
||||
val value: String
|
||||
|
||||
)
|
@ -0,0 +1,19 @@
|
||||
package ru.tele2med.mobile.domain.entity
|
||||
|
||||
data class DataTechShow(
|
||||
val id: String,
|
||||
val uniq_id: String,
|
||||
val template_checklist_uniq_id: String,
|
||||
val waybill_uniq_id: String?,
|
||||
val techcontrol_uuid: String?,
|
||||
val organization_id: String?,
|
||||
val name: String?,
|
||||
val comment: String?,
|
||||
val date_create: String,
|
||||
val date_update: String,
|
||||
val date_delete: String,
|
||||
val enabled: String,
|
||||
val data: List<DataShow>
|
||||
|
||||
|
||||
)
|
@ -0,0 +1,16 @@
|
||||
package ru.tele2med.mobile.domain.entity
|
||||
|
||||
data class DataTechUpdate(
|
||||
val id: String,
|
||||
val uniq_id: String,
|
||||
val user_uniq_id: String,
|
||||
val tech_control_uniq_id: String,
|
||||
val solution: String?,
|
||||
val description: String?,
|
||||
val tech: String,
|
||||
val date_create: String,
|
||||
val date_update: String,
|
||||
val date_delete: String,
|
||||
val enabled: String
|
||||
|
||||
)
|
@ -0,0 +1,8 @@
|
||||
package ru.tele2med.mobile.domain.entity
|
||||
|
||||
data class TechShowList(
|
||||
val af: String,
|
||||
val status: String,
|
||||
val message: String,
|
||||
val data: DataTechShow
|
||||
)
|
@ -0,0 +1,8 @@
|
||||
package ru.tele2med.mobile.domain.entity
|
||||
|
||||
data class TechUpdateList(
|
||||
val af: String,
|
||||
val status: String,
|
||||
val message: String,
|
||||
val data: DataTechUpdate
|
||||
)
|
@ -1,11 +1,8 @@
|
||||
package ru.tele2med.mobile.domain.interactor
|
||||
|
||||
import ru.tele2med.mobile.domain.entity.MedicalCheckupList
|
||||
import ru.tele2med.mobile.domain.entity.QR
|
||||
import ru.tele2med.mobile.domain.repository.QRRepository
|
||||
import io.reactivex.Single
|
||||
import ru.tele2med.mobile.domain.entity.Tech
|
||||
import ru.tele2med.mobile.domain.entity.TechCheckupList
|
||||
import ru.tele2med.mobile.domain.entity.*
|
||||
import ru.tele2med.mobile.domain.repository.TechRepository
|
||||
|
||||
class TechInteractor(
|
||||
@ -17,5 +14,18 @@ class TechInteractor(
|
||||
fun getTechCheckupList(offset: Int, limit: Int): Single<TechCheckupList> =
|
||||
techRepository.getTechCheckupAll(offset, limit)
|
||||
|
||||
fun updateTech(
|
||||
id: String,
|
||||
vehicleId: String,
|
||||
date: String,
|
||||
time: String,
|
||||
resultId: String
|
||||
): Single<TechUpdateList> =
|
||||
techRepository.updateTech(id, vehicleId, date, time, resultId)
|
||||
|
||||
fun showTech(
|
||||
id: String,
|
||||
): Single<TechShowList> =
|
||||
techRepository.showTech(id)
|
||||
|
||||
}
|
@ -1,13 +1,21 @@
|
||||
package ru.tele2med.mobile.domain.repository
|
||||
|
||||
import ru.tele2med.mobile.domain.entity.MedicalCheckupList
|
||||
import ru.tele2med.mobile.domain.entity.QR
|
||||
import io.reactivex.Single
|
||||
import ru.tele2med.mobile.domain.entity.Tech
|
||||
import ru.tele2med.mobile.domain.entity.TechCheckupList
|
||||
import ru.tele2med.mobile.domain.entity.*
|
||||
|
||||
interface TechRepository {
|
||||
fun getTech(id: String): Single<Tech>
|
||||
fun getTechCheckupAll(offset: Int, limit: Int): Single<TechCheckupList>
|
||||
fun updateTech(
|
||||
id: String,
|
||||
vehicleId: String,
|
||||
date: String,
|
||||
time: String,
|
||||
resultId: String
|
||||
): Single<TechUpdateList>
|
||||
|
||||
fun showTech(
|
||||
id: String,
|
||||
): Single<TechShowList>
|
||||
|
||||
}
|
||||
|
@ -93,6 +93,11 @@ object NavScreens {
|
||||
|
||||
fun getTechCheckup(dataTech: DataTech): TechCheckupScreen = TechCheckupScreen(dataTech)
|
||||
|
||||
fun getTechCheckupInfo(dataTech: DataTech): TechCheckupScreen = TechCheckupScreen(dataTech)
|
||||
|
||||
fun getTechCheckupTests(dataTech: DataTech): TechCheckupScreen = TechCheckupScreen(dataTech)
|
||||
|
||||
|
||||
fun getMedicalCheckups(): CheckupsScreen = CheckupsScreen()
|
||||
|
||||
fun getAlkoScreen(): AlkoScreen = AlkoScreen()
|
||||
|
@ -38,7 +38,6 @@ class TechListPresenter(
|
||||
viewState.hideLoading()
|
||||
}
|
||||
.subscribe({
|
||||
|
||||
navRouter.openTechCheckupScreen(it.data)
|
||||
}, {
|
||||
if (it is ApiException) {
|
||||
|
@ -5,7 +5,9 @@ import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter
|
||||
import com.google.gson.Gson
|
||||
import ru.tele2med.mobile.R
|
||||
import ru.tele2med.mobile.domain.entity.DataTech
|
||||
import ru.tele2med.mobile.presentation.ui.menu.items.tech.list.techCheckup.info.TechCheckupInfoFragment
|
||||
import ru.tele2med.mobile.presentation.ui.menu.items.tech.list.techCheckup.tests.TechCheckupTestsFragment
|
||||
|
||||
@ -14,9 +16,11 @@ class TechCheckupAdapter(val context: Context, fm: FragmentManager, private var
|
||||
private var fragments: MutableList<Fragment> = mutableListOf()
|
||||
|
||||
override fun getItem(position: Int): Fragment {
|
||||
val gson = Gson()
|
||||
val data = gson.fromJson(dataTech, DataTech::class.java)
|
||||
return when (position) {
|
||||
0 -> {
|
||||
val fragment = TechCheckupInfoFragment.getInstance(dataTech)
|
||||
val fragment = TechCheckupInfoFragment.getInstance(data)
|
||||
|
||||
val arguments = Bundle()
|
||||
fragment.arguments = arguments
|
||||
@ -24,7 +28,7 @@ class TechCheckupAdapter(val context: Context, fm: FragmentManager, private var
|
||||
fragment
|
||||
}
|
||||
1 -> {
|
||||
val fragment = TechCheckupTestsFragment.getInstance(dataTech)
|
||||
val fragment = TechCheckupTestsFragment.getInstance(data)
|
||||
val arguments = Bundle()
|
||||
fragment.arguments = arguments
|
||||
fragments.add(fragment)
|
||||
|
@ -2,12 +2,15 @@ package ru.tele2med.mobile.presentation.ui.menu.items.tech.list.techCheckup
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import ru.tele2med.mobile.domain.entity.DataTech
|
||||
import ru.tele2med.mobile.presentation.ui.menu.items.tech.list.techCheckup.info.TechCheckupInfoFragment
|
||||
import ru.terrakok.cicerone.android.support.SupportAppScreen
|
||||
|
||||
class TechCheckupScreen(val dataTech: DataTech) : SupportAppScreen() {
|
||||
|
||||
override fun getFragment(): Fragment {
|
||||
// return TechCheckupInfoFragment.getInstance(dataTech)
|
||||
return TechCheckupFragment.getInstance(dataTech)
|
||||
|
||||
}
|
||||
|
||||
override fun getScreenKey(): String {
|
||||
|
@ -22,13 +22,10 @@ import ru.tele2med.mobile.presentation.ui.menu.MenuActivity
|
||||
import ru.tele2med.mobile.presentation.ui.menu.ReviewActivity
|
||||
import ru.tele2med.mobile.presentation.ui.menu.base.BaseMenuFragment
|
||||
import ru.tele2med.mobile.presentation.util.providePresenter
|
||||
import kotlinx.android.synthetic.main.fragment_medical_checkup.*
|
||||
import kotlinx.android.synthetic.main.fragment_tech_checkup.*
|
||||
import kotlinx.android.synthetic.main.toolbar_with_help.*
|
||||
import ru.tele2med.mobile.BuildConfig
|
||||
import ru.tele2med.mobile.domain.entity.DataTech
|
||||
import ru.tele2med.mobile.presentation.ui.auth.number_enter.NumberEnterFragment
|
||||
import ru.tele2med.mobile.presentation.ui.menu.items.tech.list.techCheckup.tests.TechCheckupTestsFragment
|
||||
import ru.tele2med.mobile.presentation.ui.menu.items.tech.list.techCheckup.tests.TechCheckupTestsPresenter
|
||||
import ru.tele2med.mobile.presentation.ui.menu.items.medicalCheckup.MedicalCheckupFragment
|
||||
|
||||
|
||||
class TechCheckupInfoFragment : BaseMenuFragment(), TechCheckupInfoView {
|
||||
@ -72,8 +69,16 @@ class TechCheckupInfoFragment : BaseMenuFragment(), TechCheckupInfoView {
|
||||
}
|
||||
}
|
||||
|
||||
tvDriverTitle.focusable
|
||||
tvDriverTitle.requestFocus()
|
||||
var dataString = this.requireArguments().getString(DATA_QR)
|
||||
|
||||
Log.v("DATA", "data 32 = $DATA_QR")
|
||||
|
||||
val gson = Gson()
|
||||
val data = gson.fromJson(dataString, DataTech::class.java)
|
||||
|
||||
|
||||
// tvDriverTitle.focusable
|
||||
// tvDriverTitle.requestFocus()
|
||||
presenter.showCheckUp()
|
||||
|
||||
initRecycler()
|
||||
@ -88,6 +93,16 @@ class TechCheckupInfoFragment : BaseMenuFragment(), TechCheckupInfoView {
|
||||
private fun initRecycler() {
|
||||
println("initRecycler")
|
||||
|
||||
val args = arguments
|
||||
val index = args?.toString() // getString("data", "")
|
||||
Log.v(
|
||||
"TechCheckupInfoFragment", "data = $index ${args?.getString("data")}"
|
||||
)
|
||||
|
||||
Log.v("TechCheckupInfoFragment", "args = ${arguments?.getString("data")}")
|
||||
val gson = Gson()
|
||||
val data = gson.fromJson(DATA_QR, DataTech::class.java)
|
||||
fillData(data)
|
||||
refresh.setOnRefreshListener {
|
||||
println("setOnRefreshListener")
|
||||
|
||||
@ -95,6 +110,16 @@ class TechCheckupInfoFragment : BaseMenuFragment(), TechCheckupInfoView {
|
||||
|
||||
}
|
||||
|
||||
startTest.setOnClickListener {
|
||||
presenter.updateTech(
|
||||
data.uniq_id,
|
||||
data.vehicle_id,
|
||||
data.date_,
|
||||
data.time_,
|
||||
data.result_id
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("StringFormatInvalid")
|
||||
@ -108,122 +133,14 @@ class TechCheckupInfoFragment : BaseMenuFragment(), TechCheckupInfoView {
|
||||
var checkupVideoString: String
|
||||
var checkupVideoUrl: Uri
|
||||
|
||||
tvDriverNumber.text = dataTech.vehicle_name
|
||||
tvDrivers.text = dataTech.mechanic_name
|
||||
tvOrgName.text = dataTech.organization_id
|
||||
tvNumberPL.text = dataTech.waybill_name
|
||||
tvDatePL.text = dataTech.datetime
|
||||
|
||||
|
||||
/* profilePhoto = "${BuildConfig.API_BASE_URL}${dataQR.profilePhoto}"
|
||||
profilePhotoUrl = profilePhoto.toUri()
|
||||
checkupPhoto =
|
||||
"${BuildConfig.API_BASE_URL}${dataQR.checkupPhoto?.replace("/media", "media")}"
|
||||
checkupPhotoUrl = checkupPhoto.toUri()
|
||||
checkupVideoString =
|
||||
"${BuildConfig.API_BASE_URL}${dataQR.checkupVideo?.replace("/media", "media")}"
|
||||
checkupVideoUrl = checkupVideoString.toUri()
|
||||
|
||||
|
||||
tvMainInfoTitle.requestFocus()
|
||||
|
||||
tvMainInfoTitle.text = resources.getString(R.string.block_title_main_info, dataQR.idcheckup)
|
||||
tvDriverNumber.text = dataQR.login
|
||||
tvSex.text = dataQR.sex_name
|
||||
tvSurname.text = dataQR.lastname
|
||||
tvName.text = dataQR.name
|
||||
tvPatronymic.text = dataQR.oldlastname
|
||||
tvBirthday.text = dataQR.birthday
|
||||
tvOrgName.text = dataQR.organization
|
||||
tvCheckupDate.text = dataQR.exam_date
|
||||
tvCheckupBeginTime.text = dataQR.exam_timestart
|
||||
tvCheckupEndTime.text = dataQR.exam_timeend
|
||||
tvCheckupType.text = dataQR.inspectiontype
|
||||
tvCheckupTerminal.text = dataQR.terminal_name
|
||||
tvCheckupStatus.text = dataQR.exam_state_name
|
||||
tvCheckupMedic.text = dataQR.medic_fio
|
||||
tvResultAuto.text = dataQR.exam_result_auto_txt
|
||||
tvResultMedic.text = dataQR.exam_result_med_txt
|
||||
tvMedicComment.text = dataQR.medic_comment
|
||||
tvCheckupResultTime.text = dataQR.exam_result_datetime
|
||||
// ivCheckupPhoto.setImageURI(checkupPhotoUrl)
|
||||
|
||||
|
||||
val mediaController = MediaController(requireContext())
|
||||
checkupVideo.setMediaController(mediaController)
|
||||
mediaController.setMediaPlayer(checkupVideo)
|
||||
|
||||
println("гружу видео $checkupVideoUrl")
|
||||
println("гружу фото $checkupPhotoUrl")
|
||||
|
||||
checkupVideo.setVideoURI(checkupVideoUrl)
|
||||
checkupVideo.start()
|
||||
// checkupVideo.background = null
|
||||
println("гружу видео start")
|
||||
// checkupVideo.background = resources.getDrawable(R.drawable.arrow)
|
||||
/*() checkupVideo.setOnClickListener {
|
||||
checkupVideo.background = null
|
||||
checkupVideo.start()
|
||||
}
|
||||
|
||||
checkupVideo.resume()
|
||||
checkupVideo.pause() */
|
||||
|
||||
Glide.with(this).load(checkupPhoto).into(ivCheckupPhoto);
|
||||
|
||||
|
||||
// Picasso.get().load(checkupPhotoUrl).rotate(0f).into(ivCheckupPhoto)
|
||||
Picasso.get().load(profilePhotoUrl).into(ivDriverPhoto)
|
||||
|
||||
|
||||
if (dataQR.exam_result_auto == 1) {
|
||||
tvResultAuto.setBackgroundColor(resources.getColor(R.color.real_green))
|
||||
tvResultAuto.setTextColor(resources.getColor(R.color.white))
|
||||
} else {
|
||||
tvResultAuto.setBackgroundColor(resources.getColor(R.color.dark_red))
|
||||
tvResultAuto.setTextColor(resources.getColor(R.color.white))
|
||||
|
||||
}
|
||||
|
||||
if (dataQR.exam_result_auto == 1) {
|
||||
tvResultMedic.setBackgroundColor(resources.getColor(R.color.real_green))
|
||||
tvResultMedic.setTextColor(resources.getColor(R.color.white))
|
||||
} else {
|
||||
tvResultMedic.setBackgroundColor(resources.getColor(R.color.dark_red))
|
||||
tvResultMedic.setTextColor(resources.getColor(R.color.white))
|
||||
}
|
||||
|
||||
|
||||
if (!dataQR.alcotest.isNullOrEmpty()) {
|
||||
println("не нул")
|
||||
tvAlkotest.text = dataQR.alcotest
|
||||
tvSyspressure.text = dataQR.syspressure
|
||||
tvDiapressure.text = dataQR.diapressure
|
||||
tvPulse.text = dataQR.pulse
|
||||
tvCheckupTemperature.text = dataQR.temperature
|
||||
tvComplaints.text = dataQR.complaints
|
||||
tvCheckupReference.text = dataQR.epicrisis
|
||||
} else {
|
||||
tvCheckupAlkotestTitle.visibility = View.GONE
|
||||
tvCheckupSyspressureTitle.visibility = View.GONE
|
||||
tvCheckupDiapressureTitle.visibility = View.GONE
|
||||
tvCheckupPulseTitle.visibility = View.GONE
|
||||
tvCheckupTemperatureTitle.visibility = View.GONE
|
||||
tvComplaintsTitle.visibility = View.GONE
|
||||
tvCheckupReferenceTitle.visibility = View.GONE
|
||||
|
||||
tvAlkotest.visibility = View.GONE
|
||||
tvSyspressure.visibility = View.GONE
|
||||
tvDiapressure.visibility = View.GONE
|
||||
tvPulse.visibility = View.GONE
|
||||
tvCheckupTemperature.visibility = View.GONE
|
||||
tvComplaints.visibility = View.GONE
|
||||
tvCheckupReference.visibility = View.GONE
|
||||
|
||||
|
||||
divider14_.visibility = View.GONE
|
||||
divider15_.visibility = View.GONE
|
||||
divider16_.visibility = View.GONE
|
||||
divider17_.visibility = View.GONE
|
||||
divider18_.visibility = View.GONE
|
||||
divider19_.visibility = View.GONE
|
||||
divider20_.visibility = View.GONE */
|
||||
|
||||
tvStatusName.text = dataTech.exam_state_name
|
||||
tvStatusTest.text = dataTech.exam_state_description
|
||||
|
||||
}
|
||||
|
||||
@ -233,19 +150,26 @@ class TechCheckupInfoFragment : BaseMenuFragment(), TechCheckupInfoView {
|
||||
|
||||
companion object {
|
||||
|
||||
private const val DATA_QR = "DATA_QR"
|
||||
fun getInstance(dataTech: String?): TechCheckupInfoFragment {
|
||||
private var DATA_QR = "DATA_QR"
|
||||
|
||||
fun getInstance(data: DataTech): TechCheckupInfoFragment {
|
||||
val gson = Gson()
|
||||
Log.v("TechCheckupInfoFragment", "dataTech = $dataTech")
|
||||
|
||||
val string: String = gson.toJson(dataTech)
|
||||
val string: String = gson.toJson(data)
|
||||
Log.v("COMP", "data = $data")
|
||||
this.DATA_QR = string
|
||||
return TechCheckupInfoFragment().also {
|
||||
Log.v("COMP", "data2 = $data")
|
||||
|
||||
it.arguments = Bundle().apply {
|
||||
putString(TechCheckupInfoFragment.DATA_QR, dataTech)
|
||||
Log.v("COMP", "data3 = $data")
|
||||
|
||||
putString(DATA_QR, string)
|
||||
}
|
||||
Log.v("COMP", "data4 = ${it.requireArguments().getString(DATA_QR)}")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private const val PERMISSION_CAMERA_REQUEST = 1
|
||||
private const val RATIO_4_3_VALUE = 4.0 / 3.0
|
||||
|
@ -1,5 +1,6 @@
|
||||
package ru.tele2med.mobile.presentation.ui.menu.items.tech.list.techCheckup.info
|
||||
|
||||
import android.util.Log
|
||||
import com.arellomobile.mvp.InjectViewState
|
||||
import com.google.gson.Gson
|
||||
import ru.tele2med.mobile.presentation.ui.base.BasePresenter
|
||||
@ -22,6 +23,39 @@ class TechCheckupInfoPresenter(
|
||||
|
||||
}
|
||||
|
||||
fun updateTech(id: String, vehicleId: String, date: String, time: String, resultId: String) {
|
||||
Log.v(
|
||||
"LOG",
|
||||
"it id = $id, vehicleId = $vehicleId date = $date, time = $time, resultId = $resultId"
|
||||
)
|
||||
|
||||
disposable += techInteractor
|
||||
.updateTech(id, vehicleId, date, time, resultId)
|
||||
.ioToMain()
|
||||
.doOnSubscribe {
|
||||
Log.v("LOG", "it 2 = $it")
|
||||
viewState.showLoading()
|
||||
}
|
||||
.doAfterTerminate {
|
||||
viewState.hideLoading()
|
||||
}
|
||||
.subscribe({
|
||||
Log.v("LOG", "it = $it ${it.message}")
|
||||
|
||||
}, {
|
||||
if (it is ApiException) {
|
||||
if (it.code == RestApiCodes.NotFound.code) {
|
||||
} else {
|
||||
this.handleError(it)
|
||||
}
|
||||
} else {
|
||||
this.handleError(it)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun showCheckUp() {
|
||||
val gson = Gson()
|
||||
val data = gson.fromJson(stringId, DataTech::class.java)
|
||||
|
@ -15,20 +15,15 @@ import com.bumptech.glide.Glide
|
||||
import com.google.gson.Gson
|
||||
import com.squareup.picasso.Picasso
|
||||
import ru.tele2med.mobile.R
|
||||
import ru.tele2med.mobile.domain.entity.DataQR
|
||||
import ru.tele2med.mobile.presentation.ui.base.BasePresenter
|
||||
import ru.tele2med.mobile.presentation.ui.drawer.entity.ScreenType
|
||||
import ru.tele2med.mobile.presentation.ui.menu.MenuActivity
|
||||
import ru.tele2med.mobile.presentation.ui.menu.ReviewActivity
|
||||
import ru.tele2med.mobile.presentation.ui.menu.base.BaseMenuFragment
|
||||
import ru.tele2med.mobile.presentation.util.providePresenter
|
||||
import kotlinx.android.synthetic.main.fragment_medical_checkup.*
|
||||
import kotlinx.android.synthetic.main.fragment_test_list.*
|
||||
import kotlinx.android.synthetic.main.toolbar_with_help.*
|
||||
import ru.tele2med.mobile.BuildConfig
|
||||
import ru.tele2med.mobile.domain.entity.DataTech
|
||||
import ru.tele2med.mobile.presentation.ui.menu.items.medicalCheckup.MedicalCheckupFragment
|
||||
import ru.tele2med.mobile.presentation.ui.menu.items.medicalCheckup.MedicalCheckupPresenter
|
||||
import ru.tele2med.mobile.presentation.ui.menu.items.tech.list.techCheckup.info.TechCheckupInfoFragment
|
||||
import ru.tele2med.mobile.domain.entity.*
|
||||
|
||||
|
||||
class TechCheckupTestsFragment : BaseMenuFragment(), TechCheckupTestsView {
|
||||
@ -46,7 +41,13 @@ class TechCheckupTestsFragment : BaseMenuFragment(), TechCheckupTestsView {
|
||||
|
||||
|
||||
override val layoutId: Int
|
||||
get() = R.layout.fragment_tech_checkup
|
||||
get() = R.layout.fragment_test_list
|
||||
|
||||
private val adapter: TestListAdapter by lazy {
|
||||
TestListAdapter { idcheckup ->
|
||||
presenter.get(idcheckup)
|
||||
}
|
||||
}
|
||||
|
||||
private var root: View? = null // create a global variable which will hold your layout
|
||||
|
||||
@ -72,15 +73,26 @@ class TechCheckupTestsFragment : BaseMenuFragment(), TechCheckupTestsView {
|
||||
}
|
||||
}
|
||||
}
|
||||
recyclerView.adapter = adapter
|
||||
|
||||
tvDriverTitle.focusable
|
||||
tvDriverTitle.requestFocus()
|
||||
presenter.showCheckUp()
|
||||
// tvDriverTitle.focusable
|
||||
// tvDriverTitle.requestFocus()
|
||||
var dataString = DATA_QR
|
||||
val gson = Gson()
|
||||
val data = gson.fromJson(dataString, DataTech::class.java)
|
||||
|
||||
presenter.showTech(data.uniq_id)
|
||||
|
||||
initRecycler()
|
||||
|
||||
}
|
||||
|
||||
override fun showCheckups(list: List<DataShow>) {
|
||||
Log.v("SHOWCH", "data = $list")
|
||||
adapter.submitList(list)
|
||||
|
||||
}
|
||||
|
||||
override fun setRefreshing(flag: Boolean) {
|
||||
println("setRefreshing = $flag")
|
||||
refresh.isRefreshing = flag
|
||||
@ -91,174 +103,39 @@ class TechCheckupTestsFragment : BaseMenuFragment(), TechCheckupTestsView {
|
||||
|
||||
refresh.setOnRefreshListener {
|
||||
println("setOnRefreshListener")
|
||||
var dataString = DATA_QR
|
||||
val gson = Gson()
|
||||
val data = gson.fromJson(dataString, DataTech::class.java)
|
||||
|
||||
presenter.showCheckUp()
|
||||
presenter.showTech(data.uniq_id)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("StringFormatInvalid")
|
||||
override fun fillData(dataTech: DataTech) {
|
||||
|
||||
println("СЕРВЕР = ${prefs.getServer()}")
|
||||
/* var profilePhoto: String
|
||||
var profilePhotoUrl: Uri
|
||||
var checkupPhoto: String
|
||||
var checkupPhotoUrl: Uri
|
||||
var checkupVideoString: String
|
||||
var checkupVideoUrl: Uri
|
||||
|
||||
profilePhoto = "${BuildConfig.API_BASE_URL}${dataQR.profilePhoto}"
|
||||
profilePhotoUrl = profilePhoto.toUri()
|
||||
checkupPhoto =
|
||||
"${BuildConfig.API_BASE_URL}${dataQR.checkupPhoto?.replace("/media", "media")}"
|
||||
checkupPhotoUrl = checkupPhoto.toUri()
|
||||
checkupVideoString =
|
||||
"${BuildConfig.API_BASE_URL}${dataQR.checkupVideo?.replace("/media", "media")}"
|
||||
checkupVideoUrl = checkupVideoString.toUri()
|
||||
|
||||
|
||||
tvMainInfoTitle.requestFocus()
|
||||
|
||||
tvMainInfoTitle.text = resources.getString(R.string.block_title_main_info, dataQR.idcheckup)
|
||||
tvDriverNumber.text = dataQR.login
|
||||
tvSex.text = dataQR.sex_name
|
||||
tvSurname.text = dataQR.lastname
|
||||
tvName.text = dataQR.name
|
||||
tvPatronymic.text = dataQR.oldlastname
|
||||
tvBirthday.text = dataQR.birthday
|
||||
tvOrgName.text = dataQR.organization
|
||||
tvCheckupDate.text = dataQR.exam_date
|
||||
tvCheckupBeginTime.text = dataQR.exam_timestart
|
||||
tvCheckupEndTime.text = dataQR.exam_timeend
|
||||
tvCheckupType.text = dataQR.inspectiontype
|
||||
tvCheckupTerminal.text = dataQR.terminal_name
|
||||
tvCheckupStatus.text = dataQR.exam_state_name
|
||||
tvCheckupMedic.text = dataQR.medic_fio
|
||||
tvResultAuto.text = dataQR.exam_result_auto_txt
|
||||
tvResultMedic.text = dataQR.exam_result_med_txt
|
||||
tvMedicComment.text = dataQR.medic_comment
|
||||
tvCheckupResultTime.text = dataQR.exam_result_datetime
|
||||
// ivCheckupPhoto.setImageURI(checkupPhotoUrl)
|
||||
|
||||
|
||||
val mediaController = MediaController(requireContext())
|
||||
checkupVideo.setMediaController(mediaController)
|
||||
mediaController.setMediaPlayer(checkupVideo)
|
||||
|
||||
println("гружу видео $checkupVideoUrl")
|
||||
println("гружу фото $checkupPhotoUrl")
|
||||
|
||||
checkupVideo.setVideoURI(checkupVideoUrl)
|
||||
checkupVideo.start()
|
||||
// checkupVideo.background = null
|
||||
println("гружу видео start")
|
||||
// checkupVideo.background = resources.getDrawable(R.drawable.arrow)
|
||||
/*() checkupVideo.setOnClickListener {
|
||||
checkupVideo.background = null
|
||||
checkupVideo.start()
|
||||
}
|
||||
|
||||
checkupVideo.resume()
|
||||
checkupVideo.pause() */
|
||||
|
||||
Glide.with(this).load(checkupPhoto).into(ivCheckupPhoto);
|
||||
|
||||
|
||||
// Picasso.get().load(checkupPhotoUrl).rotate(0f).into(ivCheckupPhoto)
|
||||
Picasso.get().load(profilePhotoUrl).into(ivDriverPhoto)
|
||||
|
||||
|
||||
if (dataQR.exam_result_auto == 1) {
|
||||
tvResultAuto.setBackgroundColor(resources.getColor(R.color.real_green))
|
||||
tvResultAuto.setTextColor(resources.getColor(R.color.white))
|
||||
} else {
|
||||
tvResultAuto.setBackgroundColor(resources.getColor(R.color.dark_red))
|
||||
tvResultAuto.setTextColor(resources.getColor(R.color.white))
|
||||
|
||||
}
|
||||
|
||||
if (dataQR.exam_result_auto == 1) {
|
||||
tvResultMedic.setBackgroundColor(resources.getColor(R.color.real_green))
|
||||
tvResultMedic.setTextColor(resources.getColor(R.color.white))
|
||||
} else {
|
||||
tvResultMedic.setBackgroundColor(resources.getColor(R.color.dark_red))
|
||||
tvResultMedic.setTextColor(resources.getColor(R.color.white))
|
||||
}
|
||||
|
||||
|
||||
if (!dataQR.alcotest.isNullOrEmpty()) {
|
||||
println("не нул")
|
||||
tvAlkotest.text = dataQR.alcotest
|
||||
tvSyspressure.text = dataQR.syspressure
|
||||
tvDiapressure.text = dataQR.diapressure
|
||||
tvPulse.text = dataQR.pulse
|
||||
tvCheckupTemperature.text = dataQR.temperature
|
||||
tvComplaints.text = dataQR.complaints
|
||||
tvCheckupReference.text = dataQR.epicrisis
|
||||
} else {
|
||||
tvCheckupAlkotestTitle.visibility = View.GONE
|
||||
tvCheckupSyspressureTitle.visibility = View.GONE
|
||||
tvCheckupDiapressureTitle.visibility = View.GONE
|
||||
tvCheckupPulseTitle.visibility = View.GONE
|
||||
tvCheckupTemperatureTitle.visibility = View.GONE
|
||||
tvComplaintsTitle.visibility = View.GONE
|
||||
tvCheckupReferenceTitle.visibility = View.GONE
|
||||
|
||||
tvAlkotest.visibility = View.GONE
|
||||
tvSyspressure.visibility = View.GONE
|
||||
tvDiapressure.visibility = View.GONE
|
||||
tvPulse.visibility = View.GONE
|
||||
tvCheckupTemperature.visibility = View.GONE
|
||||
tvComplaints.visibility = View.GONE
|
||||
tvCheckupReference.visibility = View.GONE
|
||||
|
||||
|
||||
divider14_.visibility = View.GONE
|
||||
divider15_.visibility = View.GONE
|
||||
divider16_.visibility = View.GONE
|
||||
divider17_.visibility = View.GONE
|
||||
divider18_.visibility = View.GONE
|
||||
divider19_.visibility = View.GONE
|
||||
divider20_.visibility = View.GONE
|
||||
|
||||
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
fun play(view: View?) {
|
||||
checkupVideo.start()
|
||||
}
|
||||
|
||||
fun pause(view: View?) {
|
||||
checkupVideo.pause()
|
||||
}
|
||||
|
||||
fun stop(view: View?) {
|
||||
checkupVideo.stopPlayback()
|
||||
checkupVideo.resume()
|
||||
}
|
||||
|
||||
|
||||
override fun getPresenter(): BasePresenter<*>? = null
|
||||
|
||||
|
||||
companion object {
|
||||
|
||||
private const val DATA_QR = "DATA_QR"
|
||||
fun getInstance(dataTech: String?): TechCheckupTestsFragment {
|
||||
private var DATA_QR = "DATA_QR"
|
||||
fun getInstance(data: DataTech): TechCheckupTestsFragment {
|
||||
val gson = Gson()
|
||||
Log.v("TechCheckupTestsFragment", "dataTech = $dataTech")
|
||||
|
||||
val string: String = gson.toJson(dataTech)
|
||||
val string: String = gson.toJson(data)
|
||||
Log.v("COMP", "data = $data")
|
||||
this.DATA_QR = string
|
||||
return TechCheckupTestsFragment().also {
|
||||
it.arguments = Bundle().apply {
|
||||
putString(DATA_QR, dataTech)
|
||||
}
|
||||
}
|
||||
Log.v("COMP", "data2 = $data")
|
||||
|
||||
it.arguments = Bundle().apply {
|
||||
Log.v("COMP", "data3 = $data")
|
||||
|
||||
putString(TechCheckupTestsFragment.DATA_QR, string)
|
||||
}
|
||||
Log.v("COMP", "data4 = ${it.requireArguments().getString(TechCheckupTestsFragment.DATA_QR)}")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private const val PERMISSION_CAMERA_REQUEST = 1
|
||||
|
@ -1,5 +1,6 @@
|
||||
package ru.tele2med.mobile.presentation.ui.menu.items.tech.list.techCheckup.tests
|
||||
|
||||
import android.util.Log
|
||||
import com.arellomobile.mvp.InjectViewState
|
||||
import com.google.gson.Gson
|
||||
import ru.tele2med.mobile.presentation.ui.base.BasePresenter
|
||||
@ -22,28 +23,27 @@ class TechCheckupTestsPresenter(
|
||||
|
||||
}
|
||||
|
||||
fun showCheckUp() {
|
||||
val gson = Gson()
|
||||
val data = gson.fromJson(stringId, DataTech::class.java)
|
||||
println("data stringId = ${stringId}")
|
||||
// viewState.fillData(data)
|
||||
viewState.setRefreshing(false)
|
||||
}
|
||||
|
||||
fun get(code: String) {
|
||||
println("qrcode4 $code")
|
||||
fun showTech(id: String) {
|
||||
Log.v(
|
||||
"LOG",
|
||||
"it id = $id,"
|
||||
)
|
||||
|
||||
disposable += techInteractor
|
||||
.getTech(code)
|
||||
.showTech(id)
|
||||
.ioToMain()
|
||||
.doOnSubscribe {
|
||||
Log.v("LOG", "it 2 = $it")
|
||||
viewState.showLoading()
|
||||
}
|
||||
.doAfterTerminate {
|
||||
viewState.hideLoading()
|
||||
viewState.setRefreshing(false)
|
||||
|
||||
}
|
||||
.subscribe({
|
||||
|
||||
Log.v("LOG", "it = $it ${it.message}")
|
||||
viewState.showCheckups(it.data.data)
|
||||
|
||||
}, {
|
||||
if (it is ApiException) {
|
||||
@ -55,6 +55,11 @@ class TechCheckupTestsPresenter(
|
||||
this.handleError(it)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun get(code: String) {
|
||||
println("qrcode4 $code")
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,13 +2,13 @@ package ru.tele2med.mobile.presentation.ui.menu.items.tech.list.techCheckup.test
|
||||
|
||||
import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy
|
||||
import com.arellomobile.mvp.viewstate.strategy.StateStrategyType
|
||||
import ru.tele2med.mobile.domain.entity.DataQR
|
||||
import ru.tele2med.mobile.domain.entity.DataTech
|
||||
import ru.tele2med.mobile.domain.entity.*
|
||||
import ru.tele2med.mobile.presentation.ui.base.BaseView
|
||||
|
||||
|
||||
interface TechCheckupTestsView : BaseView {
|
||||
fun fillData(dataTech: DataTech)
|
||||
fun showCheckups(list: List<DataShow>)
|
||||
|
||||
|
||||
@StateStrategyType(AddToEndSingleStrategy::class)
|
||||
fun setRefreshing(flag: Boolean)
|
||||
|
@ -0,0 +1,60 @@
|
||||
package ru.tele2med.mobile.presentation.ui.menu.items.tech.list.techCheckup.tests
|
||||
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.ListAdapter
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import ru.tele2med.mobile.R
|
||||
import ru.tele2med.mobile.domain.entity.DataShow
|
||||
|
||||
class TestListAdapter(
|
||||
val onItemClick: (checkupId: String) -> Unit
|
||||
) : ListAdapter<DataShow, TestListAdapter.ViewHolder>(
|
||||
DIFF_CALLBACK
|
||||
) {
|
||||
companion object {
|
||||
private val DIFF_CALLBACK = object : DiffUtil.ItemCallback<DataShow>() {
|
||||
override fun areItemsTheSame(p0: DataShow, p1: DataShow): Boolean =
|
||||
p0.id == p1.id
|
||||
|
||||
override fun areContentsTheSame(p0: DataShow, p1: DataShow): Boolean =
|
||||
p0 == p1
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
Log.v("BIND", "onCreateViewHolder")
|
||||
val inflater = LayoutInflater.from(parent.context)
|
||||
return ViewHolder(inflater.inflate(R.layout.item_test, parent, false))
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
Log.v("BIND", "override fun onBindViewHolder(holder: ViewHolder, position: Int) {\n")
|
||||
holder.bind(getItem(position))
|
||||
}
|
||||
|
||||
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
private val testName: TextView = view.findViewById(R.id.tvCheckupName)
|
||||
private val testResult: TextView = view.findViewById(R.id.tvResult)
|
||||
|
||||
|
||||
init {
|
||||
view.setOnClickListener {
|
||||
val list = getItem(adapterPosition)
|
||||
onItemClick(list.uniq_id)
|
||||
}
|
||||
}
|
||||
|
||||
fun bind(list: DataShow) {
|
||||
Log.v("BIND", "list = $list")
|
||||
testName.text = list.name
|
||||
testResult.text = list.value
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -42,12 +42,13 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/carName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:fontFamily="@font/roboto_regular"
|
||||
android:text="@string/checkup"
|
||||
android:text="Технический осмотр"
|
||||
android:textColor="#515151"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintStart_toEndOf="@+id/imageView5"
|
||||
@ -88,28 +89,18 @@
|
||||
android:layout_marginTop="24dp"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:text="@string/block_title_main_info"
|
||||
android:text="Путевой лист:"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDriverTitle"
|
||||
style="@style/BlockTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="@string/driver_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvMainInfoTitle" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDriverNumberTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/driver_number_title"
|
||||
android:text="Автомобиль:"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDriverTitle" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tvMainInfoTitle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDriverNumber"
|
||||
@ -127,138 +118,37 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDriverNumber" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSexTitle"
|
||||
android:id="@+id/tvDriversTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/driver_sex_title"
|
||||
android:text="Водители"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSex"
|
||||
android:id="@+id/tvDrivers"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvSexTitle"
|
||||
tools:text="Мужской" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDriversTitle"
|
||||
tools:text="Иванов, Петров" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivStatusImage"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginStart="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvSex"
|
||||
app:layout_constraintStart_toEndOf="@id/tvSex"
|
||||
app:layout_constraintTop_toTopOf="@id/tvSex"
|
||||
tools:src="@drawable/ic_task_status_not_started" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider3"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvSex" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSurnameTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/driver_surname_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSurname"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvSurnameTitle"
|
||||
tools:text="Иванов" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider4"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvSurname" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvNameTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/driver_name_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider4" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvName"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvNameTitle"
|
||||
tools:text="Иван" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider5"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvName" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPatronymicTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/driver_patronymic_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider5" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPatronymic"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvPatronymicTitle"
|
||||
tools:text="Иванович" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider6"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvPatronymic" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBirthdayTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/driver_birthday_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider6" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBirthday"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvBirthdayTitle"
|
||||
tools:text="01.01.1990" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider7"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvBirthday" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDrivers" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOrgNameTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/driver_org_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider7" />
|
||||
android:text="Организация"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOrgName"
|
||||
@ -266,519 +156,139 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvOrgNameTitle"
|
||||
tools:text="ООО Перевозчик" />
|
||||
tools:text="Вектор-Нагибатор" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider8"
|
||||
android:id="@+id/divider4"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvOrgName" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupDataTitle"
|
||||
style="@style/BlockTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="@string/checkup_info_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/divider8" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupDateTitle"
|
||||
android:id="@+id/tvNumberPLTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_date_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvCheckupDataTitle" />
|
||||
android:text="Номер ПЛ"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider4" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupDate"
|
||||
android:id="@+id/tvNumberPL"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupDateTitle"
|
||||
tools:text="24.01.2021" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tvNumberPLTitle"
|
||||
tools:text="23" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider9"
|
||||
style="@style/SubblockValueDividerStyle"
|
||||
android:id="@+id/divider5"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupDate" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tvNumberPL" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupBeginTimeTitle"
|
||||
android:id="@+id/tvDatePLTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_begin_time_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider9" />
|
||||
android:text="Дата ПЛ"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider5" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupBeginTime"
|
||||
android:id="@+id/tvDatePL"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupBeginTimeTitle"
|
||||
tools:text="11:32:34" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDatePLTitle"
|
||||
tools:text="18.04.2024" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider10"
|
||||
android:id="@+id/divider6"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupBeginTime" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDatePL" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupEndTimeTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_end_time_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider10" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupEndTime"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupEndTimeTitle"
|
||||
tools:text="11:33:50" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider11"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupEndTime" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupTypeTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_type_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider11" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupType"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupTypeTitle"
|
||||
tools:text="Предрейсовый" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider12"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupType" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupTerminalTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_terminal_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupTerminal"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupTerminalTitle"
|
||||
tools:text="АРМ 2" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider13"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupTerminal" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupStatusTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_status_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider13" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupStatus"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupStatusTitle"
|
||||
tools:text="Подписан телемедиком" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider14"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupStatus" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupSyspressureTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_syspressure_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSyspressure"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupSyspressureTitle"
|
||||
tools:text="120" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider14_"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvSyspressure" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupDiapressureTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_diapressure_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider14_" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDiapressure"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupDiapressureTitle"
|
||||
tools:text="80" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider15_"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDiapressure" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupPulseTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_pulse_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider15_" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPulse"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupPulseTitle"
|
||||
tools:text="65" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider16_"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvPulse" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupAlkotestTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_alcotest_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider16_" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAlkotest"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupAlkotestTitle"
|
||||
tools:text="0" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider17_"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvAlkotest" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupTemperatureTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_temperature_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider17_" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupTemperature"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupTemperatureTitle"
|
||||
tools:text="36,6" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider18_"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupTemperature" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvComplaintsTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_complaints_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider18_" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvComplaints"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvComplaintsTitle"
|
||||
tools:text="Жалоб нет" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider19_"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvComplaints" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupReferenceTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_reference_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider19_" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupReference"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupReferenceTitle"
|
||||
tools:text="" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider20_"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupReference" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupMedicTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_medic_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider20_" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupMedic"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupMedicTitle"
|
||||
tools:text="Лечебная Марья Ивановна" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider15"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupMedic" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvResultAutoTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_result_auto_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider15" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvResultAuto"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvResultAutoTitle"
|
||||
tools:text="Допущен" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider16"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvResultAuto" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvResultMedicTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_result_medic_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider16" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvResultMedic"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvResultMedicTitle"
|
||||
tools:text="Допущен" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider17"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvResultMedic" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMedicCommentTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_medic_comment_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider17" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMedicComment"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvMedicCommentTitle"
|
||||
tools:text="Допущен" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider18"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvMedicComment" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupResultTimeTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_result_time_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider18" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupResultTime"
|
||||
style="@style/BlockValueStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupResultTimeTitle"
|
||||
tools:text="24.01.2022 12:32:06" />
|
||||
|
||||
|
||||
<View
|
||||
android:id="@+id/divider19"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCheckupResultTime" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ivCheckupPhotoTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkup_photo_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider19" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivCheckupPhoto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivCheckupPhotoTitle" />
|
||||
|
||||
|
||||
<View
|
||||
android:id="@+id/divider20"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivCheckupPhoto" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/checkupVideoTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/driver_video_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider20" />
|
||||
|
||||
<VideoView
|
||||
android:id="@+id/checkupVideo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="300dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/checkupVideoTitle" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider21"
|
||||
style="@style/BlockValueDividerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/checkupVideo" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ivDriverPhotoTitle"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/driver_photo_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider21" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivDriverPhoto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivDriverPhotoTitle" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/startTest"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Начать проверки"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
android:background="@drawable/btn_rounded_blue"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cvMainInfoContainer" />
|
||||
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cvStatusInfoContainer"
|
||||
style="@style/BlockStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/checkupsBody">
|
||||
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvStatusInfoTitle"
|
||||
style="@style/BlockTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:text="Статус:"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvStatusName"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="В работе"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvStatusInfoTitle" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvStatusTest"
|
||||
style="@style/BlockValueTitleStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Продено 2 проверки"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvStatusName" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
27
app/src/main/res/layout/fragment_test_list.xml
Normal file
27
app/src/main/res/layout/fragment_test_list.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/refresh"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:clipToPadding="false"
|
||||
android:paddingTop="4dp"
|
||||
tools:listitem="@layout/item_test" />
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
44
app/src/main/res/layout/item_test.xml
Normal file
44
app/src/main/res/layout/item_test.xml
Normal file
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@drawable/ic_notification_background"
|
||||
android:padding="18dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/white"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCheckupName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/roboto_medium"
|
||||
android:textColor="@color/gray_checkups"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="№ 23421" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvResult"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:fontFamily="@font/roboto_regular"
|
||||
android:textColor="@color/fio_color"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvCheckupName"
|
||||
tools:text="Иванов Иван Иоанович" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in New Issue
Block a user