commit bd9776f6717d7eeefed3e401dd9079895797ac45
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Thu Dec 29 01:10:20 2022 +0100

    Fix marking objects as free.

diff --git a/src/main/java/org/distorted/objects/RubikObject.java b/src/main/java/org/distorted/objects/RubikObject.java
index 15788b58..26a5ebc6 100644
--- a/src/main/java/org/distorted/objects/RubikObject.java
+++ b/src/main/java/org/distorted/objects/RubikObject.java
@@ -20,6 +20,8 @@ import android.graphics.drawable.Drawable;
 import android.widget.ImageButton;
 import android.widget.ImageView;
 
+import androidx.appcompat.content.res.AppCompatResources;
+
 import org.distorted.dmesh.ObjectMesh;
 import org.distorted.external.RubikFiles;
 import org.distorted.jsons.ObjectJson;
@@ -41,9 +43,9 @@ public class RubikObject
   private final String mLowerName, mUpperName;
   private final int mIconID;
   private final String[][] mPatterns;
+  private final int mPrice;
 
   private boolean mIsFree;
-  private int mPrice;
   private int mJsonID, mMeshID, mExtrasID;
   private int mObjectMinor, mExtrasMinor;
   private int mNumScramble;
@@ -140,13 +142,13 @@ public class RubikObject
     {
     if( mIconID>0 )
       {
-      mStaticIconD = act.getDrawable(mIconID);
+      mStaticIconD = AppCompatResources.getDrawable(act,mIconID);
       }
     else
       {
       RubikFiles files = RubikFiles.getInstance();
       Bitmap bmp = files.getIcon(act,mLowerName+".png");
-      if( bmp==null ) mStaticIconD = act.getDrawable(R.drawable.unknown_icon);
+      if( bmp==null ) mStaticIconD = AppCompatResources.getDrawable(act,R.drawable.unknown_icon);
       else            mStaticIconD = new BitmapDrawable(act.getResources(), bmp);
       }
     }
@@ -157,13 +159,13 @@ public class RubikObject
     {
     if( mIconID>0 )
       {
-      mRescaledIconD = act.getDrawable(mIconID);
+      mRescaledIconD = AppCompatResources.getDrawable(act,mIconID);
       }
     else
       {
       RubikFiles files = RubikFiles.getInstance();
       Bitmap bmp = files.getIcon(act,mLowerName+".png");
-      if( bmp==null ) mRescaledIconD = act.getDrawable(R.drawable.unknown_icon);
+      if( bmp==null ) mRescaledIconD = AppCompatResources.getDrawable(act,R.drawable.unknown_icon);
       else            mRescaledIconD = new BitmapDrawable(act.getResources(), bmp);
       }
     }
diff --git a/src/main/java/org/distorted/objects/RubikObjectList.java b/src/main/java/org/distorted/objects/RubikObjectList.java
index a48f12cf..b2697be4 100644
--- a/src/main/java/org/distorted/objects/RubikObjectList.java
+++ b/src/main/java/org/distorted/objects/RubikObjectList.java
@@ -476,8 +476,11 @@ public class RubikObjectList
 
       if( object!=null && !object.isFree() && scores.isSolved(obj,LEVELS_SHOWN) )
         {
-        if( SHOW_IAP_DEBUG ) android.util.Log.e("D", "object "+object.getUpperName()+" marked as free");
+        String shortName = object.getUpperName();
+        if( SHOW_IAP_DEBUG ) android.util.Log.e("D", "object "+shortName+" marked as free");
         object.markFree();
+        String add = mBoughtObjects.length()==0 ? shortName : (","+shortName);
+        mBoughtObjects += add;
         int price = object.getPrice();
         scores.changeNumStars(-price);
         ret++;
@@ -499,8 +502,11 @@ public class RubikObjectList
 
       if( object!=null && !object.isFree() )
         {
-        if( SHOW_IAP_DEBUG ) android.util.Log.e("D", "object "+object.getUpperName()+" marked as free");
+        String shortName = object.getUpperName();
+        if( SHOW_IAP_DEBUG ) android.util.Log.e("D", "object "+shortName+" marked as free");
         object.markFree();
+        String add = mBoughtObjects.length()==0 ? shortName : (","+shortName);
+        mBoughtObjects += add;
         int price = object.getPrice();
         scores.changeNumStars(-price);
         numToBeMarked--;
