# Print output for @column tags ?> AttachedSurfaceControl - Android SDK | Android Developers

Most visited

Recently visited

AttachedSurfaceControl

public interface AttachedSurfaceControl

android.view.AttachedSurfaceControl


Provides an interface to the root-Surface of a View Hierarchy or Window. This is used in combination with the SurfaceControl API to enable attaching app created SurfaceControl to the SurfaceControl hierarchy used by the app, and enable SurfaceTransactions to be performed in sync with the View hierarchy drawing. This object is obtained from View.getRootSurfaceControl() and Window.getRootSurfaceControl(). It must be used from the UI thread of the object it was obtained from.

Summary

Public methods

abstract boolean applyTransactionOnDraw(SurfaceControl.Transaction t)

Consume the passed in transaction, and request the View hierarchy to apply it atomically with the next draw.

abstract SurfaceControl.Transaction buildReparentTransaction(SurfaceControl child)

Create a transaction which will reparent to the View hierarchy root SurfaceControl.

Public methods

applyTransactionOnDraw

public abstract boolean applyTransactionOnDraw (SurfaceControl.Transaction t)

Consume the passed in transaction, and request the View hierarchy to apply it atomically with the next draw. This transaction will be merged with the buffer transaction from the ViewRoot and they will show up on-screen atomically synced. This will not cause a draw to be scheduled, and if there are no other changes to the View hierarchy you may need to call View.invalidate()

Parameters
t SurfaceControl.Transaction: This value cannot be null.

Returns
boolean

buildReparentTransaction

public abstract SurfaceControl.Transaction buildReparentTransaction (SurfaceControl child)

Create a transaction which will reparent to the View hierarchy root SurfaceControl. See SurfaceControl.Transaction#reparent. This transacton must be applied or merged in to another transaction by the caller, otherwise it will have no effect.

Returns
SurfaceControl.Transaction A new transaction which performs the reparent operation when applied. This value may be null.