1 |
cb30e768
|
leszek
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2023 Leszek Koltunski //
|
3 |
|
|
// //
|
4 |
|
|
// This file is part of Magic Cube. //
|
5 |
|
|
// //
|
6 |
|
|
// Magic Cube is proprietary software licensed under an EULA which you should have received //
|
7 |
|
|
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html //
|
8 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
9 |
|
|
|
10 |
|
|
package org.distorted.solverui;
|
11 |
|
|
|
12 |
f4b24b79
|
leszek
|
import static org.distorted.objectlib.metadata.ListObjects.*;
|
13 |
94ce8e53
|
leszek
|
import static org.distorted.objectlib.solvers.verifiers.SolverTablebase.*;
|
14 |
f4b24b79
|
leszek
|
|
15 |
cb30e768
|
leszek
|
import android.content.SharedPreferences;
|
16 |
2f53a016
|
leszek
|
import android.content.res.Resources;
|
17 |
cb30e768
|
leszek
|
import android.graphics.Bitmap;
|
18 |
|
|
import android.graphics.Canvas;
|
19 |
|
|
import android.graphics.Paint;
|
20 |
|
|
import android.graphics.PorterDuff;
|
21 |
|
|
import android.graphics.drawable.Drawable;
|
22 |
|
|
import android.os.Bundle;
|
23 |
|
|
import android.view.View;
|
24 |
|
|
import android.widget.ImageButton;
|
25 |
|
|
import android.widget.LinearLayout;
|
26 |
|
|
|
27 |
|
|
import androidx.core.content.ContextCompat;
|
28 |
|
|
|
29 |
|
|
import org.distorted.dialogs.RubikDialogSolverError;
|
30 |
|
|
import org.distorted.dialogs.RubikDialogSolverImpossible;
|
31 |
3bedda30
|
leszek
|
import org.distorted.dialogs.RubikDialogSolvers;
|
32 |
cb30e768
|
leszek
|
import org.distorted.helpers.TransparentImageButton;
|
33 |
|
|
import org.distorted.main.MainActivity;
|
34 |
|
|
import org.distorted.main.R;
|
35 |
2f53a016
|
leszek
|
import org.distorted.objectlib.helpers.OperatingSystemInterface;
|
36 |
cb30e768
|
leszek
|
import org.distorted.objectlib.main.ObjectControl;
|
37 |
|
|
import org.distorted.objectlib.main.TwistyObject;
|
38 |
3bedda30
|
leszek
|
import org.distorted.objectlib.metadata.ListObjects;
|
39 |
f4b24b79
|
leszek
|
import org.distorted.objectlib.shape.*;
|
40 |
94ce8e53
|
leszek
|
import org.distorted.objectlib.solvers.verifiers.ResultScreen;
|
41 |
|
|
import org.distorted.objectlib.solvers.verifiers.SolverAbstract;
|
42 |
|
|
import org.distorted.objectlib.solvers.verifiers.SolvingList;
|
43 |
cb30e768
|
leszek
|
|
44 |
|
|
import java.lang.ref.WeakReference;
|
45 |
|
|
|
46 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
47 |
|
|
|
48 |
94ce8e53
|
leszek
|
public class ScreenSolver extends ScreenAbstract implements ResultScreen
|
49 |
cb30e768
|
leszek
|
{
|
50 |
|
|
private static final int RESET_DURATION = 1000;
|
51 |
|
|
private static final int MODE_NORMAL = 0;
|
52 |
|
|
private static final int MODE_DINO_4 = 1;
|
53 |
|
|
|
54 |
94ce8e53
|
leszek
|
private static final int[][] colorsHex =
|
55 |
|
|
{
|
56 |
|
|
{R.string.color_yellow1,R.string.color_yellow2,R.string.color_yellow3,R.string.color_yellow4,R.string.color_yellow5,R.string.color_yellow6,R.string.color_yellow7 },
|
57 |
|
|
{R.string.color_white1 ,R.string.color_white2 ,R.string.color_white3 ,R.string.color_white4 ,R.string.color_white5 ,R.string.color_white6 ,R.string.color_white7 },
|
58 |
|
|
{R.string.color_blue1 ,R.string.color_blue2 ,R.string.color_blue3 ,R.string.color_blue4 ,R.string.color_blue5 ,R.string.color_blue6 ,R.string.color_blue7 },
|
59 |
|
|
{R.string.color_green1 ,R.string.color_green2 ,R.string.color_green3 ,R.string.color_green4 ,R.string.color_green5 ,R.string.color_green6 ,R.string.color_green7 },
|
60 |
|
|
{R.string.color_red1 ,R.string.color_red2 ,R.string.color_red3 ,R.string.color_red4 ,R.string.color_red5 ,R.string.color_red6 ,R.string.color_red7 },
|
61 |
|
|
{R.string.color_orange1,R.string.color_orange2,R.string.color_orange3,R.string.color_orange4,R.string.color_orange5,R.string.color_orange6,R.string.color_orange7 },
|
62 |
|
|
};
|
63 |
|
|
private static final int[][] colorsTet =
|
64 |
|
|
{
|
65 |
|
|
{R.string.color_green1 ,R.string.color_green2 ,R.string.color_green3 ,R.string.color_green4 ,R.string.color_green5 ,R.string.color_green6 ,R.string.color_green7 },
|
66 |
|
|
{R.string.color_yellow1,R.string.color_yellow2,R.string.color_yellow3,R.string.color_yellow4,R.string.color_yellow5,R.string.color_yellow6,R.string.color_yellow7 },
|
67 |
|
|
{R.string.color_blue1 ,R.string.color_blue2 ,R.string.color_blue3 ,R.string.color_blue4 ,R.string.color_blue5 ,R.string.color_blue6 ,R.string.color_blue7 },
|
68 |
|
|
{R.string.color_red1 ,R.string.color_red2 ,R.string.color_red3 ,R.string.color_red4 ,R.string.color_red5 ,R.string.color_red6 ,R.string.color_red7 },
|
69 |
|
|
};
|
70 |
|
|
private static final int[][] colorsOct =
|
71 |
|
|
{
|
72 |
|
|
{R.string.color_violet1,R.string.color_violet2,R.string.color_violet3,R.string.color_violet4,R.string.color_violet5,R.string.color_violet6,R.string.color_violet7 },
|
73 |
|
|
{R.string.color_grey1 ,R.string.color_grey2 ,R.string.color_grey3 ,R.string.color_grey4 ,R.string.color_grey5 ,R.string.color_grey6 ,R.string.color_grey7 },
|
74 |
|
|
{R.string.color_blue1 ,R.string.color_blue2 ,R.string.color_blue3 ,R.string.color_blue4 ,R.string.color_blue5 ,R.string.color_blue6 ,R.string.color_blue7 },
|
75 |
|
|
{R.string.color_red1 ,R.string.color_red2 ,R.string.color_red3 ,R.string.color_red4 ,R.string.color_red5 ,R.string.color_red6 ,R.string.color_red7 },
|
76 |
|
|
{R.string.color_orange1,R.string.color_orange2,R.string.color_orange3,R.string.color_orange4,R.string.color_orange5,R.string.color_orange6,R.string.color_orange7 },
|
77 |
|
|
{R.string.color_green1 ,R.string.color_green2 ,R.string.color_green3 ,R.string.color_green4 ,R.string.color_green5 ,R.string.color_green6 ,R.string.color_green7 },
|
78 |
|
|
{R.string.color_white1 ,R.string.color_white2 ,R.string.color_white3 ,R.string.color_white4 ,R.string.color_white5 ,R.string.color_white6 ,R.string.color_white7 },
|
79 |
|
|
{R.string.color_yellow1,R.string.color_yellow2,R.string.color_yellow3,R.string.color_yellow4,R.string.color_yellow5,R.string.color_yellow6,R.string.color_yellow7 },
|
80 |
|
|
};
|
81 |
|
|
private static final int[][] colorsDi4 =
|
82 |
|
|
{
|
83 |
|
|
{R.string.color_yellow1,R.string.color_yellow2,R.string.color_yellow3,R.string.color_yellow4,R.string.color_yellow5,R.string.color_yellow6,R.string.color_yellow7 },
|
84 |
|
|
{R.string.color_white1 ,R.string.color_white2 ,R.string.color_white3 ,R.string.color_white4 ,R.string.color_white5 ,R.string.color_white6 ,R.string.color_white7 },
|
85 |
|
|
{R.string.color_blue1 ,R.string.color_blue2 ,R.string.color_blue3 ,R.string.color_blue4 ,R.string.color_blue5 ,R.string.color_blue6 ,R.string.color_blue7 },
|
86 |
|
|
{R.string.color_red1 ,R.string.color_red2 ,R.string.color_red3 ,R.string.color_red4 ,R.string.color_red5 ,R.string.color_red6 ,R.string.color_red7 },
|
87 |
|
|
};
|
88 |
|
|
|
89 |
cb30e768
|
leszek
|
private static Bitmap[] mBitmap;
|
90 |
|
|
private ImageButton[] mColorButton;
|
91 |
|
|
private TransparentImageButton mResetButton,mBackButton, mSolveButton;
|
92 |
|
|
private boolean mSolving;
|
93 |
|
|
private int mCurrentColor, mCurrentButton;
|
94 |
|
|
private int[] mFaceColors;
|
95 |
|
|
private int mColorMode;
|
96 |
|
|
private int mNumColors;
|
97 |
|
|
private float mBitmapSize;
|
98 |
|
|
private WeakReference<SolverActivity> mWeakAct;
|
99 |
7464b393
|
leszek
|
private int mObjectOrdinal;
|
100 |
94ce8e53
|
leszek
|
private String[] mPhaseNames;
|
101 |
cb30e768
|
leszek
|
|
102 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
103 |
|
|
|
104 |
|
|
void leaveScreen(SolverActivity act)
|
105 |
|
|
{
|
106 |
|
|
ObjectControl control = act.getControl();
|
107 |
|
|
control.unsetLock();
|
108 |
|
|
}
|
109 |
|
|
|
110 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
111 |
|
|
|
112 |
|
|
void enterScreen(final SolverActivity act)
|
113 |
|
|
{
|
114 |
|
|
ObjectControl control = act.getControl();
|
115 |
|
|
control.setLock(false);
|
116 |
|
|
|
117 |
|
|
float width = act.getScreenWidthInPixels();
|
118 |
|
|
float heigh = act.getScreenHeightInPixels();
|
119 |
|
|
|
120 |
|
|
mWeakAct = new WeakReference<>(act);
|
121 |
|
|
mSolving = false;
|
122 |
94ce8e53
|
leszek
|
mPhaseNames = null;
|
123 |
cb30e768
|
leszek
|
|
124 |
7464b393
|
leszek
|
mObjectOrdinal = act.getObjectOrdinal();
|
125 |
cb30e768
|
leszek
|
control.solveOnly();
|
126 |
7464b393
|
leszek
|
generateFaceColors(mObjectOrdinal);
|
127 |
cb30e768
|
leszek
|
|
128 |
|
|
final float BUTTON_RATIO = 0.75f;
|
129 |
|
|
int sizeV = (int)(heigh*MainActivity.RATIO_BAR*BUTTON_RATIO);
|
130 |
|
|
int sizeH = (int)((width/mNumColors)*BUTTON_RATIO);
|
131 |
|
|
mBitmapSize = Math.min(sizeV,sizeH);
|
132 |
|
|
|
133 |
|
|
// TOP ////////////////////////////
|
134 |
|
|
LinearLayout layoutTop = act.findViewById(R.id.upperBar);
|
135 |
|
|
layoutTop.removeAllViews();
|
136 |
|
|
|
137 |
|
|
if( mNumColors>0 )
|
138 |
|
|
{
|
139 |
|
|
setupBitmaps();
|
140 |
|
|
setupColorButtons(act,width);
|
141 |
|
|
markButton(act);
|
142 |
|
|
}
|
143 |
|
|
|
144 |
|
|
for(ImageButton button: mColorButton) layoutTop.addView(button);
|
145 |
|
|
|
146 |
|
|
// BOT ////////////////////////////
|
147 |
|
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1);
|
148 |
|
|
|
149 |
|
|
LinearLayout layoutL = new LinearLayout(act);
|
150 |
|
|
layoutL.setLayoutParams(params);
|
151 |
|
|
LinearLayout layoutM = new LinearLayout(act);
|
152 |
|
|
layoutM.setLayoutParams(params);
|
153 |
|
|
LinearLayout layoutR = new LinearLayout(act);
|
154 |
|
|
layoutR.setLayoutParams(params);
|
155 |
|
|
|
156 |
|
|
LinearLayout layoutBot = act.findViewById(R.id.lowerBar);
|
157 |
|
|
layoutBot.removeAllViews();
|
158 |
|
|
|
159 |
|
|
setupResetButton(act);
|
160 |
|
|
setupSolveButton(act);
|
161 |
|
|
setupBackButton(act);
|
162 |
|
|
|
163 |
|
|
layoutL.addView(mResetButton);
|
164 |
|
|
layoutM.addView(mSolveButton);
|
165 |
|
|
layoutR.addView(mBackButton);
|
166 |
|
|
|
167 |
|
|
layoutBot.addView(layoutL);
|
168 |
|
|
layoutBot.addView(layoutM);
|
169 |
|
|
layoutBot.addView(layoutR);
|
170 |
|
|
}
|
171 |
|
|
|
172 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
173 |
|
|
// This doesn't quite work in many cases, but in case of the solvers that will pop up in foreseeable
|
174 |
|
|
// future it should be ok.
|
175 |
|
|
|
176 |
|
|
public void generateFaceColors(int object)
|
177 |
|
|
{
|
178 |
|
|
mColorMode = MODE_NORMAL;
|
179 |
|
|
|
180 |
f4b24b79
|
leszek
|
if( object==PYRA_3.ordinal() ||
|
181 |
|
|
object==PYRA_4.ordinal() ||
|
182 |
|
|
object==PYRA_5.ordinal() ||
|
183 |
|
|
object==PDUO_2.ordinal() ||
|
184 |
|
|
object==JING_2.ordinal() ||
|
185 |
|
|
object==MORP_2.ordinal() ||
|
186 |
|
|
object==MORP_3.ordinal() ||
|
187 |
|
|
object==MORP_4.ordinal() )
|
188 |
cb30e768
|
leszek
|
{
|
189 |
|
|
mNumColors = ShapeTetrahedron.NUM_FACES;
|
190 |
|
|
mFaceColors = ShapeTetrahedron.FACE_COLORS;
|
191 |
|
|
}
|
192 |
f4b24b79
|
leszek
|
else if( object==DIAM_2.ordinal() ||
|
193 |
|
|
object==DIAM_3.ordinal() ||
|
194 |
|
|
object==DIAM_4.ordinal() ||
|
195 |
|
|
object==TRAJ_3.ordinal() ||
|
196 |
|
|
object==TRAJ_4.ordinal() ||
|
197 |
|
|
object==PDIA_3.ordinal() )
|
198 |
cb30e768
|
leszek
|
{
|
199 |
|
|
mNumColors = ShapeOctahedron.NUM_FACES;
|
200 |
|
|
mFaceColors = ShapeOctahedron.FACE_COLORS;
|
201 |
|
|
}
|
202 |
f4b24b79
|
leszek
|
else if( object==CRYS_3.ordinal() ||
|
203 |
|
|
object==STAR_3.ordinal() ||
|
204 |
|
|
object==PENT_2.ordinal() ||
|
205 |
|
|
object==KILO_3.ordinal() ||
|
206 |
|
|
object==KILO_5.ordinal() ||
|
207 |
|
|
object==MEGA_3.ordinal() ||
|
208 |
|
|
object==MEGA_5.ordinal() )
|
209 |
cb30e768
|
leszek
|
{
|
210 |
|
|
mNumColors = ShapeDodecahedron.NUM_FACES;
|
211 |
|
|
mFaceColors = ShapeDodecahedron.FACE_COLORS;
|
212 |
|
|
}
|
213 |
f4b24b79
|
leszek
|
else if( object==BALL_4.ordinal() )
|
214 |
cb30e768
|
leszek
|
{
|
215 |
|
|
mNumColors = ShapeDiamond.NUM_FACES;
|
216 |
|
|
mFaceColors = ShapeDiamond.FACE_COLORS;
|
217 |
|
|
}
|
218 |
f4b24b79
|
leszek
|
else if( object==ICOS_2.ordinal() )
|
219 |
cb30e768
|
leszek
|
{
|
220 |
|
|
mNumColors = ShapeIcosahedron.NUM_FACES;
|
221 |
|
|
mFaceColors = ShapeIcosahedron.FACE_COLORS;
|
222 |
|
|
}
|
223 |
f4b24b79
|
leszek
|
else if( object==DIN4_3.ordinal() )
|
224 |
cb30e768
|
leszek
|
{
|
225 |
|
|
mNumColors = 4;
|
226 |
99c2e327
|
leszek
|
mFaceColors = new int[] { ShapeColors.COLOR_YELLOW, ShapeColors.COLOR_RED, ShapeColors.COLOR_BLUE, ShapeColors.COLOR_WHITE};
|
227 |
cb30e768
|
leszek
|
mColorMode = MODE_DINO_4;
|
228 |
|
|
}
|
229 |
|
|
else
|
230 |
|
|
{
|
231 |
|
|
mNumColors = ShapeHexahedron.NUM_FACES;
|
232 |
|
|
mFaceColors = ShapeHexahedron.FACE_COLORS;
|
233 |
|
|
}
|
234 |
|
|
}
|
235 |
|
|
|
236 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
237 |
|
|
|
238 |
|
|
private void setupBitmaps()
|
239 |
|
|
{
|
240 |
|
|
final int SIZE = (int)mBitmapSize;
|
241 |
|
|
final float R = SIZE*0.15f;
|
242 |
|
|
final float M = SIZE*0.08f;
|
243 |
|
|
|
244 |
|
|
mBitmap = new Bitmap[mNumColors];
|
245 |
|
|
|
246 |
|
|
Paint paint = new Paint();
|
247 |
|
|
paint.setColor(0xff008800);
|
248 |
|
|
paint.setStyle(Paint.Style.FILL);
|
249 |
|
|
|
250 |
|
|
paint.setAntiAlias(true);
|
251 |
|
|
paint.setTextAlign(Paint.Align.CENTER);
|
252 |
|
|
paint.setStyle(Paint.Style.FILL);
|
253 |
|
|
|
254 |
|
|
for(int i=0; i<mNumColors; i++)
|
255 |
|
|
{
|
256 |
|
|
mBitmap[i] = Bitmap.createBitmap(SIZE, SIZE, Bitmap.Config.ARGB_8888);
|
257 |
|
|
Canvas canvas = new Canvas(mBitmap[i]);
|
258 |
|
|
|
259 |
|
|
paint.setColor(0xff000000);
|
260 |
|
|
canvas.drawRect(0, 0, SIZE, SIZE, paint);
|
261 |
|
|
|
262 |
|
|
paint.setColor(mFaceColors[i]);
|
263 |
|
|
canvas.drawRoundRect( M, M, SIZE-M, SIZE-M, R, R, paint);
|
264 |
|
|
}
|
265 |
|
|
}
|
266 |
|
|
|
267 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
268 |
|
|
|
269 |
|
|
private int translateColor(int color)
|
270 |
|
|
{
|
271 |
|
|
if( mColorMode==MODE_DINO_4 )
|
272 |
|
|
{
|
273 |
|
|
int realColor = mFaceColors[color];
|
274 |
|
|
int[] hexColors = ShapeHexahedron.FACE_COLORS;
|
275 |
|
|
|
276 |
|
|
for(int i=0; i<6; i++)
|
277 |
|
|
if( hexColors[i]==realColor ) return i;
|
278 |
|
|
}
|
279 |
|
|
|
280 |
|
|
return color;
|
281 |
|
|
}
|
282 |
|
|
|
283 |
7464b393
|
leszek
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
284 |
|
|
|
285 |
|
|
private boolean pressSolve(SolverActivity act)
|
286 |
|
|
{
|
287 |
|
|
int[] solverOrdinals = SolvingList.getSolverOrdinals(mObjectOrdinal);
|
288 |
|
|
|
289 |
|
|
if( solverOrdinals!=null )
|
290 |
|
|
{
|
291 |
|
|
int len = solverOrdinals.length;
|
292 |
|
|
|
293 |
|
|
if( len==1 ) // just one solver - simply launch it and start finding the solution
|
294 |
|
|
{
|
295 |
|
|
SolvingList list = SolvingList.getSolver(solverOrdinals[0]);
|
296 |
2f53a016
|
leszek
|
OperatingSystemInterface os = act.getInterface();
|
297 |
7464b393
|
leszek
|
TwistyObject object = act.getObject();
|
298 |
94ce8e53
|
leszek
|
SolverAbstract solver = list.create(os,object);
|
299 |
|
|
|
300 |
|
|
if( solver!=null )
|
301 |
|
|
{
|
302 |
|
|
int[] result = solver.validatePosition(object);
|
303 |
|
|
if( result[0]>=0 ) solver.solve(this,result);
|
304 |
|
|
else displayImpossibleDialog(result,solver.getFaceColors());
|
305 |
|
|
}
|
306 |
|
|
else displayErrorDialog(act.getString(R.string.solver_generic_not_implemented));
|
307 |
|
|
|
308 |
7464b393
|
leszek
|
return true;
|
309 |
|
|
}
|
310 |
|
|
else // more than one solver - launch a choosing dialog
|
311 |
|
|
{
|
312 |
3bedda30
|
leszek
|
ListObjects list = ListObjects.getObject(mObjectOrdinal);
|
313 |
|
|
String upperName = list.name();
|
314 |
|
|
Bundle bundle = new Bundle();
|
315 |
|
|
bundle.putString("argument", upperName );
|
316 |
|
|
RubikDialogSolvers solv = new RubikDialogSolvers();
|
317 |
|
|
solv.setArguments(bundle);
|
318 |
|
|
solv.show( act.getSupportFragmentManager(), RubikDialogSolvers.getDialogTag() );
|
319 |
7464b393
|
leszek
|
return false;
|
320 |
|
|
}
|
321 |
|
|
}
|
322 |
|
|
else // no solvers? Impossible!
|
323 |
|
|
{
|
324 |
|
|
android.util.Log.e("D", "No solvers found for object "+mObjectOrdinal);
|
325 |
|
|
return false;
|
326 |
|
|
}
|
327 |
|
|
}
|
328 |
|
|
|
329 |
94ce8e53
|
leszek
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
330 |
|
|
|
331 |
|
|
public void fail(String result) {}
|
332 |
|
|
public void setPhaseNames(String[] names) { mPhaseNames = names; }
|
333 |
|
|
|
334 |
cb30e768
|
leszek
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
335 |
|
|
|
336 |
|
|
private void setupColorButtons(final SolverActivity act, final float width)
|
337 |
|
|
{
|
338 |
|
|
mColorButton = new ImageButton[mNumColors];
|
339 |
|
|
int padding = (int)(width*SolverActivity.PADDING);
|
340 |
|
|
int margin = (int)(width*SolverActivity.SMALL_MARGIN);
|
341 |
|
|
|
342 |
|
|
for(int i=0; i<mNumColors; i++)
|
343 |
|
|
{
|
344 |
|
|
final int ii = i;
|
345 |
|
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.MATCH_PARENT, 1.0f);
|
346 |
|
|
params.topMargin = margin;
|
347 |
|
|
params.bottomMargin = margin;
|
348 |
|
|
params.leftMargin = margin;
|
349 |
|
|
params.rightMargin = margin;
|
350 |
|
|
|
351 |
|
|
mColorButton[i] = new ImageButton(act);
|
352 |
|
|
mColorButton[i].setLayoutParams(params);
|
353 |
|
|
mColorButton[i].setPadding(padding,0,padding,0);
|
354 |
|
|
mColorButton[i].setImageBitmap(mBitmap[i]);
|
355 |
|
|
|
356 |
|
|
mColorButton[i].setOnClickListener( new View.OnClickListener()
|
357 |
|
|
{
|
358 |
|
|
@Override
|
359 |
|
|
public void onClick(View view)
|
360 |
|
|
{
|
361 |
|
|
mCurrentColor = translateColor(ii);
|
362 |
|
|
mCurrentButton= ii;
|
363 |
|
|
markButton(act);
|
364 |
|
|
}
|
365 |
|
|
});
|
366 |
|
|
}
|
367 |
|
|
}
|
368 |
|
|
|
369 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
370 |
|
|
|
371 |
|
|
private void setupResetButton(final SolverActivity act)
|
372 |
|
|
{
|
373 |
|
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT);
|
374 |
|
|
mResetButton = new TransparentImageButton(act, R.drawable.ui_reset, params);
|
375 |
|
|
|
376 |
|
|
mResetButton.setOnClickListener( new View.OnClickListener()
|
377 |
|
|
{
|
378 |
|
|
@Override
|
379 |
|
|
public void onClick(View v)
|
380 |
|
|
{
|
381 |
|
|
ObjectControl control = act.getControl();
|
382 |
|
|
control.resetTextureMapsEffect(RESET_DURATION);
|
383 |
|
|
}
|
384 |
|
|
});
|
385 |
|
|
}
|
386 |
|
|
|
387 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
388 |
|
|
|
389 |
|
|
private void setupSolveButton(final SolverActivity act)
|
390 |
|
|
{
|
391 |
|
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
|
392 |
|
|
mSolveButton = new TransparentImageButton(act,R.drawable.ui_solve,params);
|
393 |
|
|
|
394 |
|
|
mSolveButton.setOnClickListener( new View.OnClickListener()
|
395 |
|
|
{
|
396 |
|
|
@Override
|
397 |
|
|
public void onClick(View v)
|
398 |
|
|
{
|
399 |
7464b393
|
leszek
|
if( !mSolving && pressSolve(act) ) mSolving = true;
|
400 |
cb30e768
|
leszek
|
}
|
401 |
|
|
});
|
402 |
|
|
}
|
403 |
|
|
|
404 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
405 |
|
|
|
406 |
|
|
private void setupBackButton(final SolverActivity act)
|
407 |
|
|
{
|
408 |
|
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
|
409 |
|
|
mBackButton = new TransparentImageButton(act,R.drawable.ui_back,params);
|
410 |
|
|
|
411 |
|
|
mBackButton.setOnClickListener( new View.OnClickListener()
|
412 |
|
|
{
|
413 |
|
|
@Override
|
414 |
|
|
public void onClick(View v)
|
415 |
|
|
{
|
416 |
|
|
ObjectControl control = act.getControl();
|
417 |
|
|
control.resetAllTextureMaps();
|
418 |
|
|
ScreenList.goBack(act);
|
419 |
|
|
}
|
420 |
|
|
});
|
421 |
|
|
}
|
422 |
|
|
|
423 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
424 |
|
|
|
425 |
|
|
private void markButton(SolverActivity act)
|
426 |
|
|
{
|
427 |
|
|
if( mCurrentButton>=mNumColors )
|
428 |
|
|
{
|
429 |
|
|
mCurrentButton = 0;
|
430 |
|
|
mCurrentColor = translateColor(0);
|
431 |
|
|
}
|
432 |
|
|
|
433 |
|
|
for(int b=0; b<mNumColors; b++)
|
434 |
|
|
{
|
435 |
|
|
Drawable d = mColorButton[b].getBackground();
|
436 |
0a9adc31
|
leszek
|
int s = b==mCurrentButton ? act.getSelectedColor() : act.getNormalColor();
|
437 |
|
|
d.setColorFilter(ContextCompat.getColor(act,s), PorterDuff.Mode.MULTIPLY);
|
438 |
cb30e768
|
leszek
|
}
|
439 |
|
|
}
|
440 |
|
|
|
441 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
442 |
|
|
|
443 |
|
|
public void savePreferences(SharedPreferences.Editor editor)
|
444 |
|
|
{
|
445 |
|
|
editor.putInt("stateSolver_color" , mCurrentColor );
|
446 |
|
|
editor.putInt("stateSolver_button", mCurrentButton);
|
447 |
|
|
}
|
448 |
|
|
|
449 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
450 |
|
|
|
451 |
|
|
public void restorePreferences(SharedPreferences preferences)
|
452 |
|
|
{
|
453 |
|
|
mCurrentColor = preferences.getInt("stateSolver_color" , 0);
|
454 |
|
|
mCurrentButton= preferences.getInt("stateSolver_button", 0);
|
455 |
|
|
}
|
456 |
|
|
|
457 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
458 |
|
|
|
459 |
|
|
public int getCurrentColor()
|
460 |
|
|
{
|
461 |
|
|
return mCurrentColor;
|
462 |
|
|
}
|
463 |
|
|
|
464 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
465 |
|
|
|
466 |
|
|
public void setSolved(final String moves)
|
467 |
|
|
{
|
468 |
|
|
mSolving = false;
|
469 |
|
|
final SolverActivity act = mWeakAct.get();
|
470 |
|
|
|
471 |
|
|
if( act!=null )
|
472 |
|
|
{
|
473 |
|
|
act.runOnUiThread(new Runnable()
|
474 |
|
|
{
|
475 |
|
|
@Override
|
476 |
|
|
public void run()
|
477 |
|
|
{
|
478 |
|
|
ScreenList.switchScreen(act, ScreenList.SOLU);
|
479 |
|
|
ScreenSolution solution = (ScreenSolution) ScreenList.SOLU.getScreenClass();
|
480 |
94ce8e53
|
leszek
|
solution.setSolution(moves);
|
481 |
1d1f9ccf
|
leszek
|
if( !moves.isEmpty() ) act.doNotShowDialogAnymore();
|
482 |
cb30e768
|
leszek
|
}
|
483 |
|
|
});
|
484 |
|
|
}
|
485 |
|
|
}
|
486 |
|
|
|
487 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
488 |
|
|
|
489 |
94ce8e53
|
leszek
|
public void setSolved(final int[][] moves, final int phaseNumber, final int[][] subphases)
|
490 |
cb30e768
|
leszek
|
{
|
491 |
|
|
mSolving = false;
|
492 |
|
|
final SolverActivity act = mWeakAct.get();
|
493 |
|
|
|
494 |
|
|
if( act!=null )
|
495 |
|
|
{
|
496 |
|
|
act.runOnUiThread(new Runnable()
|
497 |
|
|
{
|
498 |
|
|
@Override
|
499 |
|
|
public void run()
|
500 |
|
|
{
|
501 |
94ce8e53
|
leszek
|
if( mPhaseNames!=null )
|
502 |
|
|
{
|
503 |
|
|
ScreenPhasedSolution screen = (ScreenPhasedSolution) ScreenList.PHAS.getScreenClass();
|
504 |
|
|
if( phaseNumber==0 )
|
505 |
|
|
{
|
506 |
|
|
ScreenList.switchScreen(act, ScreenList.PHAS);
|
507 |
|
|
screen.updateNames(mPhaseNames);
|
508 |
|
|
}
|
509 |
|
|
screen.setSolution(moves, phaseNumber,subphases);
|
510 |
|
|
}
|
511 |
|
|
else
|
512 |
|
|
{
|
513 |
|
|
ScreenList.switchScreen(act, ScreenList.SOLU);
|
514 |
|
|
ScreenSolution screen = (ScreenSolution) ScreenList.SOLU.getScreenClass();
|
515 |
|
|
screen.setSolution(moves);
|
516 |
|
|
}
|
517 |
|
|
|
518 |
e1637420
|
leszek
|
if( moves!=null && moves.length>0 ) act.doNotShowDialogAnymore();
|
519 |
cb30e768
|
leszek
|
}
|
520 |
|
|
});
|
521 |
|
|
}
|
522 |
|
|
}
|
523 |
|
|
|
524 |
2f53a016
|
leszek
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
525 |
|
|
|
526 |
94ce8e53
|
leszek
|
public void displayErrorDialog(String message)
|
527 |
2f53a016
|
leszek
|
{
|
528 |
|
|
mSolving = false;
|
529 |
94ce8e53
|
leszek
|
SolverActivity act = mWeakAct.get();
|
530 |
2f53a016
|
leszek
|
|
531 |
|
|
if( act!=null )
|
532 |
|
|
{
|
533 |
94ce8e53
|
leszek
|
RubikDialogSolverError dialog = new RubikDialogSolverError();
|
534 |
|
|
Bundle bundle = new Bundle();
|
535 |
|
|
bundle.putString("argument", message );
|
536 |
|
|
dialog.setArguments(bundle);
|
537 |
|
|
dialog.show( act.getSupportFragmentManager(), null);
|
538 |
2f53a016
|
leszek
|
}
|
539 |
|
|
}
|
540 |
|
|
|
541 |
cb30e768
|
leszek
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
542 |
|
|
|
543 |
94ce8e53
|
leszek
|
public void displayImpossibleDialog(String message)
|
544 |
cb30e768
|
leszek
|
{
|
545 |
|
|
mSolving = false;
|
546 |
|
|
SolverActivity act = mWeakAct.get();
|
547 |
|
|
|
548 |
|
|
if( act!=null )
|
549 |
|
|
{
|
550 |
94ce8e53
|
leszek
|
RubikDialogSolverImpossible dialog = new RubikDialogSolverImpossible();
|
551 |
cb30e768
|
leszek
|
Bundle bundle = new Bundle();
|
552 |
|
|
bundle.putString("argument", message );
|
553 |
|
|
dialog.setArguments(bundle);
|
554 |
|
|
dialog.show( act.getSupportFragmentManager(), null);
|
555 |
|
|
}
|
556 |
|
|
}
|
557 |
|
|
|
558 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
559 |
|
|
|
560 |
94ce8e53
|
leszek
|
public void displayImpossibleDialog(int[] errorCode, int[] faceColors)
|
561 |
cb30e768
|
leszek
|
{
|
562 |
|
|
mSolving = false;
|
563 |
|
|
SolverActivity act = mWeakAct.get();
|
564 |
|
|
|
565 |
|
|
if( act!=null )
|
566 |
|
|
{
|
567 |
94ce8e53
|
leszek
|
String message = error(act.getResources(),errorCode,faceColors);
|
568 |
|
|
displayImpossibleDialog(message);
|
569 |
|
|
}
|
570 |
|
|
}
|
571 |
|
|
|
572 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
573 |
|
|
|
574 |
|
|
int getHexColor(int color,int variant) { return colorsHex[color][variant]; }
|
575 |
|
|
int getTetColor(int color,int variant) { return colorsTet[color][variant]; }
|
576 |
|
|
int getOctColor(int color,int variant) { return colorsOct[color][variant]; }
|
577 |
|
|
int getDi4Color(int color,int variant) { return colorsDi4[color][variant]; }
|
578 |
|
|
|
579 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
580 |
|
|
|
581 |
|
|
String hexCornerMissingError(Resources res, int face0, int face1, int face2)
|
582 |
|
|
{
|
583 |
|
|
int j0 = getHexColor(face0,3);
|
584 |
|
|
int j1 = getHexColor(face1,3);
|
585 |
|
|
int j2 = getHexColor(face2,4);
|
586 |
|
|
|
587 |
|
|
String c0 = res.getString(j0);
|
588 |
|
|
String c1 = res.getString(j1);
|
589 |
|
|
String c2 = res.getString(j2);
|
590 |
|
|
|
591 |
|
|
return res.getString(R.string.solver_generic_missing_corner,c0,c1,c2);
|
592 |
|
|
}
|
593 |
|
|
|
594 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
595 |
|
|
|
596 |
|
|
String hexCenterMissingError(Resources res, int face)
|
597 |
|
|
{
|
598 |
|
|
int color = getHexColor(face,2);
|
599 |
|
|
String clr= res.getString(color);
|
600 |
|
|
return res.getString(R.string.solver_generic_missing_center,clr);
|
601 |
|
|
}
|
602 |
|
|
|
603 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
604 |
|
|
|
605 |
|
|
String hexEdgeMissingError(Resources res, int face0, int face1)
|
606 |
|
|
{
|
607 |
|
|
int j0 = getHexColor(face0,3);
|
608 |
|
|
int j1 = getHexColor(face1,6);
|
609 |
|
|
|
610 |
|
|
String c0 = res.getString(j0);
|
611 |
|
|
String c1 = res.getString(j1);
|
612 |
|
|
|
613 |
|
|
return res.getString(R.string.solver_generic_missing_edge,c0,c1);
|
614 |
|
|
}
|
615 |
|
|
|
616 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
617 |
|
|
|
618 |
|
|
String hexEdgeTwistedError(Resources res, int color0, int color1)
|
619 |
|
|
{
|
620 |
|
|
int j0 = getHexColor(color0,3);
|
621 |
|
|
int j1 = getHexColor(color1,6);
|
622 |
|
|
|
623 |
|
|
String c0 = res.getString(j0);
|
624 |
|
|
String c1 = res.getString(j1);
|
625 |
|
|
|
626 |
|
|
return res.getString(R.string.solver_generic_twisted_edge,c0,c1);
|
627 |
|
|
}
|
628 |
|
|
|
629 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
630 |
|
|
|
631 |
|
|
String hexCornerTwistedError(Resources res, int color0, int color1, int color2)
|
632 |
|
|
{
|
633 |
|
|
int j0 = getHexColor(color0,3);
|
634 |
|
|
int j1 = getHexColor(color1,3);
|
635 |
|
|
int j2 = getHexColor(color2,5);
|
636 |
|
|
|
637 |
|
|
String c0 = res.getString(j0);
|
638 |
|
|
String c1 = res.getString(j1);
|
639 |
|
|
String c2 = res.getString(j2);
|
640 |
|
|
|
641 |
|
|
return res.getString(R.string.solver_generic_twisted_corner,c0,c1,c2);
|
642 |
|
|
}
|
643 |
|
|
|
644 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
645 |
|
|
|
646 |
|
|
String hexEdgeMonoError(Resources res, int color)
|
647 |
|
|
{
|
648 |
|
|
int j0 = getHexColor(color,3);
|
649 |
|
|
int j1 = getHexColor(color,6);
|
650 |
|
|
String c0 = res.getString(j0);
|
651 |
|
|
String c1 = res.getString(j1);
|
652 |
|
|
|
653 |
|
|
return res.getString(R.string.solver_generic_edge_mono,c0,c1);
|
654 |
|
|
}
|
655 |
|
|
|
656 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
657 |
|
|
|
658 |
|
|
String hexEdgeTwiceError(Resources res, int color0, int color1)
|
659 |
|
|
{
|
660 |
|
|
int j0 = getHexColor(color0,3);
|
661 |
|
|
int j1 = getHexColor(color1,6);
|
662 |
|
|
String c0 = res.getString(j0);
|
663 |
|
|
String c1 = res.getString(j1);
|
664 |
|
|
|
665 |
|
|
return res.getString(R.string.solver_generic_edge_twice,c0,c1);
|
666 |
|
|
}
|
667 |
|
|
|
668 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
669 |
|
|
|
670 |
|
|
String octCenterMissingError(Resources res, int face)
|
671 |
|
|
{
|
672 |
|
|
int index = getOctColor(face,2);
|
673 |
|
|
String color = res.getString(index);
|
674 |
|
|
return res.getString(R.string.solver_generic_missing_center,color);
|
675 |
|
|
}
|
676 |
|
|
|
677 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
678 |
|
|
|
679 |
|
|
String octCornerMissingError(Resources res, int f1, int f2)
|
680 |
|
|
{
|
681 |
|
|
int i1 = getOctColor(f1,3);
|
682 |
|
|
int i2 = getOctColor(f2,4);
|
683 |
|
|
String c1 = res.getString(i1);
|
684 |
|
|
String c2 = res.getString(i2);
|
685 |
|
|
return res.getString(R.string.solver_generic_missing_corner2,c1,c2);
|
686 |
|
|
}
|
687 |
|
|
|
688 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
689 |
|
|
|
690 |
|
|
String tetCornerMissingError(Resources res, int color0, int color1, int color2)
|
691 |
|
|
{
|
692 |
|
|
int j0 = getTetColor(color0,3);
|
693 |
|
|
int j1 = getTetColor(color1,3);
|
694 |
|
|
int j2 = getTetColor(color2,4);
|
695 |
|
|
|
696 |
|
|
String c0 = res.getString(j0);
|
697 |
|
|
String c1 = res.getString(j1);
|
698 |
|
|
String c2 = res.getString(j2);
|
699 |
|
|
|
700 |
|
|
return res.getString(R.string.solver_generic_missing_corner,c0,c1,c2);
|
701 |
|
|
}
|
702 |
|
|
|
703 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
704 |
|
|
|
705 |
|
|
String tetEdgeMissingError(Resources res, int face0, int face1)
|
706 |
|
|
{
|
707 |
|
|
int j0 = getTetColor(face0,3);
|
708 |
|
|
int j1 = getTetColor(face1,6);
|
709 |
|
|
|
710 |
|
|
String c0 = res.getString(j0);
|
711 |
|
|
String c1 = res.getString(j1);
|
712 |
|
|
|
713 |
|
|
return res.getString(R.string.solver_generic_missing_edge,c0,c1);
|
714 |
|
|
}
|
715 |
|
|
|
716 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
717 |
|
|
|
718 |
|
|
String tetCenterMissingError(Resources res, int face)
|
719 |
|
|
{
|
720 |
|
|
int j = getTetColor(face,2);
|
721 |
|
|
String c = res.getString(j);
|
722 |
|
|
return res.getString(R.string.solver_generic_missing_center,c);
|
723 |
|
|
}
|
724 |
|
|
|
725 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
726 |
|
|
|
727 |
|
|
String tetVertexMissingError(Resources res, int color0, int color1, int color2)
|
728 |
|
|
{
|
729 |
|
|
int j0 = getTetColor(color0,3);
|
730 |
|
|
int j1 = getTetColor(color1,3);
|
731 |
|
|
int j2 = getTetColor(color2,4);
|
732 |
|
|
|
733 |
|
|
String c0 = res.getString(j0);
|
734 |
|
|
String c1 = res.getString(j1);
|
735 |
|
|
String c2 = res.getString(j2);
|
736 |
|
|
|
737 |
|
|
return res.getString(R.string.solver_generic_missing_vertex,c0,c1,c2);
|
738 |
|
|
}
|
739 |
|
|
|
740 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
741 |
|
|
|
742 |
|
|
String di4EdgeThreeError(Resources res, int color)
|
743 |
|
|
{
|
744 |
|
|
int j0 = getDi4Color(color,7);
|
745 |
|
|
String c0 = res.getString(j0);
|
746 |
|
|
return res.getString(R.string.solver_generic_edge_three,c0);
|
747 |
|
|
}
|
748 |
|
|
|
749 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
750 |
|
|
|
751 |
|
|
public String error(Resources res, int[] err, int[] faceColors)
|
752 |
|
|
{
|
753 |
|
|
switch(err[0])
|
754 |
|
|
{
|
755 |
|
|
case ERROR_HEX_CORNER_MISSING : return hexCornerMissingError(res,err[1],err[2],err[3]);
|
756 |
|
|
case ERROR_HEX_CENTER_MISSING : return hexCenterMissingError(res,err[1]);
|
757 |
|
|
case ERROR_HEX_EDGE_MISSING : return hexEdgeMissingError(res,err[1],err[2]);
|
758 |
|
|
case ERROR_HEX_EDGE_TWISTED : return hexEdgeTwistedError(res,err[1],err[2]);
|
759 |
|
|
case ERROR_HEX_EDGE_MONOCHROMATIC: return hexEdgeMonoError(res,err[1]);
|
760 |
|
|
case ERROR_HEX_EDGE_TWICE : return hexEdgeTwiceError(res,err[1],err[2]);
|
761 |
|
|
case ERROR_HEX_CORNER_TWISTED : return hexCornerTwistedError(res,err[1],err[2],err[3]);
|
762 |
|
|
|
763 |
|
|
case ERROR_TET_CORNER_MISSING : return tetCornerMissingError(res,err[1],err[2],err[3]);
|
764 |
|
|
case ERROR_TET_VERTEX_MISSING : return tetVertexMissingError(res,err[1],err[2],err[3]);
|
765 |
|
|
case ERROR_TET_EDGE_MISSING : return tetEdgeMissingError(res,faceColors[err[1]],faceColors[err[2]]);
|
766 |
|
|
case ERROR_TET_CENTER_MISSING : return tetCenterMissingError(res,err[1]);
|
767 |
|
|
|
768 |
|
|
case ERROR_OCT_CENTER_MISSING : return octCenterMissingError(res,err[1]);
|
769 |
|
|
case ERROR_OCT_CORNER_MISSING : return octCornerMissingError(res,err[1],err[2]);
|
770 |
|
|
|
771 |
|
|
case ERROR_DI4_EDGE_THREE : return di4EdgeThreeError(res,err[1]);
|
772 |
|
|
|
773 |
|
|
case ERROR_CORNERS_CANNOT : return res.getString(R.string.solver_generic_corners_cannot);
|
774 |
|
|
case ERROR_EDGE_CANNOT : return res.getString(R.string.solver_generic_edges_cannot);
|
775 |
|
|
case ERROR_CORNER_TWISTED : return res.getString(R.string.solver_generic_corner_twist);
|
776 |
|
|
case ERROR_CORNER_TWIST_90 : return res.getString(R.string.solver_generic_corner_twist) + " (90)";
|
777 |
|
|
case ERROR_CORNER_TWIST_180 : return res.getString(R.string.solver_generic_corner_twist) + " (180)";
|
778 |
|
|
case ERROR_EDGE_TWISTED : return res.getString(R.string.solver_generic_edge_twist);
|
779 |
|
|
case ERROR_TWO_CENTERS : return res.getString(R.string.solver_generic_two_centers);
|
780 |
|
|
case ERROR_TWO_CORNERS : return res.getString(R.string.solver_generic_two_corners);
|
781 |
|
|
case ERROR_TWO_EDGES : return res.getString(R.string.solver_generic_two_edges);
|
782 |
|
|
case ERROR_FREE_CORNERS_NOT_EVEN : return res.getString(R.string.solver_generic_free_corners_odd);
|
783 |
|
|
case ERROR_FREE_CORNERS_ROTATED : return res.getString(R.string.solver_generic_free_corners_rotated);
|
784 |
|
|
case ERROR_VERTICES_CANNOT : return res.getString(R.string.solver_generic_vertices_cannot);
|
785 |
|
|
case ERROR_C_V_DONT_MATCH : return res.getString(R.string.solver_generic_c_v_dont_match);
|
786 |
cb30e768
|
leszek
|
}
|
787 |
94ce8e53
|
leszek
|
|
788 |
|
|
return null;
|
789 |
cb30e768
|
leszek
|
}
|
790 |
|
|
}
|