commit d5fb0e7e3a6ab2fccc1f8cb5a31af71b717026ee
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Wed Feb 19 15:57:16 2020 +0000

    Improve the 'Scores' dialog: run less on the UI thread which makes this more responsive.

diff --git a/src/main/java/org/distorted/dialog/RubikDialogScoresPagerAdapter.java b/src/main/java/org/distorted/dialog/RubikDialogScoresPagerAdapter.java
index 6cee0bef..f0180aee 100644
--- a/src/main/java/org/distorted/dialog/RubikDialogScoresPagerAdapter.java
+++ b/src/main/java/org/distorted/dialog/RubikDialogScoresPagerAdapter.java
@@ -25,6 +25,7 @@ import android.support.v4.view.PagerAdapter;
 import android.support.v4.view.ViewPager;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.LinearLayout;
 
 import org.distorted.network.RubikScoresDownloader;
 import org.distorted.object.RubikObject;
@@ -92,12 +93,14 @@ class RubikDialogScoresPagerAdapter extends PagerAdapter implements RubikScoresD
       final String[] n = name[section];
       final String[] t = time[section];
 
+      final LinearLayout layout = view.createSection(mAct, sec, c, n, t);
+
       mAct.runOnUiThread(new Runnable()
         {
         @Override
         public void run()
           {
-          view.addSection(mAct, sec, c, n, t);
+          view.addSection(layout);
           }
         });
 
diff --git a/src/main/java/org/distorted/dialog/RubikDialogScoresView.java b/src/main/java/org/distorted/dialog/RubikDialogScoresView.java
index 98b30920..2b6095a6 100644
--- a/src/main/java/org/distorted/dialog/RubikDialogScoresView.java
+++ b/src/main/java/org/distorted/dialog/RubikDialogScoresView.java
@@ -82,7 +82,14 @@ public class RubikDialogScoresView extends FrameLayout
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  void addSection(FragmentActivity act, int scramble, final int[] country, final String[] name, final String[] time)
+  void addSection(LinearLayout section)
+    {
+    mLayout.addView(section);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  LinearLayout createSection(FragmentActivity act, int scramble, final int[] country, final String[] name, final String[] time)
     {
     LinearLayout level = (LinearLayout)inflate(act, R.layout.dialog_scores_scramble_title, null);
     TextView text = level.findViewById(R.id.scoresScrambleTitle);
@@ -106,6 +113,6 @@ public class RubikDialogScoresView extends FrameLayout
         }
       }
 
-    mLayout.addView(level);
+    return level;
     }
   }
