[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental
Tomaž Vajngerl
tomaz.vajngerl at collabora.co.uk
Wed Feb 4 04:15:43 PST 2015
android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java | 12 +++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
New commits:
commit a1368867ae60f6d79469ad439ec5e200740ab4ef
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date: Wed Feb 4 21:13:45 2015 +0900
android: blinking cursor
Change-Id: I1e2d5df7917ec0f8e780e3e3481dadd10b1b76ed
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java
index d9e51fc..1aed2f0 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
More information about the Libreoffice-commits
mailing list