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
*/
public class NearbyParentFragment extends CommonsDaggerSupportFragment
implements LocationUpdateListener,
WikidataEditListener.WikidataP18EditListener,
implements WikidataEditListener.WikidataP18EditListener,
NearbyParentFragmentContract.View {
@BindView(R.id.progressBar)
@ -204,21 +203,6 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
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
public void onWikidataEditSuccessful() {

View file

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