commit 13ed61b540a0e1974dfcd62ff6b27c517dae53f3
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Thu May 7 23:13:55 2020 +0100

    Improve the way we fill up the Scores tab - now it follows what user's doing, so if he changes tabs when the dialog is filling up, he won't have to wait so long.

diff --git a/src/main/java/org/distorted/dialogs/RubikDialogScoresPagerAdapter.java b/src/main/java/org/distorted/dialogs/RubikDialogScoresPagerAdapter.java
index 60346af7..84ec8376 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogScoresPagerAdapter.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogScoresPagerAdapter.java
@@ -49,15 +49,30 @@ class RubikDialogScoresPagerAdapter extends PagerAdapter implements RubikScoresD
     {
     prepareView();
 
-    int c = mViewPager.getCurrentItem();
+    boolean[] tabDone = new boolean[mNumTabs];
+    for(int i=0; i<mNumTabs; i++) tabDone[i] = false;
+    int toDo, doneTabs=0;
 
-    addPage(c, mViews[c],country[c],name[c],time[c]);
-
-    for(int i=0; i<mNumTabs; i++)
+    while( doneTabs<mNumTabs )
       {
-      if( i==c ) continue;
+      toDo = mViewPager.getCurrentItem();
+
+      if( tabDone[toDo] )
+        {
+        for(int i=0; i<mNumTabs; i++)
+          {
+          if( !tabDone[i] )
+            {
+            toDo = i;
+            break;
+            }
+          }
+        }
+
+      addPage(toDo, mViews[toDo],country[toDo],name[toDo],time[toDo]);
 
-      addPage(i, mViews[i],country[i],name[i],time[i]);
+      doneTabs++;
+      tabDone[toDo] = true;
       }
     }
 
