Revision 0333d81e
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/dialog/RubikDialogScoresPagerAdapter.java | ||
---|---|---|
28 | 28 |
import android.widget.LinearLayout; |
29 | 29 |
|
30 | 30 |
import org.distorted.network.RubikScoresDownloader; |
31 |
import org.distorted.object.RubikObject;
|
|
32 |
import org.distorted.uistate.RubikStatePlay;
|
|
31 |
import static org.distorted.object.RubikObject.LENGTH;
|
|
32 |
import static org.distorted.uistate.RubikStatePlay.MAX_SCRAMBLE;
|
|
33 | 33 |
|
34 | 34 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
35 | 35 |
|
... | ... | |
49 | 49 |
|
50 | 50 |
addPage(mViews[c],country[c],name[c],time[c]); |
51 | 51 |
|
52 |
for(int i = 0; i< RubikObject.LENGTH; i++)
|
|
52 |
for(int i=0; i<LENGTH; i++)
|
|
53 | 53 |
{ |
54 | 54 |
if( i==c ) continue; |
55 | 55 |
|
... | ... | |
66 | 66 |
@Override |
67 | 67 |
public void run() |
68 | 68 |
{ |
69 |
for(int i = 0; i< RubikObject.LENGTH; i++)
|
|
69 |
for(int i=0; i<LENGTH; i++)
|
|
70 | 70 |
{ |
71 | 71 |
mViews[i].prepareView(mAct); |
72 | 72 |
} |
... | ... | |
86 | 86 |
|
87 | 87 |
private void addPage(final RubikDialogScoresView view, final String[][] country, final String[][] name, final String[][] time) |
88 | 88 |
{ |
89 |
for(int i=0; i<RubikStatePlay.MAX_SCRAMBLE; i++)
|
|
89 |
for(int i=0; i<MAX_SCRAMBLE; i++) |
|
90 | 90 |
{ |
91 | 91 |
final LinearLayout section = view.createSection(mAct, i, country[i], name[i], time[i]); |
92 | 92 |
|
... | ... | |
119 | 119 |
@Override |
120 | 120 |
public void run() |
121 | 121 |
{ |
122 |
for(int i = 0; i< RubikObject.LENGTH; i++)
|
|
122 |
for(int i=0; i<LENGTH; i++)
|
|
123 | 123 |
{ |
124 | 124 |
mViews[i].exception(exce); |
125 | 125 |
} |
... | ... | |
132 | 132 |
RubikDialogScoresPagerAdapter(FragmentActivity act, ViewPager viewPager) |
133 | 133 |
{ |
134 | 134 |
mAct = act; |
135 |
mViews = new RubikDialogScoresView[RubikObject.LENGTH];
|
|
135 |
mViews = new RubikDialogScoresView[LENGTH]; |
|
136 | 136 |
mViewPager = viewPager; |
137 | 137 |
|
138 | 138 |
viewPager.setAdapter(this); |
139 |
viewPager.setOffscreenPageLimit( RubikObject.LENGTH-1 );
|
|
139 |
viewPager.setOffscreenPageLimit(LENGTH-1);
|
|
140 | 140 |
} |
141 | 141 |
|
142 | 142 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
150 | 150 |
|
151 | 151 |
boolean allCreated = true; |
152 | 152 |
|
153 |
for(int i = 0; i< RubikObject.LENGTH; i++)
|
|
153 |
for(int i=0; i<LENGTH; i++)
|
|
154 | 154 |
{ |
155 | 155 |
if( mViews[i]==null ) |
156 | 156 |
{ |
... | ... | |
181 | 181 |
@Override |
182 | 182 |
public int getCount() |
183 | 183 |
{ |
184 |
return RubikObject.LENGTH;
|
|
184 |
return LENGTH; |
|
185 | 185 |
} |
186 | 186 |
|
187 | 187 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Progress with StateSolving