mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Hide bottom sheets accordingly
This commit is contained in:
parent
c8100b55d7
commit
c5deba8b0b
4 changed files with 23 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ public interface NearbyParentFragmentContract {
|
|||
void animateFABs();
|
||||
void recenterMap(LatLng curLatLng);
|
||||
void hideBottomSheet();
|
||||
void hideBottomDetailsSheet();
|
||||
void displayBottomSheetWithInfo(Marker marker);
|
||||
void addOnCameraMoveListener(MapboxMap.OnCameraMoveListener onCameraMoveListener);
|
||||
void addSearchThisAreaButtonAction();
|
||||
|
|
@ -51,6 +52,7 @@ public interface NearbyParentFragmentContract {
|
|||
void backButtonClicked();
|
||||
MapboxMap.OnCameraMoveListener onCameraMove(MapboxMap mapboxMap);
|
||||
void filterByMarkerType(List<Label> selectedLabels);
|
||||
void searchViewGainedFocus();
|
||||
}
|
||||
|
||||
interface ViewsAreReadyCallback {
|
||||
|
|
|
|||
|
|
@ -203,6 +203,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
|||
searchView.setOnQueryTextFocusChangeListener((v, hasFocus) -> {
|
||||
if (hasFocus) {
|
||||
//Log.d("deneme33","11-"+recyclerView.getAdapter().getCount());
|
||||
nearbyParentFragmentPresenter.searchViewGainedFocus();
|
||||
nearbyFilterList.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
// Log.d("deneme33","22-"+recyclerView.getAdapter().getCount());
|
||||
|
|
@ -789,6 +790,11 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
|||
bottomSheetListBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideBottomDetailsSheet() {
|
||||
bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayBottomSheetWithInfo(Marker marker) {
|
||||
this.selectedMarker = marker;
|
||||
|
|
|
|||
|
|
@ -362,6 +362,16 @@ public class NearbyParentFragmentPresenter
|
|||
//}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void searchViewGainedFocus() {
|
||||
if(nearbyParentFragmentView.isListBottomSheetExpanded()) {
|
||||
// Back should first hide the bottom sheet if it is expanded
|
||||
nearbyParentFragmentView.hideBottomSheet();
|
||||
} else if (nearbyParentFragmentView.isDetailsBottomSheetVisible()) {
|
||||
nearbyParentFragmentView.hideBottomDetailsSheet();
|
||||
}
|
||||
}
|
||||
|
||||
public View.OnClickListener onSearchThisAreaClicked() {
|
||||
return v -> {
|
||||
// Lock map operations during search this area operation
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
android:layout_height="match_parent"
|
||||
android:background="@color/status_bar_blue"
|
||||
android:id="@+id/map_layout">
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"/>
|
||||
|
||||
<include
|
||||
layout="@layout/nearby_filter_all_items"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue