commit a88b947f41c73fe1f0b9a60d7b752bef64a0a44d
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Sun Aug 14 00:02:49 2022 +0200

    IAP, part 3: non-free objects appear in the popup with a lock icon: make the lock icon's size resolution-independent

diff --git a/src/main/java/org/distorted/config/ConfigScreen.java b/src/main/java/org/distorted/config/ConfigScreen.java
index 74294000..a14cd46a 100644
--- a/src/main/java/org/distorted/config/ConfigScreen.java
+++ b/src/main/java/org/distorted/config/ConfigScreen.java
@@ -56,13 +56,14 @@ public class ConfigScreen
 
     int cubeSize  = (int)(width/9);
     int margin    = (int)(width*RubikActivity.LARGE_MARGIN);
+    int padding   = (int)(width*RubikActivity.POPUP_PADDING);
     mObjectSize   = (int)(cubeSize + 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);
 
-    PopupCreator.createObjectGrid(objectGrid,act,mRowCount,mColCount,numObjects,margin,cubeSize);
+    PopupCreator.createObjectGrid(objectGrid,act,mRowCount,mColCount,numObjects,margin,cubeSize,padding);
 
     for(int child=0; child<numObjects; child++)
       {
diff --git a/src/main/java/org/distorted/helpers/PopupCreator.java b/src/main/java/org/distorted/helpers/PopupCreator.java
index 6f925afb..8660606f 100644
--- a/src/main/java/org/distorted/helpers/PopupCreator.java
+++ b/src/main/java/org/distorted/helpers/PopupCreator.java
@@ -15,6 +15,7 @@ import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.GridLayout;
 import android.widget.ImageButton;
+import android.widget.ImageView;
 
 import org.distorted.main.R;
 import org.distorted.objects.RubikObject;
@@ -24,7 +25,7 @@ import org.distorted.objects.RubikObjectList;
 
 public class PopupCreator
   {
-  public static void createObjectGrid(GridLayout grid, Activity act, int rowCount, int colCount, int numObjects, int margin, int size)
+  public static void createObjectGrid(GridLayout grid, Activity act, int rowCount, int colCount, int numObjects, int margin, int size, int pad)
     {
     GridLayout.Spec[] rowSpecs = new GridLayout.Spec[rowCount];
     GridLayout.Spec[] colSpecs = new GridLayout.Spec[colCount];
@@ -48,7 +49,7 @@ public class PopupCreator
 
     for(int object=0; object<numObjects; object++)
       {
-      View v = createView(act,layoutInflater,object);
+      View v = createView(act,layoutInflater,object,pad);
       int row = object/colCount;
 
       GridLayout.LayoutParams params = new GridLayout.LayoutParams(rowSpecs[row],colSpecs[nextInRow[row]]);
@@ -68,7 +69,7 @@ public class PopupCreator
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private static View createView(Activity act, LayoutInflater inflater, int ordinal)
+  private static View createView(Activity act, LayoutInflater inflater, int ordinal, int pad)
     {
     final RubikObject obj = RubikObjectList.getObject(ordinal);
 
@@ -85,6 +86,8 @@ public class PopupCreator
         final View layout = inflater.inflate(R.layout.non_free_object, null);
         ImageButton button= layout.findViewById(R.id.non_free_button);
         obj.setIconTo(act,button);
+        ImageView view= layout.findViewById(R.id.non_free_lock);
+        view.setPadding(0,pad,0,0);
         return layout;
         }
       }
diff --git a/src/main/java/org/distorted/main/RubikActivity.java b/src/main/java/org/distorted/main/RubikActivity.java
index 0db1a8b7..f13488d2 100644
--- a/src/main/java/org/distorted/main/RubikActivity.java
+++ b/src/main/java/org/distorted/main/RubikActivity.java
@@ -65,6 +65,7 @@ public class RubikActivity extends AppCompatActivity
     public static final float SMALL_MARGIN        = 0.004f;
     public static final float MEDIUM_MARGIN       = 0.015f;
     public static final float LARGE_MARGIN        = 0.025f;
+    public static final float POPUP_PADDING       = 0.045f;
     public static final float BUTTON_TEXT_SIZE    = 0.05f;
     public static final float TITLE_TEXT_SIZE     = 0.06f;
     public static final float SOLVER_BMP_H_SIZE   = 0.11f;
diff --git a/src/main/java/org/distorted/screens/RubikScreenPlay.java b/src/main/java/org/distorted/screens/RubikScreenPlay.java
index ffbb6af1..eeb590cf 100644
--- a/src/main/java/org/distorted/screens/RubikScreenPlay.java
+++ b/src/main/java/org/distorted/screens/RubikScreenPlay.java
@@ -178,6 +178,7 @@ public class RubikScreenPlay extends RubikScreenBase implements RubikNetwork.Upd
 
     int cubeSize = (int)(width/9);
     int margin   = (int)(width*RubikActivity.LARGE_MARGIN);
+    int padding  = (int)(width*RubikActivity.POPUP_PADDING);
     mObjectSize  = (int)(cubeSize + 2*margin + 0.5f);
     mMaxRowCount = (int)((height-1.8f*mUpperBarHeight)/mObjectSize);
 
@@ -186,7 +187,7 @@ public class RubikScreenPlay extends RubikScreenBase implements RubikNetwork.Upd
     RelativeLayout bottomLayout = view.findViewById(R.id.bottomLayout);
     setupBottomLayout(act,bottomLayout);
 
-    PopupCreator.createObjectGrid(objectGrid,act,mRowCount,mColCount,numObjects,margin,cubeSize);
+    PopupCreator.createObjectGrid(objectGrid,act,mRowCount,mColCount,numObjects,margin,cubeSize,padding);
 
     for(int child=0; child<numObjects; child++)
       {
