commit cc8ab8e33b1a8f15d3ca79332c49fd61f14d53bd
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Fri Jul 1 13:21:52 2022 +0200

    Progress witth new UI.

diff --git a/src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java b/src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java
index 80e56864..9d8cad78 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java
@@ -234,7 +234,7 @@ public class RubikDialogUpdateView implements RubikNetwork.Downloadee
         if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "3");
 
         RubikScreenPlay play = (RubikScreenPlay)ScreenList.PLAY.getScreenClass();
-        play.recreatePopup();
+        play.recreateListOfObjects();
 
         if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "4");
 
diff --git a/src/main/java/org/distorted/main/RubikObjectLibInterface.java b/src/main/java/org/distorted/main/RubikObjectLibInterface.java
index 111de7af..1f7b66b5 100644
--- a/src/main/java/org/distorted/main/RubikObjectLibInterface.java
+++ b/src/main/java/org/distorted/main/RubikObjectLibInterface.java
@@ -235,7 +235,7 @@ public class RubikObjectLibInterface implements ObjectLibInterface
     {
     RubikScreenPlay play = (RubikScreenPlay) ScreenList.PLAY.getScreenClass();
 
-    if( play.shouldReactToEndOfScrambling() )
+   // if( play.shouldReactToEndOfScrambling() )
       {
       RubikActivity act = mAct.get();
       RubikScores.getInstance().incrementNumPlays();
diff --git a/src/main/java/org/distorted/objects/RubikObjectList.java b/src/main/java/org/distorted/objects/RubikObjectList.java
index 3475e6df..035d40ca 100644
--- a/src/main/java/org/distorted/objects/RubikObjectList.java
+++ b/src/main/java/org/distorted/objects/RubikObjectList.java
@@ -400,8 +400,6 @@ public class RubikObjectList
     if( mObject!=ordinal )
       {
       mObject = ordinal;
-      RubikScreenPlay play = (RubikScreenPlay) ScreenList.PLAY.getScreenClass();
-      play.setCurrObject(act);
       return true;
       }
 
diff --git a/src/main/java/org/distorted/screens/RubikScreenDetails.java b/src/main/java/org/distorted/screens/RubikScreenDetails.java
deleted file mode 100644
index 87050771..00000000
--- a/src/main/java/org/distorted/screens/RubikScreenDetails.java
+++ /dev/null
@@ -1,759 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2020 Leszek Koltunski                                                               //
-//                                                                                               //
-// This file is part of Magic Cube.                                                              //
-//                                                                                               //
-// Magic Cube is free software: you can redistribute it and/or modify                            //
-// it under the terms of the GNU General Public License as published by                          //
-// the Free Software Foundation, either version 2 of the License, or                             //
-// (at your option) any later version.                                                           //
-//                                                                                               //
-// Magic Cube is distributed in the hope that it will be useful,                                 //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
-// GNU General Public License for more details.                                                  //
-//                                                                                               //
-// You should have received a copy of the GNU General Public License                             //
-// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-package org.distorted.screens;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.content.res.Resources;
-import android.graphics.drawable.BitmapDrawable;
-import android.os.Build;
-import android.os.Bundle;
-import android.util.TypedValue;
-import android.view.Gravity;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.Button;
-import android.widget.GridLayout;
-import android.widget.ImageButton;
-import android.widget.LinearLayout;
-import android.widget.PopupWindow;
-import android.widget.RelativeLayout;
-import android.widget.TextView;
-
-import org.distorted.dialogs.RubikDialogAbout;
-import org.distorted.dialogs.RubikDialogPattern;
-import org.distorted.dialogs.RubikDialogScores;
-import org.distorted.dialogs.RubikDialogTutorial;
-import org.distorted.dialogs.RubikDialogUpdates;
-import org.distorted.external.RubikNetwork;
-import org.distorted.external.RubikScores;
-import org.distorted.external.RubikUpdates;
-import org.distorted.helpers.TransparentButton;
-import org.distorted.helpers.TransparentImageButton;
-import org.distorted.main.R;
-import org.distorted.main.RubikActivity;
-import org.distorted.objectlib.main.ObjectControl;
-import org.distorted.objects.RubikObject;
-import org.distorted.objects.RubikObjectList;
-
-import java.lang.ref.WeakReference;
-
-import static android.view.View.inflate;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-public class RubikScreenDetails extends RubikScreenBase implements RubikNetwork.Updatee
-  {
-  public static final int NUM_COLUMNS  = 5;
-  public static final int LEVELS_SHOWN = 10;
-
-  private static final int[] BUTTON_LABELS = { R.string.scores,
-                                               R.string.patterns,
-                                               R.string.solver,
-                                               R.string.tutorials,
-                                               R.string.bandaged,
-                                               R.string.about };
-  private static final int NUM_BUTTONS = BUTTON_LABELS.length;
-
-  private static final float LAST_BUTTON = 1.5f;
-  private static final int[] mLocation = new int[2];
-
-  private TransparentImageButton mObjButton, mMenuButton, mSolveButton, mScrambleButton;
-  private TransparentButton mPlayButton;
-  private PopupWindow mObjectPopup, mMenuPopup, mPlayPopup;
-  private LinearLayout mPlayLayout;
-  private TextView mBubbleUpdates;
-  private int mObjectSize, mMenuLayoutWidth, mMenuLayoutHeight, mPlayLayoutWidth;
-  private int mLevelValue;
-  private float mButtonSize, mMenuItemSize, mMenuTextSize;
-  private int mColCount, mRowCount, mMaxRowCount;
-  private int mUpperBarHeight;
-  private boolean mShouldReactToEndOfScrambling;
-  private int mBottomHeight;
-  private float mScreenWidth;
-  private WeakReference<RubikActivity> mWeakAct;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  void leaveScreen(RubikActivity act)
-    {
-
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  void enterScreen(final RubikActivity act)
-    {
-    mWeakAct = new WeakReference<>(act);
-    int numObjects = RubikObjectList.getNumObjects();
-    mScreenWidth = act.getScreenWidthInPixels();
-    mUpperBarHeight = act.getHeightUpperBar();
-
-    mMenuTextSize = mScreenWidth*RubikActivity.MENU_MED_TEXT_SIZE;
-    mButtonSize   = mScreenWidth*RubikActivity.BUTTON_TEXT_SIZE;
-    mMenuItemSize = mScreenWidth*RubikActivity.MENU_ITEM_SIZE;
-
-    mRowCount = (numObjects + NUM_COLUMNS-1) / NUM_COLUMNS;
-    mColCount = NUM_COLUMNS;
-
-    // TOP ////////////////////////////
-    LinearLayout layoutTop = act.findViewById(R.id.upperBar);
-    layoutTop.removeAllViews();
-
-    setupObjectButton(act,mScreenWidth);
-    layoutTop.addView(mObjButton);
-
-    setupMenuButton(act,mScreenWidth);
-    layoutTop.addView(mMenuButton);
-
-    setupPlayButton(act,mScreenWidth);
-    layoutTop.addView(mPlayButton);
-
-    setupSolveButton(act);
-    setupScrambleButton(act);
-    createBottomPane(act,mSolveButton,mScrambleButton);
-    }
-
-//////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setupObjectButton(final RubikActivity act, final float width)
-    {
-    final int margin  = (int)(width*RubikActivity.SMALL_MARGIN);
-    final int lMargin = (int)(width*RubikActivity.LARGE_MARGIN);
-    final int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_menu,R.drawable.ui_medium_cube_menu, R.drawable.ui_big_cube_menu, R.drawable.ui_huge_cube_menu);
-    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
-    mObjButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params);
-
-    mObjButton.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View view)
-        {
-        if( mObjectPopup==null )
-          {
-          float width = act.getScreenWidthInPixels();
-          float height= act.getScreenHeightInPixels();
-          setupObjectWindow(act,width,height);
-          }
-
-        if( act.getControl().isUINotBlocked())
-          {
-          int rowCount = Math.min(mMaxRowCount,mRowCount);
-          View popupView = mObjectPopup.getContentView();
-          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
-          displayPopup(act,view,mObjectPopup,mObjectSize*mColCount,mObjectSize*rowCount+mBottomHeight+2*lMargin+5*margin,margin,margin);
-          }
-        }
-      });
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setupPlayButton(final RubikActivity act, final float width)
-    {
-    final int margin = (int)(width*RubikActivity.SMALL_MARGIN);
-
-    mPlayButton = new TransparentButton(act, R.string.play, mButtonSize);
-
-    mPlayButton.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View view)
-        {
-        if( mPlayPopup==null )
-          {
-          float width = act.getScreenWidthInPixels();
-          setupPlayWindow(act,width);
-          }
-
-        if( act.getControl().isUINotBlocked())
-          {
-          adjustSolvedIcons();
-          float height= act.getScreenHeightInPixels();
-          final int maxHeight= (int)(0.9f*(height-mUpperBarHeight) );
-          View popupView = mPlayPopup.getContentView();
-          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
-          final int object  = RubikObjectList.getCurrObject();
-          final int dbLevel = RubikObjectList.getDBLevel(object);
-          final int levelsShown = Math.min(dbLevel,LEVELS_SHOWN);
-          final int popupHeight = (int)(levelsShown*(mMenuItemSize+margin)+3*margin+mMenuItemSize*(LAST_BUTTON-1.0f));
-          final int realHeight = Math.min(popupHeight,maxHeight);
-          displayPopup(act,view,mPlayPopup,mPlayLayoutWidth,realHeight,margin,margin);
-          }
-        }
-      });
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setupMenuButton(final RubikActivity act, final float width)
-    {
-    final int margin = (int)(width*RubikActivity.SMALL_MARGIN);
-    final int icon = RubikActivity.getDrawable(R.drawable.ui_small_menu,R.drawable.ui_medium_menu, R.drawable.ui_big_menu, R.drawable.ui_huge_menu);
-    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
-    mMenuButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params);
-
-    mMenuButton.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View view)
-        {
-        if( mMenuPopup==null )
-          {
-          float width = act.getScreenWidthInPixels();
-          setupMenuWindow(act,width);
-          }
-
-        if( act.getControl().isUINotBlocked())
-          {
-          View popupView = mMenuPopup.getContentView();
-          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
-          displayPopup(act,view,mMenuPopup,mMenuLayoutWidth,mMenuLayoutHeight,(int)(-width/12),margin);
-          }
-        }
-      });
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setupObjectWindow(final RubikActivity act, final float width, final float height)
-    {
-    int cubeWidth = (int)(width/9);
-    int margin = (int)(width*RubikActivity.LARGE_MARGIN);
-    mObjectSize = (int)(cubeWidth + 2*margin + 0.5f);
-    mMaxRowCount = (int)((height-1.8f*mUpperBarHeight)/mObjectSize);
-
-    LinearLayout view = (LinearLayout)inflate( act, R.layout.popup_object, null);
-    GridLayout objectGrid = view.findViewById(R.id.objectGrid);
-
-    GridLayout.Spec[] rowSpecs = new GridLayout.Spec[mRowCount];
-    GridLayout.Spec[] colSpecs = new GridLayout.Spec[mColCount];
-
-    objectGrid.setColumnCount(mColCount);
-    objectGrid.setRowCount(mRowCount);
-
-    RelativeLayout bottomLayout = view.findViewById(R.id.bottomLayout);
-    setupBottomLayout(act,bottomLayout);
-
-    mObjectPopup = new PopupWindow(act);
-    mObjectPopup.setFocusable(true);
-    mObjectPopup.setContentView(view);
-
-    int[] nextInRow = new int[mRowCount];
-
-    for(int row=0; row<mRowCount; row++)
-      {
-      rowSpecs[row] = GridLayout.spec(row);
-      nextInRow[row]= 0;
-      }
-    for(int col=0; col<mColCount; col++)
-      {
-      colSpecs[col] = GridLayout.spec(col);
-      }
-
-    int numObjects = RubikObjectList.getNumObjects();
-
-    for(int object=0; object<numObjects; object++)
-      {
-      final int ordinal = object;
-      final RubikObject rObject = RubikObjectList.getObject(object);
-      int row = object/NUM_COLUMNS;
-      ImageButton button = new ImageButton(act);
-      if( rObject!=null ) rObject.setIconTo(act,button);
-
-      button.setOnClickListener( new View.OnClickListener()
-        {
-        @Override
-        public void onClick(View v)
-          {
-          if( act.getControl().isUINotBlocked() && ScreenList.getCurrentScreen()== ScreenList.PLAY )
-            {
-            RubikObjectList.setCurrObject(act,ordinal);
-            act.changeObject(ordinal,true);
-            if( mPlayLayout!=null ) adjustLevels(act);
-            mMovesController.clearMoves(act);
-            }
-
-          if( mObjectPopup!=null ) mObjectPopup.dismiss();
-          }
-        });
-
-      GridLayout.LayoutParams params = new GridLayout.LayoutParams(rowSpecs[row],colSpecs[nextInRow[row]]);
-      params.bottomMargin = margin;
-      params.topMargin    = margin;
-      params.leftMargin   = margin;
-      params.rightMargin  = margin;
-
-      params.width = cubeWidth;
-      params.height= cubeWidth;
-
-      nextInRow[row]++;
-
-      objectGrid.addView(button, params);
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setupBottomLayout(final RubikActivity act, final RelativeLayout layout)
-    {
-    int iconT = RubikActivity.getDrawable(R.drawable.ui_small_tutorial,R.drawable.ui_medium_tutorial, R.drawable.ui_big_tutorial, R.drawable.ui_huge_tutorial);
-    int iconD = RubikActivity.getDrawable(R.drawable.ui_small_download,R.drawable.ui_medium_download, R.drawable.ui_big_download, R.drawable.ui_huge_download);
-    int iconI = RubikActivity.getDrawable(R.drawable.ui_small_info,R.drawable.ui_medium_info, R.drawable.ui_big_info, R.drawable.ui_huge_info);
-
-    ImageButton buttonTut = layout.findViewById(R.id.buttonTut);
-    ImageButton buttonDow = layout.findViewById(R.id.buttonDow);
-    ImageButton buttonInf = layout.findViewById(R.id.buttonInf);
-
-    buttonTut.setImageResource(iconT);
-    buttonDow.setImageResource(iconD);
-    buttonInf.setImageResource(iconI);
-
-    Resources res = act.getResources();
-    BitmapDrawable bd = (BitmapDrawable)res.getDrawable(iconI);
-    mBottomHeight = bd.getIntrinsicHeight();
-
-    TypedValue outValue = new TypedValue();
-    act.getTheme().resolveAttribute(android.R.attr.selectableItemBackgroundBorderless, outValue, true);
-    buttonTut.setBackgroundResource(outValue.resourceId);
-    buttonDow.setBackgroundResource(outValue.resourceId);
-    buttonInf.setBackgroundResource(outValue.resourceId);
-
-    buttonTut.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View v)
-        {
-        if( mObjectPopup!=null ) mObjectPopup.dismiss();
-        RubikDialogTutorial tDiag = new RubikDialogTutorial();
-        tDiag.show( act.getSupportFragmentManager(), RubikDialogTutorial.getDialogTag() );
-        }
-      });
-
-    buttonDow.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View v)
-        {
-        if( mObjectPopup!=null ) mObjectPopup.dismiss();
-        RubikDialogUpdates uDiag = new RubikDialogUpdates();
-        uDiag.show( act.getSupportFragmentManager(), RubikDialogUpdates.getDialogTag() );
-        }
-      });
-
-    buttonInf.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View v)
-        {
-        if( mObjectPopup!=null ) mObjectPopup.dismiss();
-        int currObject = RubikObjectList.getCurrObject();
-        act.switchConfig(currObject);
-        }
-      });
-
-    mBubbleUpdates = layout.findViewById(R.id.bubbleUpdates);
-    mBubbleUpdates.setVisibility(View.INVISIBLE);
-
-    RubikNetwork network = RubikNetwork.getInstance();
-    network.signUpForUpdates(this);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setupMenuWindow(final RubikActivity act, final float width)
-    {
-    LayoutInflater layoutInflater = (LayoutInflater)act.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-    final View layout = layoutInflater.inflate(R.layout.popup_menu, null);
-    LinearLayout menuLayout = layout.findViewById(R.id.menuGrid);
-
-    mMenuPopup = new PopupWindow(act);
-    mMenuPopup.setContentView(layout);
-    mMenuPopup.setFocusable(true);
-    int margin  = (int)(width*RubikActivity.SMALL_MARGIN);
-    int padding = (int)(width*RubikActivity.PADDING);
-
-    mMenuLayoutWidth = (int)(width/2);
-    mMenuLayoutHeight= (int)(2*margin + NUM_BUTTONS*(mMenuItemSize+margin));
-
-    LinearLayout.LayoutParams p = new LinearLayout.LayoutParams( mMenuLayoutWidth - 2*padding, (int)mMenuItemSize);
-
-    for(int i=0; i<NUM_BUTTONS; i++)
-      {
-      final int but = i;
-      Button button = new Button(act);
-      button.setLayoutParams(p);
-      button.setText(BUTTON_LABELS[i]);
-      button.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
-
-      button.setOnClickListener( new View.OnClickListener()
-        {
-        @Override
-        public void onClick(View v)
-          {
-          mMenuPopup.dismiss();
-          MenuAction(act,but);
-          }
-        });
-
-      menuLayout.addView(button);
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setupPlayWindow(final RubikActivity act, final float width)
-    {
-    LayoutInflater layoutInflater = (LayoutInflater)act.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-    final View layout = layoutInflater.inflate(R.layout.popup_play, null);
-    mPlayLayout = layout.findViewById(R.id.playGrid);
-
-    mPlayLayoutWidth = (int)(width*0.4f);
-
-    mPlayPopup = new PopupWindow(act);
-    mPlayPopup.setContentView(layout);
-    mPlayPopup.setFocusable(true);
-
-    adjustLevels(act);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void MenuAction(RubikActivity act, int button)
-    {
-    switch(button)
-      {
-      case 0: Bundle sBundle = new Bundle();
-              int currObject = RubikObjectList.getCurrObject();
-              sBundle.putInt("tab", currObject );
-              sBundle.putBoolean("submitting", false);
-              RubikDialogScores scores = new RubikDialogScores();
-              scores.setArguments(sBundle);
-              scores.show(act.getSupportFragmentManager(), null);
-              break;
-      case 1: RubikDialogPattern pDiag = new RubikDialogPattern();
-              pDiag.show( act.getSupportFragmentManager(), RubikDialogPattern.getDialogTag() );
-              break;
-      case 2: ScreenList.switchScreen(act, ScreenList.SVER);
-              break;
-      case 3: RubikDialogTutorial tDiag = new RubikDialogTutorial();
-              tDiag.show( act.getSupportFragmentManager(), RubikDialogTutorial.getDialogTag() );
-              break;
-      case 4: act.switchToBandagedCreator();
-              break;
-      case 5: RubikDialogAbout aDiag = new RubikDialogAbout();
-              aDiag.show(act.getSupportFragmentManager(), null);
-              break;
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  void setupSolveButton(final RubikActivity act)
-    {
-    int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_solve_new,R.drawable.ui_medium_cube_solve_new, R.drawable.ui_big_cube_solve_new, R.drawable.ui_huge_cube_solve_new);
-    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
-    mSolveButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_END,params);
-
-    mSolveButton.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View v)
-        {
-        act.getControl().solveObject();
-        mMovesController.clearMoves(act);
-        }
-      });
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setupScrambleButton(final RubikActivity act)
-    {
-    int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_scramble_new,R.drawable.ui_medium_cube_scramble_new, R.drawable.ui_big_cube_scramble_new, R.drawable.ui_huge_cube_scramble_new);
-    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
-    mScrambleButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_START, params);
-
-    mScrambleButton.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View v)
-        {
-        int currObject = RubikObjectList.getCurrObject();
-        RubikObject object = RubikObjectList.getObject(currObject);
-        int numScrambles = object==null ? 0 : object.getNumScramble();
-        mShouldReactToEndOfScrambling = false;
-        act.getControl().scrambleObject(numScrambles);
-        }
-      });
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// This is necessary! Otherwise the ObjectPopup will not be re-created next time and we will still
-// hold a reference to the old instance of the RubikActivity class (because setupObjectWindow is not
-// going to be called)
-// An reference to the old instance of RubikActivity will cause all sorts of strange issues.
-
-  public void savePreferences(SharedPreferences.Editor editor)
-    {
-    editor.putInt("play_LevelValue", mLevelValue );
-
-    if( mObjectPopup!=null )
-      {
-      mObjectPopup.dismiss();
-      mObjectPopup = null;
-      }
-
-    if( mMenuPopup!=null )
-      {
-      mMenuPopup.dismiss();
-      mMenuPopup = null;
-      }
-
-    if( mPlayPopup!=null )
-      {
-      mPlayPopup.dismiss();
-      mPlayPopup = null;
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void restorePreferences(SharedPreferences preferences)
-    {
-    mLevelValue = preferences.getInt("play_LevelValue", 0);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void setCurrObject(RubikActivity act)
-    {
-    if( mPlayLayout!=null ) adjustLevels(act);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// work around lame bugs in Android's version <= 10 pop-up and split-screen modes
-
-  private void displayPopup(RubikActivity act, View view, PopupWindow window, int w, int h, int xoff, int yoff)
-    {
-    View topLayout = act.findViewById(R.id.relativeLayout);
-    boolean isFullScreen;
-
-    if( topLayout!=null )
-      {
-      topLayout.getLocationOnScreen(mLocation);
-      isFullScreen = (mLocation[1]==0);
-      }
-    else
-      {
-      isFullScreen = true;
-      }
-
-    try
-      {
-      // if on Android 11 or we are fullscreen
-      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R || isFullScreen )
-        {
-        window.showAsDropDown(view, xoff, yoff, Gravity.CENTER);
-        window.update(view, w, h);
-        }
-      else  // Android 10 or below in pop-up mode or split-screen mode
-        {
-        view.getLocationOnScreen(mLocation);
-        int width  = view.getWidth();
-        int height = view.getHeight();
-        int x = mLocation[0]+(width-w)/2;
-        int y = mLocation[1]+height+yoff;
-
-        window.showAsDropDown(view);
-        window.update(x,y,w,h);
-        }
-      }
-    catch( IllegalArgumentException iae )
-      {
-      // ignore, this means window is 'not attached to window manager' -
-      // which most probably is because we are already exiting the app.
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void adjustSolvedIcons()
-    {
-    if( mPlayLayout!=null )
-      {
-      int currObject = RubikObjectList.getCurrObject();
-      int dbLevel = RubikObjectList.getDBLevel(currObject);
-      int numLevel= Math.min(dbLevel, LEVELS_SHOWN);
-      RubikScores scores = RubikScores.getInstance();
-
-      for(int i=0; i<numLevel; i++)
-        {
-        int level = i<numLevel-1 ? i+1 : dbLevel;
-        Button button = (Button)mPlayLayout.getChildAt(i);
-        int icon = scores.isSolved(currObject, level-1) ? R.drawable.ui_solved : R.drawable.ui_notsolved;
-        button.setCompoundDrawablesWithIntrinsicBounds(icon,0,0,0);
-        }
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void adjustLevels(final RubikActivity act)
-    {
-    int currObject = RubikObjectList.getCurrObject();
-    int dbLevel = RubikObjectList.getDBLevel(currObject);
-    RubikObject object = RubikObjectList.getObject(currObject);
-    int numScrambles = object==null ? 0 : object.getNumScramble();
-    int numLevel = Math.min(dbLevel, LEVELS_SHOWN);
-    String[] levels = new String[numLevel];
-
-    for(int i=0; i<numLevel-1; i++)
-      {
-      levels[i] = act.getString(R.string.lv_placeholder,i+1);
-      }
-
-    if( numLevel>0 )
-      {
-      levels[numLevel-1] = act.getString(R.string.level_full);
-      }
-
-    if( mLevelValue>dbLevel || mLevelValue<1 ||
-       (mLevelValue<dbLevel || mLevelValue>LEVELS_SHOWN ) )
-      {
-      mLevelValue=1;
-      }
-
-    float width  = act.getScreenWidthInPixels();
-    int margin   = (int)(width*RubikActivity.SMALL_MARGIN);
-    int padding  = (int)(width*RubikActivity.PADDING);
-    int butWidth = mPlayLayoutWidth - 2*padding;
-    int butHeight= (int)mMenuItemSize;
-    int lastButH = (int)(mMenuItemSize*LAST_BUTTON) ;
-
-    LinearLayout.LayoutParams pM = new LinearLayout.LayoutParams( butWidth, butHeight );
-    pM.setMargins(margin, 0, margin, margin);
-    LinearLayout.LayoutParams pT = new LinearLayout.LayoutParams( butWidth, butHeight );
-    pT.setMargins(margin, margin, margin, margin);
-    LinearLayout.LayoutParams pB = new LinearLayout.LayoutParams( butWidth, lastButH  );
-    pB.setMargins(margin, margin, margin, 2*margin);
-
-    mPlayLayout.removeAllViews();
-
-    RubikScores scores = RubikScores.getInstance();
-
-    for(int i=0; i<numLevel; i++)
-      {
-      final int level     = i<numLevel-1 ? i+1 : dbLevel;
-      final int scrambles = i<numLevel-1 ? i+1 : numScrambles;
-      Button button = new Button(act);
-      button.setLayoutParams(i==0 ? pT : (i==numLevel-1 ? pB : pM));
-      button.setText(levels[i]);
-      button.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
-
-      int icon = scores.isSolved(currObject, level-1) ? R.drawable.ui_solved : R.drawable.ui_notsolved;
-      button.setCompoundDrawablesWithIntrinsicBounds(icon,0,0,0);
-
-      button.setOnClickListener( new View.OnClickListener()
-        {
-        @Override
-        public void onClick(View v)
-          {
-          ObjectControl control = act.getControl();
-
-          if(control.isUINotBlocked())
-            {
-            if( mPlayPopup!=null ) mPlayPopup.dismiss();
-            mLevelValue = level;
-            mShouldReactToEndOfScrambling = true;
-            control.scrambleObject(scrambles);
-            }
-          }
-        });
-
-      mPlayLayout.addView(button);
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public int getLevel()
-    {
-    return mLevelValue;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void recreatePopup()
-    {
-    mObjectPopup = null;
-
-    int numObjects = RubikObjectList.getNumObjects();
-    mRowCount = (numObjects + NUM_COLUMNS-1) / NUM_COLUMNS;
-    mColCount = NUM_COLUMNS;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public boolean shouldReactToEndOfScrambling()
-    {
-    return mShouldReactToEndOfScrambling;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void receiveUpdate(RubikUpdates updates)
-    {
-    Activity act = mWeakAct.get();
-
-    if( act!=null )
-      {
-      act.runOnUiThread(new Runnable()
-        {
-        @Override
-        public void run()
-          {
-          int num = updates.getCompletedNumber();
-
-          if( num>0 )
-            {
-            String shownNum = String.valueOf(num);
-            mBubbleUpdates.setText(shownNum);
-            mBubbleUpdates.setVisibility(View.VISIBLE);
-            int height = (int)(0.05f*mScreenWidth);
-            mBubbleUpdates.setTextSize(TypedValue.COMPLEX_UNIT_PX,height);
-            }
-         else
-            {
-            mBubbleUpdates.setVisibility(View.INVISIBLE);
-            }
-          }
-        });
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void errorUpdate()
-    {
-    android.util.Log.e("D", "Screen: Error receiving update");
-    }
-  }
diff --git a/src/main/java/org/distorted/screens/RubikScreenPlay.java b/src/main/java/org/distorted/screens/RubikScreenPlay.java
index c5041757..4fccada7 100644
--- a/src/main/java/org/distorted/screens/RubikScreenPlay.java
+++ b/src/main/java/org/distorted/screens/RubikScreenPlay.java
@@ -22,48 +22,29 @@ package org.distorted.screens;
 import java.lang.ref.WeakReference;
 
 import android.app.Activity;
-import android.content.Context;
 import android.content.SharedPreferences;
-import android.content.res.Resources;
-import android.graphics.Color;
-import android.graphics.drawable.BitmapDrawable;
-import android.os.Build;
-import android.os.Bundle;
 import android.util.TypedValue;
-import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
-import android.widget.Button;
 import android.widget.GridLayout;
 import android.widget.ImageButton;
 import android.widget.LinearLayout;
-import android.widget.PopupWindow;
 import android.widget.RelativeLayout;
 import android.widget.ScrollView;
 import android.widget.TextView;
 
-import org.distorted.config.ConfigActivity;
 import org.distorted.dialogs.RubikDialogUpdates;
 import org.distorted.external.RubikNetwork;
 import org.distorted.external.RubikUpdates;
-import org.distorted.main.RubikRenderer;
-import org.distorted.objectlib.main.ObjectControl;
 
 import org.distorted.main.R;
 import org.distorted.main.RubikActivity;
 import org.distorted.dialogs.RubikDialogAbout;
-import org.distorted.dialogs.RubikDialogPattern;
-import org.distorted.dialogs.RubikDialogScores;
-import org.distorted.dialogs.RubikDialogTutorial;
-import org.distorted.helpers.TransparentButton;
 import org.distorted.helpers.TransparentImageButton;
-import org.distorted.external.RubikScores;
 import org.distorted.objects.RubikObject;
 import org.distorted.objects.RubikObjectList;
 
-import static android.view.View.inflate;
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork.Updatee
@@ -71,23 +52,12 @@ public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork
   public static final int NUM_COLUMNS  = 5;
   public static final int LEVELS_SHOWN = 10;
 
-  private static final float LAST_BUTTON = 1.5f;
-  private static final int[] mLocation = new int[2];
-
   private TransparentImageButton mAboutButton, mExitButton;
-  private ImageButton mUpdatesButton;
- // private PopupWindow mObjectPopup, mMenuPopup, mPlayPopup;
-  private LinearLayout mPlayLayout;
   private TextView mBubbleUpdates;
   private int mCurrentBubbleNumber;
-  private int mObjectSize, mMenuLayoutWidth, mMenuLayoutHeight, mPlayLayoutWidth;
   private int mLevelValue;
-  private float mButtonSize, mMenuItemSize, mMenuTextSize;
-  private int mColCount, mRowCount, mMaxRowCount;
-  private int mUpperBarHeight, mLowerBarHeight;
-  private boolean mShouldReactToEndOfScrambling;
-  private int mBottomHeight;
-  private float mScreenWidth, mScreenHeight;
+  private int mColCount, mRowCount;
+  private float mScreenWidth;
   private WeakReference<RubikActivity> mWeakAct;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -107,13 +77,9 @@ public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork
     mWeakAct = new WeakReference<>(act);
     int numObjects = RubikObjectList.getNumObjects();
     mScreenWidth = act.getScreenWidthInPixels();
-    mScreenHeight= act.getScreenHeightInPixels();
-    mUpperBarHeight = act.getHeightUpperBar();
-    mLowerBarHeight = act.getHeightLowerBar();
-
-    mMenuTextSize = mScreenWidth*RubikActivity.MENU_MED_TEXT_SIZE;
-    mButtonSize   = mScreenWidth*RubikActivity.BUTTON_TEXT_SIZE;
-    mMenuItemSize = mScreenWidth*RubikActivity.MENU_ITEM_SIZE;
+    int screenHeight= act.getScreenHeightInPixels();
+    int upperBarHeight = act.getHeightUpperBar();
+    int lowerBarHeight = act.getHeightLowerBar();
 
     mRowCount = (numObjects + NUM_COLUMNS-1) / NUM_COLUMNS;
     mColCount = NUM_COLUMNS;
@@ -161,13 +127,13 @@ public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork
     hiddenView.removeAllViews();
 
     ViewGroup.LayoutParams paramsMid = hiddenView.getLayoutParams();
-    paramsMid.height = (int)(mScreenHeight-mUpperBarHeight-mLowerBarHeight);
+    paramsMid.height = (int)(screenHeight-upperBarHeight-lowerBarHeight);
     hiddenView.setLayoutParams(paramsMid);
 
     ScrollView scroll = (ScrollView)inflater.inflate(R.layout.popup_object_simple, null);
     hiddenView.addView(scroll);
 
-    setupScrollingObjects(act,scroll,mScreenWidth,mScreenHeight);
+    setupScrollingObjects(act,scroll,mScreenWidth);
     }
 
 //////////////////////////////////////////////////////////////////////////////////////////////////
@@ -214,11 +180,11 @@ public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork
     TypedValue value = new TypedValue();
     act.getTheme().resolveAttribute(android.R.attr.selectableItemBackgroundBorderless, value, true);
     final int icon = RubikActivity.getDrawable(R.drawable.ui_small_download,R.drawable.ui_medium_download, R.drawable.ui_big_download, R.drawable.ui_huge_download);
-    mUpdatesButton = relLayout.findViewById(R.id.buttonUpdates);
-    mUpdatesButton.setImageResource(icon);
-    mUpdatesButton.setBackgroundResource(value.resourceId);
+    ImageButton updatesButton = relLayout.findViewById(R.id.buttonUpdates);
+    updatesButton.setImageResource(icon);
+    updatesButton.setBackgroundResource(value.resourceId);
 
-    mUpdatesButton.setOnClickListener( new View.OnClickListener()
+    updatesButton.setOnClickListener( new View.OnClickListener()
       {
       @Override
       public void onClick(View v)
@@ -237,13 +203,10 @@ public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private void setupScrollingObjects(final RubikActivity act, final ScrollView view, final float width, final float height)
+  private void setupScrollingObjects(final RubikActivity act, final ScrollView view, final float width)
     {
-    int margin = (int)(width*RubikActivity.LARGE_MARGIN);
-    int cubeWidth = (int)(width/NUM_COLUMNS) - 2*margin;
-
-    mObjectSize = (int)(cubeWidth + 2*margin + 0.5f);
-    mMaxRowCount = (int)((height-mUpperBarHeight-mLowerBarHeight)/mObjectSize);
+    int margin   = (int)(width*RubikActivity.LARGE_MARGIN);
+    int cubeSize = (int)(width/NUM_COLUMNS) - 2*margin;
 
     GridLayout objectGrid = view.findViewById(R.id.objectGrid);
 
@@ -293,176 +256,8 @@ public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork
       params.leftMargin   = margin;
       params.rightMargin  = margin;
 
-      params.width = cubeWidth;
-      params.height= cubeWidth;
-
-      nextInRow[row]++;
-
-      objectGrid.addView(button, params);
-      }
-    }
-
-//////////////////////////////////////////////////////////////////////////////////////////////////
-/*
-  private void setupObjectButton(final RubikActivity act, final float width)
-    {
-    final int margin  = (int)(width*RubikActivity.SMALL_MARGIN);
-    final int lMargin = (int)(width*RubikActivity.LARGE_MARGIN);
-    final int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_menu,R.drawable.ui_medium_cube_menu, R.drawable.ui_big_cube_menu, R.drawable.ui_huge_cube_menu);
-    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
-    mObjButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params);
-
-    mObjButton.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View view)
-        {
-        if( mObjectPopup==null )
-          {
-          float width = act.getScreenWidthInPixels();
-          float height= act.getScreenHeightInPixels();
-          setupObjectWindow(act,width,height);
-          }
-
-        if( act.getControl().isUINotBlocked())
-          {
-          int rowCount = Math.min(mMaxRowCount,mRowCount);
-          View popupView = mObjectPopup.getContentView();
-          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
-          displayPopup(act,view,mObjectPopup,mObjectSize*mColCount,mObjectSize*rowCount+mBottomHeight+2*lMargin+5*margin,margin,margin);
-          }
-        }
-      });
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setupPlayButton(final RubikActivity act, final float width)
-    {
-    final int margin = (int)(width*RubikActivity.SMALL_MARGIN);
-
-    mPlayButton = new TransparentButton(act, R.string.play, mButtonSize);
-
-    mPlayButton.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View view)
-        {
-        if( mPlayPopup==null )
-          {
-          float width = act.getScreenWidthInPixels();
-          setupPlayWindow(act,width);
-          }
-
-        if( act.getControl().isUINotBlocked())
-          {
-          adjustSolvedIcons();
-          float height= act.getScreenHeightInPixels();
-          final int maxHeight= (int)(0.9f*(height-mUpperBarHeight) );
-          View popupView = mPlayPopup.getContentView();
-          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
-          final int object  = RubikObjectList.getCurrObject();
-          final int dbLevel = RubikObjectList.getDBLevel(object);
-          final int levelsShown = Math.min(dbLevel,LEVELS_SHOWN);
-          final int popupHeight = (int)(levelsShown*(mMenuItemSize+margin)+3*margin+mMenuItemSize*(LAST_BUTTON-1.0f));
-          final int realHeight = Math.min(popupHeight,maxHeight);
-          displayPopup(act,view,mPlayPopup,mPlayLayoutWidth,realHeight,margin,margin);
-          }
-        }
-      });
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setupMenuButton(final RubikActivity act, final float width)
-    {
-    final int margin = (int)(width*RubikActivity.SMALL_MARGIN);
-    final int icon = RubikActivity.getDrawable(R.drawable.ui_small_menu,R.drawable.ui_medium_menu, R.drawable.ui_big_menu, R.drawable.ui_huge_menu);
-    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
-    mMenuButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params);
-
-    mMenuButton.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View view)
-        {
-        if( mMenuPopup==null )
-          {
-          float width = act.getScreenWidthInPixels();
-          setupMenuWindow(act,width);
-          }
-
-        if( act.getControl().isUINotBlocked())
-          {
-          View popupView = mMenuPopup.getContentView();
-          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
-          displayPopup(act,view,mMenuPopup,mMenuLayoutWidth,mMenuLayoutHeight,(int)(-width/12),margin);
-          }
-        }
-      });
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setupObjectWindow(final RubikActivity act, final float width, final float height)
-    {
-    int cubeWidth = (int)(width/9);
-    int margin = (int)(width*RubikActivity.LARGE_MARGIN);
-    mObjectSize = (int)(cubeWidth + 2*margin + 0.5f);
-    mMaxRowCount = (int)((height-1.8f*mUpperBarHeight)/mObjectSize);
-
-    LinearLayout view = (LinearLayout)inflate( act, R.layout.popup_object, null);
-    GridLayout objectGrid = view.findViewById(R.id.objectGrid);
-
-    GridLayout.Spec[] rowSpecs = new GridLayout.Spec[mRowCount];
-    GridLayout.Spec[] colSpecs = new GridLayout.Spec[mColCount];
-
-    objectGrid.setColumnCount(mColCount);
-    objectGrid.setRowCount(mRowCount);
-
-    mObjectPopup = new PopupWindow(act);
-    mObjectPopup.setFocusable(true);
-    mObjectPopup.setContentView(view);
-
-    int[] nextInRow = new int[mRowCount];
-
-    for(int row=0; row<mRowCount; row++)
-      {
-      rowSpecs[row] = GridLayout.spec(row);
-      nextInRow[row]= 0;
-      }
-    for(int col=0; col<mColCount; col++)
-      {
-      colSpecs[col] = GridLayout.spec(col);
-      }
-
-    int numObjects = RubikObjectList.getNumObjects();
-
-    for(int object=0; object<numObjects; object++)
-      {
-      final int ordinal = object;
-      final RubikObject rObject = RubikObjectList.getObject(object);
-      int row = object/NUM_COLUMNS;
-      ImageButton button = new ImageButton(act);
-      if( rObject!=null ) rObject.setIconTo(act,button);
-
-      button.setOnClickListener( new View.OnClickListener()
-        {
-        @Override
-        public void onClick(View v)
-          {
-          // TODO
-          }
-        });
-
-      GridLayout.LayoutParams params = new GridLayout.LayoutParams(rowSpecs[row],colSpecs[nextInRow[row]]);
-      params.bottomMargin = margin;
-      params.topMargin    = margin;
-      params.leftMargin   = margin;
-      params.rightMargin  = margin;
-
-      params.width = cubeWidth;
-      params.height= cubeWidth;
+      params.width = cubeSize;
+      params.height= cubeSize;
 
       nextInRow[row]++;
 
@@ -470,201 +265,6 @@ public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork
       }
     }
 
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setupBottomLayout(final RubikActivity act, final RelativeLayout layout)
-    {
-    int iconT = RubikActivity.getDrawable(R.drawable.ui_small_tutorial,R.drawable.ui_medium_tutorial, R.drawable.ui_big_tutorial, R.drawable.ui_huge_tutorial);
-    int iconD = RubikActivity.getDrawable(R.drawable.ui_small_download,R.drawable.ui_medium_download, R.drawable.ui_big_download, R.drawable.ui_huge_download);
-    int iconI = RubikActivity.getDrawable(R.drawable.ui_small_info,R.drawable.ui_medium_info, R.drawable.ui_big_info, R.drawable.ui_huge_info);
-
-    ImageButton buttonTut = layout.findViewById(R.id.buttonTut);
-    ImageButton buttonDow = layout.findViewById(R.id.buttonDow);
-    ImageButton buttonInf = layout.findViewById(R.id.buttonInf);
-
-    buttonTut.setImageResource(iconT);
-    buttonDow.setImageResource(iconD);
-    buttonInf.setImageResource(iconI);
-
-    Resources res = act.getResources();
-    BitmapDrawable bd = (BitmapDrawable)res.getDrawable(iconI);
-    mBottomHeight = bd.getIntrinsicHeight();
-
-    TypedValue outValue = new TypedValue();
-    act.getTheme().resolveAttribute(android.R.attr.selectableItemBackgroundBorderless, outValue, true);
-    buttonTut.setBackgroundResource(outValue.resourceId);
-    buttonDow.setBackgroundResource(outValue.resourceId);
-    buttonInf.setBackgroundResource(outValue.resourceId);
-
-    buttonTut.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View v)
-        {
-        if( mObjectPopup!=null ) mObjectPopup.dismiss();
-        RubikDialogTutorial tDiag = new RubikDialogTutorial();
-        tDiag.show( act.getSupportFragmentManager(), RubikDialogTutorial.getDialogTag() );
-        }
-      });
-
-    buttonDow.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View v)
-        {
-        if( mObjectPopup!=null ) mObjectPopup.dismiss();
-        RubikDialogUpdates uDiag = new RubikDialogUpdates();
-        uDiag.show( act.getSupportFragmentManager(), RubikDialogUpdates.getDialogTag() );
-        }
-      });
-
-    buttonInf.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View v)
-        {
-        if( mObjectPopup!=null ) mObjectPopup.dismiss();
-        int currObject = RubikObjectList.getCurrObject();
-        act.switchConfig(currObject);
-        }
-      });
-
-    mBubbleUpdates = layout.findViewById(R.id.bubbleUpdates);
-    mBubbleUpdates.setVisibility(View.INVISIBLE);
-
-    RubikNetwork network = RubikNetwork.getInstance();
-    network.signUpForUpdates(this);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setupMenuWindow(final RubikActivity act, final float width)
-    {
-    LayoutInflater layoutInflater = (LayoutInflater)act.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-    final View layout = layoutInflater.inflate(R.layout.popup_menu, null);
-    LinearLayout menuLayout = layout.findViewById(R.id.menuGrid);
-
-    mMenuPopup = new PopupWindow(act);
-    mMenuPopup.setContentView(layout);
-    mMenuPopup.setFocusable(true);
-    int margin  = (int)(width*RubikActivity.SMALL_MARGIN);
-    int padding = (int)(width*RubikActivity.PADDING);
-
-    mMenuLayoutWidth = (int)(width/2);
-    mMenuLayoutHeight= (int)(2*margin + NUM_BUTTONS*(mMenuItemSize+margin));
-
-    LinearLayout.LayoutParams p = new LinearLayout.LayoutParams( mMenuLayoutWidth - 2*padding, (int)mMenuItemSize);
-
-    for(int i=0; i<NUM_BUTTONS; i++)
-      {
-      final int but = i;
-      Button button = new Button(act);
-      button.setLayoutParams(p);
-      button.setText(BUTTON_LABELS[i]);
-      button.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
-
-      button.setOnClickListener( new View.OnClickListener()
-        {
-        @Override
-        public void onClick(View v)
-          {
-          mMenuPopup.dismiss();
-          MenuAction(act,but);
-          }
-        });
-
-      menuLayout.addView(button);
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setupPlayWindow(final RubikActivity act, final float width)
-    {
-    LayoutInflater layoutInflater = (LayoutInflater)act.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-    final View layout = layoutInflater.inflate(R.layout.popup_play, null);
-    mPlayLayout = layout.findViewById(R.id.playGrid);
-
-    mPlayLayoutWidth = (int)(width*0.4f);
-
-    mPlayPopup = new PopupWindow(act);
-    mPlayPopup.setContentView(layout);
-    mPlayPopup.setFocusable(true);
-
-    adjustLevels(act);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void MenuAction(RubikActivity act, int button)
-    {
-    switch(button)
-      {
-      case 0: Bundle sBundle = new Bundle();
-              int currObject = RubikObjectList.getCurrObject();
-              sBundle.putInt("tab", currObject );
-              sBundle.putBoolean("submitting", false);
-              RubikDialogScores scores = new RubikDialogScores();
-              scores.setArguments(sBundle);
-              scores.show(act.getSupportFragmentManager(), null);
-              break;
-      case 1: RubikDialogPattern pDiag = new RubikDialogPattern();
-              pDiag.show( act.getSupportFragmentManager(), RubikDialogPattern.getDialogTag() );
-              break;
-      case 2: ScreenList.switchScreen(act, ScreenList.SVER);
-              break;
-      case 3: RubikDialogTutorial tDiag = new RubikDialogTutorial();
-              tDiag.show( act.getSupportFragmentManager(), RubikDialogTutorial.getDialogTag() );
-              break;
-      case 4: act.switchToBandagedCreator();
-              break;
-      case 5: RubikDialogAbout aDiag = new RubikDialogAbout();
-              aDiag.show(act.getSupportFragmentManager(), null);
-              break;
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  void setupSolveButton(final RubikActivity act)
-    {
-    int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_solve_new,R.drawable.ui_medium_cube_solve_new, R.drawable.ui_big_cube_solve_new, R.drawable.ui_huge_cube_solve_new);
-    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
-    mSolveButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_END,params);
-
-    mSolveButton.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View v)
-        {
-        act.getControl().solveObject();
-        mMovesController.clearMoves(act);
-        }
-      });
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setupScrambleButton(final RubikActivity act)
-    {
-    int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_scramble_new,R.drawable.ui_medium_cube_scramble_new, R.drawable.ui_big_cube_scramble_new, R.drawable.ui_huge_cube_scramble_new);
-    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
-    mScrambleButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_START, params);
-
-    mScrambleButton.setOnClickListener( new View.OnClickListener()
-      {
-      @Override
-      public void onClick(View v)
-        {
-        int currObject = RubikObjectList.getCurrObject();
-        RubikObject object = RubikObjectList.getObject(currObject);
-        int numScrambles = object==null ? 0 : object.getNumScramble();
-        mShouldReactToEndOfScrambling = false;
-        act.getControl().scrambleObject(numScrambles);
-        }
-      });
-    }
-*/
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public void savePreferences(SharedPreferences.Editor editor)
@@ -679,157 +279,6 @@ public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork
     mLevelValue = preferences.getInt("play_LevelValue", 0);
     }
 
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void setCurrObject(RubikActivity act)
-    {
-    if( mPlayLayout!=null ) adjustLevels(act);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// work around lame bugs in Android's version <= 10 pop-up and split-screen modes
-
-  private void displayPopup(RubikActivity act, View view, PopupWindow window, int w, int h, int xoff, int yoff)
-    {
-    View topLayout = act.findViewById(R.id.relativeLayout);
-    boolean isFullScreen;
-
-    if( topLayout!=null )
-      {
-      topLayout.getLocationOnScreen(mLocation);
-      isFullScreen = (mLocation[1]==0);
-      }
-    else
-      {
-      isFullScreen = true;
-      }
-
-    try
-      {
-      // if on Android 11 or we are fullscreen
-      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R || isFullScreen )
-        {
-        window.showAsDropDown(view, xoff, yoff, Gravity.CENTER);
-        window.update(view, w, h);
-        }
-      else  // Android 10 or below in pop-up mode or split-screen mode
-        {
-        view.getLocationOnScreen(mLocation);
-        int width  = view.getWidth();
-        int height = view.getHeight();
-        int x = mLocation[0]+(width-w)/2;
-        int y = mLocation[1]+height+yoff;
-
-        window.showAsDropDown(view);
-        window.update(x,y,w,h);
-        }
-      }
-    catch( IllegalArgumentException iae )
-      {
-      // ignore, this means window is 'not attached to window manager' -
-      // which most probably is because we are already exiting the app.
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void adjustSolvedIcons()
-    {
-    if( mPlayLayout!=null )
-      {
-      int currObject = RubikObjectList.getCurrObject();
-      int dbLevel = RubikObjectList.getDBLevel(currObject);
-      int numLevel= Math.min(dbLevel, LEVELS_SHOWN);
-      RubikScores scores = RubikScores.getInstance();
-
-      for(int i=0; i<numLevel; i++)
-        {
-        int level = i<numLevel-1 ? i+1 : dbLevel;
-        Button button = (Button)mPlayLayout.getChildAt(i);
-        int icon = scores.isSolved(currObject, level-1) ? R.drawable.ui_solved : R.drawable.ui_notsolved;
-        button.setCompoundDrawablesWithIntrinsicBounds(icon,0,0,0);
-        }
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void adjustLevels(final RubikActivity act)
-    {
-    int currObject = RubikObjectList.getCurrObject();
-    int dbLevel = RubikObjectList.getDBLevel(currObject);
-    RubikObject object = RubikObjectList.getObject(currObject);
-    int numScrambles = object==null ? 0 : object.getNumScramble();
-    int numLevel = Math.min(dbLevel, LEVELS_SHOWN);
-    String[] levels = new String[numLevel];
-
-    for(int i=0; i<numLevel-1; i++)
-      {
-      levels[i] = act.getString(R.string.lv_placeholder,i+1);
-      }
-
-    if( numLevel>0 )
-      {
-      levels[numLevel-1] = act.getString(R.string.level_full);
-      }
-
-    if( mLevelValue>dbLevel || mLevelValue<1 ||
-       (mLevelValue<dbLevel || mLevelValue>LEVELS_SHOWN ) )
-      {
-      mLevelValue=1;
-      }
-
-    float width  = act.getScreenWidthInPixels();
-    int margin   = (int)(width*RubikActivity.SMALL_MARGIN);
-    int padding  = (int)(width*RubikActivity.PADDING);
-    int butWidth = mPlayLayoutWidth - 2*padding;
-    int butHeight= (int)mMenuItemSize;
-    int lastButH = (int)(mMenuItemSize*LAST_BUTTON) ;
-
-    LinearLayout.LayoutParams pM = new LinearLayout.LayoutParams( butWidth, butHeight );
-    pM.setMargins(margin, 0, margin, margin);
-    LinearLayout.LayoutParams pT = new LinearLayout.LayoutParams( butWidth, butHeight );
-    pT.setMargins(margin, margin, margin, margin);
-    LinearLayout.LayoutParams pB = new LinearLayout.LayoutParams( butWidth, lastButH  );
-    pB.setMargins(margin, margin, margin, 2*margin);
-
-    mPlayLayout.removeAllViews();
-
-    RubikScores scores = RubikScores.getInstance();
-
-    for(int i=0; i<numLevel; i++)
-      {
-      final int level     = i<numLevel-1 ? i+1 : dbLevel;
-      final int scrambles = i<numLevel-1 ? i+1 : numScrambles;
-      Button button = new Button(act);
-      button.setLayoutParams(i==0 ? pT : (i==numLevel-1 ? pB : pM));
-      button.setText(levels[i]);
-      button.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
-
-      int icon = scores.isSolved(currObject, level-1) ? R.drawable.ui_solved : R.drawable.ui_notsolved;
-      button.setCompoundDrawablesWithIntrinsicBounds(icon,0,0,0);
-
-      button.setOnClickListener( new View.OnClickListener()
-        {
-        @Override
-        public void onClick(View v)
-          {
-          ObjectControl control = act.getControl();
-
-          if(control.isUINotBlocked())
-            {
-         //   if( mPlayPopup!=null ) mPlayPopup.dismiss();
-            mLevelValue = level;
-            mShouldReactToEndOfScrambling = true;
-            control.scrambleObject(scrambles);
-            }
-          }
-        });
-
-      mPlayLayout.addView(button);
-      }
-    }
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public int getLevel()
@@ -839,7 +288,7 @@ public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public void recreatePopup()
+  public void recreateListOfObjects()
     {
     int numObjects = RubikObjectList.getNumObjects();
     mRowCount = (numObjects + NUM_COLUMNS-1) / NUM_COLUMNS;
@@ -857,7 +306,7 @@ public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork
         hiddenView.removeAllViews();
         ScrollView scroll = (ScrollView)inflater.inflate(R.layout.popup_object_simple, null);
         hiddenView.addView(scroll);
-        setupScrollingObjects(act,scroll,mScreenWidth,mScreenHeight);
+        setupScrollingObjects(act,scroll,mScreenWidth);
 
         mCurrentBubbleNumber--;
         updateNumberOfNewObjects();
@@ -865,13 +314,6 @@ public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork
       });
     }
 
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public boolean shouldReactToEndOfScrambling()
-    {
-    return mShouldReactToEndOfScrambling;
-    }
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   private void updateNumberOfNewObjects()
diff --git a/src/main/java/org/distorted/screens/ScreenList.java b/src/main/java/org/distorted/screens/ScreenList.java
index dc02cf8b..8dc7589f 100644
--- a/src/main/java/org/distorted/screens/ScreenList.java
+++ b/src/main/java/org/distorted/screens/ScreenList.java
@@ -32,14 +32,13 @@ import static org.distorted.objectlib.main.ObjectControl.*;
 public enum ScreenList
   {
   PLAY ( null , MODE_NOTHING, new RubikScreenPlay()     ),
-  DETA ( PLAY , MODE_NOTHING, new RubikScreenDetails()  ),
-  SOLV ( DETA , MODE_ROTATE , new RubikScreenSolving()  ),
-  PATT ( DETA , MODE_DRAG   , new RubikScreenPattern()  ),
-  SVER ( DETA , MODE_REPLACE, new RubikScreenSolver()   ),
+  SOLV ( PLAY , MODE_ROTATE , new RubikScreenSolving()  ),
+  PATT ( PLAY , MODE_DRAG   , new RubikScreenPattern()  ),
+  SVER ( PLAY , MODE_REPLACE, new RubikScreenSolver()   ),
   SOLU ( SVER , MODE_DRAG   , new RubikScreenSolution() ),
-  READ ( DETA , MODE_ROTATE , new RubikScreenReady()    ),
-  DONE ( DETA , MODE_DRAG   , new RubikScreenDone()     ),
-  FREE ( DETA , MODE_ROTATE , new RubikScreenFreePlay() ),
+  READ ( PLAY , MODE_ROTATE , new RubikScreenReady()    ),
+  DONE ( PLAY , MODE_DRAG   , new RubikScreenDone()     ),
+  FREE ( PLAY , MODE_ROTATE , new RubikScreenFreePlay() ),
   ;
 
   public static final int LENGTH = values().length;
