diff options
| author | Jules Aguillon | 2023-08-06 18:17:59 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2023-08-06 18:22:15 +0200 |
| commit | eb56c80ffb8521ac6076abf9319874b848a3df3c (patch) | |
| tree | 34cb094a467289a5e2226661da1c937454a0e1ea /srcs/juloo.keyboard2/Keyboard2View.java | |
| parent | 4d10556d4904086664f14ac3b900e65505a19fe7 (diff) | |
| download | unexpected-keyboard-eb56c80ffb8521ac6076abf9319874b848a3df3c.tar.gz unexpected-keyboard-eb56c80ffb8521ac6076abf9319874b848a3df3c.zip | |
Elide custom keys labels
Make the font smaller for custom keys with a length above 1.
Draw up to 4 characters on keys.
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2View.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Keyboard2View.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2View.java b/srcs/juloo.keyboard2/Keyboard2View.java index f4053f2..1dfaa16 100644 --- a/srcs/juloo.keyboard2/Keyboard2View.java +++ b/srcs/juloo.keyboard2/Keyboard2View.java @@ -407,7 +407,8 @@ public class Keyboard2View extends View x += keyW / 2f; else x += (a == Paint.Align.LEFT) ? subPadding : keyW - subPadding; - canvas.drawText(kv.getString(), x, y, p); + String label = kv.getString(); + canvas.drawText(label, 0, Math.min(4, label.length()), x, y, p); } private void drawIndication(Canvas canvas, String indication, float x, |
