Revision 79c7c950
Added by Leszek Koltunski about 1 year ago
src/main/java/org/distorted/objectlib/main/ObjectPreRender.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package org.distorted.objectlib.main; |
11 | 11 |
|
12 |
import android.content.SharedPreferences; |
|
13 |
|
|
14 | 12 |
import org.distorted.library.message.EffectListener; |
15 | 13 |
import org.distorted.library.type.Static3D; |
16 | 14 |
|
... | ... | |
20 | 18 |
import org.distorted.objectlib.effects.scramble.ScrambleEffect; |
21 | 19 |
import org.distorted.objectlib.helpers.BlockController; |
22 | 20 |
import org.distorted.objectlib.helpers.MovesFinished; |
21 |
import org.distorted.objectlib.helpers.OperatingSystemInterface; |
|
23 | 22 |
import org.distorted.objectlib.shape.ShapeDodecahedron; |
24 | 23 |
import org.distorted.objectlib.shape.ShapeHexahedron; |
25 | 24 |
import org.distorted.objectlib.shape.ShapeOctahedron; |
... | ... | |
35 | 34 |
private InitAssets mAsset; |
36 | 35 |
private int mOrdinal; |
37 | 36 |
private TwistyObject mOldObject, mNewObject; |
38 |
private SharedPreferences mPreferences;
|
|
37 |
private OperatingSystemInterface mOS;
|
|
39 | 38 |
private MovesFinished mAddActionListener; |
40 | 39 |
private final BlockController mBlockController; |
41 | 40 |
private final ObjectLibInterface mInterface; |
... | ... | |
137 | 136 |
mController.setTouchControl(mNewObject); |
138 | 137 |
mNewObject.setObjectRatioNow(mScale, mController.getScalingSize() ); |
139 | 138 |
|
140 |
if( mPreferences!=null )
|
|
139 |
if( mOS!=null )
|
|
141 | 140 |
{ |
142 |
mNewObject.restorePreferences(mPreferences);
|
|
143 |
mPreferences = null;
|
|
141 |
mNewObject.restorePreferences(mOS);
|
|
142 |
mOS = null;
|
|
144 | 143 |
} |
145 | 144 |
|
146 | 145 |
mIsSolved = mNewObject.isSolved(); |
... | ... | |
511 | 510 |
// PUBLIC API |
512 | 511 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
513 | 512 |
|
514 |
public void savePreferences(SharedPreferences.Editor editor)
|
|
513 |
public void savePreferences(OperatingSystemInterface os)
|
|
515 | 514 |
{ |
516 | 515 |
if( mNewObject!=null ) |
517 | 516 |
{ |
518 |
mNewObject.savePreferences(editor);
|
|
517 |
mNewObject.savePreferences(os);
|
|
519 | 518 |
} |
520 | 519 |
} |
521 | 520 |
|
522 | 521 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
523 | 522 |
|
524 |
public void restorePreferences(SharedPreferences preferences)
|
|
523 |
public void restorePreferences(OperatingSystemInterface os)
|
|
525 | 524 |
{ |
526 |
mPreferences = preferences;
|
|
525 |
mOS = os;
|
|
527 | 526 |
} |
528 | 527 |
|
529 | 528 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Move the SharedPreferences to the OSInterface