Project

General

Profile

« Previous | Next » 

Revision 287e91a6

Added by Leszek Koltunski over 2 years ago

Remove from ObjectType info which row given object is supposed to be in. This belongs to the applcations.

View differences:

src/main/java/org/distorted/screens/RubikScreenPlay.java
52 52

  
53 53
public class RubikScreenPlay extends RubikScreenBase
54 54
  {
55
  public static final int NUM_COLUMNS  = 4;
55 56
  public static final int LEVELS_SHOWN = 10;
56 57
  public static final int DEF_OBJECT= ObjectType.CUBE_3.ordinal();
57 58

  
......
96 97
    mButtonSize   = width*RubikActivity.BUTTON_TEXT_SIZE;
97 98
    mMenuItemSize = width*RubikActivity.MENU_ITEM_SIZE;
98 99

  
99
    mRowCount = ObjectType.getRowCount();
100
    mColCount = ObjectType.getColumnCount();
100
    mRowCount = (ObjectType.NUM_OBJECTS + NUM_COLUMNS-1) / NUM_COLUMNS;
101
    mColCount = NUM_COLUMNS;
101 102

  
102 103
    // TOP ////////////////////////////
103 104
    LinearLayout layoutTop = act.findViewById(R.id.upperBar);
......
222 223
      mObjectPopup.setContentView(objectGrid);
223 224
      }
224 225

  
225
    int[] indices = ObjectType.getIndices();
226

  
227 226
    GridLayout.Spec[] rowSpecs = new GridLayout.Spec[mRowCount];
228 227
    GridLayout.Spec[] colSpecs = new GridLayout.Spec[mColCount];
229 228

  
......
248 247
      int iconSize = RubikActivity.getDrawableSize();
249 248
      int icons = list.getIconID(iconSize);
250 249
      final int obj = object;
251
      int row = indices[object];
250
      int row = object/NUM_COLUMNS;
252 251

  
253 252
      ImageButton button = new ImageButton(act);
254 253
      button.setBackgroundResource(icons);

Also available in: Unified diff