Fix small dagger issue to inject location manager properly

This commit is contained in:
neslihanturan 2019-09-02 12:27:54 +03:00
parent 53ee714eff
commit aa7fb84313
2 changed files with 11 additions and 2 deletions

View file

@ -14,6 +14,7 @@ import fr.free.nrw.commons.explore.recentsearches.RecentSearchesFragment;
import fr.free.nrw.commons.media.MediaDetailFragment; import fr.free.nrw.commons.media.MediaDetailFragment;
import fr.free.nrw.commons.media.MediaDetailPagerFragment; import fr.free.nrw.commons.media.MediaDetailPagerFragment;
import fr.free.nrw.commons.nearby.NearbyListFragment; import fr.free.nrw.commons.nearby.NearbyListFragment;
import fr.free.nrw.commons.nearby.NearbyTestLayersFragment;
import fr.free.nrw.commons.nearby.SupportMapFragment; import fr.free.nrw.commons.nearby.SupportMapFragment;
import fr.free.nrw.commons.nearby.mvp.fragments.NearbyParentFragment; import fr.free.nrw.commons.nearby.mvp.fragments.NearbyParentFragment;
import fr.free.nrw.commons.review.ReviewImageFragment; import fr.free.nrw.commons.review.ReviewImageFragment;
@ -65,6 +66,9 @@ public abstract class FragmentBuilderModule {
@ContributesAndroidInjector @ContributesAndroidInjector
abstract NearbyParentFragment bindNearbyParentFragment(); abstract NearbyParentFragment bindNearbyParentFragment();
@ContributesAndroidInjector
abstract NearbyTestLayersFragment bindNearbyTestLayersFragment();
@ContributesAndroidInjector @ContributesAndroidInjector
abstract BookmarkPicturesFragment bindBookmarkPictureListFragment(); abstract BookmarkPicturesFragment bindBookmarkPictureListFragment();

View file

@ -22,8 +22,10 @@ import com.mapbox.mapboxsdk.maps.Style;
import javax.inject.Inject; import javax.inject.Inject;
import butterknife.ButterKnife;
import fr.free.nrw.commons.R; import fr.free.nrw.commons.R;
import fr.free.nrw.commons.contributions.MainActivity; import fr.free.nrw.commons.contributions.MainActivity;
import fr.free.nrw.commons.di.CommonsDaggerSupportFragment;
import fr.free.nrw.commons.location.LocationServiceManager; import fr.free.nrw.commons.location.LocationServiceManager;
import fr.free.nrw.commons.nearby.mvp.contract.NearbyParentFragmentContract; import fr.free.nrw.commons.nearby.mvp.contract.NearbyParentFragmentContract;
import fr.free.nrw.commons.nearby.mvp.presenter.NearbyParentFragmentPresenter; import fr.free.nrw.commons.nearby.mvp.presenter.NearbyParentFragmentPresenter;
@ -34,18 +36,21 @@ import static fr.free.nrw.commons.contributions.ContributionsFragment.CONTRIBUTI
import static fr.free.nrw.commons.nearby.NearbyTestFragmentLayersActivity.CONTRIBUTIONS_TAB_POSITION; import static fr.free.nrw.commons.nearby.NearbyTestFragmentLayersActivity.CONTRIBUTIONS_TAB_POSITION;
public class NearbyTestLayersFragment extends Fragment implements NearbyParentFragmentContract.View { public class NearbyTestLayersFragment extends CommonsDaggerSupportFragment implements NearbyParentFragmentContract.View {
@Inject @Inject
LocationServiceManager locationManager; LocationServiceManager locationManager;
NearbyParentFragmentPresenter nearbyParentFragmentPresenter; NearbyParentFragmentPresenter nearbyParentFragmentPresenter;
SupportMapFragment mapFragment; SupportMapFragment mapFragment;
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_simple, container, false);
ButterKnife.bind(this, view);
// Inflate the layout for this fragment // Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_simple, container, false); return view;
} }