mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Add a boolean to enable refresh after orientation changed
This commit is contained in:
parent
677e0099af
commit
c7b7522edd
2 changed files with 10 additions and 2 deletions
|
|
@ -428,8 +428,7 @@ public class NearbyFragment extends CommonsDaggerSupportFragment
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateMapFragment(boolean updateViaButton, boolean isSlightUpdate, @Nullable LatLng customLatLng, @Nullable NearbyController.NearbyPlacesInfo nearbyPlacesInfo) {
|
private void updateMapFragment(boolean updateViaButton, boolean isSlightUpdate, @Nullable LatLng customLatLng, @Nullable NearbyController.NearbyPlacesInfo nearbyPlacesInfo) {
|
||||||
|
if (nearbyMapFragment.checkingAround) {
|
||||||
if (nearbyMapFragment.searchThisAreaModeOn) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
|
|
||||||
private boolean isMapReady;
|
private boolean isMapReady;
|
||||||
public boolean searchThisAreaModeOn = false;
|
public boolean searchThisAreaModeOn = false;
|
||||||
|
public boolean checkingAround = false;
|
||||||
|
|
||||||
private Bundle bundleForUpdtes;// Carry information from activity about changed nearby places and current location
|
private Bundle bundleForUpdtes;// Carry information from activity about changed nearby places and current location
|
||||||
private boolean searchedAroundCurrentLocation = true;
|
private boolean searchedAroundCurrentLocation = true;
|
||||||
|
|
@ -556,6 +557,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
, NearbyController.currentLocation.getLongitude()));
|
, NearbyController.currentLocation.getLongitude()));
|
||||||
|
|
||||||
if (distance > NearbyController.searchedRadius*1000*3/4) { //Convert to meter, and compare if our distance is bigger than 3/4 or our searched area
|
if (distance > NearbyController.searchedRadius*1000*3/4) { //Convert to meter, and compare if our distance is bigger than 3/4 or our searched area
|
||||||
|
checkingAround = true;
|
||||||
if (!searchThisAreaModeOn) { // If we are changing mode, then change click action
|
if (!searchThisAreaModeOn) { // If we are changing mode, then change click action
|
||||||
searchThisAreaModeOn = true;
|
searchThisAreaModeOn = true;
|
||||||
searchThisAreaButton.setOnClickListener(new View.OnClickListener() {
|
searchThisAreaButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
@ -575,6 +577,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
checkingAround = false;
|
||||||
if (searchThisAreaModeOn) {
|
if (searchThisAreaModeOn) {
|
||||||
searchThisAreaModeOn = false; // This flag will help us to understand should we folor users location or not
|
searchThisAreaModeOn = false; // This flag will help us to understand should we folor users location or not
|
||||||
searchThisAreaButton.setOnClickListener(new View.OnClickListener() {
|
searchThisAreaButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
@ -1002,6 +1005,12 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
if (mapView != null) {
|
if (mapView != null) {
|
||||||
mapView.onResume();
|
mapView.onResume();
|
||||||
}
|
}
|
||||||
|
if (mapboxMap != null) {
|
||||||
|
mapboxMap.getUiSettings().setAllGesturesEnabled(true);
|
||||||
|
}
|
||||||
|
searchThisAreaModeOn = false;
|
||||||
|
checkingAround = false;
|
||||||
|
searchedAroundCurrentLocation = true;
|
||||||
initViews();
|
initViews();
|
||||||
setListeners();
|
setListeners();
|
||||||
transparentView.setClickable(false);
|
transparentView.setClickable(false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue