commit 57dea1acd064b71221ac2ddd7dcc3ff5d1299ed5
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Tue Jan 24 10:45:33 2023 +0100

    UI iimprovements inthe Solver screen.

diff --git a/src/main/java/org/distorted/main/RubikActivity.java b/src/main/java/org/distorted/main/RubikActivity.java
index 7026dfb0..c4c0591d 100644
--- a/src/main/java/org/distorted/main/RubikActivity.java
+++ b/src/main/java/org/distorted/main/RubikActivity.java
@@ -70,8 +70,6 @@ public class RubikActivity extends AppCompatActivity
     public static final float SMALL_MARGIN        = 0.004f;
     public static final float BUTTON_TEXT_SIZE    = 0.05f;
     public static final float TITLE_TEXT_SIZE     = 0.06f;
-    public static final float SOLVER_BMP_H_SIZE   = 0.11f;
-    public static final float SOLVER_BMP_V_SIZE   = 0.06f;
     public static final float PATTERN_GROUP_TEXT  = 0.03f;
     public static final float PATTERN_CHILD_TEXT  = 0.02f;
     public static final float SCORES_LEVEL_TEXT   = 0.035f;
@@ -80,6 +78,7 @@ public class RubikActivity extends AppCompatActivity
     public static final float TAB_HEIGHT          = 0.066f;
     public static final float POPUP_PADDING       = 0.028f;
     public static final float POPUP_MARGIN        = 0.016f;
+    public static final float RATIO_BAR           = 0.10f;
 
     public static final int FLAGS =  View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
@@ -88,7 +87,6 @@ public class RubikActivity extends AppCompatActivity
                                    | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
 
     private static final int ACTIVITY_NUMBER = 0;
-    private static final float RATIO_BAR  = 0.10f;
     private static final float RATIO_INSET= 0.09f;
 
     private static final String KEY_PLAY = "movesController_play";
diff --git a/src/main/java/org/distorted/screens/RubikScreenSolver.java b/src/main/java/org/distorted/screens/RubikScreenSolver.java
index ce8b851f..b79285d4 100644
--- a/src/main/java/org/distorted/screens/RubikScreenSolver.java
+++ b/src/main/java/org/distorted/screens/RubikScreenSolver.java
@@ -50,7 +50,7 @@ public class RubikScreenSolver extends RubikScreenAbstract
   private boolean mSolving;
   private int mCurrentColor;
   private int[] mFaceColors;
-  private int mNumFaces;
+  private int mNumColors;
   private float mBitmapSize;
   private WeakReference<RubikActivity> mWeakAct;
 
@@ -72,10 +72,6 @@ public class RubikScreenSolver extends RubikScreenAbstract
     float width = act.getScreenWidthInPixels();
     float heigh = act.getScreenHeightInPixels();
 
-    int sizeV = (int)(heigh*RubikActivity.SOLVER_BMP_V_SIZE);
-    int sizeH = (int)(width*RubikActivity.SOLVER_BMP_H_SIZE);
-
-    mBitmapSize = Math.min(sizeV,sizeH);
     mWeakAct = new WeakReference<>(act);
     mSolving = false;
 
@@ -88,20 +84,16 @@ public class RubikScreenSolver extends RubikScreenAbstract
 
     generateFaceColors(currentObject);
 
+    final float BUTTON_RATIO = 0.75f;
+    int sizeV = (int)(heigh*RubikActivity.RATIO_BAR*BUTTON_RATIO);
+    int sizeH = (int)((width/mNumColors)*BUTTON_RATIO);
+    mBitmapSize = Math.min(sizeV,sizeH);
+
     // TOP ////////////////////////////
     LinearLayout layoutTop = act.findViewById(R.id.upperBar);
     layoutTop.removeAllViews();
 
-    LinearLayout.LayoutParams paramsL = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1);
-
-    LinearLayout layoutLeft = new LinearLayout(act);
-    layoutLeft.setLayoutParams(paramsL);
-    LinearLayout layoutMid = new LinearLayout(act);
-    layoutMid.setLayoutParams(paramsL);
-    LinearLayout layoutRight = new LinearLayout(act);
-    layoutRight.setLayoutParams(paramsL);
-
-    if( mNumFaces>0 )
+    if( mNumColors>0 )
       {
       setupBitmaps();
       setupColorButtons(act,width);
@@ -111,18 +103,27 @@ public class RubikScreenSolver extends RubikScreenAbstract
     for(ImageButton button: mColorButton) layoutTop.addView(button);
 
     // BOT ////////////////////////////
+    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1);
+
+    LinearLayout layoutL = new LinearLayout(act);
+    layoutL.setLayoutParams(params);
+    LinearLayout layoutM = new LinearLayout(act);
+    layoutM.setLayoutParams(params);
+    LinearLayout layoutR = new LinearLayout(act);
+    layoutR.setLayoutParams(params);
+
     LinearLayout layoutBot = act.findViewById(R.id.lowerBar);
     layoutBot.removeAllViews();
 
     setupSolveButton(act);
     setupBackButton(act);
 
