public static class PercentLayoutHelper.PercentLayoutInfo
extends java.lang.Object
LayoutParams
.Modifier and Type | Field and Description |
---|---|
float |
aspectRatio |
float |
bottomMarginPercent |
float |
endMarginPercent |
float |
heightPercent |
float |
leftMarginPercent |
float |
rightMarginPercent |
float |
startMarginPercent |
float |
topMarginPercent |
float |
widthPercent |
Constructor and Description |
---|
PercentLayoutInfo() |
Modifier and Type | Method and Description |
---|---|
void |
fillLayoutParams(android.view.ViewGroup.LayoutParams params,
int widthHint,
int heightHint)
Fills
ViewGroup.LayoutParams dimensions based on percentage values. |
void |
fillMarginLayoutParams(android.view.ViewGroup.MarginLayoutParams params,
int widthHint,
int heightHint)
Fills
ViewGroup.MarginLayoutParams dimensions and margins based on percentage
values. |
void |
restoreLayoutParams(android.view.ViewGroup.LayoutParams params)
Restores original dimensions after they were changed for percentage based values.
|
void |
restoreMarginLayoutParams(android.view.ViewGroup.MarginLayoutParams params)
Restores original dimensions and margins after they were changed for percentage based
values.
|
java.lang.String |
toString() |
public float widthPercent
public float heightPercent
public float leftMarginPercent
public float topMarginPercent
public float rightMarginPercent
public float bottomMarginPercent
public float startMarginPercent
public float endMarginPercent
public float aspectRatio
public void fillLayoutParams(android.view.ViewGroup.LayoutParams params, int widthHint, int heightHint)
ViewGroup.LayoutParams
dimensions based on percentage values.public void fillMarginLayoutParams(android.view.ViewGroup.MarginLayoutParams params, int widthHint, int heightHint)
ViewGroup.MarginLayoutParams
dimensions and margins based on percentage
values.public java.lang.String toString()
toString
in class java.lang.Object
public void restoreMarginLayoutParams(android.view.ViewGroup.MarginLayoutParams params)
fillMarginLayoutParams(android.view.ViewGroup.MarginLayoutParams, int, int)
.public void restoreLayoutParams(android.view.ViewGroup.LayoutParams params)
fillLayoutParams(android.view.ViewGroup.LayoutParams, int, int)
.