Revision 33f6abfd
Added by Leszek Koltunski about 3 years ago
src/main/java/org/distorted/dialogs/RubikDialogPatternView.java | ||
---|---|---|
26 | 26 |
import android.widget.ExpandableListView; |
27 | 27 |
import android.widget.FrameLayout; |
28 | 28 |
|
29 |
import org.distorted.objectlib.main.ObjectControl; |
|
29 | 30 |
import org.distorted.objectlib.main.ObjectType; |
30 | 31 |
|
31 | 32 |
import org.distorted.main.R; |
... | ... | |
66 | 67 |
super(act); |
67 | 68 |
|
68 | 69 |
final RubikActivity ract = (RubikActivity)getContext(); |
70 |
final ObjectControl control = ract.getControl(); |
|
69 | 71 |
|
70 | 72 |
mTab = position; |
71 | 73 |
mDialog = dialog; |
... | ... | |
94 | 96 |
{ |
95 | 97 |
RubikPattern pattern = RubikPattern.getInstance(); |
96 | 98 |
int[][] moves = pattern.reInitialize(mTab, groupPosition, childPosition); |
97 |
ObjectType list = RubikPatternList.getObject(mTab);
|
|
99 |
ObjectType object = RubikPatternList.getObject(mTab);
|
|
98 | 100 |
|
99 |
ract.setupObject(list, moves); |
|
101 |
control.changeObject(object); |
|
102 |
control.initializeObject(moves); |
|
100 | 103 |
|
101 | 104 |
ScreenList.switchScreen(ract, ScreenList.PATT); |
102 | 105 |
RubikScreenPattern state = (RubikScreenPattern) ScreenList.PATT.getScreenClass(); |
src/main/java/org/distorted/main/RubikActivity.java | ||
---|---|---|
443 | 443 |
control.changeObject(newObject); |
444 | 444 |
} |
445 | 445 |
|
446 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
447 |
|
|
448 |
public void setupObject(ObjectType object, int[][] moves) |
|
449 |
{ |
|
450 |
RubikSurfaceView view = findViewById(R.id.rubikSurfaceView); |
|
451 |
ObjectControl control = view.getObjectControl(); |
|
452 |
control.setupObject(object,moves); |
|
453 |
} |
|
454 |
|
|
455 | 446 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
456 | 447 |
|
457 | 448 |
public static int getDrawableSize() |
src/main/java/org/distorted/screens/RubikScreenSolver.java | ||
---|---|---|
85 | 85 |
|
86 | 86 |
ObjectType currentObject= ImplementedSolversList.getObject(0); |
87 | 87 |
|
88 |
act.setupObject(currentObject,null); |
|
88 |
control.changeObject(currentObject); |
|
89 |
control.solveOnly(); |
|
90 |
|
|
89 | 91 |
RubikScreenPlay play = (RubikScreenPlay) ScreenList.PLAY.getScreenClass(); |
90 | 92 |
play.setObject(act, currentObject); |
91 | 93 |
|
Also available in: Unified diff
Remove the 'setupObject()' redundant API.