60 |
60 |
private static final float MENU_BUTTON_HEIGHT = 0.068f;
|
61 |
61 |
private static final float MENU_TEXT_SIZE = 0.027f;
|
62 |
62 |
private static final float MENU_MARGIN = 0.008f;
|
|
63 |
private static final float MENU_WIDTH = 0.650f;
|
|
64 |
private static final float LEVEL_BUTTON_HEIGHT = 0.089f;
|
63 |
65 |
|
64 |
66 |
public static final int NUM_COLUMNS = 5;
|
65 |
67 |
public static final int LEVELS_SHOWN = 8;
|
... | ... | |
350 |
352 |
mMenuPopup.setFocusable(true);
|
351 |
353 |
int padding = (int)(height*MENU_MARGIN);
|
352 |
354 |
int numButtons = USE_IAP ? 7 : 6;
|
353 |
|
mMenuLayoutWidth = (int)(width*0.65f);
|
|
355 |
mMenuLayoutWidth = (int)(width*MENU_WIDTH);
|
354 |
356 |
mLevelWidth = (mMenuLayoutWidth-4*padding)/3;
|
355 |
|
mLevelHeight = (int)(mLevelWidth*0.75f);
|
|
357 |
mLevelHeight = (int)(height*LEVEL_BUTTON_HEIGHT);
|
356 |
358 |
mMenuLayoutHeight= padding + numButtons*(mMenuButtonHeight+padding) + mLevelHeight/3 + 3*(mLevelHeight+padding);
|
357 |
359 |
|
358 |
360 |
layout.setPadding(padding,0,padding,0);
|
... | ... | |
462 |
464 |
TextView levels = layout.findViewById(R.id.menuLevels);
|
463 |
465 |
levels.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
|
464 |
466 |
|
465 |
|
setupLevelButtons(act,layout,padding);
|
|
467 |
setupLevelButtons(act,layout,padding/2);
|
466 |
468 |
}
|
467 |
469 |
|
468 |
470 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
469 |
471 |
|
470 |
|
private void setupLevelButtons(RubikActivity act, View layout, int padding)
|
|
472 |
private void setupLevelButtons(RubikActivity act, View layout, int margin)
|
471 |
473 |
{
|
472 |
474 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(mLevelWidth,mLevelHeight);
|
473 |
|
params.setMargins(padding/2,0,padding/2,0);
|
|
475 |
params.setMargins(margin,margin,margin,margin);
|
474 |
476 |
|
475 |
477 |
mLevel = new Button[LEVELS_SHOWN+1];
|
476 |
478 |
|
Further improvements for the UI.