From 674c51b6d74f3a5e59964a6a0b1b7b9c9a7cfa38 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Rasquin Date: Fri, 7 Dec 2018 21:19:12 +0100 Subject: [PATCH] Hint: always show except lettres (a-z/A-Z) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some locales have shifted chars likel ç ° ä ö ü which are helpful to be visible Signed-off-by: Jean-Pierre Rasquin --- .../java/org/pocketworkstation/pckeyboard/Keyboard.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/pocketworkstation/pckeyboard/Keyboard.java b/app/src/main/java/org/pocketworkstation/pckeyboard/Keyboard.java index b4e59ecd9..e07298c05 100644 --- a/app/src/main/java/org/pocketworkstation/pckeyboard/Keyboard.java +++ b/app/src/main/java/org/pocketworkstation/pckeyboard/Keyboard.java @@ -638,7 +638,7 @@ public String getHintLabel(boolean wantAscii, boolean wantAll) { hint = ""; if (shiftLabel != null && !isSimpleUppercase) { char c = shiftLabel.charAt(0); - if (wantAll || wantAscii && is7BitAscii(c)) { + if (wantAll || wantAscii && isNotAlpha(c)) { hint = Character.toString(c); } } @@ -664,6 +664,11 @@ private static boolean is7BitAscii(char c) { if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) return false; return c >= 32 && c < 127; } + + private static boolean isNotAlpha(char c) { + if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) return false; + return true; + } /** * Informs the key that it has been pressed, in case it needs to change its appearance or