Revision 8bf8fe70
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/config/ConfigScreen.java | ||
---|---|---|
52 | 52 |
private TransparentImageButton mBackButton, mObjectButton, mPrevButton, mNextButton; |
53 | 53 |
private TextView mMovesText; |
54 | 54 |
private PopupWindow mObjectPopup; |
55 |
private LinearLayout mDetailsLayout, mComplexLayout, mMeshLayout; |
|
55 | 56 |
private int mObjectOrdinal; |
56 | 57 |
private int mColCount, mRowCount, mMaxRowCount; |
57 | 58 |
private int mObjectSize; |
... | ... | |
316 | 317 |
mMovesText.setText(act.getString(R.string.mo_placeholder,mObjectOrdinal+1,NUM_OBJECTS)); |
317 | 318 |
} |
318 | 319 |
|
320 |
|
|
321 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
322 |
|
|
323 |
private LinearLayout createLayout(ConfigActivity act, final int marginT, final int marginB, final int marginS, final int color) |
|
324 |
{ |
|
325 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,200);//LinearLayout.LayoutParams.WRAP_CONTENT); |
|
326 |
params.bottomMargin = marginB; |
|
327 |
params.topMargin = marginT; |
|
328 |
params.leftMargin = marginS; |
|
329 |
params.rightMargin = marginS; |
|
330 |
|
|
331 |
LinearLayout layout = new LinearLayout(act); |
|
332 |
layout.setLayoutParams(params); |
|
333 |
layout.setBackgroundColor(color); |
|
334 |
|
|
335 |
return layout; |
|
336 |
} |
|
337 |
|
|
338 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
339 |
|
|
340 |
private void setupDetailsLayout(ConfigActivity act, final float width) |
|
341 |
{ |
|
342 |
|
|
343 |
} |
|
344 |
|
|
345 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
346 |
|
|
347 |
private void setupComplexLayout(ConfigActivity act, final float width) |
|
348 |
{ |
|
349 |
|
|
350 |
|
|
351 |
} |
|
352 |
|
|
353 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
354 |
|
|
355 |
private void setupMeshLayout(ConfigActivity act, final float width) |
|
356 |
{ |
|
357 |
|
|
358 |
|
|
359 |
} |
|
360 |
|
|
319 | 361 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
320 |
// TODO: info pane |
|
321 | 362 |
|
322 | 363 |
private void setupInfo(ConfigActivity act) |
323 | 364 |
{ |
365 |
int width = act.getScreenWidthInPixels(); |
|
324 | 366 |
|
367 |
setupDetailsLayout(act,width); |
|
368 |
setupComplexLayout(act,width); |
|
369 |
setupMeshLayout(act,width); |
|
325 | 370 |
} |
326 | 371 |
|
327 | 372 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
366 | 411 |
layout.addView(layoutMid); |
367 | 412 |
layout.addView(layoutRight); |
368 | 413 |
|
369 |
setupInfo(act); |
|
414 |
int color = act.getResources().getColor(R.color.light_grey); |
|
415 |
int margin = (int)(1.5f*width*RubikActivity.PADDING); |
|
416 |
|
|
417 |
mDetailsLayout = createLayout(act,2*margin, margin, 2*margin, color); |
|
418 |
mComplexLayout = createLayout(act, margin, margin, 2*margin, color); |
|
419 |
mMeshLayout = createLayout(act, margin,2*margin, 2*margin, color); |
|
420 |
|
|
421 |
LinearLayout configLayout = act.findViewById(R.id.configLayout); |
|
422 |
configLayout.removeAllViews(); |
|
423 |
configLayout.addView(mDetailsLayout); |
|
424 |
configLayout.addView(mComplexLayout); |
|
425 |
configLayout.addView(mMeshLayout); |
|
370 | 426 |
} |
371 | 427 |
} |
Also available in: Unified diff
Progress with ConfigScreen.