1. add DNS layout fix

This commit is contained in:
vadym 2020-08-08 00:22:25 -07:00
parent f5fcd68984
commit 0fb8ed0252

View File

@ -107,7 +107,7 @@ class DNSListActivity : AppCompatActivity() {
var ccpInput = view.findViewById<com.hbb20.CountryCodePicker>(R.id.ccp) var ccpInput = view.findViewById<com.hbb20.CountryCodePicker>(R.id.ccp)
var ip = ipInput.text.toString().toLowerCase() var ip = ipInput.text.toString().toLowerCase()
var ccp = ccpInput.selectedCountryNameCode var ccp = ccpInput.selectedCountryNameCode
GlobalScope.launch { thread(start = true) {
var di = DNSInfo(InetAddress.getByName("["+ip+"]"), ccp, "User DNS") var di = DNSInfo(InetAddress.getByName("["+ip+"]"), ccp, "User DNS")
try { try {
var ping = ping(di.address, 53) var ping = ping(di.address, 53)
@ -115,8 +115,8 @@ class DNSListActivity : AppCompatActivity() {
} catch(e: Throwable){ } catch(e: Throwable){
di.ping = Int.MAX_VALUE di.ping = Int.MAX_VALUE
} }
withContext(Dispatchers.Main) { runOnUiThread {
var selectAdapter = (findViewById<ListView>(R.id.peerList).adapter as SelectDNSInfoListAdapter) var selectAdapter = (findViewById<ListView>(R.id.dnsList).adapter as SelectDNSInfoListAdapter)
selectAdapter.addItem(0, di) selectAdapter.addItem(0, di)
selectAdapter.notifyDataSetChanged() selectAdapter.notifyDataSetChanged()
ad.dismiss() ad.dismiss()