Project

General

Profile

« Previous | Next » 

Revision ae77f661

Added by Leszek Koltunski over 2 years ago

Correct the 'solved' icons in the Play popup.

View differences:

src/main/java/org/distorted/main/RubikObjectLibInterface.java
302 302
      else
303 303
        {
304 304
        mIsNewRecord = true;
305
        RubikScreenPlay play= (RubikScreenPlay) ScreenList.PLAY.getScreenClass();
306
        play.adjustSolvedIcons();
305 307
        }
306 308
      }
307 309
    }
src/main/java/org/distorted/screens/RubikScreenPlay.java
497 497
      }
498 498
    }
499 499

  
500
///////////////////////////////////////////////////////////////////////////////////////////////////
501

  
502
  public void adjustSolvedIcons()
503
    {
504
    int dbLevel = getDBLevel(mObject);
505
    int numLevel = Math.min(dbLevel, LEVELS_SHOWN);
506
    RubikScores scores = RubikScores.getInstance();
507

  
508
    for(int i=0; i<numLevel; i++)
509
      {
510
      int level = i<numLevel-1 ? i+1 : dbLevel;
511
      Button button = (Button)mPlayLayout.getChildAt(i);
512
      int icon = scores.isSolved(mObject.ordinal(), level-1) ? R.drawable.ui_solved : R.drawable.ui_notsolved;
513
      button.setCompoundDrawablesWithIntrinsicBounds(icon,0,0,0);
514
      }
515
    }
516

  
500 517
///////////////////////////////////////////////////////////////////////////////////////////////////
501 518

  
502 519
  private void adjustLevels(final RubikActivity act)
src/main/java/org/distorted/screens/RubikScreenSolving.java
186 186
      mElapsed = System.currentTimeMillis()-mStartTime;
187 187

  
188 188
      RubikScreenPlay play = (RubikScreenPlay) ScreenList.PLAY.getScreenClass();
189
      ObjectType object  = play.getObject();
190
      int level   = play.getLevel();
189
      ObjectType object = play.getObject();
190
      int level = play.getLevel();
191 191
      boolean isNew = mScores.setRecord(object.ordinal(), level, mElapsed);
192 192

  
193 193
      return isNew ? mElapsed : -mElapsed;

Also available in: Unified diff