summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rw-r--r--android/source/src/java/org/libreoffice/canvas/CalcHeaderCell.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/android/source/src/java/org/libreoffice/canvas/CalcHeaderCell.java b/android/source/src/java/org/libreoffice/canvas/CalcHeaderCell.java
index eec0b5e4a88d..a285234bc8b0 100644
--- a/android/source/src/java/org/libreoffice/canvas/CalcHeaderCell.java
+++ b/android/source/src/java/org/libreoffice/canvas/CalcHeaderCell.java
@@ -10,6 +10,8 @@ import android.text.TextPaint;
public class CalcHeaderCell extends CommonCanvasElement {
private final TextPaint mTextPaint = new TextPaint();
+
+ private final Paint mFramePaint = new Paint();
private final Paint mBgPaint = new Paint();
private final RectF mBounds;
private final Rect mTextBounds = new Rect();
@@ -17,16 +19,20 @@ public class CalcHeaderCell extends CommonCanvasElement {
public CalcHeaderCell(float left, float top, float width, float height, String text, boolean selected) {
mBounds = new RectF(left, top, left + width, top + height);
+
+ mFramePaint.setStyle(Style.STROKE);
+ mFramePaint.setColor(Color.BLACK);
+
+ mBgPaint.setStyle(Style.FILL);
+ mBgPaint.setColor(Color.GRAY);
+ // draw background more intensely when cell is selected
if (selected) {
- // if the cell is selected, display filled
- mBgPaint.setStyle(Style.FILL_AND_STROKE);
+ mBgPaint.setAlpha(100);
} else {
- // if not, display only the frame
- mBgPaint.setStyle(Style.STROKE);
+ mBgPaint.setAlpha(25);
}
- mBgPaint.setColor(Color.GRAY);
- mBgPaint.setAlpha(100); // hard coded for now
- mTextPaint.setColor(Color.GRAY);
+
+ mTextPaint.setColor(Color.BLACK);
mTextPaint.setTextSize(24f); // hard coded for now
mTextPaint.setTextAlign(Paint.Align.CENTER);
mText = text;
@@ -54,6 +60,7 @@ public class CalcHeaderCell extends CommonCanvasElement {
@Override
public void onDraw(Canvas canvas) {
canvas.drawRect(mBounds, mBgPaint);
+ canvas.drawRect(mBounds, mFramePaint);
canvas.drawText(mText, mBounds.centerX(), mBounds.centerY() - mTextBounds.centerY(), mTextPaint);
}
}