Project

General

Profile

« Previous | Next » 

Revision 13ed61b5

Added by Leszek Koltunski over 4 years ago

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.

View differences:

src/main/java/org/distorted/dialogs/RubikDialogScoresPagerAdapter.java
49 49
    {
50 50
    prepareView();
51 51

  
52
    int c = mViewPager.getCurrentItem();
52
    boolean[] tabDone = new boolean[mNumTabs];
53
    for(int i=0; i<mNumTabs; i++) tabDone[i] = false;
54
    int toDo, doneTabs=0;
53 55

  
54
    addPage(c, mViews[c],country[c],name[c],time[c]);
55

  
56
    for(int i=0; i<mNumTabs; i++)
56
    while( doneTabs<mNumTabs )
57 57
      {
58
      if( i==c ) continue;
58
      toDo = mViewPager.getCurrentItem();
59

  
60
      if( tabDone[toDo] )
61
        {
62
        for(int i=0; i<mNumTabs; i++)
63
          {
64
          if( !tabDone[i] )
65
            {
66
            toDo = i;
67
            break;
68
            }
69
          }
70
        }
71

  
72
      addPage(toDo, mViews[toDo],country[toDo],name[toDo],time[toDo]);
59 73

  
60
      addPage(i, mViews[i],country[i],name[i],time[i]);
74
      doneTabs++;
75
      tabDone[toDo] = true;
61 76
      }
62 77
    }
63 78

  

Also available in: Unified diff