aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorHarsh Shandilya <harsh@prjkt.io>2018-07-12 01:20:38 +0530
committerJason A. Donenfeld <Jason@zx2c4.com>2018-07-12 02:07:19 +0200
commit44279806b4952b83b123a6e85573fdf4f8d22b09 (patch)
tree2470cde52c68cf739f3c545fb4e2f7af805ae0df
parentTunnelEditorFragment: add DNSes to allowedIPs when excluding rfc1918 (diff)
downloadwireguard-android-44279806b4952b83b123a6e85573fdf4f8d22b09.tar.xz
wireguard-android-44279806b4952b83b123a6e85573fdf4f8d22b09.zip
Address lint issues in TunnelListFragment
Signed-off-by: Harsh Shandilya <harsh@prjkt.io>
-rw-r--r--app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java11
1 files changed, 5 insertions, 6 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 5969aa9..5dda6cf 100644
--- a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java
+++ b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java
@@ -45,7 +45,6 @@ import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
-import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
@@ -289,7 +288,7 @@ public class TunnelListFragment extends BaseFragment {
}
private final class ActionModeListener implements ActionMode.Callback {
- private final Set<Integer> checkedItems = new HashSet<>();
+ private final Collection<Integer> checkedItems = new HashSet<>();
private Resources resources;
@@ -297,8 +296,8 @@ public class TunnelListFragment extends BaseFragment {
public boolean onActionItemClicked(final ActionMode mode, final MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_action_delete:
- List<Tunnel> tunnelsToDelete = new ArrayList<>();
- for (Integer position : checkedItems) {
+ final Collection<Tunnel> tunnelsToDelete = new ArrayList<>();
+ for (final Integer position : checkedItems) {
tunnelsToDelete.add(Application.getTunnelManager().getTunnels().get(position));
}
@@ -341,11 +340,11 @@ public class TunnelListFragment extends BaseFragment {
binding.tunnelList.getAdapter().notifyDataSetChanged();
}
- void toggleItemChecked(int position) {
+ void toggleItemChecked(final int position) {
setItemChecked(position, !checkedItems.contains(position));
}
- void setItemChecked(int position, boolean checked) {
+ void setItemChecked(final int position, final boolean checked) {
if (checked) {
checkedItems.add(position);
} else {