commit 5a4ee1698102f856587da894326d171db90e0f72
Author: leszek <leszek@koltunski.pl>
Date:   Tue Jul 25 21:43:18 2023 +0200

    Progress with Bandaged UI.

diff --git a/src/main/java/org/distorted/bandaged/BandagedCreatorActivity.java b/src/main/java/org/distorted/bandaged/BandagedCreatorActivity.java
index 5de230ac..4718df4a 100644
--- a/src/main/java/org/distorted/bandaged/BandagedCreatorActivity.java
+++ b/src/main/java/org/distorted/bandaged/BandagedCreatorActivity.java
@@ -59,6 +59,7 @@ public class BandagedCreatorActivity extends AppCompatActivity
     private int mCurrentApiVersion;
     private BandagedCreatorScreen mScreen;
     private boolean mRTL;
+    private int mObjectOrdinal;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -79,6 +80,9 @@ public class BandagedCreatorActivity extends AppCompatActivity
       final int layoutDirection = config.getLayoutDirection();
       mRTL = layoutDirection==LAYOUT_DIRECTION_RTL;
 
+      Bundle b = getIntent().getExtras();
+      mObjectOrdinal = (b != null) ? b.getInt("obj") : 0;
+
       hideNavigationBar();
       cutoutHack();
       computeHeights();
@@ -338,7 +342,7 @@ public class BandagedCreatorActivity extends AppCompatActivity
 
     public int getObjectOrdinal()
       {
-      return 0;
+      return mObjectOrdinal;
       }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogCreatorView.java b/src/main/java/org/distorted/dialogs/RubikDialogCreatorView.java
new file mode 100644
index 00000000..68812b9a
--- /dev/null
+++ b/src/main/java/org/distorted/dialogs/RubikDialogCreatorView.java
@@ -0,0 +1,70 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2023 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Magic Cube.                                                              //
+//                                                                                               //
+// Magic Cube is proprietary software licensed under an EULA which you should have received      //
+// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.dialogs;
+
+import android.util.TypedValue;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import org.distorted.main.R;
+import org.distorted.main.RubikActivity;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+public class RubikDialogCreatorView
+  {
+  private final View mView;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public RubikDialogCreatorView(final RubikActivity act, final RubikDialogCreators dialog,
+                                final int index, int icon, int title, int desc, int padding, int fontSize,
+                                LinearLayout.LayoutParams pView, LinearLayout.LayoutParams pText, LinearLayout.LayoutParams pButt )
+    {
+    mView = act.getLayoutInflater().inflate(R.layout.dialog_creators_pane, null);
+    mView.setLayoutParams(pView);
+    mView.setPadding(padding,padding,padding,padding);
+
+    TextView titleView = mView.findViewById(R.id.creators_pane_title);
+    titleView.setText(title);
+    TextView descView = mView.findViewById(R.id.creators_pane_description);
+    descView.setText(desc);
+
+    titleView.setLayoutParams(pText);
+
+    ImageView iconView = mView.findViewById(R.id.creators_pane_image);
+    iconView.setImageResource(icon);
+
+    Button button = mView.findViewById(R.id.creators_pane_button);
+
+    button.setOnClickListener( new View.OnClickListener()
+      {
+      @Override
+      public void onClick(View v)
+        {
+        dialog.dismiss();
+        act.switchToBandagedCreator(index);
+        }
+      });
+
+    button.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize);
+    button.setLayoutParams(pButt);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public View getView()
+    {
+    return mView;
+    }
+  }
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogCreators.java b/src/main/java/org/distorted/dialogs/RubikDialogCreators.java
new file mode 100644
index 00000000..7f6e0a54
--- /dev/null
+++ b/src/main/java/org/distorted/dialogs/RubikDialogCreators.java
@@ -0,0 +1,154 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2023 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Magic Cube.                                                              //
+//                                                                                               //
+// Magic Cube is proprietary software licensed under an EULA which you should have received      //
+// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.dialogs;
+
+import android.app.Dialog;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import androidx.fragment.app.FragmentActivity;
+
+import org.distorted.main.R;
+import org.distorted.main.RubikActivity;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+public class RubikDialogCreators extends RubikDialogAbstract
+  {
+  private enum BandagedObjectDescription
+    {
+    CUBOID   ( org.distorted.objectlib.R.drawable.cu_232, R.string.creator_cuboid_title  , R.string.creator_cuboid_desc   ),
+    PYRAMINX ( org.distorted.objectlib.R.drawable.pyra_3, R.string.creator_pyraminx_title, R.string.creator_pyraminx_desc ),
+    ;
+
+    public static final int NUM_OBJECTS = values().length;
+    private static final BandagedObjectDescription[] objects;
+
+    final int mIcon, mTitle, mDescription;
+
+    BandagedObjectDescription(int icon, int title, int descripton)
+      {
+      mIcon        = icon;
+      mTitle       = title;
+      mDescription = descripton;
+      }
+
+    static
+      {
+      int i=0;
+      objects = new BandagedObjectDescription[NUM_OBJECTS];
+      for( BandagedObjectDescription object: BandagedObjectDescription.values() ) objects[i++] = object;
+      }
+
+    ////////////////////////////////////////////////////////////////////////
+
+    static int getIcon(int ordinal)
+      {
+      return objects[ordinal].mIcon;
+      }
+
+    ////////////////////////////////////////////////////////////////////////
+
+    static int getTitle(int ordinal)
+      {
+      return objects[ordinal].mTitle;
+      }
+
+    ////////////////////////////////////////////////////////////////////////
+
+    static int getDescription(int ordinal)
+      {
+      return objects[ordinal].mDescription;
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  @Override
+  public void onResume()
+    {
+    super.onResume();
+
+    Window window = getDialog().getWindow();
+
+    if( window!=null )
+      {
+      WindowManager.LayoutParams params = window.getAttributes();
+      params.width  = (int)Math.min( mHeight*0.65f,mWidth*0.98f );
+      window.setAttributes(params);
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getResource()      { return R.layout.dialog_scrollable_panes; }
+  public int getTitleResource() { return R.string.bandaged; }
+  public boolean hasArgument()  { return false; }
+  public int getPositive()      { return R.string.ok; }
+  public int getNegative()      { return -1; }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void positiveAction()
+    {
+
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void negativeAction()
+    {
+
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
+    {
+    int margin= (int)(mHeight*0.010f);
+    int padd  = (int)(mHeight*0.010f);
+    int font  = (int)(mHeight*0.025f);
+
+    LinearLayout layout= view.findViewById(R.id.dialog_scrollable_main_layout);
+    TextView text  = view.findViewById(R.id.dialog_scrollable_message);
+    text.setVisibility(View.GONE);
+
+    LinearLayout.LayoutParams pV = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT );
+    pV.setMargins(margin, margin, margin, 0);
+    LinearLayout.LayoutParams pL = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT );
+    pL.setMargins(margin, margin, margin, margin);
+    LinearLayout.LayoutParams pT = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT );
+    pT.setMargins(0,0,0,2*margin);
+    LinearLayout.LayoutParams pB = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT );
+    pB.setMargins(0,2*margin,0,0);
+
+    int num = BandagedObjectDescription.NUM_OBJECTS;
+    RubikActivity ract = (RubikActivity) getContext();
+
+    for(int i=0; i<num; i++)
+      {
+      int icon        = BandagedObjectDescription.getIcon(i);
+      int title       = BandagedObjectDescription.getTitle(i);
+      int description = BandagedObjectDescription.getDescription(i);
+      RubikDialogCreatorView pane = new RubikDialogCreatorView(ract,this,i,icon,title,description, padd, font, (i==num-1?pL:pV),pT,pB);
+      layout.addView(pane.getView());
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public static String getDialogTag()
+    {
+    return "DialogCreators";
+    }
+  }
diff --git a/src/main/java/org/distorted/main/RubikActivity.java b/src/main/java/org/distorted/main/RubikActivity.java
index 5ca000f6..c388389d 100644
--- a/src/main/java/org/distorted/main/RubikActivity.java
+++ b/src/main/java/org/distorted/main/RubikActivity.java
@@ -701,9 +701,10 @@ public class RubikActivity extends AppCompatActivity
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    public void switchToBandagedCreator()
+    public void switchToBandagedCreator(int objectOrdinal)
       {
       Intent intent = new Intent(this, BandagedCreatorActivity.class);
+      intent.putExtra("obj", objectOrdinal);
       startActivity(intent);
       }
 
diff --git a/src/main/java/org/distorted/screens/RubikScreenPlay.java b/src/main/java/org/distorted/screens/RubikScreenPlay.java
index 37549020..225c2753 100644
--- a/src/main/java/org/distorted/screens/RubikScreenPlay.java
+++ b/src/main/java/org/distorted/screens/RubikScreenPlay.java
@@ -30,6 +30,7 @@ import android.widget.PopupWindow;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
+import org.distorted.dialogs.RubikDialogCreators;
 import org.distorted.dialogs.RubikDialogSolvers;
 import org.distorted.dialogs.RubikDialogStarsStatus;
 import org.distorted.dialogs.RubikDialogUpdates;
@@ -443,7 +444,8 @@ public class RubikScreenPlay extends RubikScreenBase implements RubikNetwork.Upd
         public void onClick(View v)
           {
           mMenuPopup.dismiss();
-          act.switchToBandagedCreator();
+          RubikDialogCreators creators = new RubikDialogCreators();
+          creators.show(act.getSupportFragmentManager(), RubikDialogCreators.getDialogTag() );
           }
         });
 
diff --git a/src/main/res/layout/dialog_creators_pane.xml b/src/main/res/layout/dialog_creators_pane.xml
new file mode 100644
index 00000000..aab00df9
--- /dev/null
+++ b/src/main/res/layout/dialog_creators_pane.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+	xmlns:android="http://schemas.android.com/apk/res/android"
+	android:layout_width="match_parent"
+	android:layout_height="wrap_content"
+	android:background="@color/medium_grey"
+	android:padding="8dp"
+	android:orientation="horizontal">
+
+    <ImageView
+   	     android:id="@+id/creators_pane_image"
+   	     android:scaleType="fitCenter"
+   		 android:layout_width="0dp"
+   		 android:layout_height="match_parent"
+   		 android:layout_gravity="top"
+   		 android:layout_weight="0.5"/>
+
+   	<LinearLayout
+   		android:layout_width="0dp"
+ 		android:layout_height="match_parent"
+ 		android:orientation="vertical"
+ 		android:layout_marginStart="8dp"
+ 		android:layout_weight="1.0">
+
+		<TextView
+    		android:id="@+id/creators_pane_title"
+    		android:gravity="top|start"
+    		android:layout_width="match_parent"
+    		android:layout_height="wrap_content"
+    		android:singleLine="true"
+    		android:textStyle="bold"/>
+
+        <TextView
+    		android:id="@+id/creators_pane_description"
+    		android:gravity="top|start"
+    		android:layout_width="match_parent"
+    		android:layout_height="wrap_content"/>
+
+    	<Button
+             android:id="@+id/creators_pane_button"
+             android:layout_width="match_parent"
+             android:layout_height="wrap_content"
+             android:layout_gravity="bottom"
+             android:gravity="center"
+             android:backgroundTint="@color/black"
+             android:insetTop="0dp"
+             android:insetBottom="0dp"
+             android:text="@string/use_solver"/>
+
+ 	</LinearLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index b84c8d21..03a73aed 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -131,6 +131,7 @@
     <string name="solver_cube3_error8">Timeout, no solution found in 20 seconds!</string>
     <string name="solver_cube3_error9">Solver interrupted!</string>
 
+
     <string name="color_yellow1">yellow</string>
     <string name="color_white1">white</string>
     <string name="color_blue1">blue</string>
@@ -223,6 +224,11 @@
     <string name="solver_cu323_description">A perfect, instantaneous solver.\nAuthor: Leszek Koltunski.</string>
     <string name="solver_cube4_description">Not implemented yet.\nAuthor: Leszek Koltunski.</string>
 
+    <string name="creator_cuboid_title">Creator of Bandaged Cuboids</string>
+    <string name="creator_cuboid_desc">Set up a cuboid up to size 7 and bandage it.</string>
+    <string name="creator_pyraminx_title">Creator of Bandaged Pyraminxes</string>
+    <string name="creator_pyraminx_desc">Set up a pyraminx up to size 7 and bandage it.</string>
+
     <string name="email_address" translatable="false">app.magic.cube@gmail.com</string>
 
     <string name="ns_placeholder" translatable="false">+%1$d</string>
