Back to Fresco

AspectRatioMeasure

docs/javadoc/reference/com/facebook/drawee/view/AspectRatioMeasure.html

3.6.012.8 KB
Original Source

Fresco

|

|

Packages | Classes

Classes

Packages | Classes

Summary: Nested Classes | Ctors | Methods | Inherited Methods | [Expand All]

public class

AspectRatioMeasure

extends Object

| java.lang.Object | | ↳ | com.facebook.drawee.view.AspectRatioMeasure |

Class Overview

A utility class that performs measuring based on the desired aspect ratio.

Summary

Nested Classes
class
Public Constructors
Public Methods
static void
Updates the given measure spec with respect to the aspect ratio.

| [Expand] Inherited Methods | | --- | | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

|

Public Constructors

public AspectRatioMeasure()

Public Methods

public static void updateMeasureSpec(AspectRatioMeasure.Spec spec, float aspectRatio, ViewGroup.LayoutParams layoutParams, int widthPadding, int heightPadding)

Updates the given measure spec with respect to the aspect ratio.

Note: Measure spec is not changed if the aspect ratio is not greater than zero or if layoutParams is null.

Measure spec of the layout dimension (width or height) specified as "0dp" is updated to match the measure spec of the other dimension adjusted by the aspect ratio. Exactly one layout dimension should be specified as "0dp".

Padding is taken into account so that the aspect ratio refers to the content without padding: aspectRatio == (viewWidth - widthPadding) / (viewHeight - heightPadding)

Updated measure spec respects the parent's constraints. I.e. measure spec is not changed if the parent has specified mode EXACTLY, and it doesn't exceed measure size if parent has specified mode AT_MOST.

Parameters

| spec | in/out measure spec to be updated | | aspectRatio | desired aspect ratio | | layoutParams | view's layout params | | widthPadding | view's left + right padding | | heightPadding | view's top + bottom padding |

+Generated by Doclava. +