commit 97a4ae2310d0c5d719030ab63546ebe76aa65ae3
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Wed Nov 24 23:47:04 2021 +0100

    Progress with ConfigScreen.

diff --git a/src/main/java/org/distorted/config/ConfigActivity.java b/src/main/java/org/distorted/config/ConfigActivity.java
index a386ca10..75f4cd39 100644
--- a/src/main/java/org/distorted/config/ConfigActivity.java
+++ b/src/main/java/org/distorted/config/ConfigActivity.java
@@ -22,7 +22,6 @@ package org.distorted.config;
 import android.os.Build;
 import android.os.Bundle;
 import android.util.DisplayMetrics;
-import android.view.DisplayCutout;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.WindowManager;
@@ -39,7 +38,6 @@ import org.distorted.library.main.DistortedLibrary;
 import org.distorted.main.R;
 import org.distorted.objectlib.main.ObjectControl;
 import org.distorted.objectlib.main.ObjectType;
-import org.distorted.tutorials.TutorialScreen;
 
 import java.io.InputStream;
 
@@ -48,8 +46,7 @@ import java.io.InputStream;
 public class ConfigActivity extends AppCompatActivity
 {
     private static final int ACTIVITY_NUMBER = 2;
-    private static final float RATIO_INSET= 0.08f;
-    public static final float BAR_RATIO = 0.17f;
+    private static final float RATIO_BAR  = 0.10f;
 
     public static final float DIALOG_BUTTON_SIZE  = 0.06f;
     public static final float MENU_BIG_TEXT_SIZE  = 0.05f;
@@ -65,7 +62,7 @@ public class ConfigActivity extends AppCompatActivity
     private int mCurrentApiVersion;
     private ConfigScreen mScreen;
     private int mObjectOrdinal;
-    private int mHeightUpperBar;
+    private int mHeightBar;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -87,9 +84,26 @@ public class ConfigActivity extends AppCompatActivity
       getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
       mScreenWidth =displaymetrics.widthPixels;
       mScreenHeight=displaymetrics.heightPixels;
-
+      mScreenHeight = (int)(1.07f*mScreenHeight); // add 7% for the upper bar
+                                                  // which is not yet hidden.
+                                                  // TODO: figure this out exactly.
       hideNavigationBar();
       cutoutHack();
+      computeBarHeights();
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// this does not include possible insets
+
+    private void computeBarHeights()
+      {
+      int barHeight = (int)(mScreenHeight*RATIO_BAR);
+      mHeightBar = barHeight;
+
+      LinearLayout layout = findViewById(R.id.lowerBar);
+      ViewGroup.LayoutParams params = layout.getLayoutParams();
+      params.height = barHeight;
+      layout.setLayoutParams(params);
       }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -125,22 +139,8 @@ public class ConfigActivity extends AppCompatActivity
       {
       super.onAttachedToWindow();
 
-      int insetHeight = 0;
-
-      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
-        {
-        DisplayCutout cutout = getWindow().getDecorView().getRootWindowInsets().getDisplayCutout();
-        insetHeight = cutout!=null ? cutout.getSafeInsetTop() : 0;
-        }
-
-      LinearLayout layoutHid = findViewById(R.id.hiddenBar);
-      ViewGroup.LayoutParams paramsHid = layoutHid.getLayoutParams();
-      paramsHid.height = (int)(insetHeight*RATIO_INSET);
-      layoutHid.setLayoutParams(paramsHid);
-      mHeightUpperBar += paramsHid.height;
-
       if( mScreen==null ) mScreen = new ConfigScreen();
-      mScreen.createScreen(this);
+      mScreen.enterScreen(this,mObjectOrdinal);
       }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -221,13 +221,6 @@ public class ConfigActivity extends AppCompatActivity
       control.changeIfDifferent(type.ordinal(),jsonStream,meshStream);
       }
 
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    ConfigScreen getState()
-      {
-      return mScreen;
-      }
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // PUBLIC API
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -239,9 +232,9 @@ public class ConfigActivity extends AppCompatActivity
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    public int getHeightUpperBar()
+    public int getHeightBar()
       {
-      return mHeightUpperBar;
+      return mHeightBar;
       }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -251,6 +244,13 @@ public class ConfigActivity extends AppCompatActivity
       return mScreenWidth;
       }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    public int getScreenHeightInPixels()
+      {
+      return mScreenHeight;
+      }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
     public ObjectControl getControl()
