From c5344d57942c846da91bfeaf2cb5a93f8a311c65 Mon Sep 17 00:00:00 2001 From: vadym Date: Mon, 7 Dec 2020 13:11:06 +0200 Subject: [PATCH] 1. #30. added node info copy to Clipboard --- app/build.gradle | 2 +- app/src/main/AndroidManifest.xml | 6 ++ .../yggdrasil/CopyLocalNodeInfoActivity.kt | 28 ++++++++ .../chronosx88/yggdrasil/MainActivity.kt | 19 +++--- .../yggdrasil/YggdrasilTunService.kt | 2 +- .../chronosx88/yggdrasil/models/NodeInfo.kt | 13 ++++ .../models/config/CopyInfoAdapter.kt | 67 +++++++++++++++++++ .../layout/activity_copy_local_node_info.xml | 26 +++++++ app/src/main/res/layout/content_main.xml | 6 +- app/src/main/res/layout/content_node_info.xml | 13 ++++ .../res/layout/copy_node_info_list_item.xml | 52 ++++++++++++++ app/src/main/res/values/strings.xml | 3 +- 12 files changed, 221 insertions(+), 16 deletions(-) create mode 100644 app/src/main/java/io/github/chronosx88/yggdrasil/CopyLocalNodeInfoActivity.kt create mode 100644 app/src/main/java/io/github/chronosx88/yggdrasil/models/NodeInfo.kt create mode 100644 app/src/main/java/io/github/chronosx88/yggdrasil/models/config/CopyInfoAdapter.kt create mode 100644 app/src/main/res/layout/activity_copy_local_node_info.xml create mode 100644 app/src/main/res/layout/content_node_info.xml create mode 100644 app/src/main/res/layout/copy_node_info_list_item.xml diff --git a/app/build.gradle b/app/build.gradle index f00a1d3..44b7a07 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,7 +8,7 @@ android { applicationId "io.github.chronosx88.yggdrasil" minSdkVersion 15 targetSdkVersion 30 - versionCode 10 + versionCode 11 versionName "1.6" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" setProperty("archivesBaseName", project.getParent().name+"-"+versionName) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 81ef2dd..9f24941 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -32,6 +32,12 @@ android:label="@string/title_activity_dns_list" android:theme="@style/AppTheme.NoActionBar" android:screenOrientation="portrait"/> + (R.id.nodeInfoList) + val nodeInfoList = listOf(NodeInfo("IP address", ipv6Address!!), NodeInfo("Encryption Public Key", encryptionPublicKey!!), NodeInfo("Signing Public Key", signingPublicKey!!)); + var adapter = CopyInfoAdapter(this, nodeInfoList) + nodeInfoListView.adapter = adapter + } + +} \ No newline at end of file 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 bc39e52..25327fd 100644 --- a/app/src/main/java/io/github/chronosx88/yggdrasil/MainActivity.kt +++ b/app/src/main/java/io/github/chronosx88/yggdrasil/MainActivity.kt @@ -110,16 +110,7 @@ class MainActivity : AppCompatActivity() { if(isStarted && this.currentPeers.isEmpty()) { updatePeers() } - val copyAddressButton = findViewById