forked from extern/Unexpected-Keyboard
Elide custom keys labels
Make the font smaller for custom keys with a length above 1. Draw up to 4 characters on keys.
This commit is contained in:
parent
4d10556d49
commit
eb56c80ffb
@ -296,7 +296,7 @@ final class KeyValue
|
||||
if (str.length() == 1)
|
||||
return new KeyValue(str, Kind.Char, str.charAt(0), 0);
|
||||
else
|
||||
return new KeyValue(str, Kind.String, 0, 0);
|
||||
return new KeyValue(str, Kind.String, 0, FLAG_SMALLER_FONT);
|
||||
}
|
||||
|
||||
public static KeyValue getKeyByName(String name)
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user