I currently have a CoordinatorLayout with both a ConstraintLayout and a NestedScrollView in it. The NestedScrollView has a peek height of 50dp which is just a title. I want to be able to pull up the NestedScrollView when the device is connected, however when it is not connected I only want to be able to see the peek and not be able to drag up the rest of the view.
if(deviceConnected) {
mBottomSheetText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mBottomSheetBehavior.getState() == BottomSheetBehavior.STATE_COLLAPSED) {
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
} else {
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
}
}
});
} else {
//Want to prevent it form being draggable
}