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