@@ -301,4 +301,13 @@ public class ConfigActivity extends AppCompatActivity
       ConfigSurfaceView view = findViewById(R.id.configSurfaceView);
       return view.isVertical();
       }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    public void changeObject(ObjectType newObject)
+      {
+      ConfigSurfaceView view = findViewById(R.id.configSurfaceView);
+      ObjectControl control = view.getObjectControl();
+      changeIfDifferent(newObject,control);
+      }
 }
diff --git a/src/main/java/org/distorted/config/ConfigRenderer.java b/src/main/java/org/distorted/config/ConfigRenderer.java
index acc691d2..d05eae3e 100644
--- a/src/main/java/org/distorted/config/ConfigRenderer.java
+++ b/src/main/java/org/distorted/config/ConfigRenderer.java
@@ -42,7 +42,7 @@ public class ConfigRenderer implements GLSurfaceView.Renderer, DistortedLibrary.
 
    ConfigRenderer(ConfigSurfaceView v)
      {
-     final float BRIGHTNESS = 0.30f;
+     final float BRIGHTNESS = 0.333f;
 
      mView = v;
      mScreen = new DistortedScreen();
diff --git a/src/main/java/org/distorted/config/ConfigScreen.java b/src/main/java/org/distorted/config/ConfigScreen.java
index a26b40cb..d7fb4296 100644
--- a/src/main/java/org/distorted/config/ConfigScreen.java
+++ b/src/main/java/org/distorted/config/ConfigScreen.java
@@ -19,26 +19,128 @@
 
 package org.distorted.config;
 
+import android.content.res.Resources;
+import android.graphics.drawable.BitmapDrawable;
+import android.os.Build;
+import android.util.TypedValue;
+import android.view.Gravity;
 import android.view.View;
+import android.widget.GridLayout;
+import android.widget.ImageButton;
 import android.widget.LinearLayout;
+import android.widget.PopupWindow;
+import android.widget.ScrollView;
+import android.widget.TextView;
+
+import org.distorted.objectlib.main.ObjectControl;
+import org.distorted.objectlib.main.ObjectType;
 
 import org.distorted.helpers.TransparentImageButton;
 import org.distorted.main.R;
 import org.distorted.main.RubikActivity;
-import org.distorted.objectlib.main.ObjectControl;
+
+import static android.view.View.inflate;
+import static org.distorted.objectlib.main.ObjectType.NUM_OBJECTS;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 public class ConfigScreen
 {
-  private TransparentImageButton mBackButton;
+  private static final int NUM_COLUMNS = 4;
+  private static final int[] mLocation = new int[2];
+
+  private TransparentImageButton mBackButton, mObjectButton, mPrevButton, mNextButton;
+  private TextView mMovesText;
+  private PopupWindow mObjectPopup;
+  private int mObjectOrdinal;
+  private int mColCount, mRowCount, mMaxRowCount;
+  private int mObjectSize;
+  private int mBarHeight;
+  private float mButtonSize;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void setupObjectWindow(final ConfigActivity act, final float width, final float height)
+    {
+    int icon = RubikActivity.getDrawable(R.drawable.cube_2s,R.drawable.cube_2m, R.drawable.cube_2b, R.drawable.cube_2h);
+
+    Resources res = act.getResources();
+    BitmapDrawable bd = (BitmapDrawable)res.getDrawable(icon);
+    int cubeWidth = bd.getIntrinsicWidth();
+    int margin = (int)(width*RubikActivity.LARGE_MARGIN);
+    mObjectSize = (int)(cubeWidth + 2*margin + 0.5f);
+    mMaxRowCount = (int)((height-mBarHeight)/mObjectSize);
+
+    ScrollView view = (ScrollView)inflate( act, R.layout.popup_object_simple, null);
+    GridLayout objectGrid = view.findViewById(R.id.objectGrid);
+
+    GridLayout.Spec[] rowSpecs = new GridLayout.Spec[mRowCount];
+    GridLayout.Spec[] colSpecs = new GridLayout.Spec[mColCount];
+
+    objectGrid.setColumnCount(mColCount);
+    objectGrid.setRowCount(mRowCount);
+
+    mObjectPopup = new PopupWindow(act);
+    mObjectPopup.setFocusable(true);
+    mObjectPopup.setContentView(view);
+
+    int[] nextInRow = new int[mRowCount];
+
+    for(int row=0; row<mRowCount; row++)
+      {
+      rowSpecs[row] = GridLayout.spec(row);
+      nextInRow[row]= 0;
+      }
+    for(int col=0; col<mColCount; col++)
+      {
+      colSpecs[col] = GridLayout.spec(col);
+      }
+
+    for(int object = 0; object< NUM_OBJECTS; object++)
+      {
+      final int ordinal = object;
+      ObjectType type = ObjectType.getObject(ordinal);
+      int iconSize = RubikActivity.getDrawableSize();
+      int icons = type.getIconID(iconSize);
+      int row = object/NUM_COLUMNS;
+
+      ImageButton button = new ImageButton(act);
+      button.setBackgroundResource(icons);
+      button.setOnClickListener( new View.OnClickListener()
+        {
+        @Override
+        public void onClick(View v)
+          {
+          if( act.getControl().isUINotBlocked() && mObjectOrdinal!=ordinal )
+            {
+            mObjectOrdinal = ordinal;
+            act.changeObject(type);
+            mMovesText.setText(act.getString(R.string.mo_placeholder,mObjectOrdinal+1,NUM_OBJECTS));
+            setupInfo(act);
+            }
+
+          mObjectPopup.dismiss();
+          }
+        });
+
+      GridLayout.LayoutParams params = new GridLayout.LayoutParams(rowSpecs[row],colSpecs[nextInRow[row]]);
+      params.bottomMargin = margin;
+      params.topMargin    = margin;
+      params.leftMargin   = margin;
+      params.rightMargin  = margin;
+
+      nextInRow[row]++;
+
+      objectGrid.addView(button, params);
+      }
+    }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   private void setupBackButton(final ConfigActivity act)
     {
     int icon = RubikActivity.getDrawable(R.drawable.ui_small_smallback,R.drawable.ui_medium_smallback, R.drawable.ui_big_smallback, R.drawable.ui_huge_smallback);
-    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
+    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT);
     mBackButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params);
 
     mBackButton.setOnClickListener( new View.OnClickListener()
@@ -55,19 +157,215 @@ public class ConfigScreen
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  void createScreen(final ConfigActivity act)
+  private void setupObjectButton(final ConfigActivity act, final int width)
     {
-    LinearLayout layout = act.findViewById(R.id.lowerBar);
-    layout.removeAllViews();
-    setupBackButton(act);
-    layout.addView(mBackButton);
+    final int margin= (int)(width*RubikActivity.MARGIN);
+    final int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_menu,R.drawable.ui_medium_cube_menu, R.drawable.ui_big_cube_menu, R.drawable.ui_huge_cube_menu);
+    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT);
+    mObjectButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params);
+
+    mObjectButton.setOnClickListener( new View.OnClickListener()
+      {
+      @Override
+      public void onClick(View view)
+        {
+        if( mObjectPopup==null )
+          {
+          float height= act.getScreenHeightInPixels();
+          setupObjectWindow(act,width,height);
+          }
+
+        if( act.getControl().isUINotBlocked())
+          {
+          int rowCount = Math.min(mMaxRowCount,mRowCount);
+          View popupView = mObjectPopup.getContentView();
+          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
+          displayPopup(act,view,mObjectPopup,mObjectSize*mColCount,mObjectSize*rowCount,margin,margin);
+          }
+        }
+      });
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// work around lame bugs in Android's version <= 10 pop-up and split-screen modes
+
+  private void displayPopup(ConfigActivity act, View view, PopupWindow window, int w, int h, int xoff, int yoff)
+    {
+    View topLayout = act.findViewById(R.id.mainLayout);
+    boolean isFullScreen;
+
+    if( topLayout!=null )
+      {
+      topLayout.getLocationOnScreen(mLocation);
+      isFullScreen = (mLocation[1]==0);
+      }
+    else
+      {
+      isFullScreen = true;
+      }
+
+    try
+      {
+      // if on Android 11 or we are fullscreen
+      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R || isFullScreen )
+        {
+        window.showAsDropDown(view, xoff, yoff, Gravity.CENTER);
+        window.update(view, w, h);
+        }
+      else  // Android 10 or below in pop-up mode or split-screen mode
+        {
+        view.getLocationOnScreen(mLocation);
+        int width  = view.getWidth();
+        int height = view.getHeight();
+        int x = mLocation[0]+(width-w)/2;
+        int y = mLocation[1]+height+yoff;
+
+        window.showAsDropDown(view);
+        window.update(x,y,w,h);
+        }
+      }
+    catch( IllegalArgumentException iae )
+      {
+      // ignore, this means window is 'not attached to window manager' -
+      // which most probably is because we are already exiting the app.
+      }
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-// PUBLIC API
 
