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

View File

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