From c2badb0447accaa39e4f7b3d8ebb43601f2f5d8f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 7 May 2014 02:30:27 -0400 Subject: Start implementing modifiers, for a great reduction in code size. --- src/us/minak/IMEService.java | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) (limited to 'src/us/minak/IMEService.java') diff --git a/src/us/minak/IMEService.java b/src/us/minak/IMEService.java index a0a9ece..f8a3660 100644 --- a/src/us/minak/IMEService.java +++ b/src/us/minak/IMEService.java @@ -1,52 +1,16 @@ -/* - ******************************************************************************** - * Copyright (c) 2012 Samsung Electronics, Inc. - * All rights reserved. - * - * This software is a confidential and proprietary information of Samsung - * Electronics, Inc. ("Confidential Information"). You shall not disclose such - * Confidential Information and shall use it only in accordance with the terms - * of the license agreement you entered into with Samsung Electronics. - ******************************************************************************** - */ - package us.minak; -import java.util.Queue; - import android.inputmethodservice.InputMethodService; import android.view.View; -import android.view.inputmethod.EditorInfo; /** * Represent the application input service. */ -public class IMEService extends InputMethodService { - private IMEView mIMEView; - +public class IMEService extends InputMethodService implements InputConnectionGetter { @Override public View onCreateInputView() { final IMEView minakView = (IMEView) getLayoutInflater().inflate(R.layout.ime, null); - - minakView.setOnCharacterEnteredListener(new StringReciever() { - @Override - public void putString(String character) { - getCurrentInputConnection().commitText(character, 1); - } - }); - - mIMEView = minakView; + minakView.setInputConnectionGetter(this); return minakView; } - - @Override - public void onStartInput(EditorInfo attribute, boolean restarting) { - if (mIMEView != null) { - final Queue symbolsQueue = mIMEView.getSymbolsQueue(); - while (!symbolsQueue.isEmpty()) { - final Character character = symbolsQueue.poll(); - getCurrentInputConnection().commitText(String.valueOf(character), 1); - } - } - } } -- cgit v1.2.3