|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.support.v4.view.MarginLayoutParamsCompat
public class MarginLayoutParamsCompat
Helper for accessing API features in
MarginLayoutParams
added after API 4.
Constructor Summary | |
---|---|
MarginLayoutParamsCompat()
|
Method Summary | |
---|---|
static int |
getLayoutDirection(android.view.ViewGroup.MarginLayoutParams lp)
Retuns the layout direction. |
static int |
getMarginEnd(android.view.ViewGroup.MarginLayoutParams lp)
Get the relative ending margin that was set. |
static int |
getMarginStart(android.view.ViewGroup.MarginLayoutParams lp)
Get the relative starting margin that was set. |
static boolean |
isMarginRelative(android.view.ViewGroup.MarginLayoutParams lp)
Check if margins are relative. |
static void |
resolveLayoutDirection(android.view.ViewGroup.MarginLayoutParams lp,
int layoutDirection)
This will be called by View.requestLayout() . |
static void |
setLayoutDirection(android.view.ViewGroup.MarginLayoutParams lp,
int layoutDirection)
Set the layout direction. |
static void |
setMarginEnd(android.view.ViewGroup.MarginLayoutParams lp,
int marginEnd)
Set the relative end margin. |
static void |
setMarginStart(android.view.ViewGroup.MarginLayoutParams lp,
int marginStart)
Set the relative start margin. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MarginLayoutParamsCompat()
Method Detail |
---|
public static int getMarginStart(android.view.ViewGroup.MarginLayoutParams lp)
On platform versions supporting bidirectional text and layouts this value will be resolved into the LayoutParams object's left or right margin as appropriate when the associated View is attached to a window or when the layout direction of that view changes.
lp
- LayoutParams to query
public static int getMarginEnd(android.view.ViewGroup.MarginLayoutParams lp)
On platform versions supporting bidirectional text and layouts this value will be resolved into the LayoutParams object's left or right margin as appropriate when the associated View is attached to a window or when the layout direction of that view changes.
lp
- LayoutParams to query
public static void setMarginStart(android.view.ViewGroup.MarginLayoutParams lp, int marginStart)
On platform versions supporting bidirectional text and layouts this value will be resolved into the LayoutParams object's left or right margin as appropriate when the associated View is attached to a window or when the layout direction of that view changes.
lp
- LayoutParams to querymarginStart
- the desired start margin in pixelspublic static void setMarginEnd(android.view.ViewGroup.MarginLayoutParams lp, int marginEnd)
On platform versions supporting bidirectional text and layouts this value will be resolved into the LayoutParams object's left or right margin as appropriate when the associated View is attached to a window or when the layout direction of that view changes.
lp
- LayoutParams to querymarginEnd
- the desired end margin in pixelspublic static boolean isMarginRelative(android.view.ViewGroup.MarginLayoutParams lp)
public static int getLayoutDirection(android.view.ViewGroup.MarginLayoutParams lp)
ViewCompat.LAYOUT_DIRECTION_LTR
or
ViewCompat.LAYOUT_DIRECTION_RTL
.
public static void setLayoutDirection(android.view.ViewGroup.MarginLayoutParams lp, int layoutDirection)
layoutDirection
- the layout direction.
Should be either ViewCompat.LAYOUT_DIRECTION_LTR
or ViewCompat.LAYOUT_DIRECTION_RTL
.public static void resolveLayoutDirection(android.view.ViewGroup.MarginLayoutParams lp, int layoutDirection)
View.requestLayout()
. Left and Right margins
may be overridden depending on layout direction.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |