commit 113d9d6754549793fd739f63f511a699577505c0
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Wed Jun 29 16:42:46 2022 +0200

    Progress with lower pane of the Play state.

diff --git a/src/main/java/org/distorted/screens/RubikScreenPlay.java b/src/main/java/org/distorted/screens/RubikScreenPlay.java
index b70ab08e..c5041757 100644
--- a/src/main/java/org/distorted/screens/RubikScreenPlay.java
+++ b/src/main/java/org/distorted/screens/RubikScreenPlay.java
@@ -74,7 +74,8 @@ public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork
   private static final float LAST_BUTTON = 1.5f;
   private static final int[] mLocation = new int[2];
 
-  private ImageButton mAboutButton, mUpdatesButton, mExitButton;
+  private TransparentImageButton mAboutButton, mExitButton;
+  private ImageButton mUpdatesButton;
  // private PopupWindow mObjectPopup, mMenuPopup, mPlayPopup;
   private LinearLayout mPlayLayout;
   private TextView mBubbleUpdates;
@@ -131,15 +132,29 @@ public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork
     // BOTTOM /////////////////////////
     LinearLayout layoutBot = act.findViewById(R.id.lowerBar);
     layoutBot.removeAllViews();
-    RelativeLayout relLayout = (RelativeLayout)inflater.inflate(R.layout.play_bottom_bar, null);
-    layoutBot.addView(relLayout);
 
-    TypedValue outValue = new TypedValue();
-    act.getTheme().resolveAttribute(android.R.attr.selectableItemBackgroundBorderless, outValue, true);
+    float D = 0.20f;
+    LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams( (int)(mScreenWidth*     D ),LinearLayout.LayoutParams.MATCH_PARENT);
+    LinearLayout.LayoutParams params2 = new LinearLayout.LayoutParams( (int)(mScreenWidth*(1-2*D)),LinearLayout.LayoutParams.MATCH_PARENT);
+
+    LinearLayout layoutLeft = new LinearLayout(act);
+
+    layoutLeft.setLayoutParams(params1);
+    RelativeLayout layoutMid = (RelativeLayout)inflater.inflate(R.layout.play_bottom_bar, null);
+    layoutMid.setLayoutParams(params2);
+    LinearLayout layoutRight = new LinearLayout(act);
+    layoutRight.setLayoutParams(params1);
+
+    setupAboutButton(act);
+    setupUpdatesButtonAndBubble(act,layoutMid);
+    setupExitButton(act);
 
-    setupAboutButton(act,relLayout,outValue);
-    setupUpdatesButtonAndBubble(act,relLayout,outValue);
-    setupExitButton(act,relLayout,outValue);
+    layoutLeft.addView(mAboutButton);
+    layoutRight.addView(mExitButton);
+
+    layoutBot.addView(layoutLeft);
+    layoutBot.addView(layoutMid);
+    layoutBot.addView(layoutRight);
 
     // POPUP //////////////////////////
     LinearLayout hiddenView = act.findViewById(R.id.hiddenView);
@@ -157,12 +172,11 @@ public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork
 
 //////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private void setupAboutButton(final RubikActivity act, RelativeLayout relLayout, TypedValue value)
+  private void setupAboutButton(final RubikActivity act)
     {
     final int icon = RubikActivity.getDrawable(R.drawable.ui_small_info,R.drawable.ui_medium_info, R.drawable.ui_big_info, R.drawable.ui_huge_info);
-    mAboutButton = relLayout.findViewById(R.id.buttonAbout);
-    mAboutButton.setImageResource(icon);
-    mAboutButton.setBackgroundResource(value.resourceId);
+    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1);
+    mAboutButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE,params);
 
     mAboutButton.setOnClickListener( new View.OnClickListener()
       {
@@ -177,47 +191,48 @@ public class RubikScreenPlay extends RubikScreenAbstract implements RubikNetwork
 
 //////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private void setupUpdatesButtonAndBubble(final RubikActivity act, RelativeLayout relLayout, TypedValue value)
+  private void setupExitButton(final RubikActivity act)
     {
-    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.buttonDown);
-    mUpdatesButton.setImageResource(icon);
-    mUpdatesButton.setBackgroundResource(value.resourceId);
+    final int icon = RubikActivity.getDrawable(R.drawable.ui_small_exit,R.drawable.ui_medium_exit, R.drawable.ui_big_exit, R.drawable.ui_huge_exit);
+    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1);
+    mExitButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE,params);
 
