mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Merge "Fix possible NPE in MainKeyboardView"
This commit is contained in:
commit
bb4075bc93
@ -869,13 +869,16 @@ public final class MainKeyboardView extends KeyboardView implements DrawingProxy
|
||||
}
|
||||
|
||||
private void drawLanguageOnSpacebar(final Key key, final Canvas canvas, final Paint paint) {
|
||||
final Keyboard keyboard = getKeyboard();
|
||||
if (keyboard == null) {
|
||||
return;
|
||||
}
|
||||
final int width = key.getWidth();
|
||||
final int height = key.getHeight();
|
||||
paint.setTextAlign(Align.CENTER);
|
||||
paint.setTypeface(Typeface.DEFAULT);
|
||||
paint.setTextSize(mLanguageOnSpacebarTextSize);
|
||||
final RichInputMethodSubtype subtype = getKeyboard().mId.mSubtype;
|
||||
final String language = layoutLanguageOnSpacebar(paint, subtype, width);
|
||||
final String language = layoutLanguageOnSpacebar(paint, keyboard.mId.mSubtype, width);
|
||||
// Draw language text with shadow
|
||||
final float descent = paint.descent();
|
||||
final float textHeight = -paint.ascent() + descent;
|
||||
|
Loading…
Reference in New Issue
Block a user