mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Make curLatLang clearer
This commit is contained in:
parent
c0cf76e23c
commit
542c372ef9
1 changed files with 5 additions and 5 deletions
|
|
@ -347,16 +347,16 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
|
||||||
locationManager.registerLocationManager();
|
locationManager.registerLocationManager();
|
||||||
LatLng lastLocation = locationManager.getLastLocation();
|
LatLng lastLocation = locationManager.getLastLocation();
|
||||||
|
|
||||||
if (locationChangeType.equals(LocationServiceManager.LocationChangeType.PERMISSION_JUST_GRANTED)) {
|
|
||||||
lastLocation = lastKN;
|
|
||||||
Timber.d("Permission was just granted, lastKnownLocation is " + lastKN.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (curLatLang != null && curLatLang.equals(lastLocation)) { //refresh view only if location has changed
|
if (curLatLang != null && curLatLang.equals(lastLocation)) { //refresh view only if location has changed
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
curLatLang = lastLocation;
|
curLatLang = lastLocation;
|
||||||
|
|
||||||
|
if (locationChangeType.equals(LocationServiceManager.LocationChangeType.PERMISSION_JUST_GRANTED)) {
|
||||||
|
curLatLang = lastKN;
|
||||||
|
Timber.d("Permission was just granted, lastKnownLocation is " + lastKN.toString());
|
||||||
|
}
|
||||||
|
|
||||||
if (curLatLang == null) {
|
if (curLatLang == null) {
|
||||||
Timber.d("Skipping update of nearby places as location is unavailable");
|
Timber.d("Skipping update of nearby places as location is unavailable");
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue