Revision d90c55cc
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/screens/RubikScreenPlay.java | ||
---|---|---|
110 | 110 |
layoutTop.addView(mMenuButton); |
111 | 111 |
|
112 | 112 |
setupPlayWindow(act,width); |
113 |
setupPlayButton(act,width); |
|
113 |
setupPlayButton(act,width,height);
|
|
114 | 114 |
layoutTop.addView(mPlayButton); |
115 | 115 |
|
116 | 116 |
setupSolveButton(act,width); |
... | ... | |
148 | 148 |
|
149 | 149 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
150 | 150 |
|
151 |
private void setupPlayButton(final RubikActivity act, final float width) |
|
151 |
private void setupPlayButton(final RubikActivity act, final float width, final float height)
|
|
152 | 152 |
{ |
153 |
final int margin = (int)(width*RubikActivity.MARGIN); |
|
153 |
final int margin = (int)(width*RubikActivity.MARGIN); |
|
154 |
int upperBarHeight = act.getHeightUpperBar(); |
|
155 |
final int maxHeight= (int)(0.9f*(height-upperBarHeight) ); |
|
156 |
|
|
154 | 157 |
mPlayButton = new TransparentButton(act, R.string.play, mButtonSize, width); |
155 | 158 |
|
156 | 159 |
mPlayButton.setOnClickListener( new View.OnClickListener() |
... | ... | |
166 | 169 |
final int sizeIndex = ObjectList.getSizeIndex(mObject,mSize); |
167 | 170 |
final int dbLevel = ObjectList.getDBLevel(mObject, sizeIndex); |
168 | 171 |
final int levelsShown = Math.min(dbLevel,LEVELS_SHOWN); |
172 |
final int popupHeight = (int)(levelsShown*(mMenuItemSize+margin)+3*margin+mMenuItemSize*(LAST_BUTTON-1.0f)); |
|
169 | 173 |
|
170 | 174 |
mPlayPopup.showAsDropDown(view, margin, margin); |
171 |
mPlayPopup.update(view, mPlayLayoutWidth, (int)(levelsShown*(mMenuItemSize+margin)+3*margin+mMenuItemSize*(LAST_BUTTON-1.0f)));
|
|
175 |
mPlayPopup.update(view, mPlayLayoutWidth, Math.min(popupHeight,maxHeight));
|
|
172 | 176 |
mPlayPopup.setFocusable(true); |
173 | 177 |
mPlayPopup.update(); |
174 | 178 |
} |
Also available in: Unified diff
Make the 'Play' popup always fit within the window height.