commit e847c5536ff3795bbcfdcbb32dea84b19aa69ea7
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Wed Feb 2 13:36:10 2022 +0100

    Make 'downloaded' debugs controlled by a single boolean.

diff --git a/src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java b/src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java
index cd93c53a..b9e4171e 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java
@@ -41,6 +41,8 @@ import org.distorted.objects.RubikObjectList;
 import org.distorted.screens.RubikScreenPlay;
 import org.distorted.screens.ScreenList;
 
+import static org.distorted.main.RubikActivity.SHOW_DOWNLOADED_DEBUG;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 public class RubikDialogUpdateView implements RubikNetwork.Downloadee
@@ -125,7 +127,7 @@ public class RubikDialogUpdateView implements RubikNetwork.Downloadee
       RubikFiles files = RubikFiles.getInstance();
       mIconSaved = files.saveIcon(act,mInfo.mIcon, name);
 
-      android.util.Log.e("D", "Saving icon "+name+" to a file "+mIconSaved);
+      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Saving icon "+name+" to a file "+mIconSaved);
       }
     }
 
@@ -193,12 +195,12 @@ public class RubikDialogUpdateView implements RubikNetwork.Downloadee
         Activity act = mAct.get();
         oSuccess = files.saveFile(act,mInfo.mObjectStream, name);
 
-        android.util.Log.e("D", "Saving JSON "+name+" to a file "+oSuccess);
+        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Saving JSON "+name+" to a file "+oSuccess);
 
         JsonReader reader = JsonReader.getInstance();
         mInfo.mNumScrambles = reader.readNumScrambles(act,name);
 
-        android.util.Log.e("D", "Read from JSON numScrambles="+mInfo.mNumScrambles);
+        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Read from JSON numScrambles="+mInfo.mNumScrambles);
         }
 
       if( mInfo.mExtrasStream!=null )
@@ -207,33 +209,33 @@ public class RubikDialogUpdateView implements RubikNetwork.Downloadee
         Activity act = mAct.get();
         eSuccess = files.saveFile(act,mInfo.mExtrasStream, name);
 
-        android.util.Log.e("D", "Saving Extras "+name+" to a file "+eSuccess);
+        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Saving Extras "+name+" to a file "+eSuccess);
         }
 
       if( mIconSaved || oSuccess || eSuccess )
         {
         makeProgress(75,R.string.configuring);
 
-        android.util.Log.e("D", "1");
+        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "1");
 
         RubikObjectList.addDownloadedObject(mInfo.mObjectShortName,mInfo.mNumScrambles, mInfo.mObjectMinorVersion,
                                             mInfo.mExtrasMinorVersion, mIconSaved, oSuccess, eSuccess);
 
-        android.util.Log.e("D", "2");
+        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "2");
 
         RubikNetwork network = RubikNetwork.getInstance();
         network.updateDone(mInfo.mObjectShortName);
 
-        android.util.Log.e("D", "3");
+        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "3");
 
         RubikScreenPlay play = (RubikScreenPlay)ScreenList.PLAY.getScreenClass();
         play.recreatePopup();
 
-        android.util.Log.e("D", "4");
+        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "4");
 
         makeProgress(100,R.string.success);
 
