Revision d433b50e
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/dialogs/RubikDialogScores.java | ||
---|---|---|
38 | 38 |
import android.widget.ImageView; |
39 | 39 |
import android.widget.TextView; |
40 | 40 |
|
41 |
import org.distorted.objectlib.main.ObjectType; |
|
42 |
|
|
43 | 41 |
import org.distorted.main.R; |
44 | 42 |
import org.distorted.main.RubikActivity; |
43 |
import org.distorted.objects.RubikObject; |
|
44 |
import org.distorted.objects.RubikObjectList; |
|
45 | 45 |
|
46 | 46 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
47 | 47 |
|
... | ... | |
104 | 104 |
tabLayout.setupWithViewPager(viewPager); |
105 | 105 |
|
106 | 106 |
viewPager.setCurrentItem(curTab); |
107 |
ObjectType type; |
|
108 | 107 |
int iconSize = RubikActivity.getDrawableSize(); |
108 |
int numObjects = RubikObjectList.getNumObjects(); |
|
109 | 109 |
|
110 |
for (int object = 0; object< ObjectType.NUM_OBJECTS; object++)
|
|
110 |
for (int object=0; object<numObjects; object++)
|
|
111 | 111 |
{ |
112 |
type = ObjectType.getObject(object);
|
|
113 |
int iconID = type.getIconID(iconSize);
|
|
112 |
RubikObject robject = RubikObjectList.getObject(object);
|
|
113 |
int iconID = robject==null ? 0 : robject.getIconID(iconSize);
|
|
114 | 114 |
ImageView imageView = new ImageView(act); |
115 | 115 |
imageView.setImageResource(iconID); |
116 | 116 |
TabLayout.Tab tab = tabLayout.getTabAt(object); |
Also available in: Unified diff
In the 'magic' app, ObjectType is now only used in RubikObject and RubikObjectList classes and nowhere else.
This is a major step towards being able to download objects from an online repository.