FileDocCategorySizeDatePackage
ExpandableOutlineView.javaAPI DocAndroid 5.1 API2761Thu Mar 12 22:22:42 GMT 2015com.android.systemui.statusbar

ExpandableOutlineView

public 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 voidsetActualHeight(int actualHeight, boolean notifyListeners)

        super.setActualHeight(actualHeight, notifyListeners);
        invalidateOutline();
    
public voidsetClipTopAmount(int clipTopAmount)

        super.setClipTopAmount(clipTopAmount);
        invalidateOutline();
    
protected voidsetOutlineRect(android.graphics.RectF rect)

        if (rect != null) {
            setOutlineRect(rect.left, rect.top, rect.right, rect.bottom);
        } else {
            mCustomOutline = false;
            invalidateOutline();
        }
    
protected voidsetOutlineRect(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();