commit 462c74f4b4067c6d593979ebbef37cdce73101f2
Author: Leszek Koltunski <leszek@distorted.org>
Date:   Sun Jul 3 00:45:24 2016 +0100

    Revert the Cubes App.

diff --git a/src/main/java/org/distorted/examples/cubes/CubesActivity.java b/src/main/java/org/distorted/examples/cubes/CubesActivity.java
index d9acc8b..8331af2 100644
--- a/src/main/java/org/distorted/examples/cubes/CubesActivity.java
+++ b/src/main/java/org/distorted/examples/cubes/CubesActivity.java
@@ -30,18 +30,15 @@ import android.opengl.GLSurfaceView;
 import android.os.Bundle;
 import android.view.Gravity;
 import android.view.View;
-import android.widget.AdapterView;
-import android.widget.ArrayAdapter;
 import android.widget.Button;
 import android.widget.LinearLayout;
 import android.widget.NumberPicker;
 import android.widget.NumberPicker.OnValueChangeListener;
-import android.widget.Spinner;
 import android.widget.TableRow;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-public class CubesActivity extends Activity implements View.OnClickListener, AdapterView.OnItemSelectedListener
+public class CubesActivity extends Activity implements View.OnClickListener
 {
     private static final int COLOR_OFF = 0xffffe81f;
     private static final int COLOR_ON  = 0xff0000ff;
@@ -52,7 +49,6 @@ public class CubesActivity extends Activity implements View.OnClickListener, Ada
     private LinearLayout mLay;
     private boolean[] mShape;
     private DistortedObject mObject;
-    private int mObjectType;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
     
@@ -61,12 +57,12 @@ public class CubesActivity extends Activity implements View.OnClickListener, Ada
       {
       super.onCreate(savedState);
 
-      setContentView(R.layout.objectpickerlayout);
+      setContentView(R.layout.cubespickerlayout);
       
-      mLay = (LinearLayout)findViewById(R.id.objectpicker_buttongrid);
+      mLay = (LinearLayout)findViewById(R.id.cubespicker_buttongrid);
       
-      mColsPicker = (NumberPicker)findViewById(R.id.objectpicker_cols);
-      mRowsPicker = (NumberPicker)findViewById(R.id.objectpicker_rows);
+      mColsPicker = (NumberPicker)findViewById(R.id.cubespicker_cols);
+      mRowsPicker = (NumberPicker)findViewById(R.id.cubespicker_rows);
       
       mColsPicker.setMaxValue(10);
       mColsPicker.setMinValue( 0);
@@ -90,17 +86,6 @@ public class CubesActivity extends Activity implements View.OnClickListener, Ada
            setGrid();
            }
          });
-
-      mObjectType = 0;
-
-      Spinner typeSpinner  = (Spinner)findViewById(R.id.objectpicker_spinnerType);
-      typeSpinner.setOnItemSelectedListener(this);
-
-      String[] objectType = new String[] {"DistortedCubes", "DistortedBitmap"};
-
-      ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, objectType);
-      adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
-      typeSpinner.setAdapter(adapter);
       }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -150,22 +135,6 @@ public class CubesActivity extends Activity implements View.OnClickListener, Ada
         }
       }
 
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void onItemSelected(AdapterView<?> parent, View view, int pos, long id)
-    {
-    switch(parent.getId())
-      {
-      case R.id.objectpicker_spinnerType: mObjectType = pos; break;
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void onNothingSelected(AdapterView<?> parent)
-    {
-    }
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
     
     public void onClick(View view) 
@@ -224,19 +193,12 @@ public class CubesActivity extends Activity implements View.OnClickListener, Ada
     
     public void Create(View v)
       {
-      if( mObjectType==1 )
-        {
-        mObject = new DistortedBitmap(100,100,mNumCols);
-        }
-      else
-        {
-        String str = "";
+      String str = "";
 
-        for(int i=0; i<mNumRows*mNumCols; i++)
-          str += mShape[i] ? "1" : "0";
+      for(int i=0; i<mNumRows*mNumCols; i++)
+        str += mShape[i] ? "1" : "0";
 
-        mObject = new DistortedCubes(mNumCols, str, 10);
-        }
+      mObject = new DistortedCubes(mNumCols, str, 10);
 
       setContentView(R.layout.cubeslayout);
       }
diff --git a/src/main/res/layout/cubespickerlayout.xml b/src/main/res/layout/cubespickerlayout.xml
new file mode 100644
index 0000000..184b339
--- /dev/null
+++ b/src/main/res/layout/cubespickerlayout.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+   <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+       <LinearLayout
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+        <NumberPicker
+         android:id="@+id/cubespicker_rows"
+         android:layout_width="wrap_content"
+         android:layout_height="wrap_content"
+         android:orientation="vertical"
+         android:layout_span="1"
+         />
+
+        <NumberPicker
+         android:id="@+id/cubespicker_cols"
+         android:layout_width="wrap_content"
+         android:layout_height="wrap_content"
+         android:orientation="vertical"
+         android:layout_span="2"/>
+
+        <Button
+            android:id="@+id/cubespicker_create"
+            android:onClick="Create"
+            android:text="@string/Create"
+            android:layout_width="match_parent"
+            android:layout_height="fill_parent"
+            android:layout_span="3"
+            android:layout_marginTop="5dp"/>
+    </LinearLayout>
+
+       <LinearLayout
+        android:id="@+id/cubespicker_buttongrid"
+        android:layout_width="match_parent"
+        android:layout_height="fill_parent"
+        android:gravity="center"
+        android:orientation="vertical"
+        android:layout_weight="0.8">
+    </LinearLayout>
+
+   </LinearLayout>
\ No newline at end of file
