diff options
-rw-r--r-- | java/res/values/strings.xml | 6 | ||||
-rw-r--r-- | java/res/xml/prefs.xml | 1 | ||||
-rw-r--r-- | native/jni/src/bigram_dictionary.cpp | 3 | ||||
-rw-r--r-- | native/jni/src/dictionary.h | 16 |
4 files changed, 7 insertions, 19 deletions
diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml index 1b518a189..e3cd84c9d 100644 --- a/java/res/values/strings.xml +++ b/java/res/values/strings.xml @@ -69,8 +69,10 @@ <!-- Option summary for showing language switch key [CHAR LIMIT=65] --> <string name="show_language_switch_key_summary">Show when multiple input languages are enabled</string> - <!-- Option to enable sliding key input preview. The user can see a rubber band during sliding key input. [CHAR LIMIT=30]--> - <string name="sliding_key_input_preview">Sliding key input preview</string> + <!-- Option to enable sliding key input indicator. The user can see a rubber band-like effect during sliding key input. [CHAR LIMIT=30]--> + <string name="sliding_key_input_preview">Show slide indicator</string> + <!-- Option summary to enable sliding key input indicator. The user can see a rubber band-like effect during sliding key input. [CHAR LIMIT=65]--> + <string name="sliding_key_input_preview_summary">Display visual cue while sliding from Shift or Symbol keys</string> <!-- Option for the dismiss delay of the key popup [CHAR LIMIT=25] --> <string name="key_preview_popup_dismiss_delay">Key popup dismiss delay</string> diff --git a/java/res/xml/prefs.xml b/java/res/xml/prefs.xml index da6e60107..5ed0bb029 100644 --- a/java/res/xml/prefs.xml +++ b/java/res/xml/prefs.xml @@ -145,6 +145,7 @@ <CheckBoxPreference android:key="pref_sliding_key_input_preview" android:title="@string/sliding_key_input_preview" + android:summary="@string/sliding_key_input_preview_summary" android:persistent="true" android:defaultValue="true" /> <ListPreference diff --git a/native/jni/src/bigram_dictionary.cpp b/native/jni/src/bigram_dictionary.cpp index 44dc75e9c..ef0434c49 100644 --- a/native/jni/src/bigram_dictionary.cpp +++ b/native/jni/src/bigram_dictionary.cpp @@ -21,6 +21,7 @@ #include "bigram_dictionary.h" #include "binary_format.h" #include "bloom_filter.h" +#include "char_utils.h" #include "defines.h" #include "dictionary.h" @@ -50,7 +51,7 @@ void BigramDictionary::addWordBigram(int *word, int length, int frequency, int * int insertAt = 0; while (insertAt < MAX_RESULTS) { if (frequency > bigramFreq[insertAt] || (bigramFreq[insertAt] == frequency - && length < Dictionary::wideStrLen( + && length < getCodePointCount(MAX_WORD_LENGTH, bigramCodePoints + insertAt * MAX_WORD_LENGTH))) { break; } diff --git a/native/jni/src/dictionary.h b/native/jni/src/dictionary.h index 121cf058d..83676b204 100644 --- a/native/jni/src/dictionary.h +++ b/native/jni/src/dictionary.h @@ -65,10 +65,6 @@ class Dictionary { int getDictBufAdjust() const { return mDictBufAdjust; } virtual ~Dictionary(); - // public static utility methods - // static inline methods should be defined in the header file - static int wideStrLen(int *str); - private: DISALLOW_IMPLICIT_CONSTRUCTORS(Dictionary); const uint8_t *mDict; @@ -84,17 +80,5 @@ class Dictionary { const BigramDictionary *mBigramDictionary; SuggestInterface *mGestureSuggest; }; - -// public static utility methods -// static inline methods should be defined in the header file -inline int Dictionary::wideStrLen(int *str) { - if (!str) return 0; - int length = 0; - while (*str) { - str++; - length++; - } - return length; -} } // namespace latinime #endif // LATINIME_DICTIONARY_H |