Example usage for android.view View getLayoutParams

List of usage examples for android.view View getLayoutParams

Introduction

In this page you can find the example usage for android.view View getLayoutParams.

Prototype

@ViewDebug.ExportedProperty(deepExport = true, prefix = "layout_")
public ViewGroup.LayoutParams getLayoutParams() 

Source Link

Document

Get the LayoutParams associated with this view.

Usage

From source file:android.support.v17.leanback.widget.GridLayoutManager.java

final int getOpticalRight(View v) {
    return ((LayoutParams) v.getLayoutParams()).getOpticalRight(v);
}

From source file:android.support.v17.leanback.widget.GridLayoutManager.java

final int getOpticalTop(View v) {
    return ((LayoutParams) v.getLayoutParams()).getOpticalTop(v);
}

From source file:android.support.v17.leanback.widget.GridLayoutManager.java

final int getOpticalBottom(View v) {
    return ((LayoutParams) v.getLayoutParams()).getOpticalBottom(v);
}

From source file:android.support.v17.leanback.widget.GridLayoutManager.java

private int getViewCenterX(View v) {
    LayoutParams p = (LayoutParams) v.getLayoutParams();
    return p.getOpticalLeft(v) + p.getAlignX();
}

From source file:android.support.v17.leanback.widget.GridLayoutManager.java

private int getViewCenterY(View v) {
    LayoutParams p = (LayoutParams) v.getLayoutParams();
    return p.getOpticalTop(v) + p.getAlignY();
}

From source file:android.support.v17.leanback.widget.GridLayoutManager.java

int getDecoratedMeasuredWidthWithMargin(View v) {
    final LayoutParams lp = (LayoutParams) v.getLayoutParams();
    return getDecoratedMeasuredWidth(v) + lp.leftMargin + lp.rightMargin;
}

From source file:android.support.v17.leanback.widget.GridLayoutManager.java

int getDecoratedMeasuredHeightWithMargin(View v) {
    final LayoutParams lp = (LayoutParams) v.getLayoutParams();
    return getDecoratedMeasuredHeight(v) + lp.topMargin + lp.bottomMargin;
}

From source file:android.support.v17.leanback.widget.GridLayoutManager.java

private void updateChildAlignments(View v) {
    final LayoutParams p = (LayoutParams) v.getLayoutParams();
    if (p.getItemAlignmentFacet() == null) {
        // Fallback to global settings on grid view
        p.setAlignX(mItemAlignment.horizontal.getAlignmentPosition(v));
        p.setAlignY(mItemAlignment.vertical.getAlignmentPosition(v));
    } else {/*from w w w  . j  ava2  s .  c o m*/
        // Use ItemAlignmentFacet defined on specific ViewHolder
        p.calculateItemAlignments(mOrientation, v);
        if (mOrientation == HORIZONTAL) {
            p.setAlignY(mItemAlignment.vertical.getAlignmentPosition(v));
        } else {
            p.setAlignX(mItemAlignment.horizontal.getAlignmentPosition(v));
        }
    }
}

From source file:android.support.v17.leanback.widget.GridLayoutManager.java

@Override
public int getDecoratedTop(View child) {
    return super.getDecoratedTop(child) + ((LayoutParams) child.getLayoutParams()).mTopInset;
}

From source file:android.support.v17.leanback.widget.GridLayoutManager.java

@Override
public int getDecoratedLeft(View child) {
    return super.getDecoratedLeft(child) + ((LayoutParams) child.getLayoutParams()).mLeftInset;
}