Exemplo n.º 1
0
  @Override
  protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    if (editing) {
      float cursorX = FontFitter.measureText(this) + getPaddingLeft();
      float maxCursorX = getWidth() - getPaddingRight();
      if (cursorX > maxCursorX) {
        cursorX = maxCursorX;
      }

      canvas.drawLine(
          cursorX, 2 + getPaddingTop(), cursorX, getHeight() - 2 - getPaddingBottom(), cursorPaint);
    }
  }
Exemplo n.º 2
0
 private void fitText() {
   setTextSize(24);
   FontFitter.fitText(this, 16);
 }