Project

General

Profile

« Previous | Next » 

Revision ca292407

Added by Leszek Koltunski about 4 years ago

Progress with the 3x3x3 Solver.

View differences:

src/main/java/org/distorted/states/RubikStateSolver.java
26 26
import android.graphics.Paint;
27 27
import android.graphics.PorterDuff;
28 28
import android.graphics.drawable.Drawable;
29
import android.os.Bundle;
29 30
import android.support.v4.content.ContextCompat;
30 31
import android.util.DisplayMetrics;
31 32
import android.view.View;
......
33 34
import android.widget.ImageButton;
34 35
import android.widget.LinearLayout;
35 36

  
37
import org.distorted.dialogs.RubikDialogSolverError;
36 38
import org.distorted.main.R;
37 39
import org.distorted.main.RubikActivity;
38 40
import org.distorted.main.RubikPostRender;
......
98 100
	    else
99 101
	      result = org.distorted.solvers.cube3.Search.solution(mCubeString, 24, 20);
100 102

  
103
      mSolving = false;
104

  
101 105
	    if (result.contains("Error"))
102 106
	      {
103 107
	      switch (result.charAt(result.length() - 1))
......
113 117
		      case '9': result = res.getString(R.string.error9); break;
114 118
		      }
115 119

  
116
	      // TODO: pop up an error dialog.
120
        RubikDialogSolverError dialog = new RubikDialogSolverError();
121
        Bundle bundle = new Bundle();
122
        bundle.putString("error", result );
123
        dialog.setArguments(bundle);
124
        dialog.show( mAct.getSupportFragmentManager(), null);
117 125
	      }
118 126
	    else
119 127
        {
......
169 177
    }
170 178

  
171 179
///////////////////////////////////////////////////////////////////////////////////////////////////
180
// TODO
172 181

  
173 182
  private void setSolved( RubikActivity act, int numMoves, String moves)
174 183
    {
175
    mSolving = false;
176

  
177 184
    RubikState.switchState(act,RubikState.SOLU);
178 185
    }
179 186

  

Also available in: Unified diff