private void onTick() {

    synchronized (this) {
      List<DisplayObject> copyDisplayObjectList = new ArrayList<DisplayObject>(mDisplayList);

      Canvas canvas = mSurfaceHolder.lockCanvas();
      if (canvas == null) return;

      canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);

      for (DisplayObject displayObject : copyDisplayObjectList) {
        if (displayObject == null) {
          continue;
        }
        displayObject.draw(canvas);
      }

      mSurfaceHolder.unlockCanvasAndPost(canvas);
    }
  }
 public PostDO(Post post) {
   super.setId(post.getId());
   this.title = post.getTitle();
   this.text = post.getText();
   this.mediaURL = post.getMediaURL();
   this.postURL = post.getPostURL();
   this.type = post.getType();
   this.author = new UserDO(post.getAuthor());
   this.status = post.getStatus();
   this.community = new CommunityDO(post.getCommunity());
   this.referenceURL = post.getReferenceURL();
   this.createdOn = post.getCreatedOn();
   this.numMinutesToRead = post.getNumMinutesToRead();
   this.isPrivate = post.isPrivate();
 }
 /**
  * Adds a child to the display list at the specified index, bumping children at equal or greater
  * indexes up one, and setting its parent to this Container
  *
  * @param location index
  * @param displayObject DisplayObject
  * @return this
  */
 public FPSSurfaceView addChildAt(int location, @NonNull DisplayObject displayObject) {
   displayObject.setUp(mFps);
   mDisplayList.add(location, displayObject);
   return this;
 }
 /**
  * Adds a child to the top of the display list.
  *
  * @param displayObject DisplayObject
  * @return this
  */
 public FPSSurfaceView addChild(@NonNull DisplayObject displayObject) {
   displayObject.setUp(mFps);
   mDisplayList.add(displayObject);
   return this;
 }