Project

General

Profile

« Previous | Next » 

Revision 3329a277

Added by Leszek Koltunski over 3 years ago

Speedup: in the tutorial dialog, only create the current tab +-1.

View differences:

src/main/java/org/distorted/dialogs/RubikDialogTutorial.java
156 156
      }
157 157
    }
158 158

  
159
///////////////////////////////////////////////////////////////////////////////////////////////////
160

  
161
  public void rememberState()
162
    {
163
    mPagerAdapter.rememberState();
164
    }
165

  
166 159
///////////////////////////////////////////////////////////////////////////////////////////////////
167 160

  
168 161
  public static String getDialogTag()
src/main/java/org/distorted/dialogs/RubikDialogTutorialPagerAdapter.java
34 34

  
35 35
class RubikDialogTutorialPagerAdapter extends PagerAdapter
36 36
  {
37
  private FragmentActivity mAct;
38
  private RubikDialogTutorialView[] mViews;
39

  
40
  private int mNumTabs, mHeight;
37
  private final FragmentActivity mAct;
38
  private final RubikDialogTutorialView[] mViews;
39
  private final int mNumTabs;
41 40

  
42 41
///////////////////////////////////////////////////////////////////////////////////////////////////
43 42

  
44 43
  RubikDialogTutorialPagerAdapter(FragmentActivity act, ViewPager viewPager)
45 44
    {
46
    mAct = act;
45
    mAct     = act;
47 46
    mNumTabs = TutorialList.NUM_OBJECTS;
48
    mViews = new RubikDialogTutorialView[mNumTabs];
47
    mViews   = new RubikDialogTutorialView[mNumTabs];
49 48

  
50 49
    viewPager.setAdapter(this);
51
    viewPager.setOffscreenPageLimit(mNumTabs-1);
52
    }
53

  
54
///////////////////////////////////////////////////////////////////////////////////////////////////
55

  
56
  void rememberState()
57
    {
58
    // TODO
50
    viewPager.setOffscreenPageLimit(1);
59 51
    }
60 52

  
61 53
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff