Project

General

Profile

« Previous | Next » 

Revision 6a76f80a

Added by Leszek Koltunski over 3 years ago

Do not permit clicking on the 'play' button if we are currently scrambling an object.

View differences:

src/main/java/org/distorted/states/RubikStatePlay.java
196 196
      @Override
197 197
      public void onClick(View view)
198 198
        {
199
        if( mPlayPopup==null )
199
        if( act.getPreRender().canPlay() )
200 200
          {
201
          // I completely don't understand it, but Firebase says occasionally mPlayPopup is null here. Recreate.
202
          float width = act.getScreenWidthInPixels();
203
          setupPlayWindow(act,width);
204
          }
201
          if( mPlayPopup==null )
202
            {
203
            // I completely don't understand it, but Firebase says occasionally mPlayPopup is null here. Recreate.
204
            float width = act.getScreenWidthInPixels();
205
            setupPlayWindow(act,width);
206
            }
205 207

  
206
        mPlayPopup.setFocusable(false);
207
        mPlayPopup.update();
208
          mPlayPopup.setFocusable(false);
209
          mPlayPopup.update();
208 210

  
209
        View popupView = mPlayPopup.getContentView();
210
        popupView.setSystemUiVisibility(RubikActivity.FLAGS);
211
          View popupView = mPlayPopup.getContentView();
212
          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
211 213

  
212
        final int sizeIndex = ObjectList.getSizeIndex(mObject,mSize);
213
        final int maxLevel = ObjectList.getMaxLevel(mObject, sizeIndex);
214
        final int levelsShown = Math.min(maxLevel,LEVELS_SHOWN);
214
          final int sizeIndex = ObjectList.getSizeIndex(mObject,mSize);
215
          final int maxLevel = ObjectList.getMaxLevel(mObject, sizeIndex);
216
          final int levelsShown = Math.min(maxLevel,LEVELS_SHOWN);
215 217

  
216
        mPlayPopup.showAsDropDown(view, margin, margin);
217
        mPlayPopup.update(view, mPlayLayoutWidth, (int)(levelsShown*(mMenuItemSize+margin)+2*margin));
218
          mPlayPopup.showAsDropDown(view, margin, margin);
219
          mPlayPopup.update(view, mPlayLayoutWidth, (int)(levelsShown*(mMenuItemSize+margin)+2*margin));
218 220

  
219
        mPlayPopup.setFocusable(true);
220
        mPlayPopup.update();
221
          mPlayPopup.setFocusable(true);
222
          mPlayPopup.update();
223
          }
221 224
        }
222 225
      });
223 226
    }

Also available in: Unified diff