Android APIs
public static class

PercentLayoutHelper.PercentLayoutInfo

extends Object
java.lang.Object
   ↳ android.support.percent.PercentLayoutHelper.PercentLayoutInfo

Class Overview

Container for information about percentage dimensions and margins. It acts as an extension for LayoutParams.

Summary

Fields
public float bottomMarginPercent
public float endMarginPercent
public float heightPercent
public float leftMarginPercent
public float rightMarginPercent
public float startMarginPercent
public float topMarginPercent
public float widthPercent
Public Constructors
PercentLayoutHelper.PercentLayoutInfo()
Public Methods
void fillLayoutParams(ViewGroup.LayoutParams params, int widthHint, int heightHint)
Fills ViewGroup.LayoutParams dimensions based on percentage values.
void fillMarginLayoutParams(ViewGroup.MarginLayoutParams params, int widthHint, int heightHint)
Fills ViewGroup.MarginLayoutParams dimensions and margins based on percentage values.
void restoreLayoutParams(ViewGroup.LayoutParams params)
Restores original dimensions after they were changed for percentage based values.
void restoreMarginLayoutParams(ViewGroup.MarginLayoutParams params)
Restores original dimensions and margins after they were changed for percentage based values.
String toString()
Returns a string containing a concise, human-readable description of this object.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public float bottomMarginPercent

public float endMarginPercent

public float heightPercent

public float leftMarginPercent

public float rightMarginPercent

public float startMarginPercent

public float topMarginPercent

public float widthPercent

Public Constructors

public PercentLayoutHelper.PercentLayoutInfo ()

Public Methods

public void fillLayoutParams (ViewGroup.LayoutParams params, int widthHint, int heightHint)

Fills ViewGroup.LayoutParams dimensions based on percentage values.

public void fillMarginLayoutParams (ViewGroup.MarginLayoutParams params, int widthHint, int heightHint)

Fills ViewGroup.MarginLayoutParams dimensions and margins based on percentage values.

public void restoreLayoutParams (ViewGroup.LayoutParams params)

Restores original dimensions after they were changed for percentage based values. Calling this method only makes sense if you previously called fillLayoutParams(ViewGroup.LayoutParams, int, int).

public void restoreMarginLayoutParams (ViewGroup.MarginLayoutParams params)

Restores original dimensions and margins after they were changed for percentage based values. Calling this method only makes sense if you previously called fillMarginLayoutParams(ViewGroup.MarginLayoutParams, int, int).

public String toString ()

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.