예제 #1
0
파일: UEditView.java 프로젝트: kstep/ucalc
  @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);
    }
  }
예제 #2
0
파일: UEditView.java 프로젝트: kstep/ucalc
 @Override
 protected void onMeasure(int widthSpec, int heightSpec) {
   super.onMeasure(widthSpec, heightSpec);
   fitText();
 }
예제 #3
0
파일: UEditView.java 프로젝트: kstep/ucalc
 @Override
 protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter) {
   super.onTextChanged(text, start, lengthBefore, lengthAfter);
   syncValue = false;
   fitText();
 }