summaryrefslogtreecommitdiffhomepage
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java4
-rw-r--r--app/src/main/res/drawable/ic_action_select_all.xml10
-rw-r--r--app/src/main/res/menu/tunnel_list_action_mode.xml6
-rw-r--r--app/src/main/res/values/strings.xml1
4 files changed, 21 insertions, 0 deletions
diff --git a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java
index e244f756..72e2fbdb 100644
--- a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java
+++ b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java
@@ -305,6 +305,10 @@ public class TunnelListFragment extends BaseFragment {
.whenComplete(TunnelListFragment.this::onTunnelDeletionFinished);
mode.finish();
return true;
+ case R.id.menu_action_select_all:
+ for (int i = 0; i < tunnelList.getAdapter().getCount(); ++i)
+ tunnelList.setItemChecked(i, true);
+ return true;
default:
return false;
}
diff --git a/app/src/main/res/drawable/ic_action_select_all.xml b/app/src/main/res/drawable/ic_action_select_all.xml
new file mode 100644
index 00000000..2ddfb85a
--- /dev/null
+++ b/app/src/main/res/drawable/ic_action_select_all.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:width="24dp"
+ android:height="24dp">
+ <path
+ android:fillColor="?android:attr/colorForeground"
+ android:pathData="M3 5L5 5 5 3C3.9 3 3 3.9 3 5Zm0 8l2 0 0 -2 -2 0 0 2zm4 8l2 0 0 -2 -2 0 0 2zM3 9L5 9 5 7 3 7 3 9Zm10 -6l-2 0 0 2 2 0 0 -2zm6 0l0 2 2 0C21 3.9 20.1 3 19 3ZM5 21L5 19 3 19c0 1.1 0.9 2 2 2zm-2 -4l2 0 0 -2 -2 0 0 2zM9 3L7 3 7 5 9 5 9 3Zm2 18l2 0 0 -2 -2 0 0 2zm8 -8l2 0 0 -2 -2 0 0 2zm0 8c1.1 0 2 -0.9 2 -2l-2 0 0 2zm0 -12l2 0 0 -2 -2 0 0 2zm0 8l2 0 0 -2 -2 0 0 2zm-4 4l2 0 0 -2 -2 0 0 2zm0 -16l2 0 0 -2 -2 0 0 2zM7 17L17 17 17 7 7 7 7 17Zm2 -8l6 0 0 6 -6 0 0 -6z" />
+</vector> \ No newline at end of file
diff --git a/app/src/main/res/menu/tunnel_list_action_mode.xml b/app/src/main/res/menu/tunnel_list_action_mode.xml
index 6b03cd19..22f61943 100644
--- a/app/src/main/res/menu/tunnel_list_action_mode.xml
+++ b/app/src/main/res/menu/tunnel_list_action_mode.xml
@@ -2,6 +2,12 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
+ android:id="@+id/menu_action_select_all"
+ android:alphabeticShortcut="s"
+ android:icon="@drawable/ic_action_select_all"
+ android:title="@string/select_all"
+ app:showAsAction="always" />
+ <item
android:id="@+id/menu_action_delete"
android:alphabeticShortcut="d"
android:icon="@drawable/ic_action_delete"
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index cbf0542e..56966750 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -33,6 +33,7 @@
<string name="dark_theme_summary_on">Currently using dark night theme</string>
<string name="dark_theme_summary_off">Currently using light day theme</string>
<string name="delete">Delete</string>
+ <string name="select_all">Select all</string>
<string name="dns_servers">DNS servers</string>
<string name="edit">Edit</string>
<string name="endpoint">Endpoint</string>