MOB-14 two small fixes

This commit is contained in:
Henrik Lepson 2021-10-08 21:24:21 +03:00
parent cc35723c07
commit 76fecd766f

View File

@ -6,6 +6,7 @@ import android.nfc.NfcAdapter
import android.nfc.tech.IsoDep import android.nfc.tech.IsoDep
import android.os.Bundle import android.os.Bundle
import android.os.CountDownTimer import android.os.CountDownTimer
import android.util.Log
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
@ -78,13 +79,11 @@ class AuthFragment : Fragment() {
try { try {
val comms = Comms(it, viewModel.userCan) val comms = Comms(it, viewModel.userCan)
val response = comms.readPersonalData(byteArrayOf(1, 2, 6)) val response = comms.readPersonalData(byteArrayOf(1, 2, 6))
if (response != null) { viewModel.setUserFirstName(response[1])
viewModel.setUserFirstName(response[1]) viewModel.setUserLastName(response[0])
viewModel.setUserLastName(response[0]) viewModel.setUserIdentificationNumber(response[2])
viewModel.setUserIdentificationNumber(response[2]) requireActivity().runOnUiThread{
requireActivity().runOnUiThread{ binding!!.timeCounter.text = getString(R.string.data_read)
binding!!.timeCounter.text = getString(R.string.data_read)
}
} }
} catch (e: Exception) { } catch (e: Exception) {
requireActivity().runOnUiThread { requireActivity().runOnUiThread {
@ -94,7 +93,6 @@ class AuthFragment : Fragment() {
Thread.sleep(1000) Thread.sleep(1000)
goToTheStart() goToTheStart()
} finally { } finally {
it.close()
adapter.disableReaderMode(activity) adapter.disableReaderMode(activity)
} }
} }