Project

General

Profile

« Previous | Next » 

Revision abc1e5af

Added by Leszek Koltunski about 1 year ago

bugfix

View differences:

src/main/java/org/distorted/main/MainActivity.java
306 306

  
307 307
      RubikObjectList.savePreferences(editor);
308 308

  
309
      RubikScores scores = RubikScores.getInstance();
310
      scores.savePreferences(editor);
311

  
309 312
      boolean success = editor.commit();
310 313
      if( !success ) android.util.Log.e("D", "Failed to save preferences");
311 314
      }
......
318 321

  
319 322
      RubikObjectList.restorePreferences(this,preferences,justStarted);
320 323
      RubikScores scores = RubikScores.getInstance();
324
      scores.restorePreferences(preferences);
321 325

  
322 326
      if( scores.isVerified() )
323 327
        {
src/main/java/org/distorted/playui/ScreenSolving.java
68 68
    // TOP ////////////////////////////
69 69
    LinearLayout layoutTop = act.findViewById(R.id.upperBar);
70 70
    layoutTop.removeAllViews();
71
    mTime = (TextView)inflater.inflate(R.layout.upper_text, null);
71
    mTime = (TextView)inflater.inflate(R.layout.upper_text, layoutTop);
72 72
    int elapsed = (int)mElapsed/1000;
73 73
    mTime.setTextSize(TypedValue.COMPLEX_UNIT_PX, titleSize);
74 74
    mTime.setText(act.getString(R.string.tm_placeholder,elapsed/60,elapsed%60));
......
108 108
  public void savePreferences(SharedPreferences.Editor editor)
109 109
    {
110 110
    stopCounting();
111

  
112 111
    mElapsed = System.currentTimeMillis()-mStartTime;
113 112
    editor.putLong("stateSolving_elapsed" , mElapsed);
114
    mScores.savePreferences(editor);
115 113
    }
116 114

  
117 115
///////////////////////////////////////////////////////////////////////////////////////////////////
......
119 117
  public void restorePreferences(SharedPreferences preferences)
120 118
    {
121 119
    mElapsed = preferences.getLong("stateSolving_elapsed" , 0 );
122
    mScores.restorePreferences(preferences);
123 120
    }
124 121

  
125 122
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff