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 =
|
final ConfigListFragmentBinding binding =
|
||||||
ConfigListFragmentBinding.inflate(inflater, parent, false);
|
ConfigListFragmentBinding.inflate(inflater, parent, false);
|
||||||
binding.setConfigs(VpnService.getInstance().getConfigs());
|
binding.setConfigs(VpnService.getInstance().getConfigs());
|
||||||
final View root = binding.getRoot();
|
listView = binding.configList;
|
||||||
listView = root.findViewById(R.id.config_list);
|
|
||||||
listView.setMultiChoiceModeListener(new ConfigListModeListener());
|
listView.setMultiChoiceModeListener(new ConfigListModeListener());
|
||||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -67,7 +66,7 @@ public class ConfigListFragment extends BaseConfigFragment {
|
|||||||
});
|
});
|
||||||
binding.executePendingBindings();
|
binding.executePendingBindings();
|
||||||
setConfigChecked(getCurrentConfig());
|
setConfigChecked(getCurrentConfig());
|
||||||
return root;
|
return binding.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user