Revision a6d3b158
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/uistate/RubikState.java | ||
---|---|---|
37 | 37 |
private final RubikStateAbstract mClass; |
38 | 38 |
private static final RubikState[] sizes; |
39 | 39 |
|
40 |
private static RubikState mCurrState, mPrevState;
|
|
40 |
private static RubikState mCurrState; |
|
41 | 41 |
|
42 | 42 |
static |
43 | 43 |
{ |
... | ... | |
70 | 70 |
public static void savePreferences(SharedPreferences.Editor editor) |
71 | 71 |
{ |
72 | 72 |
editor.putInt("curr_state", mCurrState.ordinal() ); |
73 |
editor.putInt("prev_state", mPrevState.ordinal() ); |
|
74 | 73 |
} |
75 | 74 |
|
76 | 75 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
78 | 77 |
public static void restorePreferences(SharedPreferences preferences) |
79 | 78 |
{ |
80 | 79 |
int currState = preferences.getInt("curr_state", RubikState.MAIN.ordinal() ); |
81 |
int prevState = preferences.getInt("prev_state", RubikState.MAIN.ordinal() ); |
|
82 |
|
|
83 | 80 |
mCurrState = getState(currState); |
84 |
mPrevState = getState(prevState); |
|
85 | 81 |
} |
86 | 82 |
|
87 | 83 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
95 | 91 |
|
96 | 92 |
public static void setState(RubikActivity act) |
97 | 93 |
{ |
98 |
mCurrState.enterState(act,mPrevState);
|
|
94 |
mCurrState.enterState(act); |
|
99 | 95 |
} |
100 | 96 |
|
101 | 97 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
105 | 101 |
if( next!=null ) |
106 | 102 |
{ |
107 | 103 |
if( mCurrState!=null ) mCurrState.leaveState(act); |
108 |
next.enterState(act,mCurrState); |
|
109 |
mPrevState = mCurrState; |
|
104 |
next.enterState(act); |
|
110 | 105 |
mCurrState = next; |
111 | 106 |
} |
112 | 107 |
else |
... | ... | |
139 | 134 |
|
140 | 135 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
141 | 136 |
|
142 |
public void enterState(RubikActivity act, RubikState prevState)
|
|
137 |
public void enterState(RubikActivity act) |
|
143 | 138 |
{ |
144 |
mClass.enterState(act,prevState);
|
|
139 |
mClass.enterState(act); |
|
145 | 140 |
} |
146 | 141 |
} |
Also available in: Unified diff
Progress with Pretty Patterns.