Revision ea6ee91b
Added by Leszek Koltunski almost 5 years ago
src/main/java/org/distorted/object/RubikObjectList.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
public enum RubikObjectList |
31 | 31 |
{ |
32 |
CUBE ( new int[] {2,3,4}, |
|
33 |
new int[] {R.drawable.cube2,R.drawable.cube3,R.drawable.cube4}, |
|
32 |
CUBE ( new int[][] { {2,R.drawable.cube2} , {3,R.drawable.cube3} , {4,R.drawable.cube4} }, |
|
34 | 33 |
new RubikCubeMovement() ), |
35 |
PYRAMINX ( new int[] {3,4}, |
|
36 |
new int[] {R.drawable.pyra3,R.drawable.pyra4}, |
|
34 |
PYRAMINX ( new int[][] { {3,R.drawable.pyra3} , {4,R.drawable.pyra4} }, |
|
37 | 35 |
new RubikPyraminxMovement() ), |
38 | 36 |
; |
39 | 37 |
|
... | ... | |
201 | 199 |
|
202 | 200 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
203 | 201 |
|
204 |
RubikObjectList(int[] sizes, int[] iconIDs, RubikObjectMovement movement)
|
|
202 |
RubikObjectList(int[][] info, RubikObjectMovement movement)
|
|
205 | 203 |
{ |
206 |
mObjectSizes= sizes; |
|
207 |
mIconIDs = iconIDs; |
|
204 |
int length = info.length; |
|
205 |
|
|
206 |
mObjectSizes= new int[length]; |
|
207 |
mIconIDs = new int[length]; |
|
208 |
|
|
209 |
for(int i=0; i<length; i++) |
|
210 |
{ |
|
211 |
mObjectSizes[i] = info[i][0]; |
|
212 |
mIconIDs[i] = info[i][1]; |
|
213 |
} |
|
214 |
|
|
208 | 215 |
mObjectMovementClass = movement; |
209 | 216 |
} |
210 | 217 |
|
src/main/java/org/distorted/uistate/RubikStatePlay.java | ||
---|---|---|
77 | 77 |
|
78 | 78 |
DisplayMetrics metrics = act.getResources().getDisplayMetrics(); |
79 | 79 |
float scale = metrics.density; |
80 |
int size = (int)(60*scale +0.5f);
|
|
81 |
int padding = (int)(3*scale + 0.5f); |
|
80 |
int size = (int)(60*scale + 0.5f);
|
|
81 |
int padding = (int)( 3*scale + 0.5f);
|
|
82 | 82 |
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(size,size); |
83 | 83 |
|
84 | 84 |
for(int i=0; i< RubikObjectList.NUM_OBJECTS; i++) |
Also available in: Unified diff
Minor.