-    mUpdatesButton.setOnClickListener( new View.OnClickListener()
+    mExitButton.setOnClickListener( new View.OnClickListener()
       {
       @Override
       public void onClick(View v)
         {
-        RubikDialogUpdates uDiag = new RubikDialogUpdates();
-        uDiag.show( act.getSupportFragmentManager(), RubikDialogUpdates.getDialogTag() );
+        act.finish();
         }
       });
-
-    mBubbleUpdates = relLayout.findViewById(R.id.bubbleUpdates);
-    mBubbleUpdates.setVisibility(View.INVISIBLE);
-
-    RubikNetwork network = RubikNetwork.getInstance();
-    network.signUpForUpdates(this);
     }
 
 //////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private void setupExitButton(final RubikActivity act, RelativeLayout relLayout, TypedValue value)
+  private void setupUpdatesButtonAndBubble(final RubikActivity act, RelativeLayout relLayout)
     {
-    final int icon = RubikActivity.getDrawable(R.drawable.ui_small_exit,R.drawable.ui_medium_exit, R.drawable.ui_big_exit, R.drawable.ui_huge_exit);
-    mExitButton = relLayout.findViewById(R.id.buttonExit);
-    mExitButton.setImageResource(icon);
-    mExitButton.setBackgroundResource(value.resourceId);
+    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);
 
-    mExitButton.setOnClickListener( new View.OnClickListener()
+    mUpdatesButton.setOnClickListener( new View.OnClickListener()
       {
       @Override
       public void onClick(View v)
         {
-        act.finish();
+        RubikDialogUpdates uDiag = new RubikDialogUpdates();
+        uDiag.show( act.getSupportFragmentManager(), RubikDialogUpdates.getDialogTag() );
         }
       });
+
+    mBubbleUpdates = relLayout.findViewById(R.id.bubbleUpdates);
+    mBubbleUpdates.setVisibility(View.INVISIBLE);
+
+    RubikNetwork network = RubikNetwork.getInstance();
+    network.signUpForUpdates(this);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/res/layout/play_bottom_bar.xml b/src/main/res/layout/play_bottom_bar.xml
index 2237f58e..60d50278 100644
--- a/src/main/res/layout/play_bottom_bar.xml
+++ b/src/main/res/layout/play_bottom_bar.xml
@@ -1,21 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-       android:id="@+id/bottomLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
-       android:background="@android:color/transparent"
-       android:paddingTop="5dp"
-       android:paddingEnd="15dp"
-       android:paddingStart="15dp">
+       android:paddingTop="7dp"
+       android:layout_gravity="center"
+       android:background="@android:color/transparent">
 
        <ImageButton
-           android:id="@+id/buttonAbout"
-           android:layout_alignParentStart="true"
-           android:layout_width="wrap_content"
-           android:layout_height="wrap_content"/>
-
-       <ImageButton
-           android:id="@+id/buttonDown"
+           android:id="@+id/buttonUpdates"
            android:layout_centerHorizontal="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
@@ -24,17 +16,10 @@
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="100dp"
-           android:layout_alignTop="@+id/buttonDown"
-           android:layout_alignEnd="@+id/buttonDown"
+           android:layout_alignTop="@+id/buttonUpdates"
+           android:layout_alignEnd="@+id/buttonUpdates"
            android:textColor="#FFF"
            android:textSize="16sp"
            android:textStyle="bold"
            android:background="@drawable/badge_circle"/>
-
-       <ImageButton
-           android:id="@+id/buttonExit"
-           android:layout_alignParentEnd="true"
-           android:layout_width="wrap_content"
-           android:layout_height="wrap_content"/>
-
 </RelativeLayout>
\ No newline at end of file
