From f456b750303f2728e5ac0b6cb3c449f49bd81b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Thu, 28 May 2020 18:04:48 +0200 Subject: [PATCH] Color custom blocks that are performing an operation. --- .../minicards/parts/ProgramakerCustomBlockPart.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/codigoparallevar/minicards/parts/ProgramakerCustomBlockPart.java b/app/src/main/java/com/codigoparallevar/minicards/parts/ProgramakerCustomBlockPart.java index ae36479..d0ac007 100644 --- a/app/src/main/java/com/codigoparallevar/minicards/parts/ProgramakerCustomBlockPart.java +++ b/app/src/main/java/com/codigoparallevar/minicards/parts/ProgramakerCustomBlockPart.java @@ -411,6 +411,9 @@ public class ProgramakerCustomBlockPart implements Part { if (pulseOutput != null) { pulseOutput.send(new Signal()); } + + // Notify screen that there's updates + this._partGrid.update(); } private void freeBlock(String token) { @@ -511,11 +514,18 @@ public class ProgramakerCustomBlockPart implements Part { return; // Logic block, don't show on user-mode } + boolean operationInProgress = this.token != null; + drawConnectors(canvas); drawWires(canvas, devMode); Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); - paint.setColor(Color.WHITE); + if (operationInProgress) { + paint.setColor(Color.YELLOW); + } + else { + paint.setColor(Color.WHITE); + } canvas.drawRect( new Rect(get_left(), get_top(), get_right(), get_bottom()),