diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-02-04 21:13:45 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-09 08:12:08 +0100 |
commit | 2f018339be2791a6a4d6b29bd369af840e8aa5fa (patch) | |
tree | d33a72f8024a63d296100d1ffc8e5448671b6360 /android/experimental | |
parent | e2d4cfa425a9cecb31ef8aa74722083dca004b3c (diff) |
android: blinking cursor
Change-Id: I1e2d5df7917ec0f8e780e3e3481dadd10b1b76ed
Diffstat (limited to 'android/experimental')
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java index d9e51fcedb93..1aed2f0155a2 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java @@ -29,9 +29,11 @@ public class TextCursorView extends ImageView { private int mWidth; private int mHeight; + private int mAlpha = 0; public TextCursorView(Context context, AttributeSet attrs) { super(context, attrs); + postDelayed(cursorAnimation, 500); } public void changePosition(RectF position) { @@ -57,7 +59,6 @@ public class TextCursorView extends ImageView { mTop = Math.round(scaled.centerY() - y); setScaleY(scaled.height()); - setLayoutPosition(); } @@ -76,4 +77,13 @@ public class TextCursorView extends ImageView { setLayoutParams(mLayoutParams); } + + private Runnable cursorAnimation = new Runnable() { + public void run() { + mAlpha = mAlpha == 0 ? 0xFF : 0; + getDrawable().setAlpha(mAlpha); + invalidate(); + postDelayed(cursorAnimation, 500); + } + }; }
\ No newline at end of file |