commit 214e301a154d0a6c33013ea25be63414ac162866
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Mon Sep 6 14:59:25 2021 +0200

    Fix the problem reported by Samsung -
    
    1. Fire off the app
    2. minimize it, select 'Multi window'
    3. put some other app in the lower half of the screen
    4. close the lower app
    5. our app used to fail to display the upper and lower menu bars.

diff --git a/src/main/java/org/distorted/main/RubikActivity.java b/src/main/java/org/distorted/main/RubikActivity.java
index d852040d..12737af3 100644
--- a/src/main/java/org/distorted/main/RubikActivity.java
+++ b/src/main/java/org/distorted/main/RubikActivity.java
@@ -133,6 +133,16 @@ public class RubikActivity extends TwistyActivity
       int barHeight = (int)(height*RATIO_BAR);
       mHeightLowerBar = barHeight;
       mHeightUpperBar = barHeight;
+
+      LinearLayout layoutTop = findViewById(R.id.upperBar);
+      LinearLayout layoutBot = findViewById(R.id.lowerBar);
+
+      ViewGroup.LayoutParams paramsTop = layoutTop.getLayoutParams();
+      paramsTop.height = mHeightUpperBar;
+      layoutTop.setLayoutParams(paramsTop);
+      ViewGroup.LayoutParams paramsBot = layoutBot.getLayoutParams();
+      paramsBot.height = mHeightLowerBar;
+      layoutBot.setLayoutParams(paramsBot);
       }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -179,18 +189,6 @@ public class RubikActivity extends TwistyActivity
         layoutHid.setLayoutParams(paramsHid);
         mHeightUpperBar += paramsHid.height;
         }
-
-      float height = getScreenHeightInPixels();
-
-      LinearLayout layoutTop = findViewById(R.id.upperBar);
-      LinearLayout layoutBot = findViewById(R.id.lowerBar);
-
-      ViewGroup.LayoutParams paramsTop = layoutTop.getLayoutParams();
-      paramsTop.height = (int)(height*RATIO_BAR);
-      layoutTop.setLayoutParams(paramsTop);
-      ViewGroup.LayoutParams paramsBot = layoutBot.getLayoutParams();
-      paramsBot.height = (int)(height*RATIO_BAR);
-      layoutBot.setLayoutParams(paramsBot);
       }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
