ConfigListFragment: Avoid unnecessary findViewById
The generated ViewDataBinding has fields for each view with an id. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
632f3f73a2
commit
290c98a9e3
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user