public class BottomSheetCoordinatorBehavior extends BottomSheetInsetsBehavior<BottomSheetCoordinatorLayout>
Behavior allows AppBarLayout to accept drag events.
When AppBarLayout stands inside a BottomSheetBehavior,
all touch events are stolen by the behavior, unless they focus on the nested scrolling child
(which the app bar isn't). (see BottomSheetBehavior.onInterceptTouchEvent, last line).
Since no event goes to app bar, its own AppBarLayout.Behavior
cannot control drags on the view itself. We have to take care of this.
A simple implementation for this touch policy could be just returning false when sheet is expanded,
so that AppBarLayout can catch the event.
Unfortunately, this is not enough, because if sheet is expanded **and** app bar is expanded
**and** the finger goes down, we want this Behavior to actually intercept.BottomSheetInsetsBehavior.SavedState| Constructor and Description |
|---|
BottomSheetCoordinatorBehavior() |
BottomSheetCoordinatorBehavior(android.content.Context context,
android.util.AttributeSet attrs) |
| Modifier and Type | Method and Description |
|---|---|
static BottomSheetCoordinatorBehavior |
from(BottomSheetCoordinatorLayout view) |
boolean |
onInterceptTouchEvent(android.support.design.widget.CoordinatorLayout parent,
BottomSheetCoordinatorLayout sheet,
android.view.MotionEvent event) |
boolean |
onTouchEvent(android.support.design.widget.CoordinatorLayout parent,
BottomSheetCoordinatorLayout sheet,
android.view.MotionEvent event) |
onApplyWindowInsets, onRestoreInstanceState, onSaveInstanceStategetPeekHeight, getSkipCollapsed, getState, isFitToContents, isHideable, onLayoutChild, onNestedPreFling, onNestedPreScroll, onStartNestedScroll, onStopNestedScroll, setBottomSheetCallback, setFitToContents, setHideable, setPeekHeight, setSkipCollapsed, setStateblocksInteractionBelow, getInsetDodgeRect, getScrimColor, getScrimOpacity, getTag, layoutDependsOn, onAttachedToLayoutParams, onDependentViewChanged, onDependentViewRemoved, onDetachedFromLayoutParams, onMeasureChild, onNestedFling, onNestedPreScroll, onNestedScroll, onNestedScroll, onNestedScrollAccepted, onNestedScrollAccepted, onRequestChildRectangleOnScreen, onStartNestedScroll, onStopNestedScroll, setTagpublic BottomSheetCoordinatorBehavior()
public BottomSheetCoordinatorBehavior(android.content.Context context,
android.util.AttributeSet attrs)
public static BottomSheetCoordinatorBehavior from(BottomSheetCoordinatorLayout view)
public boolean onTouchEvent(android.support.design.widget.CoordinatorLayout parent,
BottomSheetCoordinatorLayout sheet,
android.view.MotionEvent event)
onTouchEvent in class android.support.design.widget.BottomSheetBehavior<BottomSheetCoordinatorLayout>public boolean onInterceptTouchEvent(android.support.design.widget.CoordinatorLayout parent,
BottomSheetCoordinatorLayout sheet,
android.view.MotionEvent event)
onInterceptTouchEvent in class android.support.design.widget.BottomSheetBehavior<BottomSheetCoordinatorLayout>