Added in API level 31

ScrollCaptureSession

open class ScrollCaptureSession
kotlin.Any
   ↳ android.view.ScrollCaptureSession

A session represents the scope of interaction between a ScrollCaptureCallback and the system during an active scroll capture operation.

Summary

Public constructors
ScrollCaptureSession(surface: Surface, scrollBounds: Rect, positionInWindow: Point)

Constructs a new session instance.

Public methods
open Point

Returns the offset of scroll bounds within the window.

open Rect

Returns the scroll bounds, as provided by ScrollCaptureCallback#onScrollCaptureSearch.

open Surface

Returns a BufferQueue in the form of a Surface for transfer of image buffers.

Public constructors

ScrollCaptureSession

Added in API level 31
ScrollCaptureSession(
    surface: Surface,
    scrollBounds: Rect,
    positionInWindow: Point)

Constructs a new session instance.

Parameters
surface Surface: the surface to consume generated images This value cannot be null.
scrollBounds Rect: the bounds of the capture area within the containing view This value cannot be null.
positionInWindow Point: the offset of scrollBounds within the window This value cannot be null.

Public methods

getPositionInWindow

Added in API level 31
open fun getPositionInWindow(): Point

Returns the offset of scroll bounds within the window.

Return
Point the area of scrolling content within the containing view This value cannot be null.

getScrollBounds

Added in API level 31
open fun getScrollBounds(): Rect

Returns the scroll bounds, as provided by ScrollCaptureCallback#onScrollCaptureSearch.

Return
Rect the area of scrolling content within the containing view This value cannot be null.

getSurface

Added in API level 31
open fun getSurface(): Surface

Returns a BufferQueue in the form of a Surface for transfer of image buffers.

The surface is guaranteed to remain valid until the session ends.

Return
Surface the surface for transferring image buffers This value cannot be null.
Exceptions
java.lang.IllegalStateException if the session has been closed