From 0171a56d6ee3d2e4fea3e54cfe5b53ed83d87ac4 Mon Sep 17 00:00:00 2001 From: kenkeiras Date: Thu, 18 Jan 2018 22:30:12 +0100 Subject: [PATCH] Lock user mode on the normal screen. --- .../com/codigoparallevar/minicards/CanvasView.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/codigoparallevar/minicards/CanvasView.java b/app/src/main/java/com/codigoparallevar/minicards/CanvasView.java index 9498c68..ab1ac2d 100644 --- a/app/src/main/java/com/codigoparallevar/minicards/CanvasView.java +++ b/app/src/main/java/com/codigoparallevar/minicards/CanvasView.java @@ -260,7 +260,7 @@ class CanvasView extends View implements PartGrid { } } } - else if (motionMode == MotionMode.Type.LongTouch) { + else if (motionMode == MotionMode.Type.LongTouch && _devMode) { if (selectedPart != null) { selectedPart.getMoveable().drop(xInCanvas, yInCanvas); @@ -286,6 +286,10 @@ class CanvasView extends View implements PartGrid { case MotionEvent.ACTION_MOVE: { + if (!_devMode) { + break; + } + if (selectedPart == null){ int xMovement = _mouseDownPoint.item1 - xInScreen; int yMovement = _mouseDownPoint.item2 - yInScreen; @@ -296,10 +300,6 @@ class CanvasView extends View implements PartGrid { _mouseDownPoint = new Tuple2(xInScreen, yInScreen); } else { - if (!_devMode) { - break; - } - Log.i("Canvas", "X: " + xInScreen + " Y: " + yInScreen + " in drop zone " + _dropToRemoveZone + " : " + inDropZone(xInScreen, yInScreen)); @@ -449,6 +449,9 @@ class CanvasView extends View implements PartGrid { public void setDevMode(boolean devMode) { _devMode = devMode; + if (!_devMode) { + this._viewOrigin = new Tuple2<>(0, 0); + } this.invalidate(); } }