From b47344b0f347e3af7d135e6b47c753e434cd8333 Mon Sep 17 00:00:00 2001 From: vadym Date: Sat, 27 Jun 2020 12:04:41 -0700 Subject: [PATCH] 1. implemented address copy --- .../chronosx88/yggdrasil/MainActivity.kt | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/github/chronosx88/yggdrasil/MainActivity.kt b/app/src/main/java/io/github/chronosx88/yggdrasil/MainActivity.kt index 0de685e..60b4e3c 100644 --- a/app/src/main/java/io/github/chronosx88/yggdrasil/MainActivity.kt +++ b/app/src/main/java/io/github/chronosx88/yggdrasil/MainActivity.kt @@ -2,6 +2,8 @@ package io.github.chronosx88.yggdrasil import android.app.Activity import android.app.ActivityManager +import android.content.ClipData +import android.content.ClipboardManager import android.content.Context import android.content.Intent import android.net.VpnService @@ -65,9 +67,19 @@ class MainActivity : AppCompatActivity() { val preferences = PreferenceManager.getDefaultSharedPreferences(this.baseContext) currentPeers = deserializeStringSet2PeerInfoSet(preferences.getStringSet(CURRENT_PEERS, HashSet())!!) - val adapter = PeerInfoListAdapter(this, currentPeers.sortedWith(compareBy { it.ping })) listView.adapter = adapter + + val copyAddressButton = findViewById