0

I am trying to keep BottomSheetBehavior extended after reloading the BottomSheet view but the code below makes the BottomSheet view disappear and reappear after reloading


        @Click(R.id.root_width_layout)
        private void onClick() {
            SELECTED_CAR_POSITION = mPosition;

            if(Integer.valueOf(vehiclesBean.getService_type_id())!=4){
                sessionManager.setCarType(SELECTED_CAR_POSITION);
            }

            placeholder.refresh(); 
            if (sheetBehaviorBottom.getState() == BottomSheetBehavior.STATE_COLLAPSED) {
                sheetBehaviorBottom.setState(BottomSheetBehavior.STATE_EXPANDED);
            }else{
                sheetBehaviorBottom.setState(BottomSheetBehavior.STATE_COLLAPSED);
            }
            if (vehiclesBean != null) {
                sessionManager.setServiceTypeId(Integer.valueOf(vehiclesBean.getService_type_id()));
                carSelectionInterface.onCarClick(vehiclesBean.getMap_icon(),vehiclesBean.getRide_now(), vehiclesBean.getRide_later(), vehiclesBean.getSurcharge(), "" + vehiclesBean.getId(), "", String.valueOf(vehiclesBean.getService_type_id()), 0); // sending blank package id cause normal category (ie this fragment ) doesn't come in any package
            }
        }

What I'm doing is that if I click on an item in the BottomSheet list, I have to refresh the BottomSheet view to apply a desing . but the problem is that if I refresh the BottomSheet view, the BottomSheet disappears and reappears. I want to keep BottomSheetBehavior extended, without making it disappear and reappear after the refresh.

the code below refreshes the contents of the BottomSheet view

placeholder.refresh(); 
alabiboo
  • 53
  • 1
  • 10

0 Answers0