Like the titles said, is there anyway to customize the size/height/offset of the official bottomSheet (Support library 23.x.x) when it is in STATE_EXPANDED state?
There is a class BottomSheetBehavior
but I can't find anything about height or offset.
After digging on Android code and searching I got it:
You can do it modifying default
BottomSheetBehavior
adding one more stat with following steps:CoordinatorLayout.Behavior<V>
BottomSheetBehavior
file to your new one.Modify the method
clampViewPositionVertical
with the following code:Add a new state
public static final int STATE_ANCHOR_POINT = X;
Modify the next methods:
onLayoutChild
,onStopNestedScroll
,BottomSheetBehavior<V> from(V view)
andsetState
(optional)I'm going to add those modified methods and a link to the example project
You can even use callbacks with
behavior.setBottomSheetCallback(new BottomSheetBehaviorGoogleMapsLike.BottomSheetCallback() {....
And here is how its looks like:
[]
Well, I'm not sure but I guess this is your answer: