I have a bottom sheet with a NestedScrollView inside (see below). When I press on a FAB button, I want to make some parts in this NestedScrollView invisible. But when I chan
I ran into this, took a while to figure out what was the cause.
It's because you're using android:animateLayoutChanges, which surfaces a bug in either BottomSheetBehavior or CoordinatorLayout.
Remove it and the BottomSheet will stop animating on its own when it shouldn't. Not a fix, but a workaround at least.
--
Update:
Turns out that if you enable "animateLayoutChanges" programmatically by setting the LayoutTransition instance to use, you can set a flag on it that will prevent it from messing with views that are ancestors of the one you're using android:animateLayoutChanges on (aka: your BottomSheet container):
LayoutTransition transition = new LayoutTransition();
transition.setAnimateParentHierarchy(false);
yourLinearLayoutThatNeedsLayoutAnimation.setLayoutTransition(transition);