am 755b3d88
: Notify the facilitator on IME start/finish.
* commit '755b3d882f9d74ceaec7b59fe618dff3ad54f304': Notify the facilitator on IME start/finish.
This commit is contained in:
commit
e7430f76d1
3 changed files with 30 additions and 0 deletions
|
@ -89,6 +89,24 @@ public interface DictionaryFacilitator {
|
||||||
void onUpdateMainDictionaryAvailability(boolean isMainDictionaryAvailable);
|
void onUpdateMainDictionaryAvailability(boolean isMainDictionaryAvailable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called every time {@link LatinIME} starts on a new text field.
|
||||||
|
* Dot not affect {@link AndroidSpellCheckerService}.
|
||||||
|
*
|
||||||
|
* WARNING: The service methods that call start/finish are very spammy.
|
||||||
|
*/
|
||||||
|
void onStartInput();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called every time the {@link LatinIME} finishes with the current text field.
|
||||||
|
* May be followed by {@link #onStartInput} again in another text field,
|
||||||
|
* or it may be done for a while.
|
||||||
|
* Dot not affect {@link AndroidSpellCheckerService}.
|
||||||
|
*
|
||||||
|
* WARNING: The service methods that call start/finish are very spammy.
|
||||||
|
*/
|
||||||
|
void onFinishInput();
|
||||||
|
|
||||||
boolean isActive();
|
boolean isActive();
|
||||||
|
|
||||||
Locale getLocale();
|
Locale getLocale();
|
||||||
|
|
|
@ -202,6 +202,15 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
|
||||||
public DictionaryFacilitatorImpl() {
|
public DictionaryFacilitatorImpl() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStartInput() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinishInput() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isActive() {
|
public boolean isActive() {
|
||||||
return mDictionaryGroup.mLocale != null;
|
return mDictionaryGroup.mLocale != null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -792,6 +792,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
void onStartInputViewInternal(final EditorInfo editorInfo, final boolean restarting) {
|
void onStartInputViewInternal(final EditorInfo editorInfo, final boolean restarting) {
|
||||||
super.onStartInputView(editorInfo, restarting);
|
super.onStartInputView(editorInfo, restarting);
|
||||||
|
|
||||||
|
mDictionaryFacilitator.onStartInput();
|
||||||
// Switch to the null consumer to handle cases leading to early exit below, for which we
|
// Switch to the null consumer to handle cases leading to early exit below, for which we
|
||||||
// also wouldn't be consuming gesture data.
|
// also wouldn't be consuming gesture data.
|
||||||
mGestureConsumer = GestureConsumer.NULL_GESTURE_CONSUMER;
|
mGestureConsumer = GestureConsumer.NULL_GESTURE_CONSUMER;
|
||||||
|
@ -970,6 +972,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
void onFinishInputInternal() {
|
void onFinishInputInternal() {
|
||||||
super.onFinishInput();
|
super.onFinishInput();
|
||||||
|
|
||||||
|
mDictionaryFacilitator.onFinishInput();
|
||||||
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
|
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
|
||||||
if (mainKeyboardView != null) {
|
if (mainKeyboardView != null) {
|
||||||
mainKeyboardView.closing();
|
mainKeyboardView.closing();
|
||||||
|
|
Loading…
Reference in a new issue