Hide space bar preview when space bar switcher is disabled.
Change-Id: I469197a4b3f55335eaee104177f0970cc904bb34
This commit is contained in:
parent
3b776b7892
commit
279da1da91
2 changed files with 5 additions and 4 deletions
|
@ -929,10 +929,11 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy {
|
||||||
// the space key preview and 3) pointer moves off the space key to other letter key, we
|
// the space key preview and 3) pointer moves off the space key to other letter key, we
|
||||||
// should hide the preview of the previous key.
|
// should hide the preview of the previous key.
|
||||||
final boolean hidePreviewOrShowSpaceKeyPreview = (tracker == null)
|
final boolean hidePreviewOrShowSpaceKeyPreview = (tracker == null)
|
||||||
|| tracker.isSpaceKey(keyIndex) || tracker.isSpaceKey(oldKeyIndex);
|
|| (SubtypeSwitcher.USE_SPACEBAR_LANGUAGE_SWITCHER
|
||||||
|
&& SubtypeSwitcher.getInstance().needsToDisplayLanguage()
|
||||||
|
&& (tracker.isSpaceKey(keyIndex) || tracker.isSpaceKey(oldKeyIndex)));
|
||||||
// If key changed and preview is on or the key is space (language switch is enabled)
|
// If key changed and preview is on or the key is space (language switch is enabled)
|
||||||
if (oldKeyIndex != keyIndex && (mShowPreview || (hidePreviewOrShowSpaceKeyPreview
|
if (oldKeyIndex != keyIndex && (mShowPreview || (hidePreviewOrShowSpaceKeyPreview))) {
|
||||||
&& SubtypeSwitcher.getInstance().needsToDisplayLanguage()))) {
|
|
||||||
if (keyIndex == NOT_A_KEY) {
|
if (keyIndex == NOT_A_KEY) {
|
||||||
mHandler.cancelPopupPreview();
|
mHandler.cancelPopupPreview();
|
||||||
mHandler.dismissPreview(mDelayAfterPreview);
|
mHandler.dismissPreview(mDelayAfterPreview);
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class SubtypeSwitcher {
|
||||||
// TODO: Cache the value
|
// TODO: Cache the value
|
||||||
public boolean needsToDisplayLanguage() {
|
public boolean needsToDisplayLanguage() {
|
||||||
// TODO: Takes care of two-char locale such as "en" in addition to "en_US"
|
// TODO: Takes care of two-char locale such as "en" in addition to "en_US"
|
||||||
return !(getEnabledKeyboardLocaleCount() == 1 && getSystemLocale().getLanguage(
|
return !(getEnabledKeyboardLocaleCount() <= 1 && getSystemLocale().getLanguage(
|
||||||
).equalsIgnoreCase(getInputLocale().getLanguage()));
|
).equalsIgnoreCase(getInputLocale().getLanguage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue