diff options
author | Samuel Holland <samuel@sholland.org> | 2017-08-24 01:22:14 -0500 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2017-08-24 01:22:20 -0500 |
commit | 618772cd515192d3d03e8733c7b5d353fd36bcf6 (patch) | |
tree | befb0864d00336c5a01db05ecec1b1acfee4c2b1 /app | |
parent | e6ea9ea03e7206750d2c3be0ee8a8895b1680a0b (diff) |
ConfigListFragment: Avoid unnecessary findViewById
The generated ViewDataBinding has fields for each view with an id.
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/com/wireguard/android/ConfigListFragment.java | 5 |
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 |