From 0e3e3ae37b093c8de04be2a141e7b49d708f5336 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 28 Jun 2018 20:05:33 +0530 Subject: android: Add select all button to action mode Thanks to Jason for suggesting the not-clinically-insane method to go about this. Signed-off-by: Harsh Shandilya --- .../main/java/com/wireguard/android/fragment/TunnelListFragment.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/src/main/java/com/wireguard/android') 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; } -- cgit v1.2.3