diff --git a/app/src/main/assets/tutors/add_subtract/animator_graph.json b/app/src/main/assets/tutors/add_subtract/animator_graph.json
index 135278303..63aee9cd4 100644
--- a/app/src/main/assets/tutors/add_subtract/animator_graph.json
+++ b/app/src/main/assets/tutors/add_subtract/animator_graph.json
@@ -75,10 +75,11 @@
{"name": "LOG_EVENT", "type": "QUEUEDCOMMAND", "id": "SAddSubtract", "method": "logState", "parms": "type#feedback,value#MATH_INSTRUCTION_ADD_BEHAVIOR:String", "features":""},
{"name":"Introduction Audio", "type": "QUEUEDAUDIO", "command": "PLAY", "soundsource": "Lets add some numbers now.mp3", "soundpackage":"default", "volume": 1.0, "mode":"flow", "features": ""},
+
+ {"name":"Zoom Operator:", "type": "QUEUEDCOMMAND", "id": "SAddSubtract", "method": "zoomOperator", "features": ""},
{"name":"This is ...", "type": "QUEUEDAUDIO", "command": "PLAY", "soundsource": "This is called a plus sign.mp3", "soundpackage":"default", "volume": 1.0, "mode":"flow", "features": ""},
{"name":"Show Scaffold:", "type": "QUEUEDCOMMAND", "id": "SAddSubtract", "method": "setDotBagsVisible", "parms":"TRUE:Boolean", "features": ""},
-
{"name":"Adding 3 + 2...", "type": "QUEUEDAUDIO", "command": "PLAY", "soundsource": "Adding 3 things plus 2 things means--.mp3", "soundpackage":"default", "volume": 1.0, "mode":"flow", "features": ""},
{"name":"Let's Tap...", "type": "QUEUEDAUDIO", "command": "PLAY", "soundsource": "Lets tap on the three things to add them to the two things.mp3", "soundpackage":"default", "volume": 1.0, "mode":"flow", "features": ""}
],
diff --git a/app/src/main/assets/tutors/bubble_pop/animator_graph.json b/app/src/main/assets/tutors/bubble_pop/animator_graph.json
index a0fdba94a..376a16da8 100644
--- a/app/src/main/assets/tutors/bubble_pop/animator_graph.json
+++ b/app/src/main/assets/tutors/bubble_pop/animator_graph.json
@@ -289,10 +289,12 @@
{"type": "COMMAND", "id": "SBubblePop", "method": "setVolatileBehavior", "parms": "BUBBLES_CLEARED:String|NEXTNODE:String" ,"features":"FTR_LASTATTEMPT"},
{"type": "COMMAND", "id": "SBubblePop", "method": "postEvent", "parms": "CLEAR_CONTENT:String" ,"features":"FTR_LASTATTEMPT"},
{"type": "COMMAND", "cmd": "WAIT" ,"features":"FTR_LASTATTEMPT" },
- {"type": "COMMAND", "id": "SBubblePop", "method": "postEvent", "parms": "HIDE_MASK:String" ,"features":"FTR_LASTATTEMPT"},
+ {"type": "COMMAND", "id": "SBubblePop", "method": "postEvent", "parms": "HIDE_MASK:String" ,"features":"FTR_LASTATTEMPT"}
- {"type": "TIMER", "id":"nextDelayTimer", "startdelay":"0", "period":"750", "repeat":"false", "action":"CREATEANDSTART", "ontimer":"NEXTNODE", "features": "" },
- {"type": "COMMAND", "cmd": "WAIT" }
+ // TODO: is this delay required removed in 45.1
+ //
+// {"type": "TIMER", "id":"nextDelayTimer", "startdelay":"0", "period":"50", "repeat":"false", "action":"CREATEANDSTART", "ontimer":"NEXTNODE", "features": "" },
+// {"type": "COMMAND", "cmd": "WAIT" }
]
},
diff --git a/app/src/main/java/cmu/xprize/robotutor/tutorengine/widgets/core/TBpComponent.java b/app/src/main/java/cmu/xprize/robotutor/tutorengine/widgets/core/TBpComponent.java
index 1bc0cce19..1f159736d 100644
--- a/app/src/main/java/cmu/xprize/robotutor/tutorengine/widgets/core/TBpComponent.java
+++ b/app/src/main/java/cmu/xprize/robotutor/tutorengine/widgets/core/TBpComponent.java
@@ -65,6 +65,7 @@
import static cmu.xprize.comp_clickmask.CM_CONST.EXCLUDE_CIRCLE;
import static cmu.xprize.comp_clickmask.CM_CONST.MASK_ADDEXCL;
import static cmu.xprize.comp_clickmask.CM_CONST.MASK_ALPHA;
+import static cmu.xprize.comp_clickmask.CM_CONST.MASK_ANIMATE;
import static cmu.xprize.comp_clickmask.CM_CONST.MASK_CLREXCL;
import static cmu.xprize.comp_clickmask.CM_CONST.MASK_R;
import static cmu.xprize.comp_clickmask.CM_CONST.MASK_SETALPHA;
@@ -72,8 +73,10 @@
import static cmu.xprize.comp_clickmask.CM_CONST.MASK_TYPE;
import static cmu.xprize.comp_clickmask.CM_CONST.MASK_X;
import static cmu.xprize.comp_clickmask.CM_CONST.MASK_Y;
+import static cmu.xprize.util.TCONST.INVISIBLE;
import static cmu.xprize.util.TCONST.QGRAPH_MSG;
import static cmu.xprize.util.TCONST.TUTOR_STATE_MSG;
+import static cmu.xprize.util.TCONST.VISIBLE;
public class TBpComponent extends CBP_Component implements IBehaviorManager, ITutorObjectImpl, IDataSink, IEventSource, IPublisher, ITutorLogger {
@@ -307,7 +310,7 @@ public void maskBubble() {
// Show the mask while the feedback is in progress
//
msg = new Intent(MASK_SHOWHIDE);
- msg.putExtra(MASK_SHOWHIDE, true);
+ msg.putExtra(MASK_SHOWHIDE, VISIBLE);
bManager.sendBroadcast(msg);
}
@@ -324,7 +327,7 @@ public void clearMask() {
// Hide the mask
//
msg = new Intent(MASK_SHOWHIDE);
- msg.putExtra(MASK_SHOWHIDE, false);
+ msg.putExtra(MASK_SHOWHIDE, INVISIBLE);
bManager.sendBroadcast(msg);
}
diff --git a/app/src/main/java/cmu/xprize/robotutor/tutorengine/widgets/core/TScenePercentLayout.java b/app/src/main/java/cmu/xprize/robotutor/tutorengine/widgets/core/TScenePercentLayout.java
index 679edad82..0b2ce0dd4 100644
--- a/app/src/main/java/cmu/xprize/robotutor/tutorengine/widgets/core/TScenePercentLayout.java
+++ b/app/src/main/java/cmu/xprize/robotutor/tutorengine/widgets/core/TScenePercentLayout.java
@@ -26,8 +26,6 @@
import android.view.ViewGroup;
import android.widget.FrameLayout;
-import cmu.xprize.comp_clickmask.CClickMask;
-import cmu.xprize.comp_clickmask.CExclusion;
import cmu.xprize.comp_clickmask.IMaskOwner;
import cmu.xprize.robotutor.R;
import cmu.xprize.robotutor.tutorengine.CSceneDelegate;
@@ -45,7 +43,7 @@ public class TScenePercentLayout extends PercentRelativeLayout implements ITutor
private Context mContext;
private CSceneDelegate mTutorScene;
private TClickMask mMask;
- private boolean isMasked = true;
+ private int mMaskState = GONE;
final private String TAG = "TScenePercentLayout";
@@ -90,7 +88,7 @@ protected void onFinishInflate() {
mMask.setLayoutParams(lp);
addView(mMask);
- setMasked(false);
+ setMasked(GONE);
bringChildToFront(mMask);
}
@@ -106,20 +104,20 @@ public void onDestroy() {
*
* @param _mask
*/
- public void setMasked(boolean _mask) {
+ public void setMasked(int _mask) {
- mMask.setVisibility(_mask? VISIBLE:INVISIBLE);
+ mMask.setVisibility(_mask);
- if(_mask)
+ if(_mask == VISIBLE)
bringChildToFront(mMask);
- isMasked = _mask;
+ mMaskState = _mask;
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
- if (isMasked) {
+ if (mMaskState == VISIBLE) {
return true;
} else {
return false;
diff --git a/app/src/main/res/layout/add_subtract.xml b/app/src/main/res/layout/add_subtract.xml
index a38693d60..bc69fba7d 100644
--- a/app/src/main/res/layout/add_subtract.xml
+++ b/app/src/main/res/layout/add_subtract.xml
@@ -30,6 +30,15 @@
app:layout_marginRightPercent="0%"
app:layout_marginLeftPercent="5%" />
+
+
+
diff --git a/build.gradle b/build.gradle
index ca89402c0..f97ef35df 100644
--- a/build.gradle
+++ b/build.gradle
@@ -36,7 +36,7 @@ allprojects {
// Semantic versioning description:
//
- rtVersionName="0.44.1.1"
+ rtVersionName="0.46.0.1"
}
}
diff --git a/comp_bubblepop/src/main/java/cmu/xprize/bp_component/CBP_Component.java b/comp_bubblepop/src/main/java/cmu/xprize/bp_component/CBP_Component.java
index a77a5ba7f..8d9970d16 100644
--- a/comp_bubblepop/src/main/java/cmu/xprize/bp_component/CBP_Component.java
+++ b/comp_bubblepop/src/main/java/cmu/xprize/bp_component/CBP_Component.java
@@ -82,6 +82,8 @@ public class CBP_Component extends FrameLayout implements IEventDispatcher, ILoa
// Working data sets
+ //
+
public ArrayList wrk_responseSet = null; // set of response tems
public ArrayList wrk_respTypeSet = null; // text/reference - for mixed response sets
public ArrayList wrk_response_script = null; // List of uttereances describing each potential response
diff --git a/comp_clickmask/src/main/java/cmu/xprize/comp_clickmask/CClickMask.java b/comp_clickmask/src/main/java/cmu/xprize/comp_clickmask/CClickMask.java
index 01646c404..b52efcb29 100644
--- a/comp_clickmask/src/main/java/cmu/xprize/comp_clickmask/CClickMask.java
+++ b/comp_clickmask/src/main/java/cmu/xprize/comp_clickmask/CClickMask.java
@@ -13,6 +13,8 @@
package cmu.xprize.comp_clickmask;
+import android.animation.Animator;
+import android.animation.AnimatorSet;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -24,6 +26,7 @@
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.RectF;
+import android.support.annotation.IntDef;
import android.support.annotation.Nullable;
import android.support.v4.content.LocalBroadcastManager;
import android.util.AttributeSet;
@@ -32,13 +35,17 @@
import java.util.ArrayList;
+import cmu.xprize.comp_logging.CLogManager;
+import cmu.xprize.comp_logging.ILogManager;
+import cmu.xprize.util.CAnimatorUtil;
import cmu.xprize.util.CDisplayMetrics;
import cmu.xprize.util.TCONST;
+import static android.view.View.GONE;
import static cmu.xprize.comp_clickmask.CM_CONST.*;
-public class CClickMask extends View implements View.OnTouchListener {
+public class CClickMask extends View implements Animator.AnimatorListener {
public Context mContext;
@@ -54,10 +61,15 @@ public class CClickMask extends View implements View.OnTouchListener {
private RectF border = new RectF();
private ArrayList exclusions;
private int[] _screenCoord = new int[2];
+ private boolean deferredHide = false;
private LocalBroadcastManager bManager;
private ChangeReceiver bReceiver;
+ public ILogManager logManager;
+
+ private final String TAG = "CClickMask";
+
public CClickMask(Context context) {
super(context);
@@ -89,9 +101,12 @@ protected void init(Context context, AttributeSet attrs) {
filter.addAction(MASK_ADDEXCL);
filter.addAction(MASK_CLREXCL);
filter.addAction(MASK_SETALPHA);
+ filter.addAction(MASK_ANIMATE);
bReceiver = new ChangeReceiver();
+ logManager = CLogManager.getInstance();
+
bManager.registerReceiver(bReceiver, filter);
}
@@ -100,11 +115,13 @@ public void setOwner(IMaskOwner _owner) {
mOwner = _owner;
}
- public void showHide(boolean _show) {
+
+ public void showHide(int _show) {
mOwner.setMasked(_show);
}
+
public void setMaskColor(int newColor) {
mPaint.setColor(newColor);
@@ -132,17 +149,101 @@ public void clearExclusions() {
}
+ @Override
+ public void setVisibility(int visibility) {
+
+ switch(visibility) {
+
+ case VISIBLE:
+ deferredHide = false;
+ setAlpha(0);
+ super.setVisibility(visibility);
+ break;
+
+ case INVISIBLE:
+ deferredHide = true;
+ break;
+
+ case GONE:
+ super.setVisibility(visibility);
+ break;
+ }
+ }
+
+
+
+ //************************************************************************
+ //************************************************************************
+ // AnimatorListener Start
+
+
+ @Override
+ public void onAnimationStart(Animator animator) {
+
+ }
+
+ @Override
+ public void onAnimationEnd(Animator animator) {
+
+ if(deferredHide)
+ super.setVisibility(INVISIBLE);
+ }
+
+ @Override
+ public void onAnimationCancel(Animator animator) {
+
+ if(deferredHide)
+ super.setVisibility(INVISIBLE);
+ }
+
+ @Override
+ public void onAnimationRepeat(Animator animator) {
+
+ }
+
+ // AnimatorListener End
+ //************************************************************************
+ //************************************************************************
+
+
+
class ChangeReceiver extends BroadcastReceiver {
public void onReceive (Context context, Intent intent) {
switch(intent.getAction()) {
+
case MASK_SHOWHIDE:
- Boolean showmask = intent.getBooleanExtra(MASK_SHOWHIDE, false);
+
+ int showmask = intent.getIntExtra(MASK_SHOWHIDE, GONE);
showHide(showmask);
+
+ // Animate the mask
+ //
+ Intent msg = new Intent(MASK_ANIMATE);
+
+ bManager.sendBroadcast(msg);
+
break;
+ case MASK_ANIMATE:
+
+ Animator fader;
+
+ if(deferredHide) {
+ fader = CAnimatorUtil.configFadeOut(CClickMask.this, CM_CONST.FADE_TIME);
+ }
+ else {
+ fader = CAnimatorUtil.configFadeIn(CClickMask.this, CM_CONST.FADE_TIME);
+ }
+ fader.start();
+
+ break;
+
+ // NOTE: Must invalidate when changing exclusions so that onDraw is called before
+ // animation to refresh the animation cache.
+ //
case MASK_ADDEXCL:
String exclusiontype = intent.getStringExtra(MASK_TYPE);
@@ -160,12 +261,14 @@ public void onReceive (Context context, Intent intent) {
exclusiony -= _screenCoord[1];
addExclusion(new CExclusion(exclusiontype, exclusionx, exclusiony, exclusionr));
+ invalidate();
break;
}
break;
case MASK_CLREXCL:
clearExclusions();
+ invalidate();
break;
case MASK_SETCOLOR:
@@ -209,10 +312,4 @@ public void onDraw(Canvas canvas) {
canvas.drawPath(mask, mPaint);
}
-
- @Override
- public boolean onTouch(View view, MotionEvent motionEvent) {
-
- return false;
- }
}
diff --git a/comp_clickmask/src/main/java/cmu/xprize/comp_clickmask/CM_CONST.java b/comp_clickmask/src/main/java/cmu/xprize/comp_clickmask/CM_CONST.java
index 5459267db..e4c37665d 100644
--- a/comp_clickmask/src/main/java/cmu/xprize/comp_clickmask/CM_CONST.java
+++ b/comp_clickmask/src/main/java/cmu/xprize/comp_clickmask/CM_CONST.java
@@ -16,6 +16,7 @@
public class CM_CONST {
+ public static final String MASK_ANIMATE = "MASK_ANIMATE";
public static final String MASK_SHOWHIDE = "MASK_SHOWHIDE";
public static final String MASK_ADDEXCL = "MASK_ADDEXCL";
public static final String MASK_CLREXCL = "MASK_CLREXCL";
@@ -28,5 +29,6 @@ public class CM_CONST {
public static final String MASK_COLOR = "MASK_COLOR";
public static final String MASK_ALPHA = "MASK_ALPHA";
- public static final String EXCLUDE_CIRCLE = "EXCLUDE_CIRCLE";
+ public static final String EXCLUDE_CIRCLE = "EXCLUDE_CIRCLE";
+ public static final long FADE_TIME = 200;
}
diff --git a/comp_clickmask/src/main/java/cmu/xprize/comp_clickmask/IMaskOwner.java b/comp_clickmask/src/main/java/cmu/xprize/comp_clickmask/IMaskOwner.java
index a33d02adc..8888335ba 100644
--- a/comp_clickmask/src/main/java/cmu/xprize/comp_clickmask/IMaskOwner.java
+++ b/comp_clickmask/src/main/java/cmu/xprize/comp_clickmask/IMaskOwner.java
@@ -18,6 +18,6 @@
public interface IMaskOwner {
- public void setMasked(boolean _mask);
+ public void setMasked(int _mask);
}
\ No newline at end of file
diff --git a/comp_listener/src/main/java/edu/cmu/xprize/listener/SpeechRecognizer.java b/comp_listener/src/main/java/edu/cmu/xprize/listener/SpeechRecognizer.java
index d14d361d3..e0a476ce1 100644
--- a/comp_listener/src/main/java/edu/cmu/xprize/listener/SpeechRecognizer.java
+++ b/comp_listener/src/main/java/edu/cmu/xprize/listener/SpeechRecognizer.java
@@ -471,6 +471,7 @@ public void run() {
// We always start the thread in the paused state
//
if (isPausedRecognizer) {
+
try {
recorder.stop();
isRecording = false;
diff --git a/comp_logging/src/main/java/cmu/xprize/comp_logging/CLogManager.java b/comp_logging/src/main/java/cmu/xprize/comp_logging/CLogManager.java
index a96d5d5f7..631108506 100644
--- a/comp_logging/src/main/java/cmu/xprize/comp_logging/CLogManager.java
+++ b/comp_logging/src/main/java/cmu/xprize/comp_logging/CLogManager.java
@@ -27,6 +27,7 @@
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
+import java.io.RandomAccessFile;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@@ -42,7 +43,9 @@ public class CLogManager implements ILogManager {
//private static final String LOG_VERSION = "1.0.0"; // initial release
private static final String LOG_VERSION = "1.0.1"; // Updated LTKPlus to use LTKPLUS tag
- private static String currenttutor = "";
+ private static String currenttutor = "";
+ private String TERMINATING_PACKET = "{\"end\":\"end\"}]}";
+ private byte[] TERMINATE_BYTES = TERMINATING_PACKET.getBytes();
private LogThread logThread; // background thread handling log data
private String log_Path;
@@ -55,7 +58,11 @@ public class CLogManager implements ILogManager {
private File logFile;
private FileOutputStream logStream;
private java.nio.channels.FileLock logLock;
+
private FileWriter logWriter;
+ private RandomAccessFile seekableLogWriter;
+ private boolean seekable = true;
+
private boolean logWriterValid = false;
// Datashop specific
@@ -289,7 +296,13 @@ private void lockLog() {
try {
logStream = new FileOutputStream(logFile);
logLock = logStream.getChannel().lock();
- logWriter = new FileWriter(outPath, TLOG_CONST.APPEND);
+
+ if(seekable) {
+ seekableLogWriter = new RandomAccessFile(outPath, "rwd");
+ }
+ else {
+ logWriter = new FileWriter(outPath, TLOG_CONST.APPEND);
+ }
logWriterValid = true;
@@ -331,14 +344,21 @@ private void releaseLog() {
try {
if(logWriterValid) {
- // Terminate the root JSON element
- //
- writePacketToLog("{\"end\":\"end\"}]}");
+ if(seekable) {
+ logWriterValid = false;
+
+ seekableLogWriter.close();
+ }
+ else {
+ // Terminate the root JSON element
+ //
+ writePacketToLog(TERMINATING_PACKET);
- logWriterValid = false;
+ logWriterValid = false;
- logWriter.flush();
- logWriter.close();
+ logWriter.flush();
+ logWriter.close();
+ }
logLock.release();
logStream.close();
@@ -380,8 +400,21 @@ private void writePacketToLog(String jsonPacket) {
// Throws if there is a JSON serializatin error
//
if(logWriterValid) {
- logWriter.write(jsonPacket);
- logWriter.flush();
+
+ if(seekable) {
+
+ if(seekableLogWriter.length() > TERMINATE_BYTES.length) {
+ seekableLogWriter.seek(seekableLogWriter.length() - TERMINATE_BYTES.length);
+ }
+
+ seekableLogWriter.writeBytes(jsonPacket);
+
+ seekableLogWriter.writeBytes(TERMINATING_PACKET);
+ }
+ else {
+ logWriter.write(jsonPacket);
+ logWriter.flush();
+ }
}
}
catch(Exception e) {
diff --git a/comp_math/src/main/java/cmu/xprize/asm_component/CAsm_Component.java b/comp_math/src/main/java/cmu/xprize/asm_component/CAsm_Component.java
index dc886800d..3ecde2fb5 100644
--- a/comp_math/src/main/java/cmu/xprize/asm_component/CAsm_Component.java
+++ b/comp_math/src/main/java/cmu/xprize/asm_component/CAsm_Component.java
@@ -4,15 +4,19 @@
import android.animation.ArgbEvaluator;
import android.animation.ValueAnimator;
import android.content.Context;
+import android.content.Intent;
import android.content.res.TypedArray;
import android.graphics.Color;
+import android.graphics.PointF;
import android.os.Handler;
import android.os.Looper;
+import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.view.MotionEventCompat;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.Gravity;
+import android.view.View;
import android.widget.LinearLayout;
import org.json.JSONObject;
@@ -23,6 +27,7 @@
import java.util.Map;
import cmu.xprize.comp_logging.CErrorManager;
+import cmu.xprize.util.CAnimatorUtil;
import cmu.xprize.util.IBehaviorManager;
import cmu.xprize.util.IEvent;
import cmu.xprize.util.IEventListener;
@@ -30,6 +35,7 @@
import cmu.xprize.util.IPublisher;
import cmu.xprize.util.IScope;
import cmu.xprize.util.JSON_Helper;
+import cmu.xprize.util.TCONST;
public class CAsm_Component extends LinearLayout implements IBehaviorManager, ILoadableObject, IEventListener, IPublisher {
@@ -47,6 +53,9 @@ public class CAsm_Component extends LinearLayout implements IBehaviorManager, IL
protected boolean _dataEOI = false;
protected int[] dataset;
+ private int[] _screenCoord = new int[2];
+ private LocalBroadcastManager bManager;
+
//current digit
protected int digitIndex;
protected int numSlots;
@@ -163,8 +172,13 @@ public void init(Context context, AttributeSet attrs) {
//
//Scontent = (CAsm_LetterBoxLayout) findViewById(R.id.Scontent);
//Scontent.setOnClickListener(this);
+
mPopup = new CAsm_Popup(mContext);
mPopupSupplement = new CAsm_Popup(mContext);
+
+ // Capture the local broadcast manager
+ //
+ bManager = LocalBroadcastManager.getInstance(getContext());
}
@@ -454,6 +468,7 @@ else if(zeroPosn > 0) {
public void setDotBagsVisible(Boolean _dotbagsVisible) {
+ // zoomOperator();
setDotBagsVisible(_dotbagsVisible, digitIndex);
}
@@ -519,6 +534,58 @@ public void setDotBagsVisible(Boolean _dotbagsVisible, int curDigitIndex, int st
}
+ /**
+ * TODO: Generalize
+ */
+ public void zoomOperator() {
+
+ Handler h = new Handler();
+ final CAsm_Alley opAlley = allAlleys.get(ASM_CONST.OPERATOR_ROW - 1);
+
+ pointAtOperator();
+
+ //wiggle operator
+ h.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ CAnimatorUtil.zoomInOut(opAlley.getTextLayout().getTextLayout(0).getText(1), 2.5f, 1500L);
+ }
+ }, 20);
+ }
+
+
+ /**
+ * TODO: Generalize
+ */
+ public void pointAtOperator() {
+
+ CAsm_Alley opAlley = allAlleys.get(ASM_CONST.OPERATOR_ROW - 1);
+ View operator = opAlley.getTextLayout().getTextLayout(0).getText(1);
+
+ operator.getLocationOnScreen(_screenCoord);
+
+ PointF targetPoint = new PointF(_screenCoord[0] + operator.getWidth(), _screenCoord[1] + operator.getHeight());
+
+ // Let the persona know where to look
+ Intent msg = new Intent(TCONST.POINTAT);
+ msg.putExtra(TCONST.SCREENPOINT, new float[]{targetPoint.x, targetPoint.y});
+
+ bManager.sendBroadcast(msg);
+ }
+
+
+ protected void broadcastLocation(String Action, PointF touchPt) {
+
+ getLocationOnScreen(_screenCoord);
+
+ // Let the persona know where to look
+ Intent msg = new Intent(Action);
+ msg.putExtra(TCONST.SCREENPOINT, new float[]{touchPt.x + _screenCoord[0], (float) touchPt.y + _screenCoord[1]});
+
+ bManager.sendBroadcast(msg);
+ }
+
+
public int wiggleDigitAndDotbag(final CAsm_Alley curAlley, int delayTime, final int curDigitIndex, int startRow) {
final CAsm_DotBag curDB = curAlley.getDotBag();
@@ -873,13 +940,13 @@ public void updateText(CAsm_Text t1, CAsm_Text t2, boolean isClickingBorrowing)
mPopup.enable(true, listeners);
if(isClickingBorrowing) {
- mPopup.update(t2, 120, -300, 300, 300);
+ mPopup.update(t2, 120, -500, 500, 500);
mPopup.setExpectedDigit(getCorrectCarryBrw().toString());
Log.d(TAG, "Correct Carry Digit: " + getCorrectCarryBrw().toString());
}
else {
- mPopup.update(t2, 60, 0, 300, 300);
+ mPopup.update(t2, 60, 20, 500, 500);
mPopup.setExpectedDigit(getCorrectDigit().toString());
Log.d(TAG, "Correct Answer Digit: " + getCorrectDigit().toString());
@@ -897,11 +964,11 @@ public void updateText(CAsm_Text t1, CAsm_Text t2, boolean isClickingBorrowing)
mPopupSupplement.enable(true, listeners);
if (isClickingBorrowing) {
- mPopup.update(t2, 420, -300, 300, 300);
- mPopupSupplement.update(t2, 120, -300, 300, 300);
+ mPopup.update(t2, 920, -500, 500, 500);
+ mPopupSupplement.update(t2, 120, -500, 500, 500);
} else {
- mPopup.update(t2, 360, 0, 300, 300);
- mPopupSupplement.update(t2, 60, 0, 300, 300);
+ mPopup.update(t2, 560, 0, 500, 500);
+ mPopupSupplement.update(t2, 60, 20, 500, 500);
}
mPopupSupplement.isActive = true;
diff --git a/comp_math/src/main/java/cmu/xprize/asm_component/CAsm_MechanicAdd.java b/comp_math/src/main/java/cmu/xprize/asm_component/CAsm_MechanicAdd.java
index 98042b477..056b1a91e 100644
--- a/comp_math/src/main/java/cmu/xprize/asm_component/CAsm_MechanicAdd.java
+++ b/comp_math/src/main/java/cmu/xprize/asm_component/CAsm_MechanicAdd.java
@@ -90,7 +90,7 @@ public void preClickSetup() {
if(i != overheadIndex) {
- if (i != firstBagIndex && i != secondBagIndex) {
+ if (i != firstBagIndex && i != secondBagIndex && i != resultIndex) {
currBag.setCols(0);
currBag.setDrawBorder(false);
} else {