commit 6fad862bd13d9068043daf1ca60a71714d7aa63c
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Tue Mar 23 11:06:30 2021 +0100

    Remove some of the UI blocks:
    
    No need to block the three top dialogs - the Object, Menu and Play popups.

diff --git a/src/main/java/org/distorted/states/RubikStatePlay.java b/src/main/java/org/distorted/states/RubikStatePlay.java
index be27d79e..017ac34c 100644
--- a/src/main/java/org/distorted/states/RubikStatePlay.java
+++ b/src/main/java/org/distorted/states/RubikStatePlay.java
@@ -38,7 +38,7 @@ import org.distorted.dialogs.RubikDialogScores;
 import org.distorted.dialogs.RubikDialogTutorial;
 import org.distorted.main.R;
 import org.distorted.main.RubikActivity;
-import org.distorted.main.RubikRenderer;
+import org.distorted.main.RubikPreRender;
 import org.distorted.objects.ObjectList;
 import org.distorted.scores.RubikScores;
 
@@ -118,27 +118,24 @@ public class RubikStatePlay extends RubikStateBase
       @Override
       public void onClick(View view)
         {
-        if( act.getPreRender().canPlay() )
+        if( mObjectPopup==null )
           {
-          if( mObjectPopup==null )
-            {
-            // I completely don't understand it, but Firebase says occasionally mObjectPopup is null here. Recreate.
-            float width = act.getScreenWidthInPixels();
-            setupObjectWindow(act,width);
-            }
+          // I completely don't understand it, but Firebase says occasionally mObjectPopup is null here. Recreate.
+          float width = act.getScreenWidthInPixels();
+          setupObjectWindow(act,width);
+          }
 
-          mObjectPopup.setFocusable(false);
-          mObjectPopup.update();
+        mObjectPopup.setFocusable(false);
+        mObjectPopup.update();
 
-          View popupView = mObjectPopup.getContentView();
-          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
+        View popupView = mObjectPopup.getContentView();
+        popupView.setSystemUiVisibility(RubikActivity.FLAGS);
 
-          mObjectPopup.showAsDropDown(view, margin, margin);
-          mObjectPopup.update(view, mObjectSize*mColCount, mObjectSize*mRowCount);
+        mObjectPopup.showAsDropDown(view, margin, margin);
+        mObjectPopup.update(view, mObjectSize*mColCount, mObjectSize*mRowCount);
 
-          mObjectPopup.setFocusable(true);
-          mObjectPopup.update();
-          }
+        mObjectPopup.setFocusable(true);
+        mObjectPopup.update();
         }
       });
     }
@@ -155,31 +152,27 @@ public class RubikStatePlay extends RubikStateBase
       @Override
       public void onClick(View view)
         {
-        if( act.getPreRender().canPlay() )
+        if( mPlayPopup==null )
           {
-          if( mPlayPopup==null )
-            {
-            // I completely don't understand it, but Firebase says occasionally mPlayPopup is null here. Recreate.
-            float width = act.getScreenWidthInPixels();
-            setupPlayWindow(act,width);
-            }
-
-          mPlayPopup.setFocusable(false);
-          mPlayPopup.update();
+          // I completely don't understand it, but Firebase says occasionally mPlayPopup is null here. Recreate.
+          float width = act.getScreenWidthInPixels();
+          setupPlayWindow(act,width);
+          }
 
-          View popupView = mPlayPopup.getContentView();
-          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
+        mPlayPopup.setFocusable(false);
+        mPlayPopup.update();
 
-          final int sizeIndex = ObjectList.getSizeIndex(mObject,mSize);
-          final int maxLevel = ObjectList.getMaxLevel(mObject, sizeIndex);
-          final int levelsShown = Math.min(maxLevel,LEVELS_SHOWN);
+        View popupView = mPlayPopup.getContentView();
+        popupView.setSystemUiVisibility(RubikActivity.FLAGS);
 
-          mPlayPopup.showAsDropDown(view, margin, margin);
-          mPlayPopup.update(view, mPlayLayoutWidth, (int)(levelsShown*(mMenuItemSize+margin)+3*margin+mMenuItemSize*(LAST_BUTTON-1.0f)));
+        final int sizeIndex = ObjectList.getSizeIndex(mObject,mSize);
+        final int maxLevel = ObjectList.getMaxLevel(mObject, sizeIndex);
+        final int levelsShown = Math.min(maxLevel,LEVELS_SHOWN);
 
-          mPlayPopup.setFocusable(true);
-          mPlayPopup.update();
-          }
+        mPlayPopup.showAsDropDown(view, margin, margin);
+        mPlayPopup.update(view, mPlayLayoutWidth, (int)(levelsShown*(mMenuItemSize+margin)+3*margin+mMenuItemSize*(LAST_BUTTON-1.0f)));
+        mPlayPopup.setFocusable(true);
+        mPlayPopup.update();
         }
       });
     }
@@ -197,27 +190,23 @@ public class RubikStatePlay extends RubikStateBase
       @Override
       public void onClick(View view)
         {
-        if( act.getPreRender().canPlay() )
+        if( mMenuPopup==null )
           {
-          if( mMenuPopup==null )
-            {
-            // I completely don't understand it, but Firebase says occasionally mMenuPopup is null here. Recreate.
-            float width = act.getScreenWidthInPixels();
-            setupMenuWindow(act,width);
-            }
-
-          mMenuPopup.setFocusable(false);
-          mMenuPopup.update();
+          // I completely don't understand it, but Firebase says occasionally mMenuPopup is null here. Recreate.
+          float width = act.getScreenWidthInPixels();
+          setupMenuWindow(act,width);
+          }
 
-          View popupView = mMenuPopup.getContentView();
-          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
+        mMenuPopup.setFocusable(false);
+        mMenuPopup.update();
 
-          mMenuPopup.showAsDropDown(view, (int)(-width/12), margin);
-          mMenuPopup.update(view, mMenuLayoutWidth, mMenuLayoutHeight);
+        View popupView = mMenuPopup.getContentView();
+        popupView.setSystemUiVisibility(RubikActivity.FLAGS);
 
-          mMenuPopup.setFocusable(true);
-          mMenuPopup.update();
-          }
+        mMenuPopup.showAsDropDown(view, (int)(-width/12), margin);
+        mMenuPopup.update(view, mMenuLayoutWidth, mMenuLayoutHeight);
+        mMenuPopup.setFocusable(true);
+        mMenuPopup.update();
         }
       });
     }
@@ -542,9 +531,14 @@ public class RubikStatePlay extends RubikStateBase
         @Override
         public void onClick(View v)
           {
-          mPlayPopup.dismiss();
-          mLevelValue = scrambles;
-          act.getPreRender().scrambleObject(mLevelValue);
+          RubikPreRender pre = act.getPreRender();
+
+          if( pre.canPlay() )
+            {
+            mPlayPopup.dismiss();
+            mLevelValue = scrambles;
+            pre.scrambleObject(mLevelValue);
+            }
           }
         });
 
