Beispiel #1
0
 private void invalidateRecursive() {
   invalidateFlag = true;
   if (treeNodes != null) {
     for (PageTreeNode child : treeNodes) {
       child.invalidateRecursive();
     }
   }
   stopDecodingThisNode();
 }
Beispiel #2
0
 void invalidateNodeBounds() {
   targetRect = null;
   targetRectF = null;
   if (treeNodes != null) {
     for (PageTreeNode child : treeNodes) {
       child.invalidateNodeBounds();
     }
   }
 }
Beispiel #3
0
 private void recycle() {
   stopDecodingThisNode();
   setBitmap(null);
   if (treeNodes != null) {
     for (PageTreeNode child : treeNodes) {
       child.recycle();
     }
   }
 }
Beispiel #4
0
 private boolean childrenContainBitmaps() {
   if (treeNodes == null) {
     return false;
   }
   for (PageTreeNode child : treeNodes) {
     if (child.containsBitmaps()) {
       return true;
     }
   }
   return false;
 }
Beispiel #5
0
 private void recycleChildren() {
   if (treeNodes == null) {
     return;
   }
   for (PageTreeNode child : treeNodes) {
     child.recycle();
   }
   if (!childrenContainBitmaps()) {
     treeNodes = null;
   }
 }
Beispiel #6
0
 private boolean isHiddenByChildren() {
   if (treeNodes == null) {
     return false;
   }
   for (PageTreeNode child : treeNodes) {
     if (child.getBitmap() == null) {
       return false;
     }
   }
   return true;
 }
Beispiel #7
0
 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);
   }
 }
Beispiel #8
0
 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);
   }
 }