Is it possible to make a Standard Bottom Sheet snap to these three states?
STATE_EXPANDEDSTATE_HALF_EXPANDEDSTATE_COLLAPSED
By default it already snaps to STATE_EXPANDED and STATE_COLLAPSED but not to STATE_HALF_EXPANDED.
Is it possible to make a Standard Bottom Sheet snap to these three states?
STATE_EXPANDEDSTATE_HALF_EXPANDEDSTATE_COLLAPSEDBy default it already snaps to STATE_EXPANDED and STATE_COLLAPSED but not to STATE_HALF_EXPANDED.
Copyright © 2021 Jogjafile Inc.
I've just found out how one can achieve it by reading
BottomSheetBehavior.java.If you read that class, you'll find the following snippet of code:
As you can see, the code will only consider snapping to the
STATE_HALF_EXPANDEDstate iffitToContentsis equals to false.So setting this flag to
falseis the answer to the question.