File tree 1 file changed +3
-2
lines changed
app/src/main/java/fr/free/nrw/commons/nearby/fragments
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 82
82
import fr .free .nrw .commons .contributions .ContributionController ;
83
83
import fr .free .nrw .commons .contributions .ContributionsFragment ;
84
84
import fr .free .nrw .commons .contributions .MainActivity ;
85
+ import fr .free .nrw .commons .contributions .MainActivity .ActiveFragment ;
85
86
import fr .free .nrw .commons .di .CommonsDaggerSupportFragment ;
86
87
import fr .free .nrw .commons .kvstore .JsonKvStore ;
87
88
import fr .free .nrw .commons .location .LocationServiceManager ;
@@ -333,7 +334,7 @@ private void addCheckBoxCallback() {
333
334
}
334
335
335
336
private void performMapReadyActions () {
336
- if (isVisible () && isMapBoxReady ) {
337
+ if ((( MainActivity ) getActivity ()). activeFragment == ActiveFragment . NEARBY && isMapBoxReady ) {
337
338
checkPermissionsAndPerformAction (() -> {
338
339
lastKnownLocation = locationManager .getLastLocation ();
339
340
fr .free .nrw .commons .location .LatLng target =lastFocusLocation ;
@@ -362,7 +363,7 @@ public void onResume() {
362
363
mapView .onResume ();
363
364
presenter .attachView (this );
364
365
registerNetworkReceiver ();
365
- if (isResumed () && isVisibleToUser ) {
366
+ if (isResumed () && (( MainActivity ) getActivity ()). activeFragment == ActiveFragment . NEARBY ) {
366
367
startTheMap ();
367
368
}
368
369
}
You can’t perform that action at this time.
0 commit comments