Methods Summary |
---|
public static int | getLayoutDirection(ViewGroup.MarginLayoutParams lp)Retuns the layout direction. Can be either {@link ViewCompat#LAYOUT_DIRECTION_LTR} or
{@link ViewCompat#LAYOUT_DIRECTION_RTL}.
return IMPL.getLayoutDirection(lp);
|
public static int | getMarginEnd(ViewGroup.MarginLayoutParams lp)Get the relative ending margin that was set.
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.
return IMPL.getMarginEnd(lp);
|
public static int | getMarginStart(ViewGroup.MarginLayoutParams lp)Get the relative starting margin that was set.
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.
final int version = Build.VERSION.SDK_INT;
if (version >= 17) { // jb-mr1
IMPL = new MarginLayoutParamsCompatImplJbMr1();
} else {
IMPL = new MarginLayoutParamsCompatImplBase();
}
return IMPL.getMarginStart(lp);
|
public static boolean | isMarginRelative(ViewGroup.MarginLayoutParams lp)Check if margins are relative.
return IMPL.isMarginRelative(lp);
|
public static void | resolveLayoutDirection(ViewGroup.MarginLayoutParams lp, int layoutDirection)This will be called by {@link android.view.View#requestLayout()}. Left and Right margins
may be overridden depending on layout direction.
IMPL.resolveLayoutDirection(lp, layoutDirection);
|
public static void | setLayoutDirection(ViewGroup.MarginLayoutParams lp, int layoutDirection)Set the layout direction.
IMPL.setLayoutDirection(lp, layoutDirection);
|
public static void | setMarginEnd(ViewGroup.MarginLayoutParams lp, int marginEnd)Set the relative end margin.
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.
IMPL.setMarginEnd(lp, marginEnd);
|
public static void | setMarginStart(ViewGroup.MarginLayoutParams lp, int marginStart)Set the relative start margin.
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.
IMPL.setMarginStart(lp, marginStart);
|