AppBarLayout.ScrollingViewBehavior
public
static
class
AppBarLayout.ScrollingViewBehavior
extends Behavior<V extends View>
java.lang.Object | ||
↳ | androidx.coordinatorlayout.widget.CoordinatorLayout.Behavior<V extends android.view.View> | |
↳ | com.google.android.material.appbar.AppBarLayout.ScrollingViewBehavior |
Behavior which should be used by View
s which can scroll vertically and support nested
scrolling to automatically scroll any AppBarLayout
siblings.
Summary
Public constructors | |
---|---|
AppBarLayout.ScrollingViewBehavior()
|
|
AppBarLayout.ScrollingViewBehavior(Context context, AttributeSet attrs)
|
Public methods | |
---|---|
int
|
getLeftAndRightOffset()
|
final
int
|
getOverlayTop()
Returns the distance that this view should overlap any |
int
|
getTopAndBottomOffset()
|
boolean
|
isHorizontalOffsetEnabled()
|
boolean
|
isVerticalOffsetEnabled()
|
boolean
|
layoutDependsOn(CoordinatorLayout parent, View child, View dependency)
|
boolean
|
onDependentViewChanged(CoordinatorLayout parent, View child, View dependency)
|
void
|
onDependentViewRemoved(CoordinatorLayout parent, View child, View dependency)
|
boolean
|
onLayoutChild(CoordinatorLayout parent, V child, int layoutDirection)
|
boolean
|
onMeasureChild(CoordinatorLayout parent, View child, int parentWidthMeasureSpec, int widthUsed, int parentHeightMeasureSpec, int heightUsed)
|
boolean
|
onRequestChildRectangleOnScreen(CoordinatorLayout parent, View child, Rect rectangle, boolean immediate)
|
void
|
setHorizontalOffsetEnabled(boolean horizontalOffsetEnabled)
|
boolean
|
setLeftAndRightOffset(int offset)
|
final
void
|
setOverlayTop(int overlayTop)
Set the distance that this view should overlap any |
boolean
|
setTopAndBottomOffset(int offset)
|
void
|
setVerticalOffsetEnabled(boolean verticalOffsetEnabled)
|
Protected methods | |
---|---|
void
|
layoutChild(CoordinatorLayout parent, V child, int layoutDirection)
|
void
|
layoutChild(CoordinatorLayout parent, View child, int layoutDirection)
|
boolean
|
shouldHeaderOverlapScrollingChild()
|
Inherited methods | |
---|---|
![]()
androidx.coordinatorlayout.widget.CoordinatorLayout.Behavior
| |
![]()
java.lang.Object
|
Public constructors
AppBarLayout.ScrollingViewBehavior
AppBarLayout.ScrollingViewBehavior ()
AppBarLayout.ScrollingViewBehavior
AppBarLayout.ScrollingViewBehavior (Context context, AttributeSet attrs)
Parameters | |
---|---|
context |
Context |
attrs |
AttributeSet |
Public methods
getLeftAndRightOffset
int getLeftAndRightOffset ()
Returns | |
---|---|
int |
getOverlayTop
int getOverlayTop ()
Returns the distance that this view should overlap any AppBarLayout
.
Returns | |
---|---|
int |
getTopAndBottomOffset
int getTopAndBottomOffset ()
Returns | |
---|---|
int |
isHorizontalOffsetEnabled
boolean isHorizontalOffsetEnabled ()
Returns | |
---|---|
boolean |
isVerticalOffsetEnabled
boolean isVerticalOffsetEnabled ()
Returns | |
---|---|
boolean |
layoutDependsOn
boolean layoutDependsOn (CoordinatorLayout parent, View child, View dependency)
Parameters | |
---|---|
parent |
CoordinatorLayout |
child |
View |
dependency |
View |
Returns | |
---|---|
boolean |
onDependentViewChanged
boolean onDependentViewChanged (CoordinatorLayout parent, View child, View dependency)
Parameters | |
---|---|
parent |
CoordinatorLayout |
child |
View |
dependency |
View |
Returns | |
---|---|
boolean |
onDependentViewRemoved
void onDependentViewRemoved (CoordinatorLayout parent, View child, View dependency)
Parameters | |
---|---|
parent |
CoordinatorLayout |
child |
View |
dependency |
View |
onLayoutChild
boolean onLayoutChild (CoordinatorLayout parent, V child, int layoutDirection)
Parameters | |
---|---|
parent |
CoordinatorLayout |
child |
V |
layoutDirection |
int |
Returns | |
---|---|
boolean |
onMeasureChild
boolean onMeasureChild (CoordinatorLayout parent, View child, int parentWidthMeasureSpec, int widthUsed, int parentHeightMeasureSpec, int heightUsed)
Parameters | |
---|---|
parent |
CoordinatorLayout |
child |
View |
parentWidthMeasureSpec |
int |
widthUsed |
int |
parentHeightMeasureSpec |
int |
heightUsed |
int |
Returns | |
---|---|
boolean |
onRequestChildRectangleOnScreen
boolean onRequestChildRectangleOnScreen (CoordinatorLayout parent, View child, Rect rectangle, boolean immediate)
Parameters | |
---|---|
parent |
CoordinatorLayout |
child |
View |
rectangle |
Rect |
immediate |
boolean |
Returns | |
---|---|
boolean |
setHorizontalOffsetEnabled
void setHorizontalOffsetEnabled (boolean horizontalOffsetEnabled)
Parameters | |
---|---|
horizontalOffsetEnabled |
boolean |
setLeftAndRightOffset
boolean setLeftAndRightOffset (int offset)
Parameters | |
---|---|
offset |
int |
Returns | |
---|---|
boolean |
setOverlayTop
void setOverlayTop (int overlayTop)
Set the distance that this view should overlap any AppBarLayout
.
Parameters | |
---|---|
overlayTop |
int : the distance in px
|
setTopAndBottomOffset
boolean setTopAndBottomOffset (int offset)
Parameters | |
---|---|
offset |
int |
Returns | |
---|---|
boolean |
setVerticalOffsetEnabled
void setVerticalOffsetEnabled (boolean verticalOffsetEnabled)
Parameters | |
---|---|
verticalOffsetEnabled |
boolean |
Protected methods
layoutChild
void layoutChild (CoordinatorLayout parent, V child, int layoutDirection)
Parameters | |
---|---|
parent |
CoordinatorLayout |
child |
V |
layoutDirection |
int |
layoutChild
void layoutChild (CoordinatorLayout parent, View child, int layoutDirection)
Parameters | |
---|---|
parent |
CoordinatorLayout |
child |
View |
layoutDirection |
int |
shouldHeaderOverlapScrollingChild
boolean shouldHeaderOverlapScrollingChild ()
Returns | |
---|---|
boolean |
Interfaces
Classes
- AppBarLayout
- AppBarLayout.BaseBehavior
- AppBarLayout.BaseBehavior.BaseDragCallback
- AppBarLayout.BaseBehavior.SavedState
- AppBarLayout.Behavior
- AppBarLayout.Behavior.DragCallback
- AppBarLayout.LayoutParams
- AppBarLayout.ScrollingViewBehavior
- CollapsingToolbarLayout
- CollapsingToolbarLayout.LayoutParams
- MaterialToolbar