private void invalidateRecursive() { invalidateFlag = true; if (treeNodes != null) { for (PageTreeNode child : treeNodes) { child.invalidateRecursive(); } } stopDecodingThisNode(); }
void invalidateNodeBounds() { targetRect = null; targetRectF = null; if (treeNodes != null) { for (PageTreeNode child : treeNodes) { child.invalidateNodeBounds(); } } }
private void recycle() { stopDecodingThisNode(); setBitmap(null); if (treeNodes != null) { for (PageTreeNode child : treeNodes) { child.recycle(); } } }
private boolean childrenContainBitmaps() { if (treeNodes == null) { return false; } for (PageTreeNode child : treeNodes) { if (child.containsBitmaps()) { return true; } } return false; }
private void recycleChildren() { if (treeNodes == null) { return; } for (PageTreeNode child : treeNodes) { child.recycle(); } if (!childrenContainBitmaps()) { treeNodes = null; } }
private boolean isHiddenByChildren() { if (treeNodes == null) { return false; } for (PageTreeNode child : treeNodes) { if (child.getBitmap() == null) { return false; } } return true; }
void draw(Canvas canvas) { if (getBitmap() != null) { canvas.drawBitmap( getBitmap(), new Rect(0, 0, getBitmap().getWidth(), getBitmap().getHeight()), getTargetRect(), bitmapPaint); } if (treeNodes == null) { return; } for (PageTreeNode child : treeNodes) { child.draw(canvas); } }
public void updateVisibility() { invalidateChildren(); if (treeNodes != null) { for (PageTreeNode child : treeNodes) { child.updateVisibility(); } } if (isVisible()) { if (!thresholdHit()) { if (getBitmap() != null && !invalidateFlag) { restoreBitmapReference(); } else { decodePageTreeNode(); } } } if (!isVisibleAndNotHiddenByChildren()) { stopDecodingThisNode(); setBitmap(null); } }