RowContainerViewpublic 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 void | addHeaderView(android.view.View headerView)
if (mHeaderDock.indexOfChild(headerView) < 0) {
mHeaderDock.addView(headerView, 0);
}
| public void | addRowView(android.view.View view)
addView(view);
| public void | draw(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.Drawable | getForeground()
return mForeground;
| protected void | onSizeChanged(int w, int h, int oldw, int oldh)
super.onSizeChanged(w, h, oldw, oldh);
mForegroundBoundsChanged = true;
| public void | removeHeaderView(android.view.View headerView)
if (mHeaderDock.indexOfChild(headerView) >= 0) {
mHeaderDock.removeView(headerView);
}
| public void | setForeground(android.graphics.drawable.Drawable d)
mForeground = d;
setWillNotDraw(mForeground == null);
invalidate();
| public void | setForegroundColor(int color)
if (mForeground instanceof ColorDrawable) {
((ColorDrawable) mForeground.mutate()).setColor(color);
invalidate();
} else {
setForeground(new ColorDrawable(color));
}
| public void | showHeader(boolean show)
mHeaderDock.setVisibility(show ? View.VISIBLE : View.GONE);
|
|