summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavisLWebb <davislwebb@ymail.com>2014-05-06 22:46:29 -0400
committerDavisLWebb <davislwebb@ymail.com>2014-05-06 22:46:29 -0400
commit69fd85ee8e91f610524dfa8134b1d2c56fd8a56d (patch)
tree72509f1526208c903896c12fafdbc1d01a77eb36 /src
parent5186680f2f185528cd4a0eacc06d28f175d4e58e (diff)
parentf5956625b9086ae719da90095f050403e5e71764 (diff)
Merge branch 'master' of https://github.com/AndrewMurrell/minak
Diffstat (limited to 'src')
-rw-r--r--src/us/minak/IMEView.java10
-rw-r--r--src/us/minak/MetaCircle.java12
-rw-r--r--src/us/minak/MetaExpression.java2
3 files changed, 18 insertions, 6 deletions
diff --git a/src/us/minak/IMEView.java b/src/us/minak/IMEView.java
index 2cf7921..318abd0 100644
--- a/src/us/minak/IMEView.java
+++ b/src/us/minak/IMEView.java
@@ -13,8 +13,6 @@
package us.minak;
import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
import java.util.Queue;
import android.content.Context;
@@ -22,7 +20,6 @@ import android.graphics.Color;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
-import android.widget.Button;
import android.widget.RelativeLayout;
/**
@@ -95,6 +92,13 @@ public class IMEView extends RelativeLayout {
* The character to enter
*/
private void enterCharacter(String character) {
+ for (MetaCircle circle : ((IMEGestureOverlayView) findViewById(R.id.drawing_space)).circles) {
+ //go through circles and check if they are applicable
+ if (circle.containsPoint(this.x, this.y) && circle.getMetaExpression().state != MetaExpression.State.OFF) {
+ //TODO: apply the Meta-key here
+ ;
+ }
+ }
mOnCharacterEnteredListener.putString(character);
}
}
diff --git a/src/us/minak/MetaCircle.java b/src/us/minak/MetaCircle.java
index 908842a..9139dc9 100644
--- a/src/us/minak/MetaCircle.java
+++ b/src/us/minak/MetaCircle.java
@@ -5,7 +5,7 @@ package us.minak;
*
*/
public class MetaCircle {
- public MetaExpression metaExpr;
+ private MetaExpression metaExpression;
public float x;
public float y;
public float radius;
@@ -14,7 +14,7 @@ public class MetaCircle {
public int expansion; //the level of expansion (if multiple circles are expanded, this decides precidence)
MetaCircle(float x, float y, float radius, int color, MetaExpression metaExpr) {
- this.metaExpr = metaExpr;
+ this.setMetaExpression(metaExpr);
this.x = x;
this.y = y;
this.radius = radius;
@@ -26,4 +26,12 @@ public class MetaCircle {
public boolean containsPoint(float x, float y) {
return Math.pow(x - this.x, 2) + Math.pow(y - this.y, 2) < Math.pow(this.radius, 2) ? true : false;
}
+
+ public MetaExpression getMetaExpression() {
+ return metaExpression;
+ }
+
+ public void setMetaExpression(MetaExpression metaExpr) {
+ this.metaExpression = metaExpr;
+ }
}
diff --git a/src/us/minak/MetaExpression.java b/src/us/minak/MetaExpression.java
index 4398c42..f9c6cbe 100644
--- a/src/us/minak/MetaExpression.java
+++ b/src/us/minak/MetaExpression.java
@@ -1,7 +1,7 @@
package us.minak;
public class MetaExpression {
- public enum State {
+ public static enum State {
ON, OFF, LOCK
}