From 0fb8ed025270ac624cb08d11fc0edf782035d161 Mon Sep 17 00:00:00 2001 From: vadym Date: Sat, 8 Aug 2020 00:22:25 -0700 Subject: [PATCH] 1. add DNS layout fix --- .../java/io/github/chronosx88/yggdrasil/DNSListActivity.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/github/chronosx88/yggdrasil/DNSListActivity.kt b/app/src/main/java/io/github/chronosx88/yggdrasil/DNSListActivity.kt index 270246b..7baa89c 100644 --- a/app/src/main/java/io/github/chronosx88/yggdrasil/DNSListActivity.kt +++ b/app/src/main/java/io/github/chronosx88/yggdrasil/DNSListActivity.kt @@ -107,7 +107,7 @@ class DNSListActivity : AppCompatActivity() { var ccpInput = view.findViewById(R.id.ccp) var ip = ipInput.text.toString().toLowerCase() var ccp = ccpInput.selectedCountryNameCode - GlobalScope.launch { + thread(start = true) { var di = DNSInfo(InetAddress.getByName("["+ip+"]"), ccp, "User DNS") try { var ping = ping(di.address, 53) @@ -115,8 +115,8 @@ class DNSListActivity : AppCompatActivity() { } catch(e: Throwable){ di.ping = Int.MAX_VALUE } - withContext(Dispatchers.Main) { - var selectAdapter = (findViewById(R.id.peerList).adapter as SelectDNSInfoListAdapter) + runOnUiThread { + var selectAdapter = (findViewById(R.id.dnsList).adapter as SelectDNSInfoListAdapter) selectAdapter.addItem(0, di) selectAdapter.notifyDataSetChanged() ad.dismiss()