use of android.view.ViewGroup.MarginLayoutParams in project PaymentKit-Droid by brendanw.
the class ViewUtils method setMarginTop.
public static void setMarginTop(final View v, final int margin) {
final MarginLayoutParams lp = (MarginLayoutParams) v.getLayoutParams();
lp.setMargins(lp.leftMargin, margin, lp.rightMargin, lp.bottomMargin);
v.setLayoutParams(lp);
}
use of android.view.ViewGroup.MarginLayoutParams in project PaymentKit-Droid by brendanw.
the class ViewUtils method setMarginLeft.
public static void setMarginLeft(final View v, final int margin) {
final MarginLayoutParams lp = (MarginLayoutParams) v.getLayoutParams();
lp.setMargins(margin, lp.topMargin, lp.rightMargin, lp.bottomMargin);
v.setLayoutParams(lp);
}
use of android.view.ViewGroup.MarginLayoutParams in project PaymentKit-Droid by brendanw.
the class ViewUtils method moveVertical.
public static void moveVertical(final View v, final float distance) {
final MarginLayoutParams lp = (MarginLayoutParams) v.getLayoutParams();
final int newTopMargin = (int) (lp.topMargin + distance);
setMarginTop(v, newTopMargin);
}
use of android.view.ViewGroup.MarginLayoutParams in project PaymentKit-Droid by brendanw.
the class ViewUtils method setMarginBottom.
public static void setMarginBottom(final View v, final int margin) {
final MarginLayoutParams lp = (MarginLayoutParams) v.getLayoutParams();
lp.setMargins(lp.leftMargin, lp.topMargin, lp.rightMargin, margin);
v.setLayoutParams(lp);
}
use of android.view.ViewGroup.MarginLayoutParams in project UltimateAndroid by cymcsg.
the class BaseLayoutManager method generateLayoutParams.
@Override
public LayoutParams generateLayoutParams(ViewGroup.LayoutParams lp) {
final LayoutParams lanedLp = new LayoutParams((MarginLayoutParams) lp);
if (isVertical()) {
lanedLp.width = LayoutParams.MATCH_PARENT;
lanedLp.height = lp.height;
} else {
lanedLp.width = lp.width;
lanedLp.height = LayoutParams.MATCH_PARENT;
}
return lanedLp;
}
Aggregations