commit dd73fdabfbb775cc2e5f48a902e1a82dcbc6cf5a
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Fri Feb 7 00:56:32 2020 +0000

    Improvements

diff --git a/src/main/java/org/distorted/magic/RubikActivity.java b/src/main/java/org/distorted/magic/RubikActivity.java
index 34a58fe7..4001748f 100644
--- a/src/main/java/org/distorted/magic/RubikActivity.java
+++ b/src/main/java/org/distorted/magic/RubikActivity.java
@@ -39,7 +39,6 @@ public class RubikActivity extends AppCompatActivity
 {
     static final int DEFAULT_SIZE  = 3;
     static final int SMALLEST_SIZE = 2;
-    private static final int[] button_ids  = {R.id.rubikSize2, R.id.rubikSize3, R.id.rubikSize4, R.id.rubikSize5};
 
     public static final int MIN_SCRAMBLE =  1;
     public static final int DEF_SCRAMBLE =  1;
@@ -54,9 +53,9 @@ public class RubikActivity extends AppCompatActivity
       {
       mSize = size;
 
-      for(int b=0; b<button_ids.length; b++)
+      for(int b=0; b<RubikSize.LENGTH; b++)
         {
-        Drawable d = findViewById(button_ids[b]).getBackground();
+        Drawable d = findViewById(RubikSize.getSize(b).getImageButton()).getBackground();
 
         if( size == b+SMALLEST_SIZE )
           {
@@ -109,13 +108,6 @@ public class RubikActivity extends AppCompatActivity
       return mSize;
       }
 
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    static int getNumCubes()
-      {
-      return button_ids.length;
-      }
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
     @Override
@@ -214,8 +206,8 @@ public class RubikActivity extends AppCompatActivity
       {
       int size=0, id = v.getId();
 
-      for(int b=0; b<button_ids.length; b++)
-        if( button_ids[b] == id )
+      for(int b=0; b<RubikSize.LENGTH; b++)
+        if( RubikSize.getSize(b).getImageButton() == id )
           {
           size = b+SMALLEST_SIZE;
           break;
diff --git a/src/main/java/org/distorted/magic/RubikScores.java b/src/main/java/org/distorted/magic/RubikScores.java
index 1a921563..74351ca8 100644
--- a/src/main/java/org/distorted/magic/RubikScores.java
+++ b/src/main/java/org/distorted/magic/RubikScores.java
@@ -72,10 +72,10 @@ public class RubikScores extends AppCompatDialogFragment
     mViewPager = new RubikScoresViewPager(act,viewPager);
     tabLayout.setupWithViewPager(viewPager);
 
-    for (int i=0; i<RubikScoresTab.LENGTH; i++)
+    for (int i = 0; i< RubikSize.LENGTH; i++)
       {
       ImageView imageView = new ImageView(act);
-      imageView.setImageResource(RubikScoresTab.getTab(i).getIcon());
+      imageView.setImageResource(RubikSize.getSize(i).getIcon());
       TabLayout.Tab tab = tabLayout.getTabAt(i);
       if(tab!=null) tab.setCustomView(imageView);
       }
diff --git a/src/main/java/org/distorted/magic/RubikScoresTab.java b/src/main/java/org/distorted/magic/RubikScoresTab.java
deleted file mode 100644
index f131fa0c..00000000
--- a/src/main/java/org/distorted/magic/RubikScoresTab.java
+++ /dev/null
@@ -1,78 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2020 Leszek Koltunski                                                               //
-//                                                                                               //
-// This file is part of Magic Cube.                                                              //
-//                                                                                               //
-// Magic Cube is free software: you can redistribute it and/or modify                            //
-// it under the terms of the GNU General Public License as published by                          //
-// the Free Software Foundation, either version 2 of the License, or                             //
-// (at your option) any later version.                                                           //
-//                                                                                               //
-// Magic Cube is distributed in the hope that it will be useful,                                 //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
-// GNU General Public License for more details.                                                  //
-//                                                                                               //
-// You should have received a copy of the GNU General Public License                             //
-// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-package org.distorted.magic;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-public enum RubikScoresTab
-  {
-  TAB1 ( R.drawable.button2, R.layout.scores_tab2 ),
-  TAB2 ( R.drawable.button3, R.layout.scores_tab3 ),
-  TAB3 ( R.drawable.button4, R.layout.scores_tab4 ),
-  TAB4 ( R.drawable.button5, R.layout.scores_tab5 ),
-  ;
-
-  static final int LENGTH = values().length;
-
-  private final int mIconID, mLayoutID;
-
-  private static final RubikScoresTab[] tabs;
-
-  static
-    {
-    int i = 0;
-    tabs = new RubikScoresTab[LENGTH];
-
-    for(RubikScoresTab tab: RubikScoresTab.values())
-      {
-      tabs[i] = tab;
-      i++;
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  static RubikScoresTab getTab(int ordinal)
-    {
-    return tabs[ordinal];
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  RubikScoresTab(int iconID, int layoutID)
-    {
-    mIconID   = iconID;
-    mLayoutID = layoutID;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  int getIcon()
-    {
-    return mIconID;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  int getLayout()
-    {
-    return mLayoutID;
-    }
-  }
diff --git a/src/main/java/org/distorted/magic/RubikScoresViewPager.java b/src/main/java/org/distorted/magic/RubikScoresViewPager.java
index a9220218..b79364da 100644
--- a/src/main/java/org/distorted/magic/RubikScoresViewPager.java
+++ b/src/main/java/org/distorted/magic/RubikScoresViewPager.java
@@ -39,7 +39,7 @@ class RubikScoresViewPager extends PagerAdapter
     {
     mContext = context;
     viewPager.setAdapter(this);
-    viewPager.setOffscreenPageLimit( RubikScoresTab.LENGTH-1 );
+    viewPager.setOffscreenPageLimit( RubikSize.LENGTH-1 );
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -48,7 +48,7 @@ class RubikScoresViewPager extends PagerAdapter
   @NonNull
   public Object instantiateItem(@NonNull ViewGroup collection, int position)
     {
-    int scoresTab= RubikScoresTab.getTab(position).getLayout();
+    int scoresTab= RubikSize.getSize(position).getLayout();
     LayoutInflater inflater = LayoutInflater.from(mContext);
     ViewGroup layout = (ViewGroup) inflater.inflate(scoresTab, collection, false);
     collection.addView(layout);
@@ -69,7 +69,7 @@ class RubikScoresViewPager extends PagerAdapter
   @Override
   public int getCount()
     {
-    return RubikScoresTab.LENGTH;
+    return RubikSize.LENGTH;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/magic/RubikSize.java b/src/main/java/org/distorted/magic/RubikSize.java
new file mode 100644
index 00000000..3f535e2c
--- /dev/null
+++ b/src/main/java/org/distorted/magic/RubikSize.java
@@ -0,0 +1,84 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2020 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Magic Cube.                                                              //
+//                                                                                               //
+// Magic Cube is free software: you can redistribute it and/or modify                            //
+// it under the terms of the GNU General Public License as published by                          //
+// the Free Software Foundation, either version 2 of the License, or                             //
+// (at your option) any later version.                                                           //
+//                                                                                               //
+// Magic Cube is distributed in the hope that it will be useful,                                 //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
+// GNU General Public License for more details.                                                  //
+//                                                                                               //
+// You should have received a copy of the GNU General Public License                             //
+// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.magic;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+public enum RubikSize
+  {
+  SIZE2 ( R.id.rubikSize2, R.drawable.button2, R.layout.scores_tab2 ),
+  SIZE3 ( R.id.rubikSize3, R.drawable.button3, R.layout.scores_tab3 ),
+  SIZE4 ( R.id.rubikSize4, R.drawable.button4, R.layout.scores_tab4 ),
+  SIZE5 ( R.id.rubikSize5, R.drawable.button5, R.layout.scores_tab5 ),
+  ;
+
+  static final int LENGTH = values().length;
+  private final int mImageButtonID, mIconID, mLayoutID;
+  private static final RubikSize[] sizes;
+
+  static
+    {
+    int i = 0;
+    sizes = new RubikSize[LENGTH];
+
+    for(RubikSize size: RubikSize.values())
+      {
+      sizes[i] = size;
+      i++;
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  static RubikSize getSize(int ordinal)
+    {
+    return sizes[ordinal];
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  RubikSize(int imageID, int iconID, int layoutID)
+    {
+    mImageButtonID= imageID;
+    mIconID       = iconID;
+    mLayoutID     = layoutID;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  int getImageButton()
+    {
+    return mImageButtonID;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  int getIcon()
+    {
+    return mIconID;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  int getLayout()
+    {
+    return mLayoutID;
+    }
+  }
diff --git a/src/main/res/layout/scores_downloading.xml b/src/main/res/layout/scores_downloading.xml
new file mode 100644
index 00000000..8b930242
--- /dev/null
+++ b/src/main/res/layout/scores_downloading.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+  android:layout_width="match_parent"
+  android:layout_height="match_parent"
+  android:textSize="32sp"
+  android:gravity="center"
+  android:text="@string/downloading"
+  android:padding="10dp"/>
\ No newline at end of file
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index ff88b3a2..169ba333 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -16,6 +16,7 @@
     <string name="win_effect">Win Effect</string>
     <string name="duration">Duration:</string>
     <string name="type">Type:</string>
+    <string name="downloading">Downloading...</string>
     <string name="credits1">Open Source app developed using the Distorted graphics library. </string>
     <string name="credits2">Code, tutorials, learn how to write your own graphics effect: <a href="http://www.distorted.org/cube">Distorted.org</a></string>
 
