Project

General

Profile

« Previous | Next » 

Revision 21a1bb5d

Added by Leszek Koltunski over 1 year ago

Move the SharedPreferences to the OSInterface

View differences:

src/main/java/org/distorted/bandaged/BandagedCreatorActivity.java
36 36
import org.distorted.objectlib.main.InitAssets;
37 37
import org.distorted.objectlib.main.TwistyJson;
38 38
import org.distorted.objectlib.main.TwistyObject;
39
import org.distorted.os.OSInterface;
39 40

  
40 41
///////////////////////////////////////////////////////////////////////////////////////////////////
41 42

  
......
286 287
          {
287 288
          SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
288 289
          SharedPreferences.Editor editor = preferences.edit();
289
          object.removePreferences(editor);
290
          OSInterface os = new OSInterface(this);
291
          object.removePreferences(os);
290 292
          editor.apply();
291 293
          }
292 294
        }
src/main/java/org/distorted/bandaged/BandagedPlayScreen.java
20 20
import org.distorted.main.R;
21 21
import org.distorted.objectlib.effects.BaseEffect;
22 22
import org.distorted.objectlib.main.ObjectControl;
23
import org.distorted.os.OSInterface;
23 24

  
24 25
///////////////////////////////////////////////////////////////////////////////////////////////////
25 26

  
......
175 176
    {
176 177
    mMovesController.savePreferences(mKey,editor);
177 178
    ObjectControl control = act.getControl();
178
    control.savePreferences(editor);
179
    OSInterface os = (OSInterface)control.getOS();
180
    os.setEditor(editor);
181
    control.savePreferences();
179 182
    }
180 183

  
181 184
///////////////////////////////////////////////////////////////////////////////////////////////////
......
184 187
    {
185 188
    mMovesController.restorePreferences(act,mKey,preferences);
186 189
    ObjectControl control = act.getControl();
187
    control.restorePreferences(preferences);
190
    OSInterface os = (OSInterface)control.getOS();
191
    os.setPreferences(preferences);
192
    control.restorePreferences();
188 193
    }
189 194
}
src/main/java/org/distorted/bandaged/BandagedPlayView.java
20 20

  
21 21
import com.google.firebase.crashlytics.FirebaseCrashlytics;
22 22

  
23
import org.distorted.objectlib.helpers.OperatingSystemInterface;
23 24
import org.distorted.objectlib.main.ObjectControl;
24 25
import org.distorted.objectlib.main.TwistyObjectNode;
25 26
import org.distorted.os.OSInterface;
src/main/java/org/distorted/main/RubikActivity.java
350 350
      RubikObjectList.saveMeshState(editor);
351 351
      ScreenList.savePreferences(editor);
352 352
      RubikSurfaceView view = findViewById(R.id.rubikSurfaceView);
353
      view.getObjectControl().savePreferences(editor);
353
      OSInterface os = view.getInterface();
354
      os.setEditor(editor);
355
      view.getObjectControl().savePreferences();
354 356

  
355 357
      ScreenList curr = ScreenList.getCurrentScreen();
356 358

  
......
427 429
      if( !mOldVersion.equals("") )
428 430
        {
429 431
        RubikSurfaceView view = findViewById(R.id.rubikSurfaceView);
430
        view.getObjectControl().restorePreferences(preferences);
432
        OSInterface os = view.getInterface();
433
        os.setPreferences(preferences);
434
        view.getObjectControl().restorePreferences();
431 435
        }
432 436
      }
433 437

  

Also available in: Unified diff