AppBarLayout.LayoutParams

public static class AppBarLayout.LayoutParams
extends LayoutParams

java.lang.Object
   ↳ LinearLayout.LayoutParams
     ↳ com.google.android.material.appbar.AppBarLayout.LayoutParams


Summary

Constants

int SCROLL_FLAG_ENTER_ALWAYS

When entering (scrolling on screen) the view will scroll on any downwards scroll event, regardless of whether the scrolling view is also scrolling.

int SCROLL_FLAG_ENTER_ALWAYS_COLLAPSED

An additional flag for 'enterAlways' which modifies the returning view to only initially scroll back to it's collapsed height.

int SCROLL_FLAG_EXIT_UNTIL_COLLAPSED

When exiting (scrolling off screen) the view will be scrolled until it is 'collapsed'.

int SCROLL_FLAG_SCROLL

The view will be scroll in direct relation to scroll events.

int SCROLL_FLAG_SNAP

Upon a scroll ending, if the view is only partially visible then it will be snapped and scrolled to it's closest edge.

int SCROLL_FLAG_SNAP_MARGINS

An additional flag to be used with 'snap'.

Public constructors

AppBarLayout.LayoutParams(Context c, AttributeSet attrs)
AppBarLayout.LayoutParams(int width, int height, float weight)
AppBarLayout.LayoutParams(ViewGroup.LayoutParams p)
AppBarLayout.LayoutParams(MarginLayoutParams source)
AppBarLayout.LayoutParams(LinearLayout.LayoutParams source)

Public methods

int getScrollFlags()

Returns the scrolling flags.

Interpolator getScrollInterpolator()

Returns the ERROR(/Interpolator) being used for scrolling the view associated with this AppBarLayout.LayoutParams.

void setScrollFlags(int flags)

Set the scrolling flags.

void setScrollInterpolator(Interpolator interpolator)

Set the interpolator to when scrolling the view associated with this AppBarLayout.LayoutParams.

Inherited methods

From class java.lang.Object

Constants

SCROLL_FLAG_ENTER_ALWAYS

int SCROLL_FLAG_ENTER_ALWAYS

When entering (scrolling on screen) the view will scroll on any downwards scroll event, regardless of whether the scrolling view is also scrolling. This is commonly referred to as the 'quick return' pattern.

Constant Value: 4 (0x00000004)

SCROLL_FLAG_ENTER_ALWAYS_COLLAPSED

int SCROLL_FLAG_ENTER_ALWAYS_COLLAPSED

An additional flag for 'enterAlways' which modifies the returning view to only initially scroll back to it's collapsed height. Once the scrolling view has reached the end of it's scroll range, the remainder of this view will be scrolled into view. The collapsed height is defined by the view's minimum height.

Constant Value: 8 (0x00000008)

SCROLL_FLAG_EXIT_UNTIL_COLLAPSED

int SCROLL_FLAG_EXIT_UNTIL_COLLAPSED

When exiting (scrolling off screen) the view will be scrolled until it is 'collapsed'. The collapsed height is defined by the view's minimum height.

Constant Value: 2 (0x00000002)

SCROLL_FLAG_SCROLL

int SCROLL_FLAG_SCROLL

The view will be scroll in direct relation to scroll events. This flag needs to be set for any of the other flags to take effect. If any sibling views before this one do not have this flag, then this value has no effect.

Constant Value: 1 (0x00000001)

SCROLL_FLAG_SNAP

int SCROLL_FLAG_SNAP

Upon a scroll ending, if the view is only partially visible then it will be snapped and scrolled to it's closest edge. For example, if the view only has it's bottom 25% displayed, it will be scrolled off screen completely. Conversely, if it's bottom 75% is visible then it will be scrolled fully into view.

Constant Value: 16 (0x00000010)

SCROLL_FLAG_SNAP_MARGINS

int SCROLL_FLAG_SNAP_MARGINS

An additional flag to be used with 'snap'. If set, the view will be snapped to its top and bottom margins, as opposed to the edges of the view itself.

Constant Value: 32 (0x00000020)

Public constructors

AppBarLayout.LayoutParams

AppBarLayout.LayoutParams (Context c, 
                AttributeSet attrs)

Parameters
c Context

attrs AttributeSet

AppBarLayout.LayoutParams

AppBarLayout.LayoutParams (int width, 
                int height, 
                float weight)

Parameters
width int

height int

weight float

AppBarLayout.LayoutParams

AppBarLayout.LayoutParams (ViewGroup.LayoutParams p)

Parameters
p ViewGroup.LayoutParams

AppBarLayout.LayoutParams

AppBarLayout.LayoutParams (MarginLayoutParams source)

Parameters
source MarginLayoutParams

AppBarLayout.LayoutParams

AppBarLayout.LayoutParams (LinearLayout.LayoutParams source)

Parameters
source LinearLayout.LayoutParams

Public methods

getScrollFlags

int getScrollFlags ()

Returns the scrolling flags.

Returns
int

getScrollInterpolator

Interpolator getScrollInterpolator ()

Returns the ERROR(/Interpolator) being used for scrolling the view associated with this AppBarLayout.LayoutParams. Null indicates 'normal' 1-to-1 scrolling.

Returns
Interpolator

setScrollFlags

void setScrollFlags (int flags)

Set the scrolling flags.

Parameters
flags int: bitwise int of SCROLL_FLAG_SCROLL, SCROLL_FLAG_EXIT_UNTIL_COLLAPSED, SCROLL_FLAG_ENTER_ALWAYS, SCROLL_FLAG_ENTER_ALWAYS_COLLAPSED, SCROLL_FLAG_SNAP, and SCROLL_FLAG_SNAP_MARGINS.

See also:

setScrollInterpolator

void setScrollInterpolator (Interpolator interpolator)

Set the interpolator to when scrolling the view associated with this AppBarLayout.LayoutParams.

Parameters
interpolator Interpolator: the interpolator to use, or null to use normal 1-to-1 scrolling.