mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
State: Map ready call is not called but permissions and methods are in correct order
This commit is contained in:
parent
f6c1d27382
commit
2e7365e902
2 changed files with 7 additions and 5 deletions
|
|
@ -138,9 +138,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
|||
// Resume the fragment if exist
|
||||
resumeFragment();
|
||||
if (!((MainActivity) getActivity()).isContributionsFragmentVisible) {
|
||||
checkPermissionsAndPerformAction(this::resumeFragment);
|
||||
} else {
|
||||
resumeFragment();
|
||||
checkPermissionsAndPerformAction(nearbyParentFragmentPresenter::performNearbyOperationsIfPermissionGiven);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -154,7 +152,6 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
|||
R.string.location_permission_rationale_nearby);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Thanks to this method we make sure NearbyMapFragment is ready and attached. So that we can
|
||||
* prevent NPE caused by null child fragment. This method is called from child fragment when
|
||||
|
|
|
|||
|
|
@ -99,7 +99,12 @@ public class NearbyParentFragmentPresenter
|
|||
Timber.d("initializing nearby operations started");
|
||||
// Add location listener to be notified about location changes
|
||||
locationServiceManager.addLocationListener(this);
|
||||
nearbyParentFragmentView.checkPermissionsAndPerformAction(nearbyParentFragmentView::resumeFragment);
|
||||
nearbyParentFragmentView.checkPermissionsAndPerformAction(this::performNearbyOperationsIfPermissionGiven);
|
||||
|
||||
}
|
||||
|
||||
public void performNearbyOperationsIfPermissionGiven() {
|
||||
Timber.d("performNearbyOperationsIfPermissionGiven");
|
||||
nearbyParentFragmentView.registerLocationUpdates(locationServiceManager);
|
||||
// Nearby buttons should be active, they should be inactive only during update
|
||||
lockNearby(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue