diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2018-07-12 01:20:38 +0530 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-12 02:07:19 +0200 |
commit | 19b57c41b79f3f62e586753b9589b28fbac53863 (patch) | |
tree | 2470cde52c68cf739f3c545fb4e2f7af805ae0df /app/src | |
parent | 26d762bc5cc57af7df9239861c5d7d1e84beedc5 (diff) |
Address lint issues in TunnelListFragment
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java | 11 |
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 5969aa9a..5dda6cfe 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 { |