From 12a86a9216ee3c974fe7ef92a90746bac3654cd6 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 10 Jan 2018 06:26:29 +0100 Subject: [PATCH] Added copy to access log --- .../java/eu/faircode/netguard/AdapterRule.java | 8 ++++++++ app/src/main/res/menu/access.xml | 17 ++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/faircode/netguard/AdapterRule.java b/app/src/main/java/eu/faircode/netguard/AdapterRule.java index 5e4c906e..a33c512d 100644 --- a/app/src/main/java/eu/faircode/netguard/AdapterRule.java +++ b/app/src/main/java/eu/faircode/netguard/AdapterRule.java @@ -21,6 +21,8 @@ package eu.faircode.netguard; import android.annotation.TargetApi; import android.app.Activity; +import android.content.ClipData; +import android.content.ClipboardManager; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; @@ -756,6 +758,12 @@ public class AdapterRule extends RecyclerView.Adapter im ServiceSinkhole.reload("reset host", context, false); result = true; break; + + case R.id.menu_copy: + ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); + ClipData clip = ClipData.newPlainText("netguard", daddr); + clipboard.setPrimaryClip(clip); + return true; } if (menu == R.id.menu_allow || menu == R.id.menu_block || menu == R.id.menu_reset) diff --git a/app/src/main/res/menu/access.xml b/app/src/main/res/menu/access.xml index a4d1cded..68aed2b4 100644 --- a/app/src/main/res/menu/access.xml +++ b/app/src/main/res/menu/access.xml @@ -4,25 +4,28 @@ android:id="@+id/menu_host" android:enabled="false" android:title=""> - + + android:title="" /> + android:title="" /> + android:title="@string/title_allow" /> + android:title="@string/title_block" /> + android:title="@string/menu_reset" /> + + android:title="" />