From 9e943e5301d5081f26affa9244f17e7fc5802ece Mon Sep 17 00:00:00 2001 From: Jean-Pierre Rasquin Date: Sun, 6 Jan 2019 01:54:07 +0100 Subject: [PATCH] Alt hint label: Do not show it if shifted Signed-off-by: Jean-Pierre Rasquin --- .../pocketworkstation/pckeyboard/LatinKeyboardBaseView.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/pocketworkstation/pckeyboard/LatinKeyboardBaseView.java b/app/src/main/java/org/pocketworkstation/pckeyboard/LatinKeyboardBaseView.java index aa0824473..3fb1ce527 100644 --- a/app/src/main/java/org/pocketworkstation/pckeyboard/LatinKeyboardBaseView.java +++ b/app/src/main/java/org/pocketworkstation/pckeyboard/LatinKeyboardBaseView.java @@ -1045,7 +1045,7 @@ private void onBufferDraw(Canvas canvas) { // Draw alternate hint label (if present) behind the main key String altHint = key.getAltHintLabel(showHints7Bit(), showHintsAll()); - if (!altHint.equals("")) { + if (!altHint.equals("") && !key.isShifted()) { int hintTextSize = (int)(mKeyTextSize * 0.6 * mLabelScale); paintHint.setTextSize(hintTextSize); @@ -1062,7 +1062,8 @@ private void onBufferDraw(Canvas canvas) { // Draw main key label final int centerX = Math.round( (key.width + padding.left - padding.right) / 2 - * (altHint.equals("") ? 1f : KEY_LABEL_ALTHINT_HORIZONTAL_ADJUSTMENT_FACTOR)); + * (!altHint.equals("") && !key.isShifted() + ? KEY_LABEL_ALTHINT_HORIZONTAL_ADJUSTMENT_FACTOR : 1f)); final int centerY = (key.height + padding.top - padding.bottom) / 2; final float baseline = centerY + labelHeight * KEY_LABEL_VERTICAL_ADJUSTMENT_FACTOR;