-        android.util.Log.e("D", "5");
+        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "5");
         }
       else
         {
diff --git a/src/main/java/org/distorted/external/RubikNetwork.java b/src/main/java/org/distorted/external/RubikNetwork.java
index 52fd3090..0f70e3b8 100644
--- a/src/main/java/org/distorted/external/RubikNetwork.java
+++ b/src/main/java/org/distorted/external/RubikNetwork.java
@@ -42,6 +42,7 @@ import org.distorted.objectlib.json.JsonWriter;
 import org.distorted.objects.RubikObjectList;
 
 import static org.distorted.objects.RubikObjectList.MAX_LEVEL;
+import static org.distorted.main.RubikActivity.SHOW_DOWNLOADED_DEBUG;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -714,7 +715,7 @@ public class RubikNetwork
           icon = downloadIcon(url);
           downloaded = true;
 
-          android.util.Log.e("D", "Downloading icon "+url);
+          if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Downloading icon "+url);
           }
         if( icon!=null )
           {
@@ -739,7 +740,7 @@ public class RubikNetwork
           icon = downloadIcon(url);
           downloaded = true;
 
-          android.util.Log.e("D", "Downloading icon "+url);
+          if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Downloading icon "+url);
           }
         if( icon!=null )
           {
@@ -758,7 +759,7 @@ public class RubikNetwork
 
     try
       {
-      android.util.Log.e("D", "Downloading JSON "+url);
+      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Downloading JSON "+url);
 
       java.net.URL connectURL = new URL(url);
       HttpURLConnection conn = (HttpURLConnection) connectURL.openConnection();
diff --git a/src/main/java/org/distorted/external/RubikUpdates.java b/src/main/java/org/distorted/external/RubikUpdates.java
index 9a772521..6a552200 100644
--- a/src/main/java/org/distorted/external/RubikUpdates.java
+++ b/src/main/java/org/distorted/external/RubikUpdates.java
@@ -26,6 +26,8 @@ import android.content.Context;
 import android.graphics.Bitmap;
 import org.distorted.objects.RubikObjectList;
 
+import static org.distorted.main.RubikActivity.SHOW_DOWNLOADED_DEBUG;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 public class RubikUpdates
@@ -118,7 +120,7 @@ public class RubikUpdates
       int objOrdinal = RubikObjectList.getOrdinal(shortName.toUpperCase());
       boolean updateO=true, updateE=true;
 
-android.util.Log.e("D", "downloaded object "+shortName+" oMinor="+oMinor+" eMinor="+eMinor);
+      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "downloaded object "+shortName+" oMinor="+oMinor+" eMinor="+eMinor);
 
       if( objOrdinal>=0 )
         {
@@ -127,23 +129,19 @@ android.util.Log.e("D", "downloaded object "+shortName+" oMinor="+oMinor+" eMino
         updateO = localObjectMinor<oMinor;
         updateE = localExtrasMinor<eMinor;
 
-
-android.util.Log.e("D", "object exists locally, localObjectMinor="+localObjectMinor+" localExtrasMinor="+localExtrasMinor);
-
+        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "object exists locally, localObjectMinor="+localObjectMinor+" localExtrasMinor="+localExtrasMinor);
         }
       if( updateO || updateE )
         {
         UpdateInfo info = new UpdateInfo(shortName,longName,description,oMinor,eMinor,oPercent,oIcon,updateO,updateE);
         if(oPercent>=100)
           {
-android.util.Log.e("D", "object added to completed");
-
+          if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "object added to completed");
           mCompleted.add(info);
           }
         else
           {
-android.util.Log.e("D", "object added to started");
-
+          if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "object added to started");
           mStarted.add(info);
           }
         }
