I have a AppCompatActivity that controls replacing many fragments. Here is my layout for it.
activity_main.xml
I have used @JasonWyatt's solution and added DragCallback to behavior class to prevent touch and drag CollapsingToolbarLayout to expand it
private void setDragCallback() {
setDragCallback(new DragCallback() {
@Override
public boolean canDrag(@NonNull AppBarLayout appBarLayout) {
return mEnabled;
}
});
}