mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +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 searchingThisArea;
|
||||||
boolean nearbyMapViewReady;
|
boolean nearbyMapViewReady;
|
||||||
boolean nearbyOperationsInitialized;
|
boolean nearbyOperationsInitialized;
|
||||||
|
boolean mapInitialized; // TODO reset this on fragment destroyed
|
||||||
|
|
||||||
|
|
||||||
private LocationServiceManager locationServiceManager;
|
private LocationServiceManager locationServiceManager;
|
||||||
|
|
@ -71,7 +72,7 @@ public class NearbyParentFragmentPresenter
|
||||||
Log.d("denemeTest","Nearby tab selected");
|
Log.d("denemeTest","Nearby tab selected");
|
||||||
onTabSelected = true;
|
onTabSelected = true;
|
||||||
// The condition for initialize operations is both having views ready and tab is selected
|
// The condition for initialize operations is both having views ready and tab is selected
|
||||||
if (nearbyViewsAreReady) {
|
if (nearbyViewsAreReady && !mapInitialized) {
|
||||||
initializeNearbyOperations();
|
initializeNearbyOperations();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -128,6 +129,7 @@ public class NearbyParentFragmentPresenter
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void nearbyMapViewReady() {
|
public void nearbyMapViewReady() {
|
||||||
|
// TODO: remove this
|
||||||
nearbyMapViewReady = true;
|
nearbyMapViewReady = true;
|
||||||
if (nearbyOperationsInitialized) {
|
if (nearbyOperationsInitialized) {
|
||||||
initializeMapOperations();
|
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
|
// 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.nearbyParentFragmentView.addSearchThisAreaButtonAction();
|
||||||
this.nearbyMapFragmentView.addOnCameraMoveListener(onCameraMove(getMapboxMap()));
|
this.nearbyMapFragmentView.addOnCameraMoveListener(onCameraMove(getMapboxMap()));
|
||||||
|
mapInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue