Removed search this area button

This commit is contained in:
Kanahia 2024-06-29 05:55:56 +05:30
parent ef8f73adcc
commit a11003a2fb
4 changed files with 19 additions and 54 deletions

View file

@ -42,10 +42,6 @@ public interface NearbyParentFragmentContract {
void hideBottomDetailsSheet();
void addSearchThisAreaButtonAction();
void setSearchThisAreaButtonVisibility(boolean isVisible);
void setProgressBarVisibility(boolean isVisible);
boolean isDetailsBottomSheetVisible();

View file

@ -206,6 +206,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
private List<Place> updatedPlaceList;
private LatLng updatedLatLng;
private boolean searchble;
private ActivityResultLauncher<String[]> inAppCameraLocationPermissionLauncher = registerForActivityResult(
new RequestMultiplePermissions(),
@ -423,13 +424,14 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
if (isNetworkConnectionEstablished() && (event.getX() > 0
|| event.getY() > 0)) {
if (distance > 2000.0) {
setSearchThisAreaButtonVisibility(true);
searchble = true;
presenter.searchInTheArea();
} else {
setSearchThisAreaButtonVisibility(false);
searchble = false;
}
}
} else {
setSearchThisAreaButtonVisibility(false);
searchble = false;
}
}
@ -984,7 +986,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
if (snackbar == null) {
snackbar = Snackbar.make(view, R.string.no_internet,
Snackbar.LENGTH_INDEFINITE);
setSearchThisAreaButtonVisibility(false);
searchble = false;
setProgressBarVisibility(false);
}
@ -1278,6 +1280,8 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
.subscribe(nearbyPlacesInfo -> {
if (nearbyPlacesInfo.placeList == null || nearbyPlacesInfo.placeList.isEmpty()) {
showErrorMessage(getString(R.string.no_nearby_places_around));
setProgressBarVisibility(false);
presenter.lockUnlockNearby(false);
} else {
updateMapMarkers(nearbyPlacesInfo.placeList, nearbyPlacesInfo.currentLatLng,
true);
@ -1315,6 +1319,8 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
.subscribe(nearbyPlacesInfo -> {
if (nearbyPlacesInfo.placeList == null || nearbyPlacesInfo.placeList.isEmpty()) {
showErrorMessage(getString(R.string.no_nearby_places_around));
setProgressBarVisibility(false);
presenter.lockUnlockNearby(false);
} else {
// Updating last searched location
applicationKvStore.putString("LastLocation",
@ -1468,20 +1474,6 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
}
}
@Override
public void addSearchThisAreaButtonAction() {
binding.searchThisAreaButton.setOnClickListener(presenter.onSearchThisAreaClicked());
}
@Override
public void setSearchThisAreaButtonVisibility(final boolean isVisible) {
if (isVisible) {
binding.searchThisAreaButton.setVisibility(View.VISIBLE);
} else {
binding.searchThisAreaButton.setVisibility(View.GONE);
}
}
@Override
public void setRecyclerViewAdapterAllSelected() {
if (nearbyFilterSearchRecyclerViewAdapter != null
@ -2014,13 +2006,13 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
if (lastMapFocus != null) {
if (isNetworkConnectionEstablished()) {
if (distance > 2000.0) {
setSearchThisAreaButtonVisibility(true);
searchble = true;
} else {
setSearchThisAreaButtonVisibility(false);
searchble = false;
}
}
} else {
setSearchThisAreaButtonVisibility(false);
searchble = false;
}
}
}

View file

@ -323,18 +323,12 @@ public class NearbyParentFragmentPresenter
}
}
public View.OnClickListener onSearchThisAreaClicked() {
return v -> {
nearbyParentFragmentView.stopQuery();
// Lock map operations during search this area operation
// nearbyParentFragmentView.setMapCenter();
nearbyParentFragmentView.setSearchThisAreaButtonVisibility(false);
if (searchCloseToCurrentLocation()) {
updateMapAndList(LOCATION_SIGNIFICANTLY_CHANGED);
} else {
updateMapAndList(SEARCH_CUSTOM_AREA);
}
};
public void searchInTheArea(){
if (searchCloseToCurrentLocation()) {
updateMapAndList(LOCATION_SIGNIFICANTLY_CHANGED);
} else {
updateMapAndList(SEARCH_CUSTOM_AREA);
}
}
/**
@ -365,7 +359,6 @@ public class NearbyParentFragmentPresenter
public void onMapReady() {
if (null != nearbyParentFragmentView) {
nearbyParentFragmentView.addSearchThisAreaButtonAction();
initializeMapOperations();
}
}

View file

@ -97,22 +97,6 @@
</RelativeLayout>
<Button
android:id="@+id/search_this_area_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/rl_container_wlm_month_message"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_margin="@dimen/activity_margin_horizontal"
android:background="@color/white"
android:padding="@dimen/activity_margin_horizontal"
android:singleLine="true"
android:text="@string/search_this_area"
android:textColor="@color/status_bar_blue"
android:visibility="gone"
app:elevation="@dimen/dimen_6" />
<View
android:id="@+id/transparentView"
android:layout_width="match_parent"