Stay organized with collections
Save and categorize content based on your preferences.
AppBarLayout.BaseOnOffsetChangedListener
public
static
interface
AppBarLayout.BaseOnOffsetChangedListener
Known indirect subclasses
|
Interface definition for a callback to be invoked when an AppBarLayout
's vertical
offset changes.
Summary
Public methods |
abstract
void
|
onOffsetChanged(T appBarLayout, int verticalOffset)
Called when the AppBarLayout 's layout offset has been changed.
|
Public methods
onOffsetChanged
public abstract void onOffsetChanged (T appBarLayout,
int verticalOffset)
Called when the AppBarLayout
's layout offset has been changed. This allows child
views to implement custom behavior based on the offset (for instance pinning a view at a
certain y value).
Parameters |
appBarLayout |
T : the AppBarLayout which offset has changed |
verticalOffset |
int : the vertical offset for the parent AppBarLayout , in px
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# AppBarLayout.BaseOnOffsetChangedListener\n\nSummary: [Methods](#pubmethods) \n\nAppBarLayout.BaseOnOffsetChangedListener\n========================================\n\n\n`\npublic\nstatic\n\n\ninterface\nAppBarLayout.BaseOnOffsetChangedListener\n`\n\n\n`\n\n\n`\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| com.google.android.material.appbar.AppBarLayout.BaseOnOffsetChangedListener\\\u003cT extends [com.google.android.material.appbar.AppBarLayout](/reference/com/google/android/material/appbar/AppBarLayout)\\\u003e |\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [AppBarLayout.OnOffsetChangedListener](/reference/com/google/android/material/appbar/AppBarLayout.OnOffsetChangedListener) |----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------| | [AppBarLayout.OnOffsetChangedListener](/reference/com/google/android/material/appbar/AppBarLayout.OnOffsetChangedListener) | Interface definition for a callback to be invoked when an [AppBarLayout](/reference/com/google/android/material/appbar/AppBarLayout)'s vertical offset changes. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface definition for a callback to be invoked when an [AppBarLayout](/reference/com/google/android/material/appbar/AppBarLayout)'s vertical\noffset changes.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onOffsetChanged](/reference/com/google/android/material/appbar/AppBarLayout.BaseOnOffsetChangedListener#onOffsetChanged(T,%20int))`(T appBarLayout, int verticalOffset) ` Called when the [AppBarLayout](/reference/com/google/android/material/appbar/AppBarLayout)'s layout offset has been changed. |\n\nPublic methods\n--------------\n\n### onOffsetChanged\n\n```\npublic abstract void onOffsetChanged (T appBarLayout, \n int verticalOffset)\n```\n\nCalled when the [AppBarLayout](/reference/com/google/android/material/appbar/AppBarLayout)'s layout offset has been changed. This allows child\nviews to implement custom behavior based on the offset (for instance pinning a view at a\ncertain y value).\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------|\n| `appBarLayout` | `T`: the [AppBarLayout](/reference/com/google/android/material/appbar/AppBarLayout) which offset has changed \u003cbr /\u003e |\n| `verticalOffset` | `int`: the vertical offset for the parent [AppBarLayout](/reference/com/google/android/material/appbar/AppBarLayout), in px \u003cbr /\u003e |"]]