Remove useless mView field from fragments

This commit is contained in:
tonymanou 2017-01-08 14:45:08 +01:00 committed by topjohnwu
parent 2a70619577
commit cffc157d98
2 changed files with 6 additions and 10 deletions

View File

@ -41,7 +41,6 @@ public class MagiskHideFragment extends Fragment implements CallbackHandler.Even
public static CallbackHandler.Event packageLoadDone = new CallbackHandler.Event();
private PackageManager packageManager;
private View mView;
private ApplicationAdapter appAdapter = new ApplicationAdapter();
private SearchView.OnQueryTextListener searchListener;
@ -49,8 +48,8 @@ public class MagiskHideFragment extends Fragment implements CallbackHandler.Even
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
mView = inflater.inflate(R.layout.magisk_hide_fragment, container, false);
ButterKnife.bind(this, mView);
View view = inflater.inflate(R.layout.magisk_hide_fragment, container, false);
ButterKnife.bind(this, view);
packageManager = getActivity().getPackageManager();
@ -76,7 +75,7 @@ public class MagiskHideFragment extends Fragment implements CallbackHandler.Even
}
};
return mView;
return view;
}
@Override
@ -90,7 +89,6 @@ public class MagiskHideFragment extends Fragment implements CallbackHandler.Even
public void onResume() {
super.onResume();
setHasOptionsMenu(true);
mView = this.getView();
getActivity().setTitle(R.string.magiskhide);
CallbackHandler.register(packageLoadDone, this);
if (packageLoadDone.isTriggered) {

View File

@ -39,13 +39,12 @@ public class ModulesFragment extends Fragment implements CallbackHandler.EventLi
@BindView(R.id.fab) FloatingActionButton fabio;
private List<Module> listModules = new ArrayList<>();
private View mView;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
mView = inflater.inflate(R.layout.modules_fragment, container, false);
ButterKnife.bind(this, mView);
View view = inflater.inflate(R.layout.modules_fragment, container, false);
ButterKnife.bind(this, view);
fabio.setOnClickListener(v -> {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
@ -74,7 +73,7 @@ public class ModulesFragment extends Fragment implements CallbackHandler.EventLi
updateUI();
}
return mView;
return view;
}
@Override
@ -96,7 +95,6 @@ public class ModulesFragment extends Fragment implements CallbackHandler.EventLi
@Override
public void onResume() {
super.onResume();
mView = this.getView();
CallbackHandler.register(moduleLoadDone, this);
getActivity().setTitle(R.string.modules);
}