Revision 9c39179e
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/screens/RubikScreenPlay.java | ||
---|---|---|
78 | 78 |
private PopupWindow mObjectPopup, mMenuPopup, mPlayPopup; |
79 | 79 |
private LinearLayout mPlayLayout; |
80 | 80 |
private TextView mBubbleUpdates; |
81 |
private RubikUpdates mUpdates; |
|
82 | 81 |
private int mObjectSize, mMenuLayoutWidth, mMenuLayoutHeight, mPlayLayoutWidth; |
83 | 82 |
private int mLevelValue; |
84 | 83 |
private float mButtonSize, mMenuItemSize, mMenuTextSize; |
... | ... | |
86 | 85 |
private int mUpperBarHeight; |
87 | 86 |
private boolean mShouldReactToEndOfScrambling; |
88 | 87 |
private int mBottomHeight; |
88 |
private float mScreenWidth; |
|
89 | 89 |
|
90 | 90 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
91 | 91 |
|
... | ... | |
99 | 99 |
void enterScreen(final RubikActivity act) |
100 | 100 |
{ |
101 | 101 |
int numObjects = RubikObjectList.getNumObjects(); |
102 |
float width = act.getScreenWidthInPixels();
|
|
102 |
mScreenWidth = act.getScreenWidthInPixels();
|
|
103 | 103 |
mUpperBarHeight = act.getHeightUpperBar(); |
104 | 104 |
|
105 |
mMenuTextSize = width*RubikActivity.MENU_MED_TEXT_SIZE;
|
|
106 |
mButtonSize = width*RubikActivity.BUTTON_TEXT_SIZE;
|
|
107 |
mMenuItemSize = width*RubikActivity.MENU_ITEM_SIZE;
|
|
105 |
mMenuTextSize = mScreenWidth*RubikActivity.MENU_MED_TEXT_SIZE;
|
|
106 |
mButtonSize = mScreenWidth*RubikActivity.BUTTON_TEXT_SIZE;
|
|
107 |
mMenuItemSize = mScreenWidth*RubikActivity.MENU_ITEM_SIZE;
|
|
108 | 108 |
|
109 | 109 |
mRowCount = (numObjects + NUM_COLUMNS-1) / NUM_COLUMNS; |
110 | 110 |
mColCount = NUM_COLUMNS; |
... | ... | |
113 | 113 |
LinearLayout layoutTop = act.findViewById(R.id.upperBar); |
114 | 114 |
layoutTop.removeAllViews(); |
115 | 115 |
|
116 |
setupObjectButton(act,width);
|
|
116 |
setupObjectButton(act,mScreenWidth);
|
|
117 | 117 |
layoutTop.addView(mObjButton); |
118 | 118 |
|
119 |
setupMenuButton(act,width);
|
|
119 |
setupMenuButton(act,mScreenWidth);
|
|
120 | 120 |
layoutTop.addView(mMenuButton); |
121 | 121 |
|
122 |
setupPlayButton(act,width);
|
|
122 |
setupPlayButton(act,mScreenWidth);
|
|
123 | 123 |
layoutTop.addView(mPlayButton); |
124 | 124 |
|
125 | 125 |
setupSolveButton(act); |
... | ... | |
707 | 707 |
{ |
708 | 708 |
updates.showDebug(); |
709 | 709 |
|
710 |
mUpdates = updates; |
|
711 |
int num = mUpdates.getNumberOfUpdates(); |
|
710 |
int numN = updates.getNewNumber(); |
|
711 |
int numU = updates.getUpdNumber(); |
|
712 |
int num = numN+numU; |
|
712 | 713 |
|
713 | 714 |
if( num>0 ) |
714 | 715 |
{ |
715 | 716 |
String shownNum = String.valueOf(num); |
716 | 717 |
mBubbleUpdates.setText(shownNum); |
717 | 718 |
mBubbleUpdates.setVisibility(View.VISIBLE); |
719 |
int height = (int)(0.05f*mScreenWidth); |
|
720 |
mBubbleUpdates.setTextSize(TypedValue.COMPLEX_UNIT_PX,height); |
|
718 | 721 |
} |
719 | 722 |
else |
720 | 723 |
{ |
Also available in: Unified diff
Downloading updates: dialog progress.