Code example for Canvas

Methods: clipRectrestoreToCountsavetranslate

0
 
    @Override 
    protected void dispatchDraw(Canvas canvas) {
        super.dispatchDraw(canvas);
        if (mAdapter == null || !mShouldPin || mCurrentHeader == null) return;
        int saveCount = canvas.save();
        canvas.translate(0, mHeaderOffset);
        canvas.clipRect(0, 0, getWidth(), mCurrentHeader.getMeasuredHeight()); // needed
        // for 
        // < 
        // HONEYCOMB 
        mCurrentHeader.draw(canvas);
        canvas.restoreToCount(saveCount);
    } 
 
    @Override 
    public void setOnScrollListener(OnScrollListener l) {
        mOnScrollListener = l;
    } 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE