commit f3e129313952cccdec8ca36d2585bce0257363a1
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Sat Feb 8 23:37:42 2020 +0000

    Improvements

diff --git a/src/main/java/org/distorted/magic/RubikActivity.java b/src/main/java/org/distorted/magic/RubikActivity.java
index 4001748f..c6d38bc2 100644
--- a/src/main/java/org/distorted/magic/RubikActivity.java
+++ b/src/main/java/org/distorted/magic/RubikActivity.java
@@ -27,7 +27,11 @@ import android.os.Bundle;
 import android.preference.PreferenceManager;
 import android.support.v4.content.ContextCompat;
 import android.support.v7.app.AppCompatActivity;
+import android.util.DisplayMetrics;
 import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageButton;
+import android.widget.LinearLayout;
 
 import org.distorted.component.HorizontalNumberPicker;
 import org.distorted.library.main.DistortedLibrary;
@@ -35,16 +39,13 @@ import org.distorted.effect.BaseEffect;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-public class RubikActivity extends AppCompatActivity
+public class RubikActivity extends AppCompatActivity implements View.OnClickListener
 {
-    static final int DEFAULT_SIZE  = 3;
-    static final int SMALLEST_SIZE = 2;
-
     public static final int MIN_SCRAMBLE =  1;
     public static final int DEF_SCRAMBLE =  1;
     public static final int MAX_SCRAMBLE = 17;
 
-    private static int mSize = DEFAULT_SIZE;
+    private static int mSize = RubikSize.DEFAULT_SIZE;
     private HorizontalNumberPicker mPicker;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -55,9 +56,9 @@ public class RubikActivity extends AppCompatActivity
 
       for(int b=0; b<RubikSize.LENGTH; b++)
         {
-        Drawable d = findViewById(RubikSize.getSize(b).getImageButton()).getBackground();
+        Drawable d = findViewById(b).getBackground();
 
-        if( size == b+SMALLEST_SIZE )
+        if( size == RubikSize.getSize(b).getCubeSize() )
           {
           d.setColorFilter(ContextCompat.getColor(this,R.color.red), PorterDuff.Mode.MULTIPLY);
           }
@@ -101,6 +102,30 @@ public class RubikActivity extends AppCompatActivity
       mPicker.setValue(scramble);
       }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    private void addSizeButtons()
+      {
+      LinearLayout layout = findViewById(R.id.sizeLayout);
+      DisplayMetrics metrics = getResources().getDisplayMetrics();
+      float scale = metrics.density;
+      int size = (int)(64*scale +0.5f);
+      int padding = (int)(3*scale + 0.5f);
+      ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(size,size);
+
+      for(int i=0; i<RubikSize.LENGTH; i++)
+        {
+        ImageButton button = new ImageButton(this);
+        button.setLayoutParams(params);
+        button.setId(i);
+        button.setPadding(padding,0,padding,0);
+        int iconID = RubikSize.getSize(i).getIconID();
+        button.setImageResource(iconID);
+        button.setOnClickListener(this);
+        layout.addView(button);
+        }
+      }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
     static int getSize()
@@ -116,6 +141,7 @@ public class RubikActivity extends AppCompatActivity
       super.onCreate(savedState);
       setTheme(R.style.CustomActivityThemeNoActionBar);
       setContentView(R.layout.main);
+      addSizeButtons();
       markButton(mSize);
 
       mPicker = findViewById(R.id.rubikNumberPicker);
@@ -133,6 +159,7 @@ public class RubikActivity extends AppCompatActivity
       GLSurfaceView view = findViewById(R.id.rubikSurfaceView);
       view.onPause();
       DistortedLibrary.onPause();
+      RubikScoresDownloader.onPause();
       savePreferences();
       super.onPause();
       }
@@ -156,6 +183,27 @@ public class RubikActivity extends AppCompatActivity
       super.onDestroy();
       }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    @Override
+    public void onClick(View v)
+      {
+      int id = v.getId();
+
+      if( id>=0 && id<RubikSize.LENGTH )
+        {
+        int size = RubikSize.getSize(id).getCubeSize();
+
+        RubikSurfaceView view = findViewById(R.id.rubikSurfaceView);
+        boolean success = view.getRenderer().createCube(size);
+
+        if( success )
+          {
+          markButton(size);
+          }
+        }
+      }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // PUBLIC API
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -199,26 +247,4 @@ public class RubikActivity extends AppCompatActivity
       RubikSurfaceView view = findViewById(R.id.rubikSurfaceView);
       view.getRenderer().solveCube();
       }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    public void setSize(View v)
-      {
-      int size=0, id = v.getId();
-
-      for(int b=0; b<RubikSize.LENGTH; b++)
-        if( RubikSize.getSize(b).getImageButton() == id )
-          {
-          size = b+SMALLEST_SIZE;
-          break;
-          }
-
-      RubikSurfaceView view = findViewById(R.id.rubikSurfaceView);
-      boolean success = view.getRenderer().createCube(size);
-
-      if( success )
-        {
-        markButton(size);
-        }
-      }
 }
diff --git a/src/main/java/org/distorted/magic/RubikScores.java b/src/main/java/org/distorted/magic/RubikScores.java
index 74351ca8..5b8ae8c7 100644
--- a/src/main/java/org/distorted/magic/RubikScores.java
+++ b/src/main/java/org/distorted/magic/RubikScores.java
@@ -37,6 +37,11 @@ import android.widget.TextView;
 
 public class RubikScores extends AppCompatDialogFragment
   {
+  interface ScoresReceiver
+    {
+    void receive(String scores);
+    }
+
   RubikScoresViewPager mViewPager;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -75,11 +80,13 @@ public class RubikScores extends AppCompatDialogFragment
     for (int i = 0; i< RubikSize.LENGTH; i++)
       {
       ImageView imageView = new ImageView(act);
-      imageView.setImageResource(RubikSize.getSize(i).getIcon());
+      imageView.setImageResource(RubikSize.getSize(i).getIconID());
       TabLayout.Tab tab = tabLayout.getTabAt(i);
       if(tab!=null) tab.setCustomView(imageView);
       }
 
+    RubikScoresDownloader.download(mViewPager);
+
     return builder.create();
     }
   }
diff --git a/src/main/java/org/distorted/magic/RubikScoresDownloader.java b/src/main/java/org/distorted/magic/RubikScoresDownloader.java
index bc1894c3..5cb7ab9b 100644
--- a/src/main/java/org/distorted/magic/RubikScoresDownloader.java
+++ b/src/main/java/org/distorted/magic/RubikScoresDownloader.java
@@ -19,11 +19,223 @@
 
 package org.distorted.magic;
 
-import android.support.v7.app.AppCompatDialogFragment;
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-public class RubikScoresDownloader extends AppCompatDialogFragment
+class RubikScoresDownloader extends Thread
   {
+  private static String mScores = "";
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  static void onPause()
+    {
+    mScores = "";
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  static boolean gottaDownload()
+    {
+    return mScores.length() == 0;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  static void download(RubikScores.ScoresReceiver receiver)
+    {
+    if( gottaDownload() )
+      {
+      doDownload();
+      }
+
+    receiver.receive(mScores);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static void doDownload()
+    {
+mScores =
 
+"0 0 0 INEED7X7X7 1 rus" + "\n" +
+"0 0 1 Tilly 1 uk" + "\n" +
+"0 0 2 ARNOLD 1 rus" + "\n" +
+"0 0 3 ALBERTO 1 mex" + "\n" +
+"0 0 4 TO 1 ger" + "\n" +
+"0 1 0 INEED7X7X7 1 rus" + "\n" +
+"0 1 1 Tilly 1 uk" + "\n" +
+"0 1 2 ALBERTO 1 mex" + "\n" +
+"0 1 3 RINAT 1 rus" + "\n" +
+"0 1 4 BOOW 1 tha" + "\n" +
+"0 2 0 Neriel 3 bra" + "\n" +
+"0 2 1 NPPN 3 vie" + "\n" +
+"0 2 2 FREDRIK 4 den" + "\n" +
+"0 2 3 OHIOCUBER 4 usa" + "\n" +
+"0 2 4 S13 4 usa" + "\n" +
+"0 3 0 NIKITOS 8 rus" + "\n" +
+"0 3 1 THISNAVIS 8 usa" + "\n" +
+"0 3 2 MDR04 9 ita" + "\n" +
+"0 3 3 ROBERT04 9 unk" + "\n" +
+"0 3 4 DULCE 10 mex" + "\n" +
+"0 4 0 THISNAVIS 11 usa" + "\n" +
+"0 4 1 Tilly 12 uk" + "\n" +
+"0 4 2 OHIOCUBER 14 usa" + "\n" +
+"0 4 3 GRV 15 mex" + "\n" +
+"0 4 4 INEED7X7X7 16 rus" + "\n" +
+"0 5 0 KADE 6 unk" + "\n" +
+"0 5 1 FREDRIK 11 den" + "\n" +
+"0 5 2 THISNAVIS 11 usa" + "\n" +
+"0 5 3 Tilly 14 uk" + "\n" +
+"0 5 4 A9QSKPJJDM 16 bra" + "\n" +
+"0 6 0 LoiraH 1 bra" + "\n" +
+"0 6 1 KAN 5 unk" + "\n" +
+"0 6 2 Tilly 7 uk" + "\n" +
+"0 6 3 FRITZ 17 ita" + "\n" +
+"0 6 4 JONIWWE 17 ina" + "\n" +
+"0 7 0 SULTANOUU 30 rus" + "\n" +
+"0 7 1 LOLO766 33 fra" + "\n" +
+"0 7 2 ElyKho 37 mly" + "\n" +
+"0 7 3 FREDRIK 37 den" + "\n" +
+"0 7 4 ILXOM707 37 uzb" + "\n" +
+"0 8 0 pardal 16 bra" + "\n" +
+"0 8 1 ILXOM707 32 uzb" + "\n" +
+"0 8 2 LOLO766 43 fra" + "\n" +
+"0 8 3 NIKODZ 44 geo" + "\n" +
+"0 8 4 SHAFFAF 48 ind" + "\n" +
+"1 0 0 INEED7X7X7 1 rus" + "\n" +
+"1 0 1 Tilly 1 uk" + "\n" +
+"1 0 2 REBECCA 1 fra" + "\n" +
+"1 0 3 PRAKOBKRIT 1 tha" + "\n" +
+"1 0 4 E 1 mex" + "\n" +
+"1 1 0 BAYLEY 3 usa" + "\n" +
+"1 1 1 DEMONAIRE 3 uk" + "\n" +
+"1 1 2 UMMWT 3 ina" + "\n" +
+"1 1 3 MDR04 4 ita" + "\n" +
+"1 1 4 FREDRIK 4 den" + "\n" +
+"1 2 0 HAGER 5 egy" + "\n" +
+"1 2 1 S13 7 usa" + "\n" +
+"1 2 2 UTEK 7 ina" + "\n" +
+"1 2 3 UMMWT 7 ina" + "\n" +
+"1 2 4 210JITQU 7 ukr" + "\n" +
+"1 3 0 UTEK 16 ina" + "\n" +
+"1 3 1 LOLO766 21 fra" + "\n" +
+"1 3 2 NIKITOS 21 rus" + "\n" +
+"1 3 3 PYCUK1707 21 rus" + "\n" +
+"1 3 4 KEDAR 22 ind" + "\n" +
+"1 4 0 Kinkz 7 ned" + "\n" +
+"1 4 1 UTEK 14 ina" + "\n" +
+"1 4 2 SJNT 23 ind" + "\n" +
+"1 4 3 ABCDEF89 24 vie" + "\n" +
+"1 4 4 SIJOYSIJ 27 ind" + "\n" +
+"1 5 0 SIJOYSIJ 40 ind" + "\n" +
+"1 5 1 UTEK 46 ina" + "\n" +
+"1 5 2 SJNT 54 ind" + "\n" +
+"1 5 3 FREDRIK 59 den" + "\n" +
+"1 5 4 YANY 64 arg" + "\n" +
+"1 6 0 UTEK 26 ina" + "\n" +
+"1 6 1 FLAVINHA 57 bra" + "\n" +
+"1 6 2 MILKMAN 57 fin" + "\n" +
+"1 6 3 MARIOEAGLE 59 ita" + "\n" +
+"1 6 4 LOLO766 85 fra" + "\n" +
+"1 7 0 UTEK 45 ina" + "\n" +
+"1 7 1 SEUA 157 vie" + "\n" +
+"1 7 2 FREDRIK 201 den" + "\n" +
+"1 7 3 ARMIN 205 rus" + "\n" +
+"1 7 4 ILXOM7 215 uzb" + "\n" +
+"1 8 0 SJNT 73 ind" + "\n" +
+"1 8 1 MILKOMANN 219 fin" + "\n" +
+"1 8 2 DEMONAIRE 288 uk" + "\n" +
+"1 8 3 SIJ 311 ind" + "\n" +
+"1 8 4 SIJOYSIJ 316 ind" + "\n" +
+"2 0 0 INEED7X7X7 1 rus" + "\n" +
+"2 0 1 HOMER0815 1 ger" + "\n" +
+"2 0 2 EIP 1 usa" + "\n" +
+"2 0 3 THEBIGBOSS 1 fra" + "\n" +
+"2 0 4 PHONG 1 vie" + "\n" +
+"2 1 0 SATERNSPY9 3 unk" + "\n" +
+"2 1 1 S13 4 usa" + "\n" +
+"2 1 2 ALSOELAN 4 usa" + "\n" +
+"2 1 3 NIKITOS 4 rus" + "\n" +
+"2 1 4 SEPIA6MIRA 4 unk" + "\n" +
+"2 2 0 STEVE123 9 irl" + "\n" +
+"2 2 1 NIKITOS 9 rus" + "\n" +
+"2 2 2 SEPIA6MIRA 9 unk" + "\n" +
+"2 2 3 INEED7X7X7 10 rus" + "\n" +
+"2 2 4 S13 10 usa" + "\n" +
+"2 3 0 NIKITOS 22 rus" + "\n" +
+"2 3 1 RUBIK123 24 lit" + "\n" +
+"2 3 2 NONAME 24 fin" + "\n" +
+"2 3 3 ABB0 26 ind" + "\n" +
+"2 3 4 NOYS 27 mex" + "\n" +
+"2 4 0 NIKITOS 37 rus" + "\n" +
+"2 4 1 INEED7X7X7 45 rus" + "\n" +
+"2 4 2 ILXOM7 50 uzb" + "\n" +
+"2 4 3 NOYS 52 mex" + "\n" +
+"2 4 4 MikeK 57 ger" + "\n" +
+"2 5 0 NIKITOS 62 rus" + "\n" +
+"2 5 1 LOLO766 70 fra" + "\n" +
+"2 5 2 HUBBUB 87 swe" + "\n" +
+"2 5 3 TETRAULT 90 usa" + "\n" +
+"2 5 4 NOYS 115 mex" + "\n" +
+"2 6 0 LOLO766 128 fra" + "\n" +
+"2 6 1 KAN 193 unk" + "\n" +
+"2 6 2 MEECMEEC 195 uk" + "\n" +
+"2 6 3 HUBBUB 197 swe" + "\n" +
+"2 6 4 PTOR 238 kyr" + "\n" +
+"2 7 0 CHRISTA 268 za" + "\n" +
+"2 7 1 MUZAFFER 288 tur" + "\n" +
+"2 7 2 INEED7X7X7 323 rus" + "\n" +
+"2 7 3 HECTOR58 360 mex" + "\n" +
+"2 7 4 CABC 391 rus" + "\n" +
+"2 8 0 CABC 245 rus" + "\n" +
+"2 8 1 SIRWALTR 289 arg" + "\n" +
+"2 8 2 NAMIT 558 ind" + "\n" +
+"2 8 3 HDH580702 602 mex" + "\n" +
+"2 8 4 HECTOR58 959 mex" + "\n" +
+"3 0 0 JARO 1 ger" + "\n" +
+"3 0 1 INEED7X7X7 1 rus" + "\n" +
+"3 0 2 MDR04 1 ita" + "\n" +
+"3 0 3 SAMW 1 uk" + "\n" +
+"3 0 4 MOKAI88 1 den" + "\n" +
+"3 1 0 MDR04G 3 ita" + "\n" +
+"3 1 1 INEED7X7X7 4 rus" + "\n" +
+"3 1 2 S13 4 usa" + "\n" +
+"3 1 3 KARAVAN 4 rus" + "\n" +
+"3 1 4 AWSOME897 4 usa" + "\n" +
+"3 2 0 INEED7X7X7 8 rus" + "\n" +
+"3 2 1 KARAVAN 8 rus" + "\n" +
+"3 2 2 S13 9 usa" + "\n" +
+"3 2 3 ALSOELAN 9 usa" + "\n" +
+"3 2 4 ROBERT04 9 unk" + "\n" +
+"3 3 0 NIKITOS 23 rus" + "\n" +
+"3 3 1 THISNAVIS 23 usa" + "\n" +
+"3 3 2 INEED7X7X7 24 rus" + "\n" +
+"3 3 3 RUBIK123 30 lit" + "\n" +
+"3 3 4 SKY16 31 usa" + "\n" +
+"3 4 0 NIKITOS 37 rus" + "\n" +
+"3 4 1 6969696 43 usa" + "\n" +
+"3 4 2 ALFREDOPVV 45 bra" + "\n" +
+"3 4 3 HIEU 48 vie" + "\n" +
+"3 4 4 INEED7X7X7 52 rus" + "\n" +
+"3 5 0 ILXOM707 63 uzb" + "\n" +
+"3 5 1 PHOENIX 77 fin" + "\n" +
+"3 5 2 Nargiza 82 unk" + "\n" +
+"3 5 3 NIKITOS 83 rus" + "\n" +
+"3 5 4 ILXOM7 83 uzb" + "\n" +
+"3 6 0 ILXOM7 81 uzb" + "\n" +
+"3 6 1 ILXOM707 140 uzb" + "\n" +
+"3 6 2 INEED7X7X7 143 rus" + "\n" +
+"3 6 3 KAN 143 unk" + "\n" +
+"3 6 4 RUBIK123 177 lit" + "\n" +
+"3 7 0 ILXOM707 238 uzb" + "\n" +
+"3 7 1 LOLO766 283 fra" + "\n" +
+"3 7 2 INEED7X7X7 293 rus" + "\n" +
+"3 7 3 RUBIK123 313 lit" + "\n" +
+"3 7 4 SIRWALTR 343 arg" + "\n" +
+"3 8 0 CABC 312 rus" + "\n" +
+"3 8 1 HDH580702 411 mex" + "\n" +
+"3 8 2 RUBIK123 558 lit" + "\n" +
+"3 8 3 MUZAFFER 568 tur" + "\n" +
+"3 8 4 NOYS 649 mex";
+    }
   }
diff --git a/src/main/java/org/distorted/magic/RubikScoresViewPager.java b/src/main/java/org/distorted/magic/RubikScoresViewPager.java
index b79364da..5d879afa 100644
--- a/src/main/java/org/distorted/magic/RubikScoresViewPager.java
+++ b/src/main/java/org/distorted/magic/RubikScoresViewPager.java
@@ -19,41 +19,46 @@
 
 package org.distorted.magic;
 
-import android.content.Context;
 import android.support.annotation.NonNull;
+import android.support.v4.app.FragmentActivity;
 import android.support.v4.view.PagerAdapter;
 import android.support.v4.view.ViewPager;
-import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-class RubikScoresViewPager extends PagerAdapter
+class RubikScoresViewPager extends PagerAdapter implements RubikScores.ScoresReceiver
   {
-  private Context mContext;
+  private FragmentActivity mAct;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  RubikScoresViewPager(Context context, ViewPager viewPager)
+  RubikScoresViewPager(FragmentActivity act, ViewPager viewPager)
     {
-    mContext = context;
+    mAct = act;
     viewPager.setAdapter(this);
     viewPager.setOffscreenPageLimit( RubikSize.LENGTH-1 );
     }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// TODO
+
+  public void receive(String scores)
+    {
+
+    }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   @Override
   @NonNull
   public Object instantiateItem(@NonNull ViewGroup collection, int position)
     {
-    int scoresTab= RubikSize.getSize(position).getLayout();
-    LayoutInflater inflater = LayoutInflater.from(mContext);
-    ViewGroup layout = (ViewGroup) inflater.inflate(scoresTab, collection, false);
-    collection.addView(layout);
+    RubikScoresView view = new RubikScoresView(mAct,position);
+    collection.addView(view);
 
-    return layout;
+    return view;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/magic/RubikSize.java b/src/main/java/org/distorted/magic/RubikSize.java
index 3f535e2c..11aa9e9a 100644
--- a/src/main/java/org/distorted/magic/RubikSize.java
+++ b/src/main/java/org/distorted/magic/RubikSize.java
@@ -23,14 +23,15 @@ 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 ),
+  SIZE2 ( 2, R.drawable.button2 ),
+  SIZE3 ( 3, R.drawable.button3 ),
+  SIZE4 ( 4, R.drawable.button4 ),
+  SIZE5 ( 5, R.drawable.button5 ),
   ;
 
+  static final int DEFAULT_SIZE  = 3;
   static final int LENGTH = values().length;
-  private final int mImageButtonID, mIconID, mLayoutID;
+  private final int mCubeSize, mIconID;
   private static final RubikSize[] sizes;
 
   static
@@ -54,31 +55,23 @@ public enum RubikSize
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  RubikSize(int imageID, int iconID, int layoutID)
+  RubikSize(int size, int iconID)
     {
-    mImageButtonID= imageID;
-    mIconID       = iconID;
-    mLayoutID     = layoutID;
+    mCubeSize = size;
+    mIconID   = iconID;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  int getImageButton()
-    {
-    return mImageButtonID;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  int getIcon()
+  int getIconID()
     {
     return mIconID;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  int getLayout()
+  int getCubeSize()
     {
-    return mLayoutID;
+    return mCubeSize;
     }
   }
diff --git a/src/main/res/layout/main.xml b/src/main/res/layout/main.xml
index af619fb0..2a29cda2 100644
--- a/src/main/res/layout/main.xml
+++ b/src/main/res/layout/main.xml
@@ -43,45 +43,11 @@
         android:layout_weight="1" />
 
     <LinearLayout
+        android:id="@+id/sizeLayout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:gravity="center" >
-
-        <ImageButton
-            android:id="@+id/rubikSize2"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:onClick="setSize"
-            android:paddingLeft="3dp"
-            android:paddingRight="3dp"
-            android:src="@drawable/button2" />
-
-        <ImageButton
-            android:id="@+id/rubikSize3"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:onClick="setSize"
-            android:paddingLeft="3dp"
-            android:paddingRight="3dp"
-            android:src="@drawable/button3" />
-
-        <ImageButton
-            android:id="@+id/rubikSize4"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:onClick="setSize"
-            android:paddingLeft="3dp"
-            android:paddingRight="3dp"
-            android:src="@drawable/button4" />
-
-        <ImageButton
-            android:id="@+id/rubikSize5"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:onClick="setSize"
-            android:paddingLeft="3dp"
-            android:paddingRight="3dp"
-            android:src="@drawable/button5" />
+        android:gravity="center"
+        android:orientation="horizontal">
     </LinearLayout>
 
     <LinearLayout
diff --git a/src/main/res/layout/scores_downloading.xml b/src/main/res/layout/scores_downloading.xml
index 8b930242..dc4bb8a3 100644
--- a/src/main/res/layout/scores_downloading.xml
+++ b/src/main/res/layout/scores_downloading.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <TextView xmlns:android="http://schemas.android.com/apk/res/android"
+  android:id="@+id/downloading_text"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:textSize="32sp"
diff --git a/src/main/res/layout/scores_tab.xml b/src/main/res/layout/scores_tab.xml
new file mode 100644
index 00000000..c01e863d
--- /dev/null
+++ b/src/main/res/layout/scores_tab.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:orientation="vertical" >
+
+    <ScrollView
+         android:id="@+id/tabScrollView"
+         android:layout_width="match_parent"
+         android:layout_height="match_parent"
+         android:background="@color/grey">
+
+         <LinearLayout
+             android:id="@+id/tabLayout"
+             android:layout_width="match_parent"
+             android:layout_height="wrap_content"
+             android:orientation="vertical" >
+         </LinearLayout>
+
+    </ScrollView>
+
+</LinearLayout>
diff --git a/src/main/res/layout/scores_tab2.xml b/src/main/res/layout/scores_tab2.xml
deleted file mode 100644
index 18b3ec79..00000000
--- a/src/main/res/layout/scores_tab2.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:orientation="vertical" >
-
-    <ScrollView
-         android:id="@+id/tabScrollView2"
-         android:layout_width="match_parent"
-         android:layout_height="match_parent">
-
-         <LinearLayout
-             android:id="@+id/tabLayout2"
-             android:layout_width="match_parent"
-             android:layout_height="wrap_content"
-             android:orientation="vertical" >
-         </LinearLayout>
-
-    </ScrollView>
-
-</LinearLayout>
diff --git a/src/main/res/layout/scores_tab3.xml b/src/main/res/layout/scores_tab3.xml
deleted file mode 100644
index e825cfda..00000000
--- a/src/main/res/layout/scores_tab3.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:orientation="vertical" >
-
-    <ScrollView
-         android:id="@+id/tabScrollView3"
-         android:layout_width="match_parent"
-         android:layout_height="match_parent">
-
-         <LinearLayout
-             android:id="@+id/tabLayout3"
-             android:layout_width="match_parent"
-             android:layout_height="wrap_content"
-             android:orientation="vertical" >
-         </LinearLayout>
-
-    </ScrollView>
-
-</LinearLayout>
diff --git a/src/main/res/layout/scores_tab4.xml b/src/main/res/layout/scores_tab4.xml
deleted file mode 100644
index d656c7ef..00000000
--- a/src/main/res/layout/scores_tab4.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:orientation="vertical" >
-
-    <ScrollView
-         android:id="@+id/tabScrollView4"
-         android:layout_width="match_parent"
-         android:layout_height="match_parent">
-
-         <LinearLayout
-             android:id="@+id/tabLayout4"
-             android:layout_width="match_parent"
-             android:layout_height="wrap_content"
-             android:orientation="vertical" >
-         </LinearLayout>
-
-    </ScrollView>
-
-</LinearLayout>
diff --git a/src/main/res/layout/scores_tab5.xml b/src/main/res/layout/scores_tab5.xml
deleted file mode 100644
index 569734e4..00000000
--- a/src/main/res/layout/scores_tab5.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:orientation="vertical" >
-
-    <ScrollView
-         android:id="@+id/tabScrollView5"
-         android:layout_width="match_parent"
-         android:layout_height="match_parent">
-
-         <LinearLayout
-             android:id="@+id/tabLayout5"
-             android:layout_width="match_parent"
-             android:layout_height="wrap_content"
-             android:orientation="vertical" >
-         </LinearLayout>
-
-    </ScrollView>
-
-</LinearLayout>
