Revision 88d28110
Added by Leszek Koltunski about 3 years ago
src/main/java/org/distorted/dialogs/RubikDialogScores.java | ||
---|---|---|
104 | 104 |
tabLayout.setupWithViewPager(viewPager); |
105 | 105 |
|
106 | 106 |
viewPager.setCurrentItem(curTab); |
107 |
ObjectType list;
|
|
107 |
ObjectType type;
|
|
108 | 108 |
int iconSize = RubikActivity.getDrawableSize(); |
109 | 109 |
|
110 | 110 |
for (int object = 0; object< ObjectType.NUM_OBJECTS; object++) |
111 | 111 |
{ |
112 |
list = ObjectType.getObject(object);
|
|
113 |
int iconID = list.getIconID(iconSize);
|
|
112 |
type = ObjectType.getObject(object);
|
|
113 |
int iconID = type.getIconID(iconSize);
|
|
114 | 114 |
ImageView imageView = new ImageView(act); |
115 | 115 |
imageView.setImageResource(iconID); |
116 | 116 |
TabLayout.Tab tab = tabLayout.getTabAt(object); |
src/main/java/org/distorted/screens/RubikScreenPlay.java | ||
---|---|---|
48 | 48 |
import org.distorted.helpers.TransparentImageButton; |
49 | 49 |
import org.distorted.network.RubikScores; |
50 | 50 |
|
51 |
import static org.distorted.objectlib.main.ObjectType.NUM_OBJECTS; |
|
52 |
|
|
51 | 53 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
52 | 54 |
|
53 | 55 |
public class RubikScreenPlay extends RubikScreenBase |
... | ... | |
110 | 112 |
mButtonSize = width*RubikActivity.BUTTON_TEXT_SIZE; |
111 | 113 |
mMenuItemSize = width*RubikActivity.MENU_ITEM_SIZE; |
112 | 114 |
|
113 |
mRowCount = (ObjectType.NUM_OBJECTS + NUM_COLUMNS-1) / NUM_COLUMNS;
|
|
115 |
mRowCount = (NUM_OBJECTS + NUM_COLUMNS-1) / NUM_COLUMNS; |
|
114 | 116 |
mColCount = NUM_COLUMNS; |
115 | 117 |
|
116 | 118 |
// TOP //////////////////////////// |
... | ... | |
271 | 273 |
colSpecs[col] = GridLayout.spec(col); |
272 | 274 |
} |
273 | 275 |
|
274 |
for(int object = 0; object< ObjectType.NUM_OBJECTS; object++)
|
|
276 |
for(int object = 0; object< NUM_OBJECTS; object++) |
|
275 | 277 |
{ |
276 | 278 |
final ObjectType type = ObjectType.getObject(object); |
277 | 279 |
int iconSize = RubikActivity.getDrawableSize(); |
... | ... | |
443 | 445 |
{ |
444 | 446 |
String objName= preferences.getString("statePlay_objName", DEF_OBJECT.name() ); |
445 | 447 |
int ordinal = ObjectType.getOrdinal(objName); |
446 |
mObject = ordinal>=0 ? ObjectType.values()[ordinal] : DEF_OBJECT; |
|
448 |
mObject = ordinal>=0 && ordinal<NUM_OBJECTS ? ObjectType.values()[ordinal] : DEF_OBJECT;
|
|
447 | 449 |
} |
448 | 450 |
|
449 | 451 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Minor