Revision e03e0352
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/main/RubikActivity.java | ||
---|---|---|
25 | 25 |
import androidx.appcompat.app.AppCompatActivity; |
26 | 26 |
|
27 | 27 |
import android.util.DisplayMetrics; |
28 |
import android.view.View; |
|
29 | 28 |
|
30 | 29 |
import com.google.firebase.analytics.FirebaseAnalytics; |
31 | 30 |
|
32 |
import org.distorted.dialogs.RubikDialogAbout; |
|
33 | 31 |
import org.distorted.dialogs.RubikDialogError; |
34 |
import org.distorted.dialogs.RubikDialogScores; |
|
35 | 32 |
import org.distorted.effects.BaseEffect; |
36 | 33 |
import org.distorted.library.main.DistortedLibrary; |
37 | 34 |
|
... | ... | |
96 | 93 |
super.onResume(); |
97 | 94 |
RubikSurfaceView view = findViewById(R.id.rubikSurfaceView); |
98 | 95 |
view.onResume(); |
96 |
view.initialize(); |
|
99 | 97 |
restorePreferences(); |
100 | 98 |
RubikState.setState(this); |
101 | 99 |
|
... | ... | |
296 | 294 |
RubikSurfaceView view = findViewById(R.id.rubikSurfaceView); |
297 | 295 |
return view.isVertical(); |
298 | 296 |
} |
299 |
|
|
300 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
301 |
|
|
302 |
public void Play(View v) |
|
303 |
{ |
|
304 |
RubikState.switchState(this,RubikState.PLAY); |
|
305 |
} |
|
306 |
|
|
307 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
308 |
|
|
309 |
public void Scores(View v) |
|
310 |
{ |
|
311 |
RubikStatePlay play = (RubikStatePlay) RubikState.PLAY.getStateClass(); |
|
312 |
int object = play.getObject(); |
|
313 |
int size = play.getSize(); |
|
314 |
int sizeIndex = RubikObjectList.getSizeIndex(object,size); |
|
315 |
|
|
316 |
Bundle bundle = new Bundle(); |
|
317 |
bundle.putInt("tab", RubikObjectList.pack(object,sizeIndex) ); |
|
318 |
bundle.putBoolean("submitting", false); |
|
319 |
|
|
320 |
RubikDialogScores scores = new RubikDialogScores(); |
|
321 |
scores.setArguments(bundle); |
|
322 |
scores.show(getSupportFragmentManager(), null); |
|
323 |
} |
|
324 |
|
|
325 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
326 |
|
|
327 |
public void Patterns(View v) |
|
328 |
{ |
|
329 |
RubikState.switchState(this,RubikState.PATT); |
|
330 |
} |
|
331 |
|
|
332 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
333 |
|
|
334 |
public void Solver(View v) |
|
335 |
{ |
|
336 |
RubikState.switchState(this,RubikState.SVER); |
|
337 |
} |
|
338 |
|
|
339 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
340 |
|
|
341 |
public void About(View v) |
|
342 |
{ |
|
343 |
RubikDialogAbout diag = new RubikDialogAbout(); |
|
344 |
diag.show(getSupportFragmentManager(), null); |
|
345 |
} |
|
346 | 297 |
} |
Also available in: Unified diff
Remove the 'MAIN' state.
Fix one crasher with two-fingered dragging in the View.