-    layoutLeft.addView(mSolveButton);
-    layoutRight.addView(mBackButton);
+    layoutL.addView(mSolveButton);
+    layoutR.addView(mBackButton);
 
-    layoutBot.addView(layoutLeft);
-    layoutBot.addView(layoutMid);
-    layoutBot.addView(layoutRight);
+    layoutBot.addView(layoutL);
+    layoutBot.addView(layoutM);
+    layoutBot.addView(layoutR);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -140,7 +141,7 @@ public class RubikScreenSolver extends RubikScreenAbstract
         object== ObjectSignatures.MORP_3 ||
         object== ObjectSignatures.MORP_4  )
       {
-      mNumFaces = ShapeTetrahedron.NUM_FACES;
+      mNumColors  = ShapeTetrahedron.NUM_FACES;
       mFaceColors = ShapeTetrahedron.FACE_COLORS;
       }
     else if( object== ObjectSignatures.DIAM_2 ||
@@ -150,7 +151,7 @@ public class RubikScreenSolver extends RubikScreenAbstract
         object== ObjectSignatures.TRAJ_4 ||
         object== ObjectSignatures.PDIA_3  )
       {
-      mNumFaces   = ShapeOctahedron.NUM_FACES;
+      mNumColors  = ShapeOctahedron.NUM_FACES;
       mFaceColors = ShapeOctahedron.FACE_COLORS;
       }
     else if( object== ObjectSignatures.CRYS_3 ||
@@ -161,17 +162,17 @@ public class RubikScreenSolver extends RubikScreenAbstract
         object== ObjectSignatures.MEGA_3 ||
         object== ObjectSignatures.MEGA_5  )
       {
-      mNumFaces   = ShapeDodecahedron.NUM_FACES;
+      mNumColors  = ShapeDodecahedron.NUM_FACES;
       mFaceColors = ShapeDodecahedron.FACE_COLORS;
       }
     else if( object== ObjectSignatures.BALL_4 )
       {
-      mNumFaces   = ShapeDiamond.NUM_FACES;
+      mNumColors  = ShapeDiamond.NUM_FACES;
       mFaceColors = ShapeDiamond.FACE_COLORS;
       }
     else
       {
-      mNumFaces   = ShapeHexahedron.NUM_FACES;
+      mNumColors  = ShapeHexahedron.NUM_FACES;
       mFaceColors = ShapeHexahedron.FACE_COLORS;
       }
     }
@@ -184,7 +185,7 @@ public class RubikScreenSolver extends RubikScreenAbstract
     final float R = SIZE*0.15f;
     final float M = SIZE*0.08f;
 
-    mBitmap = new Bitmap[mNumFaces];
+    mBitmap = new Bitmap[mNumColors];
 
     Paint paint = new Paint();
     paint.setColor(0xff008800);
@@ -194,7 +195,7 @@ public class RubikScreenSolver extends RubikScreenAbstract
     paint.setTextAlign(Paint.Align.CENTER);
     paint.setStyle(Paint.Style.FILL);
 
-    for(int i=0; i<mNumFaces; i++)
+    for(int i=0; i<mNumColors; i++)
       {
       mBitmap[i] = Bitmap.createBitmap(SIZE, SIZE, Bitmap.Config.ARGB_8888);
       Canvas canvas = new Canvas(mBitmap[i]);
@@ -211,11 +212,11 @@ public class RubikScreenSolver extends RubikScreenAbstract
 
   private void setupColorButtons(final RubikActivity act, final float width)
     {
-    mColorButton = new ImageButton[mNumFaces];
+    mColorButton = new ImageButton[mNumColors];
     int padding = (int)(width*RubikActivity.PADDING);
     int margin  = (int)(width*RubikActivity.SMALL_MARGIN);
 
-    for(int i=0; i<mNumFaces; i++)
+    for(int i=0; i<mNumColors; i++)
       {
       final int ii = i;
       LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.MATCH_PARENT, 1.0f);
@@ -289,7 +290,7 @@ public class RubikScreenSolver extends RubikScreenAbstract
 
   private void markButton(RubikActivity act)
     {
-    for(int b=0; b<mNumFaces; b++)
+    for(int b=0; b<mNumColors; b++)
       {
       Drawable d = mColorButton[b].getBackground();
 
