mirror of
https://github.com/M66B/NetGuard.git
synced 2025-01-30 19:31:26 +00:00
Added copy to access log
This commit is contained in:
parent
9b27f8d120
commit
12a86a9216
2 changed files with 18 additions and 7 deletions
|
@ -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<AdapterRule.ViewHolder> 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)
|
||||
|
|
|
@ -4,25 +4,28 @@
|
|||
android:id="@+id/menu_host"
|
||||
android:enabled="false"
|
||||
android:title="">
|
||||
<menu/>
|
||||
<menu />
|
||||
</item>
|
||||
<item
|
||||
android:id="@+id/menu_whois"
|
||||
android:title=""/>
|
||||
android:title="" />
|
||||
<item
|
||||
android:id="@+id/menu_port"
|
||||
android:title=""/>
|
||||
android:title="" />
|
||||
<item
|
||||
android:id="@+id/menu_allow"
|
||||
android:title="@string/title_allow"/>
|
||||
android:title="@string/title_allow" />
|
||||
<item
|
||||
android:id="@+id/menu_block"
|
||||
android:title="@string/title_block"/>
|
||||
android:title="@string/title_block" />
|
||||
<item
|
||||
android:id="@+id/menu_reset"
|
||||
android:title="@string/menu_reset"/>
|
||||
android:title="@string/menu_reset" />
|
||||
<item
|
||||
android:id="@+id/menu_copy"
|
||||
android:title="@string/title_log_copy" />
|
||||
<item
|
||||
android:id="@+id/menu_time"
|
||||
android:enabled="false"
|
||||
android:title=""/>
|
||||
android:title="" />
|
||||
</menu>
|
||||
|
|
Loading…
Reference in a new issue