Revision 88d28110
Added by Leszek Koltunski over 2 years ago
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