Revision 98e7cc0f
Added by Leszek Koltunski over 5 years ago
| src/main/java/org/distorted/states/RubikStateSolving.java | ||
|---|---|---|
| 114 | 114 |
LinearLayout layoutLeft = act.findViewById(R.id.mainBarLeft); |
| 115 | 115 |
layoutLeft.removeAllViews(); |
| 116 | 116 |
|
| 117 |
setupPrevMoveButtom(act,scale); |
|
| 117 |
setupPrevMoveButtom(act,scale,width);
|
|
| 118 | 118 |
layoutLeft.addView(mPrevButton); |
| 119 | 119 |
|
| 120 | 120 |
LinearLayout layoutRight = act.findViewById(R.id.mainBarRight); |
| ... | ... | |
| 143 | 143 |
|
| 144 | 144 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 145 | 145 |
|
| 146 |
private void setupPrevMoveButtom(final RubikActivity act, float scale) |
|
| 146 |
private void setupPrevMoveButtom(final RubikActivity act, float scale, float width)
|
|
| 147 | 147 |
{
|
| 148 | 148 |
int padding = (int)( 3*scale + 0.5f); |
| 149 |
int width = (int)(60*scale + 0.5f); |
|
| 150 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(width,LinearLayout.LayoutParams.MATCH_PARENT); |
|
| 149 |
int widthBut= (int)(width/6); |
|
| 150 |
|
|
| 151 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(widthBut,LinearLayout.LayoutParams.MATCH_PARENT); |
|
| 151 | 152 |
mPrevButton = new ImageButton(act); |
| 152 | 153 |
mPrevButton.setLayoutParams(params); |
| 153 | 154 |
mPrevButton.setPadding(padding,0,padding,0); |
Also available in: Unified diff
Improvements to the UI - make it proportional regardless of the physical screen size. (Part 4)