animateLayoutChanges=“true” in BottomSheetView showing unexpected behaviour

后端 未结 4 583
没有蜡笔的小新
没有蜡笔的小新 2021-01-31 15:24

I have a BottomSheetView which has animateLayoutChanges=\"true\". Initially it shows up fine. But if change the visibility of a view (insi

4条回答
  •  忘了有多久
    2021-01-31 16:11

    The BottomSheetBehavior does not work well with LayoutTransition (animateLayoutChanges="true") for now. I will work on a fix.

    For now, you can use Transition instead. Something like this will fade the view inside and animate the size of the bottom sheet.

    ViewGroup bottomSheet = ...;
    View hidingView = ...;
    
    TransitionManager.beginDelayedTransition(bottomSheet);
    hidingView.setVisibility(View.GONE);
    

    You can refer to Applying a Transition for more information including how to customize the animation.

提交回复
热议问题