android-components / mozilla.components.support.base.android.view / AutoFitTextureView

AutoFitTextureView

open class AutoFitTextureView (source)

A TextureView that can be adjusted to a specified aspect ratio.

Constructors

Name Summary
<init> AutoFitTextureView(context: <ERROR CLASS>, attrs: <ERROR CLASS>? = null, defStyle: Int = 0)
A TextureView that can be adjusted to a specified aspect ratio.

Functions

Name Summary
onMeasure open fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int): Unit
setAspectRatio fun setAspectRatio(width: Int, height: Int): Unit
Sets the aspect ratio for this view. The size of the view will be measured based on the ratio calculated from the parameters. Note that the actual sizes of parameters don’t matter, that is, calling setAspectRatio(2, 3) and setAspectRatio(4, 6) make the same result.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.