android: change cursor blink time to a constant static field

Change-Id: I49947cccfd2662533da3087cb1f04dc91014cfb0
This commit is contained in:
Tomaž Vajngerl 2015-03-18 14:00:44 +09:00 committed by Miklos Vajna
parent 86548b6bfe
commit 907583d10c

View File

@ -34,6 +34,7 @@ import java.util.List;
public class TextCursorView extends View implements View.OnTouchListener {
private static final String LOGTAG = TextCursorView.class.getSimpleName();
private static final float CURSOR_WIDTH = 2f;
private static final int CURSOR_BLINK_TIME = 500;
private boolean mInitialized = false;
private RectF mCursorPosition = new RectF();
@ -96,7 +97,7 @@ public class TextCursorView extends View implements View.OnTouchListener {
mGraphicHandleFillPaint.setColor(Color.WHITE);
mGraphicSelectionVisible = false;
postDelayed(cursorAnimation, 500);
postDelayed(cursorAnimation, CURSOR_BLINK_TIME);
mInitialized = true;
}
@ -197,7 +198,7 @@ public class TextCursorView extends View implements View.OnTouchListener {
mCursorPaint.setAlpha(mCursorPaint.getAlpha() == 0 ? 0xFF : 0);
invalidate();
}
postDelayed(cursorAnimation, 500);
postDelayed(cursorAnimation, CURSOR_BLINK_TIME);
}
};