@@ -154,7 +152,7 @@ android.util.Log.e("D", "object added to started");
 
   void parse(String updates)
     {
-    android.util.Log.e("D", updates);
+    if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", updates);
 
     mCompleted.clear();
     mStarted.clear();
diff --git a/src/main/java/org/distorted/main/RubikActivity.java b/src/main/java/org/distorted/main/RubikActivity.java
index 0b42b4b8..488774cd 100644
--- a/src/main/java/org/distorted/main/RubikActivity.java
+++ b/src/main/java/org/distorted/main/RubikActivity.java
@@ -65,6 +65,8 @@ import static org.distorted.objectlib.main.TwistyObject.MESH_NICE;
 
 public class RubikActivity extends AppCompatActivity
 {
+    public static final boolean SHOW_DOWNLOADED_DEBUG = false;
+
     public static final float PADDING             = 0.01f;
     public static final float SMALL_MARGIN        = 0.004f;
     public static final float MEDIUM_MARGIN       = 0.015f;
@@ -85,7 +87,6 @@ public class RubikActivity extends AppCompatActivity
     public static final float MENU_SMALL_TEXT_SIZE= 0.035f;
     public static final float TAB_WIDTH           = 0.100f;
     public static final float TAB_HEIGHT          = 0.100f;
-    public static final float BUBBLE_SIZE         = 0.15f;
 
     public static final int FLAGS =  View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
diff --git a/src/main/java/org/distorted/objects/RubikObject.java b/src/main/java/org/distorted/objects/RubikObject.java
index 5d6a38fa..79cf6e53 100644
--- a/src/main/java/org/distorted/objects/RubikObject.java
+++ b/src/main/java/org/distorted/objects/RubikObject.java
@@ -37,6 +37,7 @@ import org.distorted.objectlib.main.ObjectType;
 import org.distorted.patterns.RubikPatternList;
 
 import static org.distorted.objectlib.main.TwistyObject.MESH_NICE;
+import static org.distorted.main.RubikActivity.SHOW_DOWNLOADED_DEBUG;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -85,7 +86,7 @@ public class RubikObject
 
   RubikObject(RubikObjectList.DownloadedObject object)
     {
-    android.util.Log.e("D", "new downloaded RubikObject "+object.shortName+" added");
+    if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "new downloaded RubikObject "+object.shortName+" added");
 
     mLowerName     = object.shortName;
     mUpperName     = object.shortName.toUpperCase();
@@ -111,7 +112,7 @@ public class RubikObject
 
     if( object.objectMinor>JsonWriter.VERSION_OBJECT_MINOR )
       {
-      android.util.Log.e("D", "Updating RubikObject's "+object.shortName+" main JSON");
+      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Updating RubikObject's "+object.shortName+" main JSON");
 
       mObjectMinor = object.objectMinor;
       mNumScramble = object.numScrambles;
@@ -122,7 +123,7 @@ public class RubikObject
 
     if( object.extrasMinor>JsonWriter.VERSION_EXTRAS_MINOR )
       {
-      android.util.Log.e("D", "Updating RubikObject's "+object.shortName+" extras JSON");
+      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Updating RubikObject's "+object.shortName+" extras JSON");
 
       mExtrasMinor = object.extrasMinor;
       mExtrasID = -1;
diff --git a/src/main/java/org/distorted/objects/RubikObjectList.java b/src/main/java/org/distorted/objects/RubikObjectList.java
index aa437c42..a726dc5d 100644
--- a/src/main/java/org/distorted/objects/RubikObjectList.java
+++ b/src/main/java/org/distorted/objects/RubikObjectList.java
@@ -31,6 +31,7 @@ import org.distorted.screens.ScreenList;
 
 import static org.distorted.objectlib.main.TwistyObject.MESH_NICE;
 import static org.distorted.objectlib.main.ObjectType.NUM_OBJECTS;
+import static org.distorted.main.RubikActivity.SHOW_DOWNLOADED_DEBUG;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -104,20 +105,18 @@ public class RubikObjectList
       mObjects.add(obj);
       mNumObjects++;
 
-android.util.Log.e("D", "creating local object "+type.name() );
+      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "creating local object "+type.name() );
 
       if( obj.hasExtras() )
         {
-        android.util.Log.e("D", "has extras "+mNumExtras );
-
+        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "has extras "+mNumExtras );
 
         obj.setExtrasOrdinal(mNumExtras);
         mNumExtras++;
         }
       else
         {
-        android.util.Log.e("D", "no extras");
-
+        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "no extras");
         }
       }
     }
@@ -138,19 +137,18 @@ android.util.Log.e("D", "creating local object "+type.name() );
     mObjects.add(obj);
     mNumObjects++;
 
-
-android.util.Log.e("D", "creating downloaded object "+obj.getUpperName() );
+    if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "creating downloaded object "+obj.getUpperName() );
 
     if( obj.hasExtras() )
       {
-      android.util.Log.e("D", "has extras "+mNumExtras );
+      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "has extras "+mNumExtras );
 
       obj.setExtrasOrdinal(mNumExtras);
       mNumExtras++;
       }
     else
       {
-      android.util.Log.e("D", "no extras");
+      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "no extras");
       }
 
     return true;
@@ -197,7 +195,7 @@ android.util.Log.e("D", "creating downloaded object "+obj.getUpperName() );
         obj.object|= object;
         obj.extras|= extras;
 
-        android.util.Log.e("D", "Updating downloaded object "+shortName);
+        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Updating downloaded object "+shortName);
 
         return;
         }
@@ -206,7 +204,7 @@ android.util.Log.e("D", "creating downloaded object "+obj.getUpperName() );
     DownloadedObject extra = new DownloadedObject(shortName,numScrambles,objectMinor,extrasMinor,icon,object,extras);
     if ( internalAddDownloadedObject(extra) )
       {
-      android.util.Log.e("D", "Adding new downloaded object "+shortName);
+      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Adding new downloaded object "+shortName);
       mDownloadedObjects.add(extra);
       }
     }
@@ -259,7 +257,7 @@ android.util.Log.e("D", "creating downloaded object "+obj.getUpperName() );
         }
 
       String objects = downloadedObjects.toString();
-android.util.Log.e("D", "saving: "+objects);
+      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "saving: "+objects);
 
       editor.putString("rol_downloaded", objects );
       }
@@ -287,7 +285,7 @@ android.util.Log.e("D", "saving: "+objects);
     {
     String downloaded = preferences.getString("rol_downloaded","");
 
-    android.util.Log.e("D", downloaded);
+    if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", downloaded);
 
     if( !downloaded.equals(""))
       {
