DismissibleFrameLayout

@UiThread public class DismissibleFrameLayout

Known direct subclasses
SwipeDismissFrameLayout

A layout enabling left-to-right swipe-to-dismiss, intended for use within an activity.


Special FrameLayout that is dismissible by the Back button press, and by left to right swipe when the SwipeToDismiss is been enabled on the device config or themes.

Summary

Nested types

DismissibleFrameLayout.Callback

Implement this callback to act on particular stage of the dismissal.

Public constructors

Simple constructor to use when creating a view from code.

DismissibleFrameLayout(
    @NonNull Context context,
    @Nullable AttributeSet attrs
)

Constructor that is called when inflating a view from XML.

DismissibleFrameLayout(
    @NonNull Context context,
    @Nullable AttributeSet attrs,
    int defStyle
)

Perform inflation from XML and apply a class-specific base style from a theme attribute.

DismissibleFrameLayout(
    @NonNull Context context,
    @Nullable AttributeSet attrs,
    int defStyle,
    int defStyleRes
)

Perform inflation from XML and apply a class-specific base style from a theme attribute.

Public methods

@Override boolean
canScrollHorizontally(int direction)
boolean

Returns true if the frame layout would be dismissed with back button click

boolean

Returns true if the frame layout can be dismissed by swipe gestures.

@Override boolean
@Override boolean
final @UiThread void

Registers a callback for dismissal.

@Override void
requestDisallowInterceptTouchEvent(boolean disallowIntercept)

Following methods overriding are only required with swipe-to-dismiss to handle touch event for detect swipe gesture.

final void
setBackButtonDismissible(boolean backButtonDismissible)

Sets the frame layout to be back button dismissible or not.

final void