mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Add pre-alpha text to spacebar
This commit is contained in:
parent
9308bcbfb0
commit
81cc428e92
@ -42,4 +42,5 @@
|
||||
<string name="disable_emoji">Disable emoji suggestions</string>
|
||||
<string name="try_typing">Try typing here…</string>
|
||||
<string name="externally_imported_model">Externally imported model</string>
|
||||
<string name="spacebar_default_text">Pre-Alpha</string>
|
||||
</resources>
|
@ -815,10 +815,7 @@ public final class MainKeyboardView extends KeyboardView implements DrawingProxy
|
||||
super.onDrawKeyTopVisuals(key, canvas, paint, params);
|
||||
final int code = key.getCode();
|
||||
if (code == Constants.CODE_SPACE) {
|
||||
// If input language are explicitly selected.
|
||||
if (mLanguageOnSpacebarFormatType != LanguageOnSpacebarUtils.FORMAT_TYPE_NONE) {
|
||||
drawLanguageOnSpacebar(key, canvas, paint);
|
||||
}
|
||||
drawLanguageOnSpacebar(key, canvas, paint);
|
||||
// Whether space key needs to show the "..." popup hint for special purposes
|
||||
if (key.isLongPressEnabled() && mHasMultipleEnabledIMEsOrSubtypes) {
|
||||
drawKeyPopupHint(key, canvas, paint, params);
|
||||
@ -848,6 +845,12 @@ public final class MainKeyboardView extends KeyboardView implements DrawingProxy
|
||||
// Layout language name on spacebar.
|
||||
private String layoutLanguageOnSpacebar(final Paint paint,
|
||||
final RichInputMethodSubtype subtype, final int width) {
|
||||
if (mLanguageOnSpacebarFormatType == LanguageOnSpacebarUtils.FORMAT_TYPE_NONE) {
|
||||
final String text = getContext().getString(R.string.spacebar_default_text);
|
||||
if(fitsTextIntoWidth(width, text, paint)) {
|
||||
return text;
|
||||
}
|
||||
}
|
||||
// Choose appropriate language name to fit into the width.
|
||||
if (mLanguageOnSpacebarFormatType == LanguageOnSpacebarUtils.FORMAT_TYPE_FULL_LOCALE) {
|
||||
final String fullText = subtype.getFullDisplayName();
|
||||
|
Loading…
Reference in New Issue
Block a user