Move AdvancedDialog initialization
This commit is contained in:
@@ -65,19 +65,9 @@ internal class AdvancedDialog(
|
|||||||
binding = AdvancedSettingsDialogBinding.inflate(layoutInflater)
|
binding = AdvancedSettingsDialogBinding.inflate(layoutInflater)
|
||||||
binding.disableSSL.isChecked = disableSSL
|
binding.disableSSL.isChecked = disableSSL
|
||||||
binding.disableSSL.setOnCheckedChangeListener(onCheckedChangeListener)
|
binding.disableSSL.setOnCheckedChangeListener(onCheckedChangeListener)
|
||||||
if (caCertPath == null) {
|
|
||||||
showSelectCaCertificate()
|
|
||||||
} else {
|
|
||||||
showRemoveCaCertificate(caCertCN!!)
|
|
||||||
}
|
|
||||||
if (!clientCertPassword.isNullOrEmpty()) {
|
if (!clientCertPassword.isNullOrEmpty()) {
|
||||||
binding.clientCertPasswordEdittext.setText(clientCertPassword)
|
binding.clientCertPasswordEdittext.setText(clientCertPassword)
|
||||||
}
|
}
|
||||||
if (clientCertPath == null) {
|
|
||||||
showSelectClientCertificate()
|
|
||||||
} else {
|
|
||||||
showRemoveClientCertificate()
|
|
||||||
}
|
|
||||||
binding.clientCertPasswordEdittext.doOnTextChanged { _, _, _, _ ->
|
binding.clientCertPasswordEdittext.doOnTextChanged { _, _, _, _ ->
|
||||||
if (binding.selectedClientCert.text.toString() ==
|
if (binding.selectedClientCert.text.toString() ==
|
||||||
context.getString(R.string.certificate_found)
|
context.getString(R.string.certificate_found)
|
||||||
@@ -95,6 +85,16 @@ internal class AdvancedDialog(
|
|||||||
.create()
|
.create()
|
||||||
dialog.show()
|
dialog.show()
|
||||||
dialogDoneButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE)
|
dialogDoneButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE)
|
||||||
|
if (caCertPath == null) {
|
||||||
|
showSelectCaCertificate()
|
||||||
|
} else {
|
||||||
|
showRemoveCaCertificate(caCertCN!!)
|
||||||
|
}
|
||||||
|
if (clientCertPath == null) {
|
||||||
|
showSelectClientCertificate()
|
||||||
|
} else {
|
||||||
|
showRemoveClientCertificate()
|
||||||
|
}
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,9 +132,7 @@ internal class AdvancedDialog(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun showPasswordMissing(toggled: Boolean) {
|
private fun showPasswordMissing(toggled: Boolean) {
|
||||||
if (::dialogDoneButton.isInitialized) {
|
dialogDoneButton.isEnabled = !toggled
|
||||||
dialogDoneButton.isEnabled = !toggled
|
|
||||||
}
|
|
||||||
val error = if (toggled) {
|
val error = if (toggled) {
|
||||||
context.getString(R.string.client_cert_password_missing)
|
context.getString(R.string.client_cert_password_missing)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user