Create new ContributionController before NearbyAdapterFactory is initiated

This commit is contained in:
misaochan 2018-02-07 20:13:10 +10:00 committed by maskara
parent 863eee64dd
commit 87cd8eecab

View file

@ -61,6 +61,7 @@ public class NearbyListFragment extends DaggerFragment {
View view = inflater.inflate(R.layout.fragment_nearby, container, false); View view = inflater.inflate(R.layout.fragment_nearby, container, false);
recyclerView = view.findViewById(R.id.listView); recyclerView = view.findViewById(R.id.listView);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
controller = new ContributionController(this);
adapterFactory = new NearbyAdapterFactory(this, controller); adapterFactory = new NearbyAdapterFactory(this, controller);
return view; return view;
} }
@ -70,8 +71,6 @@ public class NearbyListFragment extends DaggerFragment {
// Check that this is the first time view is created, // Check that this is the first time view is created,
// to avoid double list when screen orientation changed // to avoid double list when screen orientation changed
List<Place> placeList = Collections.emptyList(); List<Place> placeList = Collections.emptyList();
controller = new ContributionController(this);
Bundle bundle = this.getArguments(); Bundle bundle = this.getArguments();
if (bundle != null) { if (bundle != null) {
String gsonPlaceList = bundle.getString("PlaceList", "[]"); String gsonPlaceList = bundle.getString("PlaceList", "[]");