AspectRatioFrameLayout.AspectRatioListener


interface AspectRatioFrameLayout.AspectRatioListener


Listener to be notified about changes of the aspect ratios of this view.

Summary

Public functions

Unit
onAspectRatioUpdated(
    targetAspectRatio: Float,
    naturalAspectRatio: Float,
    aspectRatioMismatch: Boolean
)

Called when either the target aspect ratio or the view aspect ratio is updated.

Public functions

onAspectRatioUpdated

fun onAspectRatioUpdated(
    targetAspectRatio: Float,
    naturalAspectRatio: Float,
    aspectRatioMismatch: Boolean
): Unit

Called when either the target aspect ratio or the view aspect ratio is updated.

Parameters
targetAspectRatio: Float

The aspect ratio that has been set in setAspectRatio

naturalAspectRatio: Float

The natural aspect ratio of this view (before its width and height are modified to satisfy the target aspect ratio).

aspectRatioMismatch: Boolean

Whether the target and natural aspect ratios differ enough for changing the resize mode to have an effect.