Skip to content

Most visited

Recently visited

navigation
added in version 24.1.0
belongs to Maven artifact com.android.support:design:27.0.0

AppBarLayout.LayoutParams

public static class AppBarLayout.LayoutParams
extends LinearLayout.LayoutParams

java.lang.Object
   ↳ android.view.ViewGroup.LayoutParams
     ↳ android.view.ViewGroup.MarginLayoutParams
       ↳ android.widget.LinearLayout.LayoutParams
         ↳ android.support.design.widget.AppBarLayout.LayoutParams


Summary

XML attributes

AppBarLayout_Layout_layout_scrollFlags  
AppBarLayout_Layout_layout_scrollInterpolator  

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.

Inherited constants

From class android.view.ViewGroup.LayoutParams

Inherited fields

From class android.widget.LinearLayout.LayoutParams
From class android.view.ViewGroup.MarginLayoutParams
From class android.view.ViewGroup.LayoutParams

Public constructors

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

Public methods

int getScrollFlags()

Returns the scrolling flags.

Interpolator getScrollInterpolator()

Returns the 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 android.widget.LinearLayout.LayoutParams
From class android.view.ViewGroup.MarginLayoutParams
From class android.view.ViewGroup.LayoutParams
From class java.lang.Object

XML attributes

AppBarLayout_Layout_layout_scrollFlags

Related methods:

AppBarLayout_Layout_layout_scrollInterpolator

Related methods:

Constants

SCROLL_FLAG_ENTER_ALWAYS

added in version 24.1.0
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

added in version 24.1.0
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.

See also:

Constant Value: 8 (0x00000008)

SCROLL_FLAG_EXIT_UNTIL_COLLAPSED

added in version 24.1.0
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.

See also:

Constant Value: 2 (0x00000002)

SCROLL_FLAG_SCROLL

added in version 24.1.0
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

added in version 24.1.0
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)

Public constructors

AppBarLayout.LayoutParams

added in version 24.1.0
AppBarLayout.LayoutParams (Context c, 
                AttributeSet attrs)

Parameters
c Context

attrs AttributeSet

AppBarLayout.LayoutParams

added in version 24.1.0
AppBarLayout.LayoutParams (int width, 
                int height)

Parameters
width int

height int

AppBarLayout.LayoutParams

added in version 24.1.0
AppBarLayout.LayoutParams (int width, 
                int height, 
                float weight)

Parameters
width int

height int

weight float

AppBarLayout.LayoutParams

added in version 24.1.0
AppBarLayout.LayoutParams (ViewGroup.LayoutParams p)

Parameters
p ViewGroup.LayoutParams

AppBarLayout.LayoutParams

added in version 24.1.0
AppBarLayout.LayoutParams (ViewGroup.MarginLayoutParams source)

Parameters
source ViewGroup.MarginLayoutParams

AppBarLayout.LayoutParams

added in version 24.1.0
AppBarLayout.LayoutParams (LinearLayout.LayoutParams source)

Parameters
source LinearLayout.LayoutParams

AppBarLayout.LayoutParams

added in version 24.1.0
AppBarLayout.LayoutParams (AppBarLayout.LayoutParams source)

Parameters
source AppBarLayout.LayoutParams

Public methods

getScrollFlags

added in version 24.1.0
int getScrollFlags ()

Returns the scrolling flags.

Related XML Attributes:

Returns
int

See also:

getScrollInterpolator

added in version 24.1.0
Interpolator getScrollInterpolator ()

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

Related XML Attributes:

Returns
Interpolator

See also:

setScrollFlags

added in version 24.1.0
void setScrollFlags (int flags)

Set the scrolling flags.

Related XML Attributes:

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

See also:

setScrollInterpolator

added in version 24.1.0
void setScrollInterpolator (Interpolator interpolator)

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

Related XML Attributes:

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

See also:

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)