Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

dont graph matrices

  • Loading branch information...
commit 9f559846c113e528a21f56ad1079925b6d30232c 1 parent 64f1a8b
Will authored

Showing 1 changed file with 9 additions and 2 deletions. Show diff stats Hide diff stats

  1. +9 2 src/com/android2/calculator3/Logic.java
11 src/com/android2/calculator3/Logic.java
@@ -240,11 +240,18 @@ void onEnter() {
240 240 }
241 241 }
242 242
243   - public void evaluateAndShowResult(String text, Scroll scroll) {
  243 + private boolean displayContainsMatrices() {
244 244 boolean containsMatrices = false;
245 245 for(int i = 0; i < mDisplay.getAdvancedDisplay().getChildCount(); i++) {
246 246 if(mDisplay.getAdvancedDisplay().getChildAt(i) instanceof MatrixView) containsMatrices = true;
  247 + if(mDisplay.getAdvancedDisplay().getChildAt(i) instanceof MatrixInverseView) containsMatrices = true;
  248 + if(mDisplay.getAdvancedDisplay().getChildAt(i) instanceof MatrixTransposeView) containsMatrices = true;
247 249 }
  250 + return containsMatrices;
  251 + }
  252 +
  253 + public void evaluateAndShowResult(String text, Scroll scroll) {
  254 + boolean containsMatrices = displayContainsMatrices();
248 255 try {
249 256 String result;
250 257 if(containsMatrices) result = evaluateMatrices(mDisplay.getAdvancedDisplay());
@@ -483,7 +490,7 @@ void updateGraph(final Graph g) {
483 490 return;
484 491 }
485 492
486   - if(isOperator(eq.charAt(eq.length() - 1))) return;
  493 + if(isOperator(eq.charAt(eq.length() - 1)) || displayContainsMatrices()) return;
487 494
488 495 final String[] equation = eq.split("=");
489 496

0 comments on commit 9f55984

Please sign in to comment.
Something went wrong with that request. Please try again.