Revision 0b162619
Added by Leszek Koltunski about 3 years ago
src/main/java/org/distorted/screens/RubikScreenPlay.java | ||
---|---|---|
29 | 29 |
import android.view.Gravity; |
30 | 30 |
import android.view.LayoutInflater; |
31 | 31 |
import android.view.View; |
32 |
import android.view.ViewGroup; |
|
32 | 33 |
import android.widget.Button; |
33 | 34 |
import android.widget.GridLayout; |
34 | 35 |
import android.widget.ImageButton; |
... | ... | |
243 | 244 |
int cubeWidth = bd.getIntrinsicWidth(); |
244 | 245 |
int margin = (int)(width*RubikActivity.LARGE_MARGIN); |
245 | 246 |
mObjectSize = (int)(cubeWidth + 2*margin + 0.5f); |
246 |
mMaxRowCount = (int)((height-2.0f*mUpperBarHeight)/mObjectSize); |
|
247 |
mMaxRowCount = (int)((height-1.8f*mUpperBarHeight)/mObjectSize); |
|
248 |
int layoutH = (int)(1.5f*mObjectSize); |
|
247 | 249 |
|
248 | 250 |
int viewID = mMaxRowCount<mRowCount ? R.layout.popup_object_withscroll : R.layout.popup_object_scrollless; |
249 | 251 |
View view = inflate( act, viewID, null); |
... | ... | |
256 | 258 |
objectGrid.setRowCount(mRowCount); |
257 | 259 |
|
258 | 260 |
LinearLayout bottomLayout = view.findViewById(R.id.bottomLayout); |
259 |
setupDetailsButton(act); |
|
261 |
setupDetailsButton(act,layoutH);
|
|
260 | 262 |
bottomLayout.addView(mDetailsButton); |
261 | 263 |
|
264 |
ViewGroup.LayoutParams paramsB = bottomLayout.getLayoutParams(); |
|
265 |
paramsB.height = layoutH; |
|
266 |
bottomLayout.setLayoutParams(paramsB); |
|
267 |
|
|
262 | 268 |
mObjectPopup = new PopupWindow(act); |
263 | 269 |
mObjectPopup.setFocusable(true); |
264 | 270 |
mObjectPopup.setContentView(view); |
... | ... | |
400 | 406 |
|
401 | 407 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
402 | 408 |
|
403 |
void setupDetailsButton(final RubikActivity act) |
|
409 |
void setupDetailsButton(final RubikActivity act, int width)
|
|
404 | 410 |
{ |
405 |
int butWidth = 100; |
|
406 | 411 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_solve_new,R.drawable.ui_medium_cube_solve_new, R.drawable.ui_big_cube_solve_new, R.drawable.ui_huge_cube_solve_new); |
407 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(butWidth,LinearLayout.LayoutParams.MATCH_PARENT);
|
|
412 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(width,LinearLayout.LayoutParams.MATCH_PARENT);
|
|
408 | 413 |
mDetailsButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params); |
409 | 414 |
|
410 | 415 |
mDetailsButton.setOnClickListener( new View.OnClickListener() |
Also available in: Unified diff
Add info pane: some progress.