ExpandableOutlineViewpublic abstract class ExpandableOutlineView extends ExpandableView Like {@link ExpandableView}, but setting an outline for the height and clipping. |
Fields Summary |
---|
private final android.graphics.Rect | mOutlineRect | private boolean | mCustomOutline |
Constructors Summary |
---|
public ExpandableOutlineView(android.content.Context context, android.util.AttributeSet attrs)
super(context, attrs);
setOutlineProvider(new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
if (!mCustomOutline) {
outline.setRect(0,
mClipTopAmount,
getWidth(),
Math.max(getActualHeight(), mClipTopAmount));
} else {
outline.setRect(mOutlineRect);
}
}
});
|
Methods Summary |
---|
public void | setActualHeight(int actualHeight, boolean notifyListeners)
super.setActualHeight(actualHeight, notifyListeners);
invalidateOutline();
| public void | setClipTopAmount(int clipTopAmount)
super.setClipTopAmount(clipTopAmount);
invalidateOutline();
| protected void | setOutlineRect(android.graphics.RectF rect)
if (rect != null) {
setOutlineRect(rect.left, rect.top, rect.right, rect.bottom);
} else {
mCustomOutline = false;
invalidateOutline();
}
| protected void | setOutlineRect(float left, float top, float right, float bottom)
mCustomOutline = true;
mOutlineRect.set((int) left, (int) top, (int) right, (int) bottom);
// Outlines need to be at least 1 dp
mOutlineRect.bottom = (int) Math.max(top, mOutlineRect.bottom);
mOutlineRect.right = (int) Math.max(left, mOutlineRect.right);
invalidateOutline();
|
|