Stay organized with collections
Save and categorize content based on your preferences.
BottomSheetBehavior.BottomSheetCallback
public
static
abstract
class
BottomSheetBehavior.BottomSheetCallback
extends Object
java.lang.Object
|
↳ |
com.google.android.material.bottomsheet.BottomSheetBehavior.BottomSheetCallback
|
Callback for monitoring events about bottom sheets.
Summary
Public methods |
abstract
void
|
onSlide(View bottomSheet, float slideOffset)
Called when the bottom sheet is being dragged.
|
abstract
void
|
onStateChanged(View bottomSheet, int newState)
Called when the bottom sheet changes its state.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public constructors
BottomSheetCallback
public BottomSheetCallback ()
Public methods
onSlide
public abstract void onSlide (View bottomSheet,
float slideOffset)
Called when the bottom sheet is being dragged.
Parameters |
bottomSheet |
View : The bottom sheet view. |
slideOffset |
float : The new offset of this bottom sheet within [-1,1] range. Offset increases
as this bottom sheet is moving upward. From 0 to 1 the sheet is between collapsed and
expanded states and from -1 to 0 it is between hidden and collapsed states.
|
onStateChanged
public abstract void onStateChanged (View bottomSheet,
int newState)
Called when the bottom sheet changes its state.
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,["# BottomSheetBehavior.BottomSheetCallback\n\nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nBottomSheetBehavior.BottomSheetCallback\n=======================================\n\n\n`\npublic\nstatic\n\nabstract\nclass\nBottomSheetBehavior.BottomSheetCallback\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|---------------------------------------------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.google.android.material.bottomsheet.BottomSheetBehavior.BottomSheetCallback |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nCallback for monitoring events about bottom sheets.\n\nSummary\n-------\n\n| ### Public constructors ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[BottomSheetCallback](/reference/com/google/android/material/bottomsheet/BottomSheetBehavior.BottomSheetCallback#BottomSheetCallback())`() ` |\n\n| ### Public methods ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onSlide](/reference/com/google/android/material/bottomsheet/BottomSheetBehavior.BottomSheetCallback#onSlide(android.view.View,%20float))`(View bottomSheet, float slideOffset) ` Called when the bottom sheet is being dragged. |\n| ` abstract void` | ` `[onStateChanged](/reference/com/google/android/material/bottomsheet/BottomSheetBehavior.BottomSheetCallback#onStateChanged(android.view.View,%20int))`(View bottomSheet, int newState) ` Called when the bottom sheet changes its state. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nPublic constructors\n-------------------\n\n### BottomSheetCallback\n\n```\npublic BottomSheetCallback ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### onSlide\n\n```\npublic abstract void onSlide (View bottomSheet, \n float slideOffset)\n```\n\nCalled when the bottom sheet is being dragged.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `bottomSheet` | `View`: The bottom sheet view. \u003cbr /\u003e |\n| `slideOffset` | `float`: The new offset of this bottom sheet within \\[-1,1\\] range. Offset increases as this bottom sheet is moving upward. From 0 to 1 the sheet is between collapsed and expanded states and from -1 to 0 it is between hidden and collapsed states. \u003cbr /\u003e |\n\n### onStateChanged\n\n```\npublic abstract void onStateChanged (View bottomSheet, \n int newState)\n```\n\nCalled when the bottom sheet changes its state.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `bottomSheet` | `View`: The bottom sheet view. \u003cbr /\u003e |\n| `newState` | `int`: The new state. This will be one of [BottomSheetBehavior.STATE_DRAGGING](/reference/com/google/android/material/bottomsheet/BottomSheetBehavior#STATE_DRAGGING), [BottomSheetBehavior.STATE_SETTLING](/reference/com/google/android/material/bottomsheet/BottomSheetBehavior#STATE_SETTLING), [BottomSheetBehavior.STATE_EXPANDED](/reference/com/google/android/material/bottomsheet/BottomSheetBehavior#STATE_EXPANDED), [BottomSheetBehavior.STATE_COLLAPSED](/reference/com/google/android/material/bottomsheet/BottomSheetBehavior#STATE_COLLAPSED), [BottomSheetBehavior.STATE_HIDDEN](/reference/com/google/android/material/bottomsheet/BottomSheetBehavior#STATE_HIDDEN), or [BottomSheetBehavior.STATE_HALF_EXPANDED](/reference/com/google/android/material/bottomsheet/BottomSheetBehavior#STATE_HALF_EXPANDED). \u003cbr /\u003e |"]]