SurfaceWrapper


@CarProtocol
class SurfaceWrapper


A class holding the information needed to render the content on a surface.

Summary

Public constructors

SurfaceWrapper(
    hostToken: IBinder?,
    width: @Dimension Int,
    height: @Dimension Int,
    displayId: Int,
    densityDpi: Int,
    surface: Surface
)

Creates a SurfaceWrapper.

Public functions

Int

Returns the screen density expressed as dots-per-inch of the android.view.Display for the contained SurfaceView.

Int

Returns the display id of the android.view.Display for the SurfaceView contained in this class.

@Dimension Int

Returns the height of the contained SurfaceView in pixels.

IBinder?

Returns the host token corresponding to the SurfaceView contained in this class.

Surface

Returns the Surface of the contained SurfaceView.

@Dimension Int

Returns the width of the contained SurfaceView in pixels.

Public constructors

SurfaceWrapper

Added in 1.1.0
SurfaceWrapper(
    hostToken: IBinder?,
    width: @Dimension Int,
    height: @Dimension Int,
    displayId: Int,
    densityDpi: Int,
    surface: Surface
)

Creates a SurfaceWrapper.

Parameters
hostToken: IBinder?

a token used for constructing SurfaceControlViewHost. see SurfaceView for more details

width: @Dimension Int

the width of the surface view in pixels

height: @Dimension Int

the height of the surface view in pixels

displayId: Int

the ID of the display showing the surface

densityDpi: Int

the density of the display showing the surface expressed as dots-per-inch

surface: Surface

the surface for which the wrapper is created

Public functions

getDensityDpi

Added in 1.1.0
fun getDensityDpi(): Int

Returns the screen density expressed as dots-per-inch of the android.view.Display for the contained SurfaceView.

getDisplayId

Added in 1.1.0
fun getDisplayId(): Int

Returns the display id of the android.view.Display for the SurfaceView contained in this class.

getHeight

Added in 1.1.0
fun getHeight(): @Dimension Int

Returns the height of the contained SurfaceView in pixels.

getHostToken

Added in 1.1.0
fun getHostToken(): IBinder?

Returns the host token corresponding to the SurfaceView contained in this class.

getSurface

Added in 1.1.0
fun getSurface(): Surface

Returns the Surface of the contained SurfaceView.

getWidth

Added in 1.1.0
fun getWidth(): @Dimension Int

Returns the width of the contained SurfaceView in pixels.