Class DynamicBottomSheetBehavior<V extends View>
java.lang.Object
androidx.coordinatorlayout.widget.CoordinatorLayout.Behavior<V>
com.google.android.material.bottomsheet.BottomSheetBehavior<V>
com.pranavpandey.android.dynamic.support.behavior.DynamicBottomSheetBehavior<V>
- Type Parameters:
V
- The type of the view attached to this behavior.
- All Implemented Interfaces:
MaterialBackHandler
A
BottomSheetBehavior
behavior to automatically hide it according to the nested scroll.
Set this behavior in the layout file having CoordinatorLayout
as root element to hide
the bottom sheet according to the scroll direction.
Scrolling in downwards direction will hide the bottom sheet.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.android.material.bottomsheet.BottomSheetBehavior
BottomSheetBehavior.BottomSheetCallback, BottomSheetBehavior.SavedState, BottomSheetBehavior.SaveFlags, BottomSheetBehavior.StableState, BottomSheetBehavior.State
-
Field Summary
Fields inherited from class com.google.android.material.bottomsheet.BottomSheetBehavior
PEEK_HEIGHT_AUTO, SAVE_ALL, SAVE_FIT_TO_CONTENTS, SAVE_HIDEABLE, SAVE_NONE, SAVE_PEEK_HEIGHT, SAVE_SKIP_COLLAPSED, STATE_COLLAPSED, STATE_DRAGGING, STATE_EXPANDED, STATE_HALF_EXPANDED, STATE_HIDDEN, STATE_SETTLING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
layoutDependsOn
(CoordinatorLayout parent, V child, View dependency) boolean
onLayoutChild
(CoordinatorLayout parent, V child, int layoutDirection) void
onNestedScroll
(CoordinatorLayout coordinatorLayout, V child, View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int type, int[] consumed) boolean
onStartNestedScroll
(CoordinatorLayout coordinatorLayout, V child, View directTargetChild, View target, int nestedScrollAxes, int type) Methods inherited from class com.google.android.material.bottomsheet.BottomSheetBehavior
addBottomSheetCallback, calculateSlideOffset, cancelBackProgress, disableShapeAnimations, from, getExpandedOffset, getHalfExpandedRatio, getHideFriction, getLastStableState, getMaxHeight, getMaxWidth, getPeekHeight, getSaveFlags, getSignificantVelocityThreshold, getSkipCollapsed, getState, handleBackInvoked, isDraggable, isFitToContents, isGestureInsetBottomIgnored, isHideable, isHideableWhenDragging, isNestedScrollingCheckEnabled, isShouldRemoveExpandedCorners, onAttachedToLayoutParams, onDetachedFromLayoutParams, onInterceptTouchEvent, onMeasureChild, onNestedPreFling, onNestedPreScroll, onRestoreInstanceState, onSaveInstanceState, onStopNestedScroll, onTouchEvent, removeBottomSheetCallback, setBottomSheetCallback, setDraggable, setExpandedOffset, setFitToContents, setGestureInsetBottomIgnored, setHalfExpandedRatio, setHideable, setHideableInternal, setHideFriction, setMaxHeight, setMaxWidth, setPeekHeight, setPeekHeight, setSaveFlags, setShouldRemoveExpandedCorners, setSignificantVelocityThreshold, setSkipCollapsed, setState, setUpdateImportantForAccessibilityOnSiblings, shouldExpandOnUpwardDrag, shouldSkipHalfExpandedStateWhenDragging, shouldSkipSmoothAnimation, startBackProgress, updateBackProgress
Methods inherited from class androidx.coordinatorlayout.widget.CoordinatorLayout.Behavior
blocksInteractionBelow, getInsetDodgeRect, getScrimColor, getScrimOpacity, getTag, onApplyWindowInsets, onDependentViewChanged, onDependentViewRemoved, onNestedFling, onNestedPreScroll, onNestedScroll, onNestedScroll, onNestedScrollAccepted, onNestedScrollAccepted, onRequestChildRectangleOnScreen, onStartNestedScroll, onStopNestedScroll, setTag
-
Constructor Details
-
DynamicBottomSheetBehavior
-
-
Method Details
-
onLayoutChild
public boolean onLayoutChild(@NonNull CoordinatorLayout parent, @NonNull V child, int layoutDirection) - Overrides:
onLayoutChild
in classBottomSheetBehavior<V extends View>
-
layoutDependsOn
public boolean layoutDependsOn(@NonNull CoordinatorLayout parent, @NonNull V child, @NonNull View dependency) - Overrides:
layoutDependsOn
in classCoordinatorLayout.Behavior<V extends View>
-
onStartNestedScroll
public boolean onStartNestedScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull V child, @NonNull View directTargetChild, @NonNull View target, int nestedScrollAxes, int type) - Overrides:
onStartNestedScroll
in classBottomSheetBehavior<V extends View>
-
onNestedScroll
public void onNestedScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull V child, @NonNull View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int type, @NonNull int[] consumed) - Overrides:
onNestedScroll
in classBottomSheetBehavior<V extends View>
-