summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard/android
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2017-08-24 01:22:14 -0500
committerSamuel Holland <samuel@sholland.org>2017-08-24 01:22:20 -0500
commit290c98a9e3ca24853a20a575aaf028386ff07b4f (patch)
treebefb0864d00336c5a01db05ecec1b1acfee4c2b1 /app/src/main/java/com/wireguard/android
parent632f3f73a2133221242668051465b55fcc3e1f55 (diff)
ConfigListFragment: Avoid unnecessary findViewById
The generated ViewDataBinding has fields for each view with an id. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com/wireguard/android')
-rw-r--r--app/src/main/java/com/wireguard/android/ConfigListFragment.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/src/main/java/com/wireguard/android/ConfigListFragment.java b/app/src/main/java/com/wireguard/android/ConfigListFragment.java
index c086e40d..bc44e05e 100644
--- a/app/src/main/java/com/wireguard/android/ConfigListFragment.java
+++ b/app/src/main/java/com/wireguard/android/ConfigListFragment.java
@@ -44,8 +44,7 @@ public class ConfigListFragment extends BaseConfigFragment {
final ConfigListFragmentBinding binding =
ConfigListFragmentBinding.inflate(inflater, parent, false);
binding.setConfigs(VpnService.getInstance().getConfigs());
- final View root = binding.getRoot();
- listView = root.findViewById(R.id.config_list);
+ listView = binding.configList;
listView.setMultiChoiceModeListener(new ConfigListModeListener());
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
@@ -67,7 +66,7 @@ public class ConfigListFragment extends BaseConfigFragment {
});
binding.executePendingBindings();
setConfigChecked(getCurrentConfig());
- return root;
+ return binding.getRoot();
}
@Override