@Override
  protected void onDraw(Canvas canvas) {
    if (user == null && chat == null && encryptedChat == null) {
      return;
    }

    if (cellLayout == null) {
      requestLayout();
      return;
    }

    if (useSeparator) {
      int h = getMeasuredHeight();
      if (!usePadding) {
        canvas.drawLine(0, h - 1, getMeasuredWidth(), h - 1, linePaint);
      } else {
        canvas.drawLine(
            AndroidUtilities.dp(11),
            h - 1,
            getMeasuredWidth() - AndroidUtilities.dp(11),
            h - 1,
            linePaint);
      }
    }

    if (drawAlpha != 1) {
      canvas.saveLayerAlpha(
          0,
          0,
          canvas.getWidth(),
          canvas.getHeight(),
          (int) (255 * drawAlpha),
          Canvas.HAS_ALPHA_LAYER_SAVE_FLAG);
    }

    if (cellLayout.drawNameLock) {
      setDrawableBounds(lockDrawable, cellLayout.nameLockLeft, cellLayout.nameLockTop);
      lockDrawable.draw(canvas);
    } else if (cellLayout.drawNameGroup) {
      setDrawableBounds(groupDrawable, cellLayout.nameLockLeft, cellLayout.nameLockTop);
      groupDrawable.draw(canvas);
    } else if (cellLayout.drawNameBroadcast) {
      setDrawableBounds(broadcastDrawable, cellLayout.nameLockLeft, cellLayout.nameLockTop);
      broadcastDrawable.draw(canvas);
    }

    canvas.save();
    canvas.translate(cellLayout.nameLeft, cellLayout.nameTop);
    cellLayout.nameLayout.draw(canvas);
    canvas.restore();

    if (cellLayout.onlineLayout != null) {
      canvas.save();
      canvas.translate(cellLayout.onlineLeft, cellLayout.onlineTop);
      cellLayout.onlineLayout.draw(canvas);
      canvas.restore();
    }

    avatarImage.draw(canvas);
  }