Revision a6d3b158
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/magic/RubikActivity.java | ||
---|---|---|
36 | 36 |
import org.distorted.scores.RubikScoresDownloader; |
37 | 37 |
import org.distorted.object.RubikObjectList; |
38 | 38 |
import org.distorted.uistate.RubikState; |
39 |
import org.distorted.uistate.RubikStateAbstract; |
|
40 | 39 |
import org.distorted.uistate.RubikStatePlay; |
41 | 40 |
|
42 | 41 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
43 | 42 |
|
44 |
public class RubikActivity extends AppCompatActivity implements View.OnClickListener
|
|
43 |
public class RubikActivity extends AppCompatActivity |
|
45 | 44 |
{ |
46 | 45 |
private boolean mJustStarted; |
47 | 46 |
|
... | ... | |
114 | 113 |
super.onDestroy(); |
115 | 114 |
} |
116 | 115 |
|
117 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
118 |
|
|
119 |
@Override |
|
120 |
public void onClick(View v) |
|
121 |
{ |
|
122 |
if( v.getId() == RubikStateAbstract.BUTTON_ID_BACK ) |
|
123 |
{ |
|
124 |
RubikState.goBack(this); |
|
125 |
} |
|
126 |
} |
|
127 |
|
|
128 | 116 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
129 | 117 |
|
130 | 118 |
private void savePreferences() |
... | ... | |
173 | 161 |
|
174 | 162 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
175 | 163 |
// PUBLIC API |
164 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
165 |
|
|
166 |
public void setCanRotate(boolean can) |
|
167 |
{ |
|
168 |
RubikSurfaceView view = findViewById(R.id.rubikSurfaceView); |
|
169 |
RubikRenderer renderer = view.getRenderer(); |
|
170 |
|
|
171 |
renderer.setCanRotate(can); |
|
172 |
} |
|
173 |
|
|
176 | 174 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
177 | 175 |
|
178 | 176 |
public void changeObject(int object, int size) |
... | ... | |
181 | 179 |
int objectSize = obj.getSizes()[size]; |
182 | 180 |
|
183 | 181 |
RubikSurfaceView view = findViewById(R.id.rubikSurfaceView); |
184 |
view.getRenderer().createObject(obj,objectSize); |
|
182 |
RubikRenderer renderer = view.getRenderer(); |
|
183 |
|
|
184 |
if( renderer.canDrag() ) |
|
185 |
{ |
|
186 |
renderer.createObject(obj,objectSize); |
|
187 |
} |
|
185 | 188 |
} |
186 | 189 |
|
187 | 190 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Progress with Pretty Patterns.