File tree 2 files changed +10
-0
lines changed
src/main/java/fr/free/nrw/commons/nearby
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ dependencies {
35
35
implementation ' com.github.chrisbanes:PhotoView:2.0.0'
36
36
implementation ' com.github.pedrovgs:renderers:3.3.3'
37
37
implementation ' com.mapbox.mapboxsdk:mapbox-android-sdk:6.8.0'
38
+ implementation ' com.mapbox.mapboxsdk:mapbox-android-plugin-localization:0.6.0'
38
39
implementation ' com.github.deano2390:MaterialShowcaseView:1.2.0'
39
40
implementation ' com.dinuscxj:circleprogressbar:1.1.1'
40
41
implementation ' com.karumi:dexter:5.0.0'
Original file line number Diff line number Diff line change 44
44
import com .mapbox .mapboxsdk .maps .MapView ;
45
45
import com .mapbox .mapboxsdk .maps .MapboxMap ;
46
46
import com .mapbox .mapboxsdk .maps .MapboxMapOptions ;
47
+ import com .mapbox .mapboxsdk .plugins .localization .LocalizationPlugin ;
47
48
48
49
import java .lang .reflect .Type ;
49
50
import java .util .ArrayList ;
@@ -528,6 +529,14 @@ private void setupMapView(Bundle savedInstanceState) {
528
529
// create map
529
530
mapView .onCreate (savedInstanceState );
530
531
mapView .getMapAsync (mapboxMap -> {
532
+ LocalizationPlugin localizationPlugin = new LocalizationPlugin (mapView , mapboxMap );
533
+
534
+ try {
535
+ localizationPlugin .matchMapLanguageWithDeviceDefault ();
536
+ } catch (RuntimeException exception ) {
537
+ Timber .d (exception .toString ());
538
+ }
539
+
531
540
NearbyMapFragment .this .mapboxMap = mapboxMap ;
532
541
addMapMovementListeners ();
533
542
updateMapSignificantlyForCurrentLocation ();
You can’t perform that action at this time.
0 commit comments