Do not track users position if user is searching around

This commit is contained in:
neslihanturan 2019-10-02 16:30:27 +03:00
parent 1a816fdecd
commit dbd6693244
3 changed files with 13 additions and 1 deletions

View file

@ -36,6 +36,7 @@ public interface NearbyParentFragmentContract {
void setTabItemContributions();
boolean isDetailsBottomSheetVisible();
void setBottomSheetDetailsSmaller();
boolean isSearchThisAreaButtonVisible();
}
interface NearbyListView {

View file

@ -554,6 +554,15 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
}
}
@Override
public boolean isSearchThisAreaButtonVisible() {
if (searchThisAreaButton.getVisibility() == View.VISIBLE) {
return true;
} else {
return false;
}
}
@Override
public void setProgressBarVisibility(boolean isVisible) {
if (isVisible) {

View file

@ -258,7 +258,9 @@ public class NearbyParentFragmentPresenter
} else { // Means location changed slightly, ie user is walking or driving.
Timber.d("Means location changed slightly");
nearbyParentFragmentView.recenterMap(curLatLng);
if (!nearbyParentFragmentView.isSearchThisAreaButtonVisible()) { // Do not track users position if the user is checking around
nearbyParentFragmentView.recenterMap(curLatLng);
}
}
}