commit c5b4af4ab9e471050a68ed68a6ea3d6205d701fb
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Sat Mar 27 11:27:23 2021 +0100

    Fix the 6fad862b commit and remove the UI block in a proper way (i.e. the problem was that popping up the Object, Play or Menu windows was impossible while the 'WIN' glow was active)

diff --git a/src/main/java/org/distorted/main/RubikPreRender.java b/src/main/java/org/distorted/main/RubikPreRender.java
index 65e0ff20..2a5f9f07 100644
--- a/src/main/java/org/distorted/main/RubikPreRender.java
+++ b/src/main/java/org/distorted/main/RubikPreRender.java
@@ -189,12 +189,13 @@ public class RubikPreRender implements EffectController
         }
 
       mCanRotate = true;
+      mCanPlay   = true;
       doEffectNow( BaseEffect.Type.WIN );
       }
     else
       {
       mCanRotate = true;
-      mCanPlay = true;
+      mCanPlay   = true;
       }
 
     mIsSolved = solved;
diff --git a/src/main/java/org/distorted/states/RubikStatePlay.java b/src/main/java/org/distorted/states/RubikStatePlay.java
index 017ac34c..ca60cd6a 100644
--- a/src/main/java/org/distorted/states/RubikStatePlay.java
+++ b/src/main/java/org/distorted/states/RubikStatePlay.java
@@ -118,24 +118,27 @@ public class RubikStatePlay extends RubikStateBase
       @Override
       public void onClick(View view)
         {
-        if( mObjectPopup==null )
+        if( act.getPreRender().canPlay() )
           {
-          // I completely don't understand it, but Firebase says occasionally mObjectPopup is null here. Recreate.
-          float width = act.getScreenWidthInPixels();
-          setupObjectWindow(act,width);
-          }
+          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);
+            }
 
-        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();
+          }
         }
       });
     }
@@ -152,27 +155,30 @@ public class RubikStatePlay extends RubikStateBase
       @Override
       public void onClick(View view)
         {
-        if( mPlayPopup==null )
+        if( act.getPreRender().canPlay() )
           {
-          // I completely don't understand it, but Firebase says occasionally mPlayPopup is null here. Recreate.
-          float width = act.getScreenWidthInPixels();
-          setupPlayWindow(act,width);
-          }
+          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();
+          mPlayPopup.setFocusable(false);
+          mPlayPopup.update();
 
-        View popupView = mPlayPopup.getContentView();
-        popupView.setSystemUiVisibility(RubikActivity.FLAGS);
+          View popupView = mPlayPopup.getContentView();
+          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
 
-        final int sizeIndex = ObjectList.getSizeIndex(mObject,mSize);
-        final int maxLevel = ObjectList.getMaxLevel(mObject, sizeIndex);
-        final int levelsShown = Math.min(maxLevel,LEVELS_SHOWN);
+          final int sizeIndex = ObjectList.getSizeIndex(mObject,mSize);
+          final int maxLevel = ObjectList.getMaxLevel(mObject, sizeIndex);
+          final int levelsShown = Math.min(maxLevel,LEVELS_SHOWN);
 
-        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();
+          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();
+          }
         }
       });
     }
@@ -190,23 +196,26 @@ public class RubikStatePlay extends RubikStateBase
       @Override
       public void onClick(View view)
         {
-        if( mMenuPopup==null )
+        if( act.getPreRender().canPlay() )
           {
-          // I completely don't understand it, but Firebase says occasionally mMenuPopup is null here. Recreate.
-          float width = act.getScreenWidthInPixels();
-          setupMenuWindow(act,width);
-          }
+          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();
+          mMenuPopup.setFocusable(false);
+          mMenuPopup.update();
 
-        View popupView = mMenuPopup.getContentView();
-        popupView.setSystemUiVisibility(RubikActivity.FLAGS);
+          View popupView = mMenuPopup.getContentView();
+          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
 
-        mMenuPopup.showAsDropDown(view, (int)(-width/12), margin);
-        mMenuPopup.update(view, mMenuLayoutWidth, mMenuLayoutHeight);
-        mMenuPopup.setFocusable(true);
-        mMenuPopup.update();
+          mMenuPopup.showAsDropDown(view, (int)(-width/12), margin);
+          mMenuPopup.update(view, mMenuLayoutWidth, mMenuLayoutHeight);
+          mMenuPopup.setFocusable(true);
+          mMenuPopup.update();
+          }
         }
       });
     }
