[android] Remove LocationListener.Simple()

Add default methods instead.

Signed-off-by: Roman Tsisyk <roman@tsisyk.com>
This commit is contained in:
Roman Tsisyk 2023-02-25 13:20:06 +02:00
parent 03f32574f1
commit 6fc67663a7
4 changed files with 7 additions and 13 deletions

View file

@ -94,7 +94,7 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
new Factory.KmzKmlProcessor(this),
};
private final LocationListener mLocationListener = new LocationListener.Simple()
private final LocationListener mLocationListener = new LocationListener()
{
@Override
public void onLocationUpdated(Location location)

View file

@ -6,16 +6,10 @@ import androidx.annotation.NonNull;
public interface LocationListener
{
class Simple implements LocationListener
{
@Override
public void onLocationUpdated(@NonNull Location location) {}
@Override
public void onCompassUpdated(double north) {}
}
void onLocationUpdated(@NonNull Location location);
void onCompassUpdated(double north);
default void onCompassUpdated(double north)
{
// No op.
}
}

View file

@ -59,7 +59,7 @@ public class NavigationService extends Service
private boolean mChangingConfiguration = false;
@NonNull
private final LocationListener mLocationListener = new LocationListener.Simple()
private final LocationListener mLocationListener = new LocationListener()
{
@Override
public void onLocationUpdated(Location location)

View file

@ -168,7 +168,7 @@ public class SearchFragment extends BaseMwmFragment
private String mInitialLocale;
private boolean mInitialSearchOnMap = false;
private final LocationListener mLocationListener = new LocationListener.Simple()
private final LocationListener mLocationListener = new LocationListener()
{
@Override
public void onLocationUpdated(Location location)