diff options
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2View.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Keyboard2View.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2View.java b/srcs/juloo.keyboard2/Keyboard2View.java index 7955aca..d82b58a 100644 --- a/srcs/juloo.keyboard2/Keyboard2View.java +++ b/srcs/juloo.keyboard2/Keyboard2View.java @@ -267,6 +267,10 @@ public class Keyboard2View extends View drawSubLabel(canvas, k.key2, x, y, keyW, keyH, Paint.Align.RIGHT, Vertical.TOP, isKeyDown); drawSubLabel(canvas, k.key4, x, y, keyW, keyH, Paint.Align.RIGHT, Vertical.BOTTOM, isKeyDown); } + if (k.indication != null) + { + drawIndication(canvas, k.indication, keyW / 2f + x, y, keyH); + } x += _keyWidth * k.width; } y += row.height * _config.keyHeight; @@ -309,7 +313,9 @@ public class Keyboard2View extends View canvas.drawText(kv.getString(), x, (keyH - p.ascent() - p.descent()) / 2f + y, p); } - private void drawSubLabel(Canvas canvas, KeyboardData.Corner k, float x, float y, float keyW, float keyH, Paint.Align a, Vertical v, boolean isKeyDown) + private void drawSubLabel(Canvas canvas, KeyboardData.Corner k, float x, + float y, float keyW, float keyH, Paint.Align a, Vertical v, + boolean isKeyDown) { if (k == null) return; @@ -332,6 +338,17 @@ public class Keyboard2View extends View canvas.drawText(kv.getString(), x, y, p); } + private void drawIndication(Canvas canvas, String indication, float x, + float y, float keyH) + { + float textSize = keyH * _config.sublabelTextSize * _config.characterSize; + Paint p = _theme.indicationPaint(); + p.setColor(_theme.subLabelColor); + p.setTextSize(textSize); + canvas.drawText(indication, x, + (keyH - p.ascent() - p.descent()) * 4/5 + y, p); + } + private float scaleTextSize(KeyValue k, float rel_size, float keyH) { float smaller_font = k.hasFlags(KeyValue.FLAG_SMALLER_FONT) ? 0.75f : 1.f; |
