Search in sources :

Example 11 with MarginLayoutParams

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);
}
Also used : MarginLayoutParams(android.view.ViewGroup.MarginLayoutParams)

Example 12 with MarginLayoutParams

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);
}
Also used : MarginLayoutParams(android.view.ViewGroup.MarginLayoutParams)

Example 13 with MarginLayoutParams

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);
}
Also used : MarginLayoutParams(android.view.ViewGroup.MarginLayoutParams)

Example 14 with MarginLayoutParams

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);
}
Also used : MarginLayoutParams(android.view.ViewGroup.MarginLayoutParams)

Example 15 with MarginLayoutParams

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;
}
Also used : LayoutParams(android.support.v7.widget.RecyclerView.LayoutParams) MarginLayoutParams(android.view.ViewGroup.MarginLayoutParams)

Aggregations

MarginLayoutParams (android.view.ViewGroup.MarginLayoutParams)40 ViewGroup (android.view.ViewGroup)15 LayoutParams (android.view.ViewGroup.LayoutParams)10 SuppressLint (android.annotation.SuppressLint)8 Paint (android.graphics.Paint)6 ViewInfo (com.android.ide.common.rendering.api.ViewInfo)6 Point (android.graphics.Point)5 ViewParent (android.view.ViewParent)5 ActionMenuView (android.widget.ActionMenuView)5 ListMenuItemView (com.android.internal.view.menu.ListMenuItemView)5 Context (android.content.Context)4 View (android.view.View)4 TextView (android.widget.TextView)4 TextPaint (android.text.TextPaint)3 IntentFilter (android.content.IntentFilter)2 RemoteException (android.os.RemoteException)2 RecyclerView (android.support.v7.widget.RecyclerView)2 LayoutParams (android.support.v7.widget.RecyclerView.LayoutParams)2 MotionEvent (android.view.MotionEvent)2 ImageView (android.widget.ImageView)2