commit 2e99ba6a47d41387c50ad9581d2f64dc2ec2972c
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Mon Nov 29 15:20:03 2021 +0100

    Progress with ConfigPane.

diff --git a/src/main/java/org/distorted/config/ConfigScreenPane.java b/src/main/java/org/distorted/config/ConfigScreenPane.java
index 6953d059..ab2e0854 100644
--- a/src/main/java/org/distorted/config/ConfigScreenPane.java
+++ b/src/main/java/org/distorted/config/ConfigScreenPane.java
@@ -19,7 +19,10 @@
 
 package org.distorted.config;
 
+import android.util.TypedValue;
 import android.widget.LinearLayout;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
 import android.widget.TextView;
 
 import org.distorted.jsons.ObjectJson;
@@ -35,7 +38,10 @@ import static android.view.View.inflate;
 
 public class ConfigScreenPane
 {
-  private static final float TEXT_RATIO = 0.015f;
+  private static final float PADDING_RATIO = 0.015f;
+  private static final float TEXT_RATIO    = 0.025f;
+  private static final float RADIO_RATIO   = 0.900f;
+
   private JsonReader mReader;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -64,33 +70,68 @@ public class ConfigScreenPane
 
   ConfigScreenPane(final ConfigActivity act, int objectOrdinal)
     {
+    int height = act.getScreenHeightInPixels();
+    float textSize = height*TEXT_RATIO;
+    int padding = (int)(height*PADDING_RATIO);
+
     LinearLayout detailsLayout    = (LinearLayout)inflate( act, R.layout.config_details   , null);
     LinearLayout difficultyLayout = (LinearLayout)inflate( act, R.layout.config_difficulty, null);
     LinearLayout meshLayout       = (LinearLayout)inflate( act, R.layout.config_mesh      , null);
 
-    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0, 1.0f);
-    detailsLayout.setLayoutParams(params);
-    difficultyLayout.setLayoutParams(params);
-    meshLayout.setLayoutParams(params);
+    detailsLayout.setPadding(padding,padding,padding,padding/2);
+    difficultyLayout.setPadding(padding,padding/2,padding,padding/2);
+    meshLayout.setPadding(padding,padding/2,padding,padding);
+
+    LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0, 1.0f);
+    LinearLayout.LayoutParams params2 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0, 1.0f);
+    LinearLayout.LayoutParams params3 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0, 1.3f);
+
+    detailsLayout.setLayoutParams(params1);
+    difficultyLayout.setLayoutParams(params2);
+    meshLayout.setLayoutParams(params3);
 
-    int height = act.getScreenHeightInPixels();
-    float textSize = height*TEXT_RATIO;
     TextView text;
     text = detailsLayout.findViewById(R.id.configDetailsTitle);
-    text.setTextSize(textSize);
+    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
     text = detailsLayout.findViewById(R.id.configDetailsName1);
-    text.setTextSize(textSize);
+    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
     text = detailsLayout.findViewById(R.id.configDetailsName2);
-    text.setTextSize(textSize);
+    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
     text = detailsLayout.findViewById(R.id.configDetailsAuthor1);
-    text.setTextSize(textSize);
+    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
     text = detailsLayout.findViewById(R.id.configDetailsAuthor2);
-    text.setTextSize(textSize);
+    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
 
     text = difficultyLayout.findViewById(R.id.configDifficultyTitle);
-    text.setTextSize(textSize);
+    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
     text = meshLayout.findViewById(R.id.configMeshTitle);
-    text.setTextSize(textSize);
+    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
+
+    RadioButton butt1 = meshLayout.findViewById(R.id.meshNice);
+    butt1.setTextSize(TypedValue.COMPLEX_UNIT_PX, RADIO_RATIO*textSize);
+    RadioButton butt2 = meshLayout.findViewById(R.id.meshSimple);
+    butt2.setTextSize(TypedValue.COMPLEX_UNIT_PX, RADIO_RATIO*textSize);
+
+    LinearLayout layoutDiff = difficultyLayout.findViewById(R.id.configDifficultyLayout);
+    layoutDiff.setPadding(padding,padding,padding,padding);
+
+    RadioGroup radioGroup = meshLayout.findViewById(R.id.meshRadioGroup);
+
+    radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener()
+      {
+      @Override
+      public void onCheckedChanged(RadioGroup group, int checkedId)
+        {
+        if(checkedId == R.id.meshNice)
+          {
+          android.util.Log.e("D", "mesh Nice");
+          }
+        else
+          {
+          android.util.Log.e("D", "mesh Simple");
+          }
+        }
+      });
 
     LinearLayout layout = act.findViewById(R.id.configLayout);
     layout.removeAllViews();
diff --git a/src/main/res/layout/config_details.xml b/src/main/res/layout/config_details.xml
index 56b80bd6..56f209ac 100644
--- a/src/main/res/layout/config_details.xml
+++ b/src/main/res/layout/config_details.xml
@@ -2,7 +2,8 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="0dp"
-    android:layout_weight="1"
+    android:paddingRight="10dp"
+    android:paddingLeft="10dp"
     android:gravity="center|fill_horizontal"
     android:background="@color/grey"
     android:orientation="vertical">
@@ -14,9 +15,6 @@
         android:layout_weight="1"
         android:gravity="center"
         android:textSize="26sp"
-        android:layout_marginTop="10dp"
-        android:layout_marginLeft="10dp"
-        android:layout_marginRight="10dp"
         android:paddingLeft="2dp"
         android:paddingRight="2dp"
         android:maxLines="1"
@@ -27,8 +25,6 @@
         android:layout_width="fill_parent"
         android:layout_height="0dp"
         android:layout_weight="1"
-        android:layout_marginLeft="10dp"
-        android:layout_marginRight="10dp"
         android:paddingLeft="5dp"
         android:paddingRight="5dp"
         android:background="@color/light_grey"
@@ -63,8 +59,6 @@
         android:layout_width="fill_parent"
         android:layout_height="0dp"
         android:layout_weight="1"
-        android:layout_marginLeft="10dp"
-        android:layout_marginRight="10dp"
         android:paddingLeft="5dp"
         android:paddingRight="5dp"
         android:background="@color/light_grey"
diff --git a/src/main/res/layout/config_difficulty.xml b/src/main/res/layout/config_difficulty.xml
index 0ae7b1fa..aa5ac681 100644
--- a/src/main/res/layout/config_difficulty.xml
+++ b/src/main/res/layout/config_difficulty.xml
@@ -2,25 +2,77 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="0dp"
-    android:layout_weight="1"
     android:gravity="center|fill_horizontal"
     android:background="@color/grey"
+    android:paddingLeft="10dp"
+    android:paddingRight="10dp"
     android:orientation="vertical">
 
     <TextView
         android:id="@+id/configDifficultyTitle"
         android:layout_width="match_parent"
         android:layout_height="0dp"
-        android:layout_weight="1"
+        android:layout_weight="0.8"
         android:gravity="center"
         android:textSize="26sp"
-        android:layout_marginTop="10dp"
-        android:layout_marginLeft="10dp"
-        android:layout_marginRight="10dp"
         android:paddingLeft="2dp"
         android:paddingRight="2dp"
         android:maxLines="1"
         android:text="@string/config_difficulty"
         android:background="@color/light_grey"/>
 
+    <LinearLayout
+        android:id="@+id/configDifficultyLayout"
+        android:layout_width="fill_parent"
+        android:layout_height="0dp"
+        android:layout_weight="2.0"
+        android:paddingLeft="5dp"
+        android:paddingRight="5dp"
+        android:paddingTop="10dp"
+        android:paddingBottom="10dp"
+        android:background="@color/light_grey"
+        android:orientation="horizontal">
+
+        <ImageView
+             android:id="@+id/configDifficulty0"
+             android:layout_width="0dp"
+             android:layout_height="match_parent"
+             android:layout_weight="1"
+             android:gravity="center"
+             android:src="@drawable/ui_huge_info" />
+
+        <ImageView
+             android:id="@+id/configDifficulty1"
+             android:layout_width="0dp"
+             android:layout_height="match_parent"
+             android:layout_weight="1"
+             android:gravity="center"
+             android:src="@drawable/ui_huge_tutorial" />
+
+        <ImageView
+             android:id="@+id/configDifficulty2"
+             android:layout_width="0dp"
+             android:layout_height="match_parent"
+             android:layout_weight="1"
+             android:gravity="center"
+             android:src="@drawable/ui_huge_cube_back" />
+
+        <ImageView
+             android:id="@+id/configDifficulty3"
+             android:layout_width="0dp"
+             android:layout_height="match_parent"
+             android:layout_weight="1"
+             android:gravity="center"
+             android:src="@drawable/ui_huge_cube_grey" />
+
+        <ImageView
+             android:id="@+id/configDifficulty4"
+             android:layout_width="0dp"
+             android:layout_height="match_parent"
+             android:layout_weight="1"
+             android:gravity="center"
+             android:src="@drawable/ui_huge_cube_scramble" />
+
+    </LinearLayout>
+
 </LinearLayout>
diff --git a/src/main/res/layout/config_mesh.xml b/src/main/res/layout/config_mesh.xml
index 7eb9793f..263db6ee 100644
--- a/src/main/res/layout/config_mesh.xml
+++ b/src/main/res/layout/config_mesh.xml
@@ -2,7 +2,9 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="0dp"
-    android:layout_weight="1"
+    android:paddingLeft="10dp"
+    android:paddingRight="10dp"
+    android:paddingBottom="10dp"
     android:gravity="center|fill_horizontal"
     android:background="@color/grey"
     android:orientation="vertical">
@@ -11,86 +13,37 @@
         android:id="@+id/configMeshTitle"
         android:layout_width="match_parent"
         android:layout_height="0dp"
-        android:layout_weight="1"
+        android:layout_weight="0.8"
         android:gravity="center"
         android:textSize="26sp"
-        android:layout_marginTop="10dp"
-        android:layout_marginLeft="10dp"
-        android:layout_marginRight="10dp"
         android:paddingLeft="2dp"
         android:paddingRight="2dp"
         android:maxLines="1"
         android:text="@string/config_mesh"
         android:background="@color/light_grey"/>
 
-    <LinearLayout
-        android:layout_width="fill_parent"
-        android:layout_height="0dp"
-        android:layout_weight="1"
-        android:layout_marginLeft="10dp"
-        android:layout_marginRight="10dp"
-        android:paddingLeft="5dp"
-        android:paddingRight="5dp"
-        android:background="@color/light_grey"
-        android:orientation="horizontal">
-
-        <TextView
-             android:layout_width="0dp"
-             android:layout_height="match_parent"
-             android:layout_weight="1.0"
-             android:gravity="center_vertical|start"
-             android:paddingStart="5dp"
-             android:textSize="26sp"
-             android:singleLine="true"
-             android:maxLines="1"
-             android:text="@string/config_name"/>
-
-        <TextView
-             android:id="@+id/configDetailsName"
-             android:layout_width="0dp"
-             android:layout_height="match_parent"
-             android:layout_weight="1.0"
-             android:gravity="center_vertical|start"
-             android:paddingStart="5dp"
-             android:textSize="26sp"
-             android:singleLine="true"
-             android:maxLines="1"/>
-
-    </LinearLayout>
-
-    <LinearLayout
-        android:layout_width="fill_parent"
+    <RadioGroup
+        android:id="@+id/meshRadioGroup"
+        android:layout_width="match_parent"
         android:layout_height="0dp"
-        android:layout_weight="1"
-        android:layout_marginLeft="10dp"
-        android:layout_marginRight="10dp"
-        android:layout_marginBottom="10dp"
-        android:paddingLeft="5dp"
-        android:paddingRight="5dp"
-        android:background="@color/light_grey"
-        android:orientation="horizontal">
-
-        <TextView
-             android:layout_width="0dp"
-             android:layout_height="match_parent"
-             android:layout_weight="1.0"
-             android:gravity="center_vertical|start"
-             android:paddingStart="5dp"
-             android:textSize="26sp"
-             android:singleLine="true"
-             android:maxLines="1"
-             android:text="@string/config_author"/>
-
-        <TextView
-             android:id="@+id/configDetailsAuthor"
-             android:layout_width="0dp"
-             android:layout_height="match_parent"
-             android:layout_weight="1.0"
-             android:gravity="center_vertical|start"
-             android:paddingStart="5dp"
-             android:textSize="26sp"
-             android:singleLine="true"
-             android:maxLines="1"/>
+        android:layout_weight="2"
+        android:checkedButton="@+id/meshNice"
+        android:background="@color/light_grey">
+
+        <RadioButton
+            android:id="@+id/meshSimple"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginBottom="0dp"
+            android:text="@string/config_mesh_simple"/>
+
+        <RadioButton
+            android:id="@+id/meshNice"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginBottom="0dp"
+            android:text="@string/config_mesh_nice"/>
+
+    </RadioGroup>
 
-    </LinearLayout>
 </LinearLayout>