-  public ConfigScreen()
+  private void prevObject(ConfigActivity act)
     {
+    mObjectOrdinal--;
+    if( mObjectOrdinal<0 ) mObjectOrdinal=NUM_OBJECTS-1;
+
+    ObjectType type = ObjectType.getObject(mObjectOrdinal);
+    act.changeObject(type);
+
+    setupInfo(act);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void nextObject(ConfigActivity act)
+    {
+    mObjectOrdinal++;
+    if( mObjectOrdinal>=NUM_OBJECTS ) mObjectOrdinal=0;
+
+    ObjectType type = ObjectType.getObject(mObjectOrdinal);
+    act.changeObject(type);
+
+    setupInfo(act);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void setupPrevButton(final ConfigActivity act)
+    {
+    int icon = RubikActivity.getDrawable(R.drawable.ui_small_left,R.drawable.ui_medium_left, R.drawable.ui_big_left, R.drawable.ui_huge_left);
+    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
+    mPrevButton = new TransparentImageButton(act,icon,TransparentImageButton.GRAVITY_MIDDLE,params);
+
+    mPrevButton.setOnClickListener( new View.OnClickListener()
+      {
+      @Override
+      public void onClick(View v)
+        {
+        prevObject(act);
+        mMovesText.setText(act.getString(R.string.mo_placeholder,mObjectOrdinal+1,NUM_OBJECTS));
+        }
+      });
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void setupNextButton(final ConfigActivity act)
+    {
+    int icon = RubikActivity.getDrawable(R.drawable.ui_small_right,R.drawable.ui_medium_right, R.drawable.ui_big_right, R.drawable.ui_huge_right);
+    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
+    mNextButton = new TransparentImageButton(act,icon,TransparentImageButton.GRAVITY_MIDDLE,params);
+
+    mNextButton.setOnClickListener( new View.OnClickListener()
+      {
+      @Override
+      public void onClick(View v)
+        {
+        nextObject(act);
+        mMovesText.setText(act.getString(R.string.mo_placeholder,mObjectOrdinal+1,NUM_OBJECTS));
+        }
+      });
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void setupTextView(final ConfigActivity act, final float width)
+    {
+    int padding = (int)(width*RubikActivity.PADDING);
+    int margin  = (int)(width*RubikActivity.MARGIN);
+    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT,2.0f);
+    params.topMargin    = margin;
+    params.bottomMargin = margin;
+    params.leftMargin   = margin;
+    params.rightMargin  = margin;
+
+    mMovesText = new TextView(act);
+    mMovesText.setTextSize(20);
+    mMovesText.setLayoutParams(params);
+    mMovesText.setPadding(padding,0,padding,0);
+    mMovesText.setGravity(Gravity.CENTER);
+    mMovesText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mButtonSize);
+    mMovesText.setText(act.getString(R.string.mo_placeholder,mObjectOrdinal+1,NUM_OBJECTS));
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// TODO: info pane
+
+  private void setupInfo(ConfigActivity act)
+    {
+
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  void enterScreen(final ConfigActivity act, final int objectOrdinal)
+    {
+    int width = act.getScreenWidthInPixels();
+    mBarHeight = act.getHeightBar();
+    mButtonSize = width*RubikActivity.BUTTON_TEXT_SIZE;
+
+    mRowCount = (NUM_OBJECTS + NUM_COLUMNS-1) / NUM_COLUMNS;
+    mColCount = NUM_COLUMNS;
+
+    mObjectOrdinal = objectOrdinal;
+
+    LinearLayout.LayoutParams paramsL = new LinearLayout.LayoutParams((int)(width/4),LinearLayout.LayoutParams.MATCH_PARENT);
+    LinearLayout.LayoutParams paramsM = new LinearLayout.LayoutParams((int)(width/2),LinearLayout.LayoutParams.MATCH_PARENT);
+    LinearLayout.LayoutParams paramsR = new LinearLayout.LayoutParams((int)(width/4),LinearLayout.LayoutParams.MATCH_PARENT);
+
+    LinearLayout layoutLeft = new LinearLayout(act);
+    layoutLeft.setLayoutParams(paramsL);
+    LinearLayout layoutMid  = new LinearLayout(act);
+    layoutMid.setLayoutParams(paramsM);
+    LinearLayout layoutRight= new LinearLayout(act);
+    layoutRight.setLayoutParams(paramsR);
+
+    setupObjectButton(act,width);
+    setupPrevButton(act);
+    setupNextButton(act);
+    setupTextView(act,width);
+    setupBackButton(act);
+
+    layoutLeft.addView(mObjectButton);
+    layoutMid.addView(mPrevButton);
+    layoutMid.addView(mMovesText);
+    layoutMid.addView(mNextButton);
+    layoutRight.addView(mBackButton);
+
+    LinearLayout layout = act.findViewById(R.id.lowerBar);
+    layout.removeAllViews();
+    layout.addView(layoutLeft);
+    layout.addView(layoutMid);
+    layout.addView(layoutRight);
 
+    setupInfo(act);
     }
 }
diff --git a/src/main/java/org/distorted/config/ConfigSurfaceView.java b/src/main/java/org/distorted/config/ConfigSurfaceView.java
index 155a2fd3..fc8b51b2 100644
--- a/src/main/java/org/distorted/config/ConfigSurfaceView.java
+++ b/src/main/java/org/distorted/config/ConfigSurfaceView.java
@@ -47,7 +47,7 @@ public class ConfigSurfaceView extends GLSurfaceView
       mScreenWidth = width;
       mScreenHeight= height;
       mObjectController.setScreenSize(width,height);
-      mObjectController.setObjectScale(0.80f);
+      mObjectController.setObjectScale(1.00f);
 
       if( !mCreated )
         {
diff --git a/src/main/java/org/distorted/screens/RubikScreenPlay.java b/src/main/java/org/distorted/screens/RubikScreenPlay.java
index 6d0db2b9..a3403d60 100644
--- a/src/main/java/org/distorted/screens/RubikScreenPlay.java
+++ b/src/main/java/org/distorted/screens/RubikScreenPlay.java
@@ -29,7 +29,6 @@ import android.util.TypedValue;
 import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
-import android.view.ViewGroup;
 import android.widget.Button;
 import android.widget.GridLayout;
 import android.widget.ImageButton;
diff --git a/src/main/res/layout/config.xml b/src/main/res/layout/config.xml
index 2f897b3a..ba62efd8 100644
--- a/src/main/res/layout/config.xml
+++ b/src/main/res/layout/config.xml
@@ -1,54 +1,29 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout  xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/mainLayout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical">
 
-    <LinearLayout
-        android:id="@+id/hiddenBar"
+    <org.distorted.config.ConfigSurfaceView
+        android:id="@+id/configSurfaceView"
         android:layout_width="match_parent"
-        android:layout_height="100dp"
-        android:gravity="center"
-        android:orientation="horizontal"
-        android:background="@android:color/transparent">
-    </LinearLayout>
+        android:layout_height="0dp"
+        android:layout_weight="1"/>
 
-    <LinearLayout
-        android:id="@+id/upperBar"
+    <ScrollView
+        android:id="@+id/configScroll"
         android:layout_width="match_parent"
-        android:layout_height="100dp"
-        android:gravity="center"
-        android:orientation="horizontal"
-        android:background="@android:color/transparent">
-    </LinearLayout>
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:gravity="center"
-        android:orientation="vertical"
-        android:background="@android:color/transparent">
-
-        <org.distorted.config.ConfigSurfaceView
-           android:id="@+id/configSurfaceView"
-           android:layout_width="match_parent"
-           android:layout_height="0dp"
-           android:layout_weight="1"/>
-
-        <ScrollView
-           android:id="@+id/configScroll"
-           android:layout_width="match_parent"
-           android:layout_height="0dp"
-           android:layout_weight="1"/>
-
-    </LinearLayout>
+        android:layout_height="0dp"
+        android:layout_weight="1"/>
 
     <LinearLayout
         android:id="@+id/lowerBar"
         android:layout_width="match_parent"
         android:layout_height="100dp"
+        android:layout_gravity="end"
         android:orientation="horizontal"
-        android:background="@android:color/transparent">
+        android:background="@color/light_grey">
     </LinearLayout>
 
 </LinearLayout>
diff --git a/src/main/res/layout/popup_object_simple.xml b/src/main/res/layout/popup_object_simple.xml
new file mode 100644
index 00000000..ac3a45cd
--- /dev/null
+++ b/src/main/res/layout/popup_object_simple.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/objectScroll"
+    android:layout_width="match_parent"
+    android:layout_height="0dp"
+    android:layout_weight="1">
+
+    <GridLayout
+        android:id="@+id/objectGrid"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+    </GridLayout>
+
+</ScrollView>
