Java Code Examples for android.view.View#isDirty()

The following examples show how to use android.view.View#isDirty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CoverFlowItemWrapper.java    From superXingPostCard with GNU General Public License v3.0 6 votes vote down vote up
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
protected void dispatchDraw(Canvas canvas) {
    View childView = getChildAt(0);

    if (childView != null) {
        // If on honeycomb or newer, cache the view.
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            if (childView.isDirty()) {
                childView.draw(this.wrappedViewDrawingCanvas);

                if (this.isReflectionEnabled) {
                    this.createReflectedImages();
                }
            }
        } else {
            childView.draw(this.wrappedViewDrawingCanvas);
        }
    }

    canvas.drawBitmap(this.wrappedViewBitmap, (this.getWidth() - childView.getWidth()) / 2, 0, paint);
}
 
Example 2
Source File: OCursorListAdapter.java    From hr with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public View newView(Context context, Cursor cursor, ViewGroup viewGroup) {
    View view;
    if (mCacheViews && getCachedView(cursor) != null) {
        view = getCachedView(cursor);
        if (!view.isDirty()) {
            return view;
        }
    }
    if (mOnViewCreateListener != null) {
        view = mOnViewCreateListener.onViewCreated(context, viewGroup,
                cursor, cursor.getPosition());
        if (view == null) {
            view = mInflater.inflate(mLayout, viewGroup, false);
        }
    } else
        view = mInflater.inflate(mLayout, viewGroup, false);
    if (mCacheViews) {
        mViewCache.put("view_" + cursor.getPosition(), view);
    }
    return view;
}
 
Example 3
Source File: FancyCoverFlowItemWrapper.java    From UltimateAndroid with Apache License 2.0 6 votes vote down vote up
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
protected void dispatchDraw(Canvas canvas) {
    View childView = getChildAt(0);

    if (childView != null) {
        // If on honeycomb or newer, cache the view.
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            if (childView.isDirty()) {
                childView.draw(this.wrappedViewDrawingCanvas);

                if (this.isReflectionEnabled) {
                    this.createReflectedImages();
                }
            }
        } else {
            childView.draw(this.wrappedViewDrawingCanvas);
        }
    }

    canvas.drawBitmap(this.wrappedViewBitmap, (this.getWidth() - childView.getWidth()) / 2, 0, paint);
}
 
Example 4
Source File: FancyCoverFlowItemWrapper.java    From UltimateAndroid with Apache License 2.0 6 votes vote down vote up
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
protected void dispatchDraw(Canvas canvas) {
    View childView = getChildAt(0);

    if (childView != null) {
        // If on honeycomb or newer, cache the view.
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            if (childView.isDirty()) {
                childView.draw(this.wrappedViewDrawingCanvas);

                if (this.isReflectionEnabled) {
                    this.createReflectedImages();
                }
            }
        } else {
            childView.draw(this.wrappedViewDrawingCanvas);
        }
    }

    canvas.drawBitmap(this.wrappedViewBitmap, (this.getWidth() - childView.getWidth()) / 2, 0, paint);
}
 
Example 5
Source File: OCursorListAdapter.java    From framework with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public View newView(Context context, Cursor cursor, ViewGroup viewGroup) {
    View view;
    if (mCacheViews && getCachedView(cursor) != null) {
        view = getCachedView(cursor);
        if (!view.isDirty()) {
            return view;
        }
    }
    if (mOnViewCreateListener != null) {
        view = mOnViewCreateListener.onViewCreated(context, viewGroup,
                cursor, cursor.getPosition());
        if (view == null) {
            view = mInflater.inflate(mLayout, viewGroup, false);
        }
    } else
        view = mInflater.inflate(mLayout, viewGroup, false);
    if (mCacheViews) {
        mViewCache.put("view_" + cursor.getPosition(), view);
    }
    return view;
}