Project

General

Profile

« Previous | Next » 

Revision 060b445e

Added by Leszek Koltunski over 1 year ago

Unblock PreRender's scrambling & solving oonly AFTER we change screen to READ post-scrambling (otherwise it was possible to press the 'solve' button in the brief period between unblocking and switching screen because switching screen runs on the background UI thread)

View differences:

src/main/java/org/distorted/objectlib/main/ObjectPreRender.java
392 392
    }
393 393

  
394 394
///////////////////////////////////////////////////////////////////////////////////////////////////
395
// called from ObjectControl; this from app when we switch the screen to READ post-scrambling.
396
// The point: we only unblock having completed the screen switch so that it is impossible to
397
// click the solve button then.
395 398

  
396
  private void unblockEverything()
399
  void unblockEverything()
397 400
    {
398 401
    mScramblingAndSolvingBlocked = false;
399 402
    mRotationBlocked = false;
......
744 747
        {
745 748
        if( effectID == mEffectID[i] )
746 749
          {
747
          if( i!=BaseEffect.Type.WIN.ordinal()      )
748
            {
749
            unblockEverything();
750
            }
751 750
          if( i==BaseEffect.Type.SCRAMBLE.ordinal() )
752 751
            {
753 752
            mScrambleEndTime = System.currentTimeMillis();
754 753
            mInterface.onScrambleEffectFinished();
755 754
            }
756
          if( i==BaseEffect.Type.WIN.ordinal()      )
755
          else if( i==BaseEffect.Type.WIN.ordinal()      )
757 756
            {
758 757
            mInterface.onWinEffectFinished(mScrambleStartTime,mScrambleEndTime-mScrambleStartTime,mDebug,mScrambleObjectNum);
759 758
            }
759
          else
760
            {
761
            unblockEverything();
762
            }
763

  
760 764
          break;
761 765
          }
762 766
        }

Also available in: Unified diff