Revision 88d8ccb6
Added by Leszek Koltunski about 1 year ago
src/main/java/org/distorted/playui/PlayActivity.java | ||
---|---|---|
221 | 221 |
|
222 | 222 |
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); |
223 | 223 |
restorePreferences(preferences); |
224 |
restoreMoves(preferences); |
|
225 | 224 |
|
226 | 225 |
ScreenList sl = mJustStarted ? |
227 | 226 |
(mModeFree ? ScreenList.FREE : ScreenList.SCRA) : |
... | ... | |
229 | 228 |
|
230 | 229 |
ScreenList.switchScreen(this,sl); |
231 | 230 |
|
232 |
mJustStarted = false;
|
|
231 |
if( !mJustStarted ) restoreMoves(preferences);
|
|
233 | 232 |
|
234 | 233 |
if( mObjectName.length()>0 ) |
235 | 234 |
{ |
236 | 235 |
changeIfDifferent(mObjectName,mObjectLocal,mObjectOrdinal,control); |
237 | 236 |
} |
238 | 237 |
|
239 |
if( !mModeFree ) |
|
238 |
if( mJustStarted && !mModeFree )
|
|
240 | 239 |
{ |
241 | 240 |
control.scrambleObject(mNumScrambles); |
242 | 241 |
} |
242 |
|
|
243 |
mJustStarted = false; |
|
243 | 244 |
} |
244 | 245 |
|
245 | 246 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/playui/ScreenList.java | ||
---|---|---|
81 | 81 |
|
82 | 82 |
public static void savePreferences(SharedPreferences.Editor editor) |
83 | 83 |
{ |
84 |
android.util.Log.e("D", "saving current state: "+mCurrScreen.name() ); |
|
85 |
|
|
86 | 84 |
editor.putString("curr_state_name", mCurrScreen.name() ); |
87 | 85 |
} |
88 | 86 |
|
... | ... | |
92 | 90 |
{ |
93 | 91 |
String currScreenName = preferences.getString("curr_state_name", ScreenList.SCRA.name() ); |
94 | 92 |
mCurrScreen = getScreenFromName(currScreenName); |
95 |
|
|
96 |
android.util.Log.e("D", "restoring current state: "+currScreenName ); |
|
97 | 93 |
} |
98 | 94 |
|
99 | 95 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
progress with PlayActivity