ResponsivePaneLayout

class ResponsivePaneLayout @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : ConstraintLayout, Openable, ResponsivePaneTag

An adaptive Samsung One UI container layout extending ConstraintLayout that manages side navigation drawers and content panes, supporting responsive pane states (OPENED, CLOSED) across tablet, foldable, and desktop screens.

Integrates with One UI elevation concepts, back handling via OnBackInvokedDispatcher, and drag gestures. Use a ResponsiveDrawerLayout with ID responsive_pane_drawer and a content container with ID responsive_pane_content. The drawer must be a direct child for drag capture.

Use ResponsivePaneListener to observe transitions, including those initiated by gestures.

Parameters

context

context used to resolve resources and create child behavior.

attrs

optional XML attributes passed to ConstraintLayout.

defStyleAttr

default style attribute passed to ConstraintLayout.

Constructors

Link copied to clipboard
constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0)

Types

Link copied to clipboard

Receives state and slide notifications for the drawer currently managed by the layout.

Properties

Link copied to clipboard
open override val logTag: String

Tag used for responsive pane log messages.

Functions

Link copied to clipboard
open override fun addFocusables(views: <Error class: unknown class><View>, direction: Int, focusableMode: Int)

Adds focusable views, restricting focus to the drawer while it is opened in modal mode.

Link copied to clipboard

Registers listener for drawer state and slide changes. Duplicate registrations are ignored.

Link copied to clipboard
open override fun addView(child: View, index: Int, params: ViewGroup.LayoutParams)

Adds a child, clearing cached drawer behavior and applying elevation for drawer children.

Link copied to clipboard
open override fun close()

Closes the drawer with animation by calling close with animate = true.

fun close(animate: Boolean)
Link copied to clipboard
open override fun computeScroll()

Advances controller settling and schedules another animation frame when needed.

Link copied to clipboard

Returns the configuration currently stored for paneState.

Link copied to clipboard
open override fun isOpen(): Boolean

Returns whether the controller reports PaneState.OPENED.

Link copied to clipboard

Returns whether interaction with content outside an opened drawer is enabled.

Link copied to clipboard
open override fun onInterceptTouchEvent(event: MotionEvent): Boolean

Asks the controller whether to intercept event, falling back to the superclass if undecided.

Link copied to clipboard
open override fun onTouchEvent(event: MotionEvent): Boolean

Passes event to the controller, falling back to the superclass if undecided.

Link copied to clipboard
open override fun open()

Opens the drawer with animation by calling open with animate = true.

fun open(animate: Boolean)
Link copied to clipboard

Unregisters listener; removing an unregistered listener has no effect.

Link copied to clipboard

Controls interaction with content outside an opened drawer.

Link copied to clipboard
fun setPaneConfig(paneState: PaneState, responsiveConfig: ResponsiveConfig)

Stores a configuration for paneState, applying it without animation if that state is current.

Link copied to clipboard

Swaps the pane behavior strategy driving width, drag and elevation.

Link copied to clipboard

Reapplies responsive constraints for the current pane state.