feat: refs #8212 showWarningUdate
This commit is contained in:
parent
e0b148ddfd
commit
54687e2e05
|
@ -157,6 +157,7 @@ class LoginFragment :
|
|||
}
|
||||
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
private fun setSwitch() {
|
||||
|
@ -325,31 +326,36 @@ class LoginFragment :
|
|||
if (binding.edittextServer.text.toString() == "Producción") {
|
||||
mobileApplication.clearApplicationData()
|
||||
}
|
||||
customDialog.setTitle(getString(R.string.Actualizar))
|
||||
.setDescription(getString(R.string.updatemng)).setOkButton(
|
||||
getString(
|
||||
R.string.Actualizar
|
||||
)
|
||||
) {
|
||||
try {
|
||||
val openURL = Intent(Intent.ACTION_VIEW)
|
||||
openURL.data = Uri.parse(it.url)
|
||||
startActivity(openURL)
|
||||
} catch (ex: Exception) {
|
||||
getString(R.string.problemUpdate).toast(requireActivity())
|
||||
//Tarea 8212 serialMuber is obtaines from back when PDA is registered, updated scaleFusion
|
||||
if (it.serialNumber.isEmpty()) {
|
||||
customDialog.setTitle(getString(R.string.Actualizar))
|
||||
.setDescription(getString(R.string.updatemng)).setOkButton(
|
||||
getString(
|
||||
R.string.Actualizar
|
||||
)
|
||||
) {
|
||||
try {
|
||||
val openURL = Intent(Intent.ACTION_VIEW)
|
||||
openURL.data = Uri.parse(it.url)
|
||||
startActivity(openURL)
|
||||
} catch (ex: Exception) {
|
||||
getString(R.string.problemUpdate).toast(requireActivity())
|
||||
}
|
||||
|
||||
}
|
||||
if (it.isVersionCritical) {
|
||||
customDialog.setDescription(getString(R.string.updatecritical))
|
||||
} else {
|
||||
customDialog.setKoButton(getString(R.string.cancel)) {
|
||||
customDialog.dismiss()
|
||||
goToMain()
|
||||
}
|
||||
|
||||
}
|
||||
if (it.isVersionCritical) {
|
||||
customDialog.setDescription(getString(R.string.updatecritical))
|
||||
customDialog.show()
|
||||
|
||||
} else {
|
||||
customDialog.setKoButton(getString(R.string.cancel)) {
|
||||
customDialog.dismiss()
|
||||
goToMain()
|
||||
}
|
||||
goToMain()
|
||||
}
|
||||
customDialog.show()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue