Revision 24679c47
Added by Leszek Koltunski over 1 year ago
src/main/java/org/distorted/main/RubikObjectLibInterface.java | ||
---|---|---|
44 | 44 |
|
45 | 45 |
import java.lang.ref.WeakReference; |
46 | 46 |
|
47 |
import static org.distorted.external.RubikScores.RECORD_FIRST; |
|
48 |
import static org.distorted.external.RubikScores.RECORD_NOT_NEW; |
|
49 |
|
|
47 | 50 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
48 | 51 |
|
49 | 52 |
public class RubikObjectLibInterface implements ObjectLibInterface |
50 | 53 |
{ |
51 | 54 |
private final WeakReference<RubikActivity> mAct; |
52 |
private boolean mIsNewRecord;
|
|
55 |
private int mIsNewRecord;
|
|
53 | 56 |
private long mNewRecord; |
54 | 57 |
private int mLastCubitColor, mLastCubit, mLastCubitFace; |
55 | 58 |
|
... | ... | |
195 | 198 |
reportRecord(act,startTime,endTime,debug,scrambleNum); |
196 | 199 |
requestReview(act); |
197 | 200 |
|
198 |
if( mIsNewRecord ) |
|
201 |
if( mIsNewRecord!=RECORD_NOT_NEW )
|
|
199 | 202 |
{ |
200 |
RubikDialogNewRecord dialog = new RubikDialogNewRecord(); |
|
201 |
dialog.setArguments(bundle); |
|
202 |
dialog.show( act.getSupportFragmentManager(), RubikDialogNewRecord.getDialogTag() ); |
|
203 |
if( mIsNewRecord==RECORD_FIRST && RubikObjectList.thereAreLockedObjects() ) |
|
204 |
{ |
|
205 |
|
|
206 |
} |
|
207 |
else |
|
208 |
{ |
|
209 |
RubikDialogNewRecord dialog = new RubikDialogNewRecord(); |
|
210 |
dialog.setArguments(bundle); |
|
211 |
dialog.show( act.getSupportFragmentManager(), RubikDialogNewRecord.getDialogTag() ); |
|
212 |
} |
|
203 | 213 |
} |
204 | 214 |
else |
205 | 215 |
{ |
... | ... | |
308 | 318 |
if( ScreenList.getCurrentScreen()== ScreenList.SOLV ) |
309 | 319 |
{ |
310 | 320 |
RubikScreenSolving solving = (RubikScreenSolving) ScreenList.SOLV.getScreenClass(); |
311 |
mNewRecord = solving.getRecord(); |
|
312 |
|
|
313 |
if( mNewRecord< 0 ) |
|
314 |
{ |
|
315 |
mNewRecord = -mNewRecord; |
|
316 |
mIsNewRecord = false; |
|
317 |
} |
|
318 |
else |
|
319 |
{ |
|
320 |
mIsNewRecord = true; |
|
321 |
} |
|
321 |
mNewRecord = solving.stopTimerAndGetRecord(); |
|
322 |
mIsNewRecord = solving.setRecord(); |
|
322 | 323 |
} |
323 | 324 |
} |
324 | 325 |
|
Also available in: Unified diff
Progress with marking objects as free.