mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Prevent loding map each time tab selected
This commit is contained in:
parent
be1ca1a2ae
commit
8c9c37abcb
1 changed files with 4 additions and 1 deletions
|
|
@ -40,6 +40,7 @@ public class NearbyParentFragmentPresenter
|
|||
boolean searchingThisArea;
|
||||
boolean nearbyMapViewReady;
|
||||
boolean nearbyOperationsInitialized;
|
||||
boolean mapInitialized; // TODO reset this on fragment destroyed
|
||||
|
||||
|
||||
private LocationServiceManager locationServiceManager;
|
||||
|
|
@ -71,7 +72,7 @@ public class NearbyParentFragmentPresenter
|
|||
Log.d("denemeTest","Nearby tab selected");
|
||||
onTabSelected = true;
|
||||
// The condition for initialize operations is both having views ready and tab is selected
|
||||
if (nearbyViewsAreReady) {
|
||||
if (nearbyViewsAreReady && !mapInitialized) {
|
||||
initializeNearbyOperations();
|
||||
}
|
||||
}
|
||||
|
|
@ -128,6 +129,7 @@ public class NearbyParentFragmentPresenter
|
|||
*/
|
||||
@Override
|
||||
public void nearbyMapViewReady() {
|
||||
// TODO: remove this
|
||||
nearbyMapViewReady = true;
|
||||
if (nearbyOperationsInitialized) {
|
||||
initializeMapOperations();
|
||||
|
|
@ -155,6 +157,7 @@ public class NearbyParentFragmentPresenter
|
|||
// TODO: document this prpoblem, if updateMapAndList is not called at checkGPS then this method never called, setup map view never ends
|
||||
this.nearbyParentFragmentView.addSearchThisAreaButtonAction();
|
||||
this.nearbyMapFragmentView.addOnCameraMoveListener(onCameraMove(getMapboxMap()));
|
||||
mapInitialized = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue