FileDocCategorySizeDatePackage
RowContainerView.javaAPI DocAndroid 5.1 API3472Thu Mar 12 22:22:56 GMT 2015android.support.v17.leanback.widget

RowContainerView

public final class RowContainerView extends android.widget.LinearLayout
RowContainerView wraps header and user defined row view

Fields Summary
private android.view.ViewGroup
mHeaderDock
private android.graphics.drawable.Drawable
mForeground
private boolean
mForegroundBoundsChanged
Constructors Summary
public RowContainerView(android.content.Context context)


       
        this(context, null, 0);
    
public RowContainerView(android.content.Context context, android.util.AttributeSet attrs)

        this(context, attrs, 0);
    
public RowContainerView(android.content.Context context, android.util.AttributeSet attrs, int defStyle)

        super(context, attrs, defStyle);
        setOrientation(VERTICAL);
        LayoutInflater inflater = LayoutInflater.from(context);
        inflater.inflate(R.layout.lb_row_container, this);

        mHeaderDock = (ViewGroup) findViewById(R.id.lb_row_container_header_dock);
        setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
    
Methods Summary
public voidaddHeaderView(android.view.View headerView)

        if (mHeaderDock.indexOfChild(headerView) < 0) {
            mHeaderDock.addView(headerView, 0);
        }
    
public voidaddRowView(android.view.View view)

        addView(view);
    
public voiddraw(android.graphics.Canvas canvas)

        super.draw(canvas);
        if (mForeground != null) {
            if (mForegroundBoundsChanged) {
                mForegroundBoundsChanged = false;
                mForeground.setBounds(0, 0, getWidth(), getHeight());
            }
            mForeground.draw(canvas);
        }
    
public android.graphics.drawable.DrawablegetForeground()

        return mForeground;
    
protected voidonSizeChanged(int w, int h, int oldw, int oldh)

        super.onSizeChanged(w, h, oldw, oldh);
        mForegroundBoundsChanged = true;
    
public voidremoveHeaderView(android.view.View headerView)

        if (mHeaderDock.indexOfChild(headerView) >= 0) {
            mHeaderDock.removeView(headerView);
        }
    
public voidsetForeground(android.graphics.drawable.Drawable d)

        mForeground = d;
        setWillNotDraw(mForeground == null);
        invalidate();
    
public voidsetForegroundColor(int color)

        if (mForeground instanceof ColorDrawable) {
            ((ColorDrawable) mForeground.mutate()).setColor(color);
            invalidate();
        } else {
            setForeground(new ColorDrawable(color));
        }
    
public voidshowHeader(boolean show)

        mHeaderDock.setVisibility(show ? View.VISIBLE : View.GONE);