public class

SideSheetBehavior

extends CoordinatorLayout.Behavior<V extends View>
java.lang.Object
   ↳ androidx.coordinatorlayout.widget.CoordinatorLayout.Behavior<V extends android.view.View>
     ↳ com.sap.cloud.mobile.fiori.maps.SideSheetBehavior<V extends android.view.View>

Class Overview

Adapted from BottomSheetBehavior, supports STATE_EXPANDED and STATE_COLLAPSED states, can be used to show/hide side sheet on tablet landscape mode.

Summary

Nested Classes
interface SideSheetBehavior.OnStateChangeListener Callback interface used to notify the application that the view has been dismissed. 
Constants
int STATE_COLLAPSED View collapsed with only handle visible
int STATE_DRAGGING A view is currently being dragged.
int STATE_EXPANDED View expanded
int STATE_SETTLING A view is currently settling into place as a result of a fling or predefined non-interactive motion.
Public Constructors
SideSheetBehavior()
SideSheetBehavior(Context context, AttributeSet attrs)
Public Methods
static <V extends View> SideSheetBehavior<V> from(V view)
A utility function to get the SideSheetBehavior associated with the view.
int getExpandedWidth()
Returns the expanded width
int getPeekWidth()
The peek width when the sheet is collapsed
int getState()
Retrieve the current drag state of this behavior.
void onAttachedToLayoutParams(CoordinatorLayout.LayoutParams layoutParams)
void onDetachedFromLayoutParams()
boolean onInterceptTouchEvent(CoordinatorLayout parent, V child, MotionEvent event)
boolean onLayoutChild(CoordinatorLayout parent, V child, int layoutDirection)
boolean onTouchEvent(CoordinatorLayout parent, V child, MotionEvent event)
void setExpandedWidth(int expandedWidth)
Sets the expanded width
void setListener(SideSheetBehavior.OnStateChangeListener listener)
Set the listener to be used when a dismiss event occurs.
void setPeekWidth(int peekWidth)
Sets the peek width when the sheet is collapsed
void setSensitivity(float sensitivity)
Set the sensitivity used for detecting the start of a swipe.
final void setState(int state)
Sets the state of the side sheet.
[Expand]
Inherited Methods
From class androidx.coordinatorlayout.widget.CoordinatorLayout.Behavior
From class java.lang.Object

Constants

public static final int STATE_COLLAPSED

View collapsed with only handle visible

Constant Value: 3 (0x00000003)

public static final int STATE_DRAGGING

A view is currently being dragged. The position is currently changing as a result of user input or simulated user input.

Constant Value: 1 (0x00000001)

public static final int STATE_EXPANDED

View expanded

Constant Value: 4 (0x00000004)

public static final int STATE_SETTLING

A view is currently settling into place as a result of a fling or predefined non-interactive motion.

Constant Value: 2 (0x00000002)

Public Constructors

public SideSheetBehavior ()

public SideSheetBehavior (Context context, AttributeSet attrs)

Public Methods

public static SideSheetBehavior<V> from (V view)

A utility function to get the SideSheetBehavior associated with the view.

Parameters
view The View with SideSheetBehavior.
Returns

public int getExpandedWidth ()

Returns the expanded width

public int getPeekWidth ()

The peek width when the sheet is collapsed

public int getState ()

Retrieve the current drag state of this behavior. This will return one of STATE_COLLAPSED, STATE_EXPANDED, STATE_DRAGGING or STATE_SETTLING.

Returns
  • The current drag state

public void onAttachedToLayoutParams (CoordinatorLayout.LayoutParams layoutParams)

public void onDetachedFromLayoutParams ()

public boolean onInterceptTouchEvent (CoordinatorLayout parent, V child, MotionEvent event)

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

public boolean onTouchEvent (CoordinatorLayout parent, V child, MotionEvent event)

public void setExpandedWidth (int expandedWidth)

Sets the expanded width

public void setListener (SideSheetBehavior.OnStateChangeListener listener)

Set the listener to be used when a dismiss event occurs.

Parameters
listener the listener to use.

public void setPeekWidth (int peekWidth)

Sets the peek width when the sheet is collapsed

public void setSensitivity (float sensitivity)

Set the sensitivity used for detecting the start of a swipe. This only takes effect if no touch handling has occured yet.

Parameters
sensitivity Multiplier for how sensitive we should be about detecting the start of a drag. Larger values are more sensitive. 1.0f is normal.

public final void setState (int state)

Sets the state of the side sheet. The side sheet will transition to that state with animation.

Parameters
state One of STATE_COLLAPSED, or STATE_EXPANDED. Other states are used internally.