Loading java/Android.mk +1 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ LOCAL_CERTIFICATE := shared LOCAL_JNI_SHARED_LIBRARIES := libjni_latinime LOCAL_STATIC_JAVA_LIBRARIES := android-common inputmethod-common android-support-v4 LOCAL_STATIC_JAVA_LIBRARIES := android-common inputmethod-common android-support-v4 jsr305 # Do not compress dictionary files to mmap dict data runtime LOCAL_AAPT_FLAGS := -0 .dict Loading java/src/com/android/inputmethod/event/Combiner.java +3 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.inputmethod.event; import java.util.ArrayList; import javax.annotation.Nonnull; /** * A generic interface for combiners. Combiners are objects that transform chains of input events * into committable strings and manage feedback to show to the user on the combining state. Loading @@ -33,6 +35,7 @@ public interface Combiner { * @param event the event to combine with the existing state. * @return the resulting event. */ @Nonnull Event processEvent(ArrayList<Event> previousEvents, Event event); /** Loading java/src/com/android/inputmethod/event/CombinerChain.java +3 −4 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import com.android.inputmethod.latin.Constants; import java.util.ArrayList; import java.util.HashMap; import javax.annotation.Nonnull; /** * This class implements the logic chain between receiving events and generating code points. * Loading Loading @@ -87,6 +89,7 @@ public class CombinerChain { * @return the processed event. It may be the same event, or a consumed event, or a completely * new event. However it may never be null. */ @Nonnull public Event processEvent(final ArrayList<Event> previousEvents, final Event newEvent) { final ArrayList<Event> modifiablePreviousEvents = new ArrayList<>(previousEvents); Event event = newEvent; Loading @@ -94,10 +97,6 @@ public class CombinerChain { // A combiner can never return more than one event; it can return several // code points, but they should be encapsulated within one event. event = combiner.processEvent(modifiablePreviousEvents, event); if (null == event) { // Combiners return null if they eat the event. break; } } return event; } Loading java/src/com/android/inputmethod/event/DeadKeyCombiner.java +3 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ import com.android.inputmethod.latin.Constants; import java.util.ArrayList; import javax.annotation.Nonnull; /** * A combiner that handles dead keys. */ Loading @@ -31,6 +33,7 @@ public class DeadKeyCombiner implements Combiner { final StringBuilder mDeadSequence = new StringBuilder(); @Override @Nonnull public Event processEvent(final ArrayList<Event> previousEvents, final Event event) { if (TextUtils.isEmpty(mDeadSequence)) { if (event.isDead()) { Loading java/src/com/android/inputmethod/event/MyanmarReordering.java +3 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ import com.android.inputmethod.latin.Constants; import java.util.ArrayList; import java.util.Arrays; import javax.annotation.Nonnull; /** * A combiner that reorders input for Myanmar. */ Loading Loading @@ -129,6 +131,7 @@ public class MyanmarReordering implements Combiner { } @Override @Nonnull public Event processEvent(ArrayList<Event> previousEvents, Event newEvent) { final int codePoint = newEvent.mCodePoint; if (VOWEL_E == codePoint) { Loading Loading
java/Android.mk +1 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ LOCAL_CERTIFICATE := shared LOCAL_JNI_SHARED_LIBRARIES := libjni_latinime LOCAL_STATIC_JAVA_LIBRARIES := android-common inputmethod-common android-support-v4 LOCAL_STATIC_JAVA_LIBRARIES := android-common inputmethod-common android-support-v4 jsr305 # Do not compress dictionary files to mmap dict data runtime LOCAL_AAPT_FLAGS := -0 .dict Loading
java/src/com/android/inputmethod/event/Combiner.java +3 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.inputmethod.event; import java.util.ArrayList; import javax.annotation.Nonnull; /** * A generic interface for combiners. Combiners are objects that transform chains of input events * into committable strings and manage feedback to show to the user on the combining state. Loading @@ -33,6 +35,7 @@ public interface Combiner { * @param event the event to combine with the existing state. * @return the resulting event. */ @Nonnull Event processEvent(ArrayList<Event> previousEvents, Event event); /** Loading
java/src/com/android/inputmethod/event/CombinerChain.java +3 −4 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import com.android.inputmethod.latin.Constants; import java.util.ArrayList; import java.util.HashMap; import javax.annotation.Nonnull; /** * This class implements the logic chain between receiving events and generating code points. * Loading Loading @@ -87,6 +89,7 @@ public class CombinerChain { * @return the processed event. It may be the same event, or a consumed event, or a completely * new event. However it may never be null. */ @Nonnull public Event processEvent(final ArrayList<Event> previousEvents, final Event newEvent) { final ArrayList<Event> modifiablePreviousEvents = new ArrayList<>(previousEvents); Event event = newEvent; Loading @@ -94,10 +97,6 @@ public class CombinerChain { // A combiner can never return more than one event; it can return several // code points, but they should be encapsulated within one event. event = combiner.processEvent(modifiablePreviousEvents, event); if (null == event) { // Combiners return null if they eat the event. break; } } return event; } Loading
java/src/com/android/inputmethod/event/DeadKeyCombiner.java +3 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ import com.android.inputmethod.latin.Constants; import java.util.ArrayList; import javax.annotation.Nonnull; /** * A combiner that handles dead keys. */ Loading @@ -31,6 +33,7 @@ public class DeadKeyCombiner implements Combiner { final StringBuilder mDeadSequence = new StringBuilder(); @Override @Nonnull public Event processEvent(final ArrayList<Event> previousEvents, final Event event) { if (TextUtils.isEmpty(mDeadSequence)) { if (event.isDead()) { Loading
java/src/com/android/inputmethod/event/MyanmarReordering.java +3 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ import com.android.inputmethod.latin.Constants; import java.util.ArrayList; import java.util.Arrays; import javax.annotation.Nonnull; /** * A combiner that reorders input for Myanmar. */ Loading Loading @@ -129,6 +131,7 @@ public class MyanmarReordering implements Combiner { } @Override @Nonnull public Event processEvent(ArrayList<Event> previousEvents, Event newEvent) { final int codePoint = newEvent.mCodePoint; if (VOWEL_E == codePoint) { Loading