mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Refactor: Update onLocationChanged methods to accept nullable LatLng
The `onLocationChangedSignificantly`, `onLocationChangedSlightly`, and `onLocationChangedMedium` methods in `NearbyParentFragment.java` have been updated to accept a nullable `LatLng` parameter. This change allows for cases where the location may not be available or valid. The methods previously required a non-null `LatLng` object. If the location is found to be valid then the location is handled by calling `handleLocationUpdate` method.
This commit is contained in:
parent
a4109eb37c
commit
7175b7021f
1 changed files with 3 additions and 3 deletions
|
|
@ -1699,7 +1699,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChangedSignificantly(final LatLng latLng) {
|
||||
public void onLocationChangedSignificantly(@Nullable final LatLng latLng) {
|
||||
Timber.d("Location significantly changed");
|
||||
if (latLng != null) {
|
||||
handleLocationUpdate(latLng, LOCATION_SIGNIFICANTLY_CHANGED);
|
||||
|
|
@ -1707,7 +1707,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChangedSlightly(final LatLng latLng) {
|
||||
public void onLocationChangedSlightly(@Nullable final LatLng latLng) {
|
||||
Timber.d("Location slightly changed");
|
||||
if (latLng != null) {//If the map has never ever shown the current location, lets do it know
|
||||
handleLocationUpdate(latLng, LOCATION_SLIGHTLY_CHANGED);
|
||||
|
|
@ -1715,7 +1715,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChangedMedium(final LatLng latLng) {
|
||||
public void onLocationChangedMedium(@Nullable final LatLng latLng) {
|
||||
Timber.d("Location changed medium");
|
||||
if (latLng != null) {//If the map has never ever shown the current location, lets do it know
|
||||
handleLocationUpdate(latLng, LOCATION_SIGNIFICANTLY_CHANGED);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue