Loading java/src/com/android/inputmethod/event/CombinerChain.java +2 −10 Original line number Diff line number Diff line Loading @@ -81,11 +81,11 @@ public class CombinerChain { } /** * Process an event through the combining chain, and return a processed event to apply. * Pass a new event through the whole chain. * @param previousEvents the list of previous events in this composition * @param newEvent the new event to process */ public Event processEvent(final ArrayList<Event> previousEvents, final Event newEvent) { public void processEvent(final ArrayList<Event> previousEvents, final Event newEvent) { final ArrayList<Event> modifiablePreviousEvents = new ArrayList<>(previousEvents); Event event = newEvent; for (final Combiner combiner : mCombiners) { Loading @@ -97,14 +97,6 @@ public class CombinerChain { break; } } return event; } /** * Apply a processed event. * @param event the event to be applied */ public void applyProcessedEvent(final Event event) { if (null != event) { // TODO: figure out the generic way of doing this if (Constants.CODE_DELETE == event.mKeyCode) { Loading java/src/com/android/inputmethod/latin/WordComposer.java +5 −15 Original line number Diff line number Diff line Loading @@ -175,30 +175,20 @@ public final class WordComposer { } /** * Process an event and return an event, and return a processed event to apply. * @param event the unprocessed event. * @return the processed event. */ public Event processEvent(final Event event) { final Event processedEvent = mCombinerChain.processEvent(mEvents, event); mEvents.add(event); return processedEvent; } /** * Apply a processed input event. * Process an input event. * * All input events should be supported, including software/hardware events, characters as well * as deletions, multiple inputs and gestures. * * @param event the event to apply. * @param event the event to process. */ public void applyProcessedEvent(final Event event) { public void processEvent(final Event event) { final int primaryCode = event.mCodePoint; final int keyX = event.mX; final int keyY = event.mY; final int newIndex = size(); mCombinerChain.applyProcessedEvent(event); mCombinerChain.processEvent(mEvents, event); mEvents.add(event); refreshTypedWordCache(); mCursorPositionWithinWord = mCodePointSize; // We may have deleted the last one. Loading java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +2 −4 Original line number Diff line number Diff line Loading @@ -762,8 +762,7 @@ public final class InputLogic { resetComposingState(false /* alsoResetLastComposedWord */); } if (isComposingWord) { final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent); mWordComposer.applyProcessedEvent(processedEvent); mWordComposer.processEvent(inputTransaction.mEvent); // If it's the first letter, make note of auto-caps state if (mWordComposer.isSingleLetter()) { mWordComposer.setCapitalizedModeAtStartComposingTime(inputTransaction.mShiftState); Loading Loading @@ -934,8 +933,7 @@ public final class InputLogic { mDictionaryFacilitator.removeWordFromPersonalizedDicts(rejectedSuggestion); } } else { final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent); mWordComposer.applyProcessedEvent(processedEvent); mWordComposer.processEvent(inputTransaction.mEvent); } if (mWordComposer.isComposingWord()) { mConnection.setComposingText(getTextWithUnderline(mWordComposer.getTypedWord()), 1); Loading Loading
java/src/com/android/inputmethod/event/CombinerChain.java +2 −10 Original line number Diff line number Diff line Loading @@ -81,11 +81,11 @@ public class CombinerChain { } /** * Process an event through the combining chain, and return a processed event to apply. * Pass a new event through the whole chain. * @param previousEvents the list of previous events in this composition * @param newEvent the new event to process */ public Event processEvent(final ArrayList<Event> previousEvents, final Event newEvent) { public void processEvent(final ArrayList<Event> previousEvents, final Event newEvent) { final ArrayList<Event> modifiablePreviousEvents = new ArrayList<>(previousEvents); Event event = newEvent; for (final Combiner combiner : mCombiners) { Loading @@ -97,14 +97,6 @@ public class CombinerChain { break; } } return event; } /** * Apply a processed event. * @param event the event to be applied */ public void applyProcessedEvent(final Event event) { if (null != event) { // TODO: figure out the generic way of doing this if (Constants.CODE_DELETE == event.mKeyCode) { Loading
java/src/com/android/inputmethod/latin/WordComposer.java +5 −15 Original line number Diff line number Diff line Loading @@ -175,30 +175,20 @@ public final class WordComposer { } /** * Process an event and return an event, and return a processed event to apply. * @param event the unprocessed event. * @return the processed event. */ public Event processEvent(final Event event) { final Event processedEvent = mCombinerChain.processEvent(mEvents, event); mEvents.add(event); return processedEvent; } /** * Apply a processed input event. * Process an input event. * * All input events should be supported, including software/hardware events, characters as well * as deletions, multiple inputs and gestures. * * @param event the event to apply. * @param event the event to process. */ public void applyProcessedEvent(final Event event) { public void processEvent(final Event event) { final int primaryCode = event.mCodePoint; final int keyX = event.mX; final int keyY = event.mY; final int newIndex = size(); mCombinerChain.applyProcessedEvent(event); mCombinerChain.processEvent(mEvents, event); mEvents.add(event); refreshTypedWordCache(); mCursorPositionWithinWord = mCodePointSize; // We may have deleted the last one. Loading
java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +2 −4 Original line number Diff line number Diff line Loading @@ -762,8 +762,7 @@ public final class InputLogic { resetComposingState(false /* alsoResetLastComposedWord */); } if (isComposingWord) { final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent); mWordComposer.applyProcessedEvent(processedEvent); mWordComposer.processEvent(inputTransaction.mEvent); // If it's the first letter, make note of auto-caps state if (mWordComposer.isSingleLetter()) { mWordComposer.setCapitalizedModeAtStartComposingTime(inputTransaction.mShiftState); Loading Loading @@ -934,8 +933,7 @@ public final class InputLogic { mDictionaryFacilitator.removeWordFromPersonalizedDicts(rejectedSuggestion); } } else { final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent); mWordComposer.applyProcessedEvent(processedEvent); mWordComposer.processEvent(inputTransaction.mEvent); } if (mWordComposer.isComposingWord()) { mConnection.setComposingText(getTextWithUnderline(mWordComposer.getTypedWord()), 1); Loading