Example usage for android.widget LinearLayout getPaddingRight

List of usage examples for android.widget LinearLayout getPaddingRight

Introduction

In this page you can find the example usage for android.widget LinearLayout getPaddingRight.

Prototype

public int getPaddingRight() 

Source Link

Document

Returns the right padding of this view.

Usage

From source file:com.nttec.everychan.ui.presentation.BoardFragment.java

/**
 * ? thumbnail view  ?  ?  ?./*ww  w .  ja  va2s  . c  o m*/
 *  ??  thumbnail view   {@link #thumbnailWidth}
 */
private FloatingModel[] measureFloatingModels(LayoutInflater inflater) {
    Point displaySize = AppearanceUtils.getDisplaySize(activity.getWindowManager().getDefaultDisplay());

    LinearLayout view = (LinearLayout) inflater.inflate(R.layout.post_item_layout, (ViewGroup) rootView, false);

    TextView commentView = (TextView) view.findViewById(R.id.post_comment);
    TextPaint textPaint = commentView.getPaint();
    int textLineHeight = Math.max(1, commentView.getLineHeight());
    int rootWidth = (int) (displaySize.x * settings.getRootViewWeight());
    postItemPadding = view.getPaddingLeft() + view.getPaddingRight();
    int textWidth = postItemWidth = rootWidth - postItemPadding;

    View thumbnailView = view.findViewById(R.id.post_thumbnail);
    ViewGroup.MarginLayoutParams thumbnailLayoutParams = (ViewGroup.MarginLayoutParams) thumbnailView
            .getLayoutParams();
    thumbnailMargin = thumbnailLayoutParams.leftMargin + thumbnailLayoutParams.rightMargin;

    View attachmentTypeView = thumbnailView.findViewById(R.id.post_thumbnail_attachment_type);
    FloatingModel[] floatingModels = new FloatingModel[2];

    attachmentTypeView.setVisibility(View.GONE);
    thumbnailView.measure(displaySize.x, displaySize.y);
    Point thumbnailSize = new Point(thumbnailMargin + thumbnailView.getMeasuredWidth(),
            thumbnailView.getMeasuredHeight());
    floatingModels[0] = new FloatingModel(thumbnailSize, textWidth, textPaint);

    attachmentTypeView.setVisibility(View.VISIBLE);
    thumbnailView.measure(displaySize.x, displaySize.y);
    thumbnailSize = new Point(thumbnailMargin + thumbnailView.getMeasuredWidth(),
            thumbnailView.getMeasuredHeight());
    floatingModels[1] = new FloatingModel(thumbnailSize, textWidth, textPaint);

    thumbnailWidth = thumbnailSize.x;
    maxItemLines = divcell(thumbnailSize.y, textLineHeight);

    return floatingModels;
}