Project

General

Profile

« Previous | Next » 

Revision 972f9eae

Added by Leszek Koltunski about 2 years ago

Bandaged 3x3: remember object state and move history.

View differences:

src/main/java/org/distorted/main/RubikActivity.java
100 100
    private static final float RATIO_BAR  = 0.10f;
101 101
    private static final float RATIO_INSET= 0.09f;
102 102

  
103
    private static final String KEY_PLAY = "movesController_play";
104
    private static final String KEY_SOLV = "movesController_solv";
105

  
103 106
    private boolean mJustStarted;
104 107
    private FirebaseAnalytics mFirebaseAnalytics;
105 108
    private static int mScreenWidth, mScreenHeight;
......
325 328
      if( curr==ScreenList.PLAY )
326 329
        {
327 330
        RubikScreenPlay play = (RubikScreenPlay)ScreenList.PLAY.getScreenClass();
328
        play.saveMovePreferences(editor);
331
        play.saveMovePreferences(KEY_PLAY,editor);
329 332
        }
330 333
      if( curr==ScreenList.SOLV )
331 334
        {
332 335
        RubikScreenSolving solv = (RubikScreenSolving)ScreenList.SOLV.getScreenClass();
333
        solv.saveMovePreferences(editor);
336
        solv.saveMovePreferences(KEY_SOLV,editor);
334 337
        }
335 338

  
336 339
      editor.apply();
......
393 396
      if( curr==ScreenList.PLAY )
394 397
        {
395 398
        RubikScreenPlay play = (RubikScreenPlay)ScreenList.PLAY.getScreenClass();
396
        play.restoreMovePreferences(this,preferences);
399
        play.restoreMovePreferences(this,KEY_PLAY,preferences);
397 400
        }
398 401
      if( curr==ScreenList.SOLV )
399 402
        {
400 403
        RubikScreenSolving solv = (RubikScreenSolving)ScreenList.SOLV.getScreenClass();
401
        solv.restoreMovePreferences(this,preferences);
404
        solv.restoreMovePreferences(this,KEY_SOLV,preferences);
402 405
        }
403 406
      }
404 407

  

Also available in: Unified diff