The BottomBar library I used is deprecated. But perhaps my code gives you an idea how it could be done.
I reacted to onSlide events of the BottomSheet like this:
@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
switch (bssBehavior.getState()) {
case BottomSheetBehavior.STATE_DRAGGING:
setMapPaddingBotttom(slideOffset);
searchVM.map.moveCamera(CameraUpdateFactory.newLatLng(lastValidMapCenter));
break;
case BottomSheetBehavior.STATE_SETTLING:
setMapPaddingBotttom(slideOffset);
searchVM.map.moveCamera(CameraUpdateFactory.newLatLng(lastValidMapCenter));
break;
case BottomSheetBehavior.STATE_HIDDEN:
break;
case BottomSheetBehavior.STATE_EXPANDED:
break;
case BottomSheetBehavior.STATE_COLLAPSED:
break;
}
And smoothly resized the map by changing its padding. For calculating it accordingly I used sth. like this.
private void setMapPaddingBotttom(Float offset) {
//From 0.0 (min) - 1.0 (max)
Float maxMapPaddingBottom = bsExpanded - bsCollapsed;
//left,top,right,bottom
searchVM.map.setPadding(0, 0, 0, Math.round(offset * maxMapPaddingBottom));
}