mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Share decoders among latinime components.
Change-Id: I6c8d3cf10e05e606308cea42d1e935a415ada9f8
This commit is contained in:
parent
ed378c78a1
commit
b684d2d2e4
@ -20,7 +20,7 @@ package com.android.inputmethod.latin;
|
||||
* Factory for instantiating DictionaryFacilitator objects.
|
||||
*/
|
||||
public class DictionaryFacilitatorProvider {
|
||||
public static DictionaryFacilitator getDictionaryFacilitator() {
|
||||
public static DictionaryFacilitator getDictionaryFacilitator(boolean isNeededForSpellChecking) {
|
||||
return new DictionaryFacilitatorImpl();
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,8 @@ public class DictionaryFacilitatorLruCache {
|
||||
public DictionaryFacilitatorLruCache(final Context context, final String dictionaryNamePrefix) {
|
||||
mContext = context;
|
||||
mDictionaryNamePrefix = dictionaryNamePrefix;
|
||||
mDictionaryFacilitator = DictionaryFacilitatorProvider.getDictionaryFacilitator();
|
||||
mDictionaryFacilitator = DictionaryFacilitatorProvider.getDictionaryFacilitator(
|
||||
true /* isNeededForSpellChecking */);
|
||||
}
|
||||
|
||||
private static void waitForLoadingMainDictionary(
|
||||
|
@ -127,7 +127,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||
|
||||
final Settings mSettings;
|
||||
private final DictionaryFacilitator mDictionaryFacilitator =
|
||||
DictionaryFacilitatorProvider.getDictionaryFacilitator();
|
||||
DictionaryFacilitatorProvider.getDictionaryFacilitator(
|
||||
false /* isNeededForSpellChecking */);
|
||||
final InputLogic mInputLogic = new InputLogic(this /* LatinIME */,
|
||||
this /* SuggestionStripViewAccessor */, mDictionaryFacilitator);
|
||||
// We expect to have only one decoder in almost all cases, hence the default capacity of 1.
|
||||
|
Loading…
Reference in New Issue
Block a user