diff options
-rw-r--r-- | src/us/minak/IMEService.java | 10 | ||||
-rw-r--r-- | src/us/minak/IMEView.java | 13 | ||||
-rw-r--r-- | src/us/minak/MetaCircle.java | 17 | ||||
-rw-r--r-- | src/us/minak/MetaExpression.java | 17 | ||||
-rw-r--r-- | src/us/minak/SketchPadActivity.java | 39 |
5 files changed, 94 insertions, 2 deletions
diff --git a/src/us/minak/IMEService.java b/src/us/minak/IMEService.java index fb260aa..acbe616 100644 --- a/src/us/minak/IMEService.java +++ b/src/us/minak/IMEService.java @@ -1,5 +1,7 @@ package us.minak; +import java.util.Queue; + import android.inputmethodservice.InputMethodService; import android.view.View; import android.view.inputmethod.EditorInfo; @@ -31,6 +33,12 @@ public class IMEService extends InputMethodService { * Called to inform the input method that text input has started in an editor. */ public void onStartInput(EditorInfo info, boolean restarting) { - // TODO: I don't even know + if (imeView != null) { + final Queue<Character> symbolsQueue = imeView.getSymbolsQueue(); + while (!symbolsQueue.isEmpty()) { + final Character character = symbolsQueue.poll(); + getCurrentInputConnection().commitText(String.valueOf(character), 1); + } + } } } diff --git a/src/us/minak/IMEView.java b/src/us/minak/IMEView.java index 03b3716..5c70a48 100644 --- a/src/us/minak/IMEView.java +++ b/src/us/minak/IMEView.java @@ -1,12 +1,18 @@ package us.minak; +import java.util.LinkedList; +import java.util.Queue; + import android.content.Context; import android.util.AttributeSet; import android.widget.RelativeLayout; public class IMEView extends RelativeLayout{ private StringReciever mOutput; - + private final Context mContext; + private final Queue<Character> mSymbolsQueue = new LinkedList<Character>(); + private OnCharacterEnteredListener mOnCharacterEnteredListener; + public IMEView(Context context, AttributeSet attrs) { super(context, attrs); } @@ -28,4 +34,9 @@ public class IMEView extends RelativeLayout{ if (mOutput != null) mOutput.putString(character); } + + public Queue<Character> getSymbolsQueue() { + return mSymbolsQueue; + } + } diff --git a/src/us/minak/MetaCircle.java b/src/us/minak/MetaCircle.java new file mode 100644 index 0000000..8741e20 --- /dev/null +++ b/src/us/minak/MetaCircle.java @@ -0,0 +1,17 @@ +package us.minak; + +import android.graphics.Color; + +/* + * Not sure if this should be drawable or what. + * + */ +public class MetaCircle { + public MetaExpression metaExpr; + public int x; + public int y; + public int radius; + public Color color; + public boolean expanded; + public int expansion; //the level of expansion (if multiple circles are expanded, this decides precidence) +} diff --git a/src/us/minak/MetaExpression.java b/src/us/minak/MetaExpression.java new file mode 100644 index 0000000..82a9aa3 --- /dev/null +++ b/src/us/minak/MetaExpression.java @@ -0,0 +1,17 @@ +package us.minak; + +public class MetaExpression { + public enum state { + ON, OFF, LOCK + } + + private String value; + + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/src/us/minak/SketchPadActivity.java b/src/us/minak/SketchPadActivity.java new file mode 100644 index 0000000..b415718 --- /dev/null +++ b/src/us/minak/SketchPadActivity.java @@ -0,0 +1,39 @@ + +package us.minak; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.content.LocalBroadcastManager; +import android.view.View; +import android.view.Window; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; +import android.widget.GridView; +import android.widget.AdapterView.OnItemClickListener; + +public class SketchPadActivity extends Activity { + public static final String INTENT_ACTION = "us.minak.SYMBOL_ENTERED"; + public static final String INTENT_EXTRA_NAME = "symbol"; + private static final Character[] SYMBOLS = new Character[] { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '!', + '@', '#', '$', '%', '^', '&', '*', '(', ')', '`', '-', '=', '~', '_', '+', '[', ']', '\\', '{', '}', '|', + ';', '\'', ':', '\'', ',', '.', '/', '<', '>', '?' }; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + requestWindowFeature(Window.FEATURE_NO_TITLE); + /*setContentView(R.layout.symbols); + final GridView gridView = (GridView) findViewById(R.id.symbols_gridview); + final ArrayAdapter<Character> adapter = new ArrayAdapter<Character>(this, android.R.layout.simple_list_item_1, SYMBOLS); + gridView.setAdapter(adapter); + gridView.setOnItemClickListener(new OnItemClickListener() { + @Override + public void onItemClick(AdapterView<?> parent, View view, int position, long id) { + final Intent intent = new Intent(INTENT_ACTION); + intent.putExtra(INTENT_EXTRA_NAME, SYMBOLS[position]); + LocalBroadcastManager.getInstance(SketchPadActivity.this).sendBroadcast(intent); + } + });*/ + } +}
\ No newline at end of file |