SupportsPivotTransform

An interface for a View which supports setting and unsetting its transform pivot, even on pre-API 28 (P) devices.

This interface exists because View#resetPivot was only introduced in API 28 (P), and due to View recycling in Litho, we must have a way to restore all Views to their vanilla, newly created state after they are unmounted.

Inheritors

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun setTransformPivot(@FloatRange(from = 0.0, to = 100.0) pivotXPercent: Float, @FloatRange(from = 0.0, to = 100.0) pivotYPercent: Float)

Sets the transform pivot of a View - used for scale and rotation transforms - to be centered at the given point, expressed as a percentage of the View's width and height. The default pivot point is (50f, 50f).