summaryrefslogtreecommitdiff
path: root/android/experimental
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-02-04 21:13:45 +0900
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-02-09 08:12:08 +0100
commit2f018339be2791a6a4d6b29bd369af840e8aa5fa (patch)
treed33a72f8024a63d296100d1ffc8e5448671b6360 /android/experimental
parente2d4cfa425a9cecb31ef8aa74722083dca004b3c (diff)
android: blinking cursor
Change-Id: I1e2d5df7917ec0f8e780e3e3481dadd10b1b76ed
Diffstat (limited to 'android/experimental')
-rw-r--r--android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java12
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