mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
try to simplify previous method during refactor
This commit is contained in:
parent
034a2e2f08
commit
bcd7e648b6
1 changed files with 28 additions and 0 deletions
|
|
@ -9,6 +9,10 @@ import fr.free.nrw.commons.nearby.mvp.contract.NearbyParentFragmentContract;
|
||||||
import fr.free.nrw.commons.wikidata.WikidataEditListener;
|
import fr.free.nrw.commons.wikidata.WikidataEditListener;
|
||||||
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.MAP_UPDATED;
|
||||||
|
import static fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType.PERMISSION_JUST_GRANTED;
|
||||||
|
|
||||||
public class NearbyParentFragmentPresenter
|
public class NearbyParentFragmentPresenter
|
||||||
implements NearbyParentFragmentContract.UserActions,
|
implements NearbyParentFragmentContract.UserActions,
|
||||||
WikidataEditListener.WikidataP18EditListener,
|
WikidataEditListener.WikidataP18EditListener,
|
||||||
|
|
@ -18,6 +22,7 @@ public class NearbyParentFragmentPresenter
|
||||||
|
|
||||||
private NearbyParentFragmentContract.View nearbyParentFragmentView;
|
private NearbyParentFragmentContract.View nearbyParentFragmentView;
|
||||||
private boolean isNearbyLocked;
|
private boolean isNearbyLocked;
|
||||||
|
private LatLng curLatLng;
|
||||||
|
|
||||||
public NearbyParentFragmentPresenter(NearbyParentFragmentContract.View nearbyParentFragmentView) {
|
public NearbyParentFragmentPresenter(NearbyParentFragmentContract.View nearbyParentFragmentView) {
|
||||||
this.nearbyParentFragmentView = nearbyParentFragmentView;
|
this.nearbyParentFragmentView = nearbyParentFragmentView;
|
||||||
|
|
@ -79,6 +84,29 @@ public class NearbyParentFragmentPresenter
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nearbyParentFragmentView.registerLocationUpdates(locationManager);
|
||||||
|
LatLng lastLocation = locationManager.getLastLocation();
|
||||||
|
|
||||||
|
if (curLatLng != null) {
|
||||||
|
// TODO figure out what is happening here about orientation change
|
||||||
|
}
|
||||||
|
|
||||||
|
curLatLng = lastLocation;
|
||||||
|
|
||||||
|
if (curLatLng == null) {
|
||||||
|
Timber.d("Skipping update of nearby places as location is unavailable");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (locationChangeType.equals(LOCATION_SIGNIFICANTLY_CHANGED)
|
||||||
|
|| locationChangeType.equals(MAP_UPDATED)) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue