Revision 31a9f38d
Added by Leszek Koltunski over 4 years ago
src/main/java/org/distorted/main/RubikActivity.java | ||
---|---|---|
313 | 313 |
//android.util.Log.e("view", "returning medium, mScrH="+mScreenHeight); |
314 | 314 |
return 1; |
315 | 315 |
} |
316 |
if( mScreenHeight<1900 ) |
|
317 |
{ |
|
318 |
//android.util.Log.e("view", "returning bug, mScrH="+mScreenHeight); |
|
319 |
return 2; |
|
320 |
} |
|
316 | 321 |
|
317 |
//android.util.Log.e("view", "returning big, mScrH="+mScreenHeight);
|
|
318 |
return 2;
|
|
322 |
//android.util.Log.e("view", "returning huge, mScrH="+mScreenHeight);
|
|
323 |
return 3;
|
|
319 | 324 |
} |
320 | 325 |
|
321 | 326 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
322 | 327 |
|
323 |
public static int getDrawable(int small, int medium, int big) |
|
328 |
public static int getDrawable(int small, int medium, int big, int huge)
|
|
324 | 329 |
{ |
325 | 330 |
int size = getDrawableSize(); |
326 | 331 |
|
... | ... | |
328 | 333 |
{ |
329 | 334 |
case 0 : return small; |
330 | 335 |
case 1 : return medium; |
331 |
default: return big; |
|
336 |
case 2 : return big; |
|
337 |
default: return huge; |
|
332 | 338 |
} |
333 | 339 |
} |
334 | 340 |
|
src/main/java/org/distorted/objects/RubikObjectList.java | ||
---|---|---|
36 | 36 |
{ |
37 | 37 |
CUBE ( |
38 | 38 |
new int[][] { |
39 |
{2 , 12, R.raw.cube2, R.drawable.ui_small_cube2, R.drawable.ui_medium_cube2, R.drawable.ui_big_cube2} , |
|
40 |
{3 , 16, R.raw.cube3, R.drawable.ui_small_cube3, R.drawable.ui_medium_cube3, R.drawable.ui_big_cube3} , |
|
41 |
{4 , 20, R.raw.cube4, R.drawable.ui_small_cube4, R.drawable.ui_medium_cube4, R.drawable.ui_big_cube4} , |
|
42 |
{5 , 24, R.raw.cube5, R.drawable.ui_small_cube5, R.drawable.ui_medium_cube5, R.drawable.ui_big_cube5} |
|
39 |
{2 , 12, R.raw.cube2, R.drawable.ui_small_cube2, R.drawable.ui_medium_cube2, R.drawable.ui_big_cube2, R.drawable.ui_huge_cube2} ,
|
|
40 |
{3 , 16, R.raw.cube3, R.drawable.ui_small_cube3, R.drawable.ui_medium_cube3, R.drawable.ui_big_cube3, R.drawable.ui_huge_cube3} ,
|
|
41 |
{4 , 20, R.raw.cube4, R.drawable.ui_small_cube4, R.drawable.ui_medium_cube4, R.drawable.ui_big_cube4, R.drawable.ui_huge_cube4} ,
|
|
42 |
{5 , 24, R.raw.cube5, R.drawable.ui_small_cube5, R.drawable.ui_medium_cube5, R.drawable.ui_big_cube5, R.drawable.ui_huge_cube5}
|
|
43 | 43 |
}, |
44 | 44 |
RubikCube.class, |
45 | 45 |
new RubikCubeMovement() |
... | ... | |
47 | 47 |
|
48 | 48 |
PYRA ( |
49 | 49 |
new int[][] { |
50 |
{3 , 10, R.raw.pyra3, R.drawable.ui_small_pyra3, R.drawable.ui_medium_pyra3, R.drawable.ui_big_pyra3} , |
|
51 |
{4 , 15, R.raw.pyra4, R.drawable.ui_small_pyra4, R.drawable.ui_medium_pyra4, R.drawable.ui_big_pyra4} , |
|
52 |
{5 , 20, R.raw.pyra5, R.drawable.ui_small_pyra5, R.drawable.ui_medium_pyra5, R.drawable.ui_big_pyra5} |
|
50 |
{3 , 10, R.raw.pyra3, R.drawable.ui_small_pyra3, R.drawable.ui_medium_pyra3, R.drawable.ui_big_pyra3, R.drawable.ui_huge_pyra3} ,
|
|
51 |
{4 , 15, R.raw.pyra4, R.drawable.ui_small_pyra4, R.drawable.ui_medium_pyra4, R.drawable.ui_big_pyra4, R.drawable.ui_huge_pyra4} ,
|
|
52 |
{5 , 20, R.raw.pyra5, R.drawable.ui_small_pyra5, R.drawable.ui_medium_pyra5, R.drawable.ui_big_pyra5, R.drawable.ui_huge_pyra5}
|
|
53 | 53 |
}, |
54 | 54 |
RubikPyraminx.class, |
55 | 55 |
new RubikPyraminxMovement() |
... | ... | |
61 | 61 |
public static final int MAX_LEVEL; |
62 | 62 |
public static final int MAX_OBJECT_SIZE; |
63 | 63 |
|
64 |
private final int[] mObjectSizes, mMaxLevels, mSmallIconIDs, mMediumIconIDs, mBigIconIDs, mResourceIDs; |
|
64 |
private final int[] mObjectSizes, mMaxLevels, mSmallIconIDs, mMediumIconIDs, mBigIconIDs, mHugeIconIDs, mResourceIDs;
|
|
65 | 65 |
private final Class<? extends RubikObject> mObjectClass; |
66 | 66 |
private final RubikObjectMovement mObjectMovementClass; |
67 | 67 |
private static final RubikObjectList[] objects; |
... | ... | |
282 | 282 |
mSmallIconIDs = new int[length]; |
283 | 283 |
mMediumIconIDs= new int[length]; |
284 | 284 |
mBigIconIDs = new int[length]; |
285 |
mHugeIconIDs = new int[length]; |
|
285 | 286 |
|
286 | 287 |
for(int i=0; i<length; i++) |
287 | 288 |
{ |
... | ... | |
291 | 292 |
mSmallIconIDs[i] = info[i][3]; |
292 | 293 |
mMediumIconIDs[i]= info[i][4]; |
293 | 294 |
mBigIconIDs[i] = info[i][5]; |
295 |
mHugeIconIDs[i] = info[i][6]; |
|
294 | 296 |
} |
295 | 297 |
|
296 | 298 |
mObjectClass = object; |
... | ... | |
321 | 323 |
{ |
322 | 324 |
case 0 : return mSmallIconIDs; |
323 | 325 |
case 1 : return mMediumIconIDs; |
324 |
default: return mBigIconIDs; |
|
326 |
case 2 : return mBigIconIDs; |
|
327 |
default: return mHugeIconIDs; |
|
325 | 328 |
} |
326 | 329 |
} |
327 | 330 |
|
src/main/java/org/distorted/states/RubikStatePattern.java | ||
---|---|---|
203 | 203 |
{ |
204 | 204 |
int padding = (int)(width*RubikActivity.PADDING); |
205 | 205 |
int margin = (int)(width*RubikActivity.MARGIN); |
206 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_left,R.drawable.ui_medium_left, R.drawable.ui_big_left); |
|
206 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_left,R.drawable.ui_medium_left, R.drawable.ui_big_left, R.drawable.ui_huge_left);
|
|
207 | 207 |
|
208 | 208 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
209 | 209 |
params.topMargin = margin; |
... | ... | |
236 | 236 |
{ |
237 | 237 |
int padding = (int)(width*RubikActivity.PADDING); |
238 | 238 |
int margin = (int)(width*RubikActivity.MARGIN); |
239 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_right,R.drawable.ui_medium_right, R.drawable.ui_big_right); |
|
239 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_right,R.drawable.ui_medium_right, R.drawable.ui_big_right, R.drawable.ui_huge_right);
|
|
240 | 240 |
|
241 | 241 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT, 1.0f); |
242 | 242 |
params.topMargin = margin; |
src/main/java/org/distorted/states/RubikStatePlay.java | ||
---|---|---|
151 | 151 |
{ |
152 | 152 |
int padding = (int)(width*RubikActivity.PADDING); |
153 | 153 |
int margin = (int)(width*RubikActivity.MARGIN); |
154 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_menu,R.drawable.ui_medium_cube_menu, R.drawable.ui_big_cube_menu); |
|
154 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_menu,R.drawable.ui_medium_cube_menu, R.drawable.ui_big_cube_menu, R.drawable.ui_huge_cube_menu);
|
|
155 | 155 |
|
156 | 156 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 1.2f); |
157 | 157 |
params.topMargin = margin; |
... | ... | |
196 | 196 |
{ |
197 | 197 |
int padding = (int)(width*RubikActivity.PADDING); |
198 | 198 |
int margin = (int)(width*RubikActivity.MARGIN); |
199 |
int spin = RubikActivity.getDrawable(R.drawable.ui_small_spinner,R.drawable.ui_big_spinner, R.drawable.ui_big_spinner); |
|
199 |
int spin = RubikActivity.getDrawable(R.drawable.ui_small_spinner,R.drawable.ui_big_spinner, R.drawable.ui_big_spinner, R.drawable.ui_huge_spinner);
|
|
200 | 200 |
|
201 | 201 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 1.0f); |
202 | 202 |
params.topMargin = margin; |
... | ... | |
273 | 273 |
{ |
274 | 274 |
int padding = (int)(width*RubikActivity.PADDING); |
275 | 275 |
int margin = (int)(width*RubikActivity.MARGIN); |
276 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_menu,R.drawable.ui_medium_menu, R.drawable.ui_big_menu); |
|
276 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_menu,R.drawable.ui_medium_menu, R.drawable.ui_big_menu, R.drawable.ui_huge_menu);
|
|
277 | 277 |
|
278 | 278 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); |
279 | 279 |
params.topMargin = margin; |
... | ... | |
309 | 309 |
int padding = (int)(width*RubikActivity.PADDING); |
310 | 310 |
int margin = (int)(width*RubikActivity.MARGIN); |
311 | 311 |
int widthBut = (int)(width/6); |
312 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_solve,R.drawable.ui_medium_cube_solve, R.drawable.ui_big_cube_solve); |
|
312 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_solve,R.drawable.ui_medium_cube_solve, R.drawable.ui_big_cube_solve, R.drawable.ui_huge_cube_solve);
|
|
313 | 313 |
|
314 | 314 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(widthBut, LinearLayout.LayoutParams.MATCH_PARENT); |
315 | 315 |
params.topMargin = margin; |
... | ... | |
340 | 340 |
int padding = (int)(width*RubikActivity.PADDING); |
341 | 341 |
int margin = (int)(width*RubikActivity.MARGIN); |
342 | 342 |
int widthBut = (int)(width/6); |
343 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_back,R.drawable.ui_medium_cube_back, R.drawable.ui_big_cube_back); |
|
343 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_back,R.drawable.ui_medium_cube_back, R.drawable.ui_big_cube_back, R.drawable.ui_huge_cube_back);
|
|
344 | 344 |
|
345 | 345 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(widthBut, LinearLayout.LayoutParams.MATCH_PARENT); |
346 | 346 |
params.topMargin = margin; |
... | ... | |
376 | 376 |
mObjectPopup.setContentView(layout); |
377 | 377 |
mObjectPopup.setFocusable(true); |
378 | 378 |
int margin = (int)(width*RubikActivity.LARGE_MARGIN); |
379 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube2,R.drawable.ui_medium_cube2, R.drawable.ui_big_cube2); |
|
379 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube2,R.drawable.ui_medium_cube2, R.drawable.ui_big_cube2, R.drawable.ui_huge_cube2);
|
|
380 | 380 |
|
381 | 381 |
BitmapDrawable bd = (BitmapDrawable) act.getResources().getDrawable(icon); |
382 | 382 |
int cubeWidth = bd.getIntrinsicWidth(); |
src/main/java/org/distorted/states/RubikStateReady.java | ||
---|---|---|
104 | 104 |
{ |
105 | 105 |
int padding = (int)(width*RubikActivity.PADDING); |
106 | 106 |
int widthBut= (int)(width/6); |
107 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_back,R.drawable.ui_medium_cube_back, R.drawable.ui_big_cube_back); |
|
107 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_back,R.drawable.ui_medium_cube_back, R.drawable.ui_big_cube_back, R.drawable.ui_huge_cube_back);
|
|
108 | 108 |
|
109 | 109 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(widthBut,LinearLayout.LayoutParams.MATCH_PARENT); |
110 | 110 |
mPrevButton = new ImageButton(act); |
src/main/java/org/distorted/states/RubikStateSolution.java | ||
---|---|---|
100 | 100 |
{ |
101 | 101 |
int padding = (int)(width*RubikActivity.PADDING); |
102 | 102 |
int margin = (int)(width*RubikActivity.MARGIN); |
103 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_left,R.drawable.ui_medium_left, R.drawable.ui_big_left); |
|
103 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_left,R.drawable.ui_medium_left, R.drawable.ui_big_left, R.drawable.ui_huge_left);
|
|
104 | 104 |
|
105 | 105 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
106 | 106 |
params.topMargin = margin; |
... | ... | |
131 | 131 |
{ |
132 | 132 |
int padding = (int)(width*RubikActivity.PADDING); |
133 | 133 |
int margin = (int)(width*RubikActivity.MARGIN); |
134 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_right,R.drawable.ui_medium_right, R.drawable.ui_big_right); |
|
134 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_right,R.drawable.ui_medium_right, R.drawable.ui_big_right, R.drawable.ui_huge_right);
|
|
135 | 135 |
|
136 | 136 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT, 1.0f); |
137 | 137 |
params.topMargin = margin; |
src/main/java/org/distorted/states/RubikStateSolving.java | ||
---|---|---|
150 | 150 |
int padding = (int)(width*RubikActivity.PADDING); |
151 | 151 |
int margin = (int)(width*RubikActivity.MARGIN); |
152 | 152 |
int widthBut= (int)(width/6); |
153 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_back,R.drawable.ui_medium_cube_back, R.drawable.ui_big_cube_back); |
|
153 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_back,R.drawable.ui_medium_cube_back, R.drawable.ui_big_cube_back, R.drawable.ui_huge_cube_back);
|
|
154 | 154 |
|
155 | 155 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(widthBut,LinearLayout.LayoutParams.MATCH_PARENT); |
156 | 156 |
params.topMargin = margin; |
src/main/res/drawable/ui_huge_spinner.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> |
|
3 |
<item> |
|
4 |
<layer-list> |
|
5 |
<item> |
|
6 |
<shape android:shape="rectangle"> |
|
7 |
<solid android:color="@color/light_grey" /> |
|
8 |
<corners android:radius="6dip" /> |
|
9 |
<stroke |
|
10 |
android:color="@color/grey" |
|
11 |
android:width="2dp"/> |
|
12 |
</shape> |
|
13 |
</item> |
|
14 |
<item > |
|
15 |
<bitmap android:gravity="center_vertical|right" android:src="@drawable/ui_huge_down"/> |
|
16 |
</item> |
|
17 |
</layer-list> |
|
18 |
</item> |
|
19 |
</selector> |
Also available in: Unified diff
Introduce HUGE ui version.