Remove location listener implementation from view, handle them in presenter instead. And add timber debug notes and required method calls

This commit is contained in:
neslihanturan 2019-05-27 13:37:47 +03:00
parent 97ab63e19a
commit ceab7f4c1b
2 changed files with 7 additions and 21 deletions

View file

@ -51,8 +51,7 @@ import static fr.free.nrw.commons.location.LocationServiceManager.LocationChange
* two nearby element fragments as NearbyMapFragment and NearbyListFragment * two nearby element fragments as NearbyMapFragment and NearbyListFragment
*/ */
public class NearbyParentFragment extends CommonsDaggerSupportFragment public class NearbyParentFragment extends CommonsDaggerSupportFragment
implements LocationUpdateListener, implements WikidataEditListener.WikidataP18EditListener,
WikidataEditListener.WikidataP18EditListener,
NearbyParentFragmentContract.View { NearbyParentFragmentContract.View {
@BindView(R.id.progressBar) @BindView(R.id.progressBar)
@ -204,21 +203,6 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
return (NearbyListFragment) getChildFragmentManager().findFragmentByTag(TAG_RETAINED_LIST_FRAGMENT); return (NearbyListFragment) getChildFragmentManager().findFragmentByTag(TAG_RETAINED_LIST_FRAGMENT);
} }
@Override
public void onLocationChangedSignificantly(LatLng latLng) {
Log.d("deneme1","location changed significantly");
}
@Override
public void onLocationChangedSlightly(LatLng latLng) {
Log.d("deneme1","location changed significantly");
}
@Override
public void onLocationChangedMedium(LatLng latLng) {
Log.d("deneme1","location changed significantly");
}
@Override @Override
public void onWikidataEditSuccessful() { public void onWikidataEditSuccessful() {

View file

@ -17,6 +17,7 @@ import io.reactivex.schedulers.Schedulers;
import timber.log.Timber; import timber.log.Timber;
import static fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType.LOCATION_SIGNIFICANTLY_CHANGED; import static fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType.LOCATION_SIGNIFICANTLY_CHANGED;
import static fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType.LOCATION_SLIGHTLY_CHANGED;
import static fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType.MAP_UPDATED; import static fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType.MAP_UPDATED;
public class NearbyParentFragmentPresenter public class NearbyParentFragmentPresenter
@ -181,19 +182,20 @@ public class NearbyParentFragmentPresenter
@Override @Override
public void onLocationChangedSignificantly(LatLng latLng) { public void onLocationChangedSignificantly(LatLng latLng) {
Log.d("deneme1","onLocationChangedSignificantly"); Timber.d("Location significantly changed");
updateMapAndList(LOCATION_SIGNIFICANTLY_CHANGED);
} }
@Override @Override
public void onLocationChangedSlightly(LatLng latLng) { public void onLocationChangedSlightly(LatLng latLng) {
Log.d("deneme1","onLocationChangedSlightly"); Timber.d("Location significantly changed");
updateMapAndList(LOCATION_SLIGHTLY_CHANGED);
} }
@Override @Override
public void onLocationChangedMedium(LatLng latLng) { public void onLocationChangedMedium(LatLng latLng) {
Log.d("deneme1","onLocationChangedMedium"); Timber.d("Location changed medium");
} }
} }