mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Add MapBox localization (#2614)
This commit is contained in:
parent
1d225c545e
commit
51f58b7118
2 changed files with 10 additions and 0 deletions
|
|
@ -35,6 +35,7 @@ dependencies {
|
|||
implementation 'com.github.chrisbanes:PhotoView:2.0.0'
|
||||
implementation 'com.github.pedrovgs:renderers:3.3.3'
|
||||
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.8.0'
|
||||
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-localization:0.6.0'
|
||||
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
|
||||
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
|
||||
implementation 'com.karumi:dexter:5.0.0'
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ import com.mapbox.mapboxsdk.geometry.LatLng;
|
|||
import com.mapbox.mapboxsdk.maps.MapView;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMapOptions;
|
||||
import com.mapbox.mapboxsdk.plugins.localization.LocalizationPlugin;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -528,6 +529,14 @@ public class NearbyMapFragment extends DaggerFragment {
|
|||
// create map
|
||||
mapView.onCreate(savedInstanceState);
|
||||
mapView.getMapAsync(mapboxMap -> {
|
||||
LocalizationPlugin localizationPlugin = new LocalizationPlugin(mapView, mapboxMap);
|
||||
|
||||
try {
|
||||
localizationPlugin.matchMapLanguageWithDeviceDefault();
|
||||
} catch (RuntimeException exception) {
|
||||
Timber.d(exception.toString());
|
||||
}
|
||||
|
||||
NearbyMapFragment.this.mapboxMap = mapboxMap;
|
||||
addMapMovementListeners();
|
||||
updateMapSignificantlyForCurrentLocation();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue