From 957682f8da4f0131bef1e920e814618f598326a9 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Mon, 5 May 2014 14:15:44 -0400 Subject: Added basic outlines for MetaCircle and MetaExpression which aren't useful yet. --- src/us/minak/MetaCircle.java | 17 +++++++++++++++++ src/us/minak/MetaExpression.java | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/us/minak/MetaCircle.java create mode 100644 src/us/minak/MetaExpression.java 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..fec2ddc --- /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 getValue() { + return this.value; + } + + public setValue(Sitring value) { + this.value = value; + } +} -- cgit v1.2.3-2-g168b From a7b6d856a146d2d576885001cc2154304a156efe Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Mon, 5 May 2014 15:19:57 -0400 Subject: made my stuff actually compile --- src/us/minak/MetaExpression.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/us/minak/MetaExpression.java b/src/us/minak/MetaExpression.java index fec2ddc..82a9aa3 100644 --- a/src/us/minak/MetaExpression.java +++ b/src/us/minak/MetaExpression.java @@ -7,11 +7,11 @@ public class MetaExpression { private String value; - public getValue() { + public String getValue() { return this.value; } - public setValue(Sitring value) { + public void setValue(String value) { this.value = value; } } -- cgit v1.2.3-2-g168b From 181991a85c528d4c5cec66303f677285d38d2b97 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Mon, 5 May 2014 16:06:02 -0400 Subject: Perhaps our problem is that the Symbol Activity didn't do what we thought it did or had some other side effects. I added a file to experiment with that and added minor changes elsewhere. --- src/us/minak/IMEService.java | 10 +++++++++- src/us/minak/IMEView.java | 10 ++++++++++ src/us/minak/SketchPadActivity.java | 39 +++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 src/us/minak/SketchPadActivity.java diff --git a/src/us/minak/IMEService.java b/src/us/minak/IMEService.java index 6064be9..86c7864 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; @@ -33,6 +35,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: get characters from this.imeView, and pass them to getCurrentInputConnection().commitText(..., 1); + if (imeView != null) { + final Queue 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 d341ae5..aefded8 100644 --- a/src/us/minak/IMEView.java +++ b/src/us/minak/IMEView.java @@ -1,12 +1,17 @@ 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 final Context mContext; + private final Queue mSymbolsQueue = new LinkedList(); private OnCharacterEnteredListener mOnCharacterEnteredListener; + public IMEView(Context context, AttributeSet attrs) { super(context, attrs); mContext = context; @@ -31,4 +36,9 @@ public class IMEView extends RelativeLayout{ private void enterCharacter(String character) { mOnCharacterEnteredListener.characterEntered(character); } + + public Queue getSymbolsQueue() { + return mSymbolsQueue; + } + } 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 adapter = new ArrayAdapter(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 -- cgit v1.2.3-2-g168b