SearchBar.ScrollingViewBehavior

public class SearchBar.ScrollingViewBehavior extends AppBarLayout.ScrollingViewBehavior


Behavior that sets up the scroll-away mode for an SearchBar.

Summary

Public fields

int

Public constructors

ScrollingViewBehavior(Context context, AttributeSet attrs)

Public methods

int
final int

Returns the distance that this view should overlap any .

int
boolean
boolean
boolean
onDependentViewChanged(
    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
)
void
setHorizontalOffsetEnabled(boolean horizontalOffsetEnabled)
boolean
final void
setOverlayTop(int overlayTop)

Set the distance that this view should overlap any .

boolean
void
setVerticalOffsetEnabled(boolean verticalOffsetEnabled)

Protected methods

void
layoutChild(CoordinatorLayout parent, View child, int layoutDirection)
void
layoutChild(CoordinatorLayout parent, V child, int layoutDirection)
boolean

Inherited methods

From com.google.android.material.appbar.AppBarLayout.ScrollingViewBehavior
boolean
layoutDependsOn(CoordinatorLayout parent, View child, View dependency)
void
onDependentViewRemoved(
    CoordinatorLayout parent,
    View child,
    View dependency
)
boolean
onRequestChildRectangleOnScreen(
    CoordinatorLayout parent,
    View child,
    Rect rectangle,
    boolean immediate
)

Public fields

overlayTop

public int overlayTop

Public constructors

ScrollingViewBehavior

public ScrollingViewBehavior()

ScrollingViewBehavior

public ScrollingViewBehavior(Context context, AttributeSet attrs)

Public methods

getLeftAndRightOffset

public int getLeftAndRightOffset()

getOverlayTop

public final int getOverlayTop()

Returns the distance that this view should overlap any .

getTopAndBottomOffset

public int getTopAndBottomOffset()

isHorizontalOffsetEnabled

public boolean isHorizontalOffsetEnabled()

isVerticalOffsetEnabled

public boolean isVerticalOffsetEnabled()

onDependentViewChanged

public boolean onDependentViewChanged(
    CoordinatorLayout parent,
    View child,
    View dependency
)

onLayoutChild

public boolean onLayoutChild(CoordinatorLayout parent, V child, int layoutDirection)

onMeasureChild

public boolean onMeasureChild(
    CoordinatorLayout parent,
    View child,
    int parentWidthMeasureSpec,
    int widthUsed,
    int parentHeightMeasureSpec,
    int heightUsed
)

setHorizontalOffsetEnabled

public void setHorizontalOffsetEnabled(boolean horizontalOffsetEnabled)

setLeftAndRightOffset

public boolean setLeftAndRightOffset(int offset)

setOverlayTop

public final void setOverlayTop(int overlayTop)

Set the distance that this view should overlap any .

Parameters
int overlayTop

the distance in px

setTopAndBottomOffset

public boolean setTopAndBottomOffset(int offset)

setVerticalOffsetEnabled

public void setVerticalOffsetEnabled(boolean verticalOffsetEnabled)

Protected methods

layoutChild

protected void layoutChild(CoordinatorLayout parent, View child, int layoutDirection)

layoutChild

protected void layoutChild(CoordinatorLayout parent, V child, int layoutDirection)

shouldHeaderOverlapScrollingChild

protected boolean shouldHeaderOverlapScrollingChild()