Project

General

Profile

« Previous | Next » 

Revision 6a71c9b3

Added by Leszek Koltunski over 4 years ago

Make the top three controls in the Play state reach all the way from the left to the right edge of the screen.

View differences:

src/main/java/org/distorted/states/RubikStatePlay.java
108 108
  private void setupObjectButton(final RubikActivity act, final float scale)
109 109
    {
110 110
    int padding = (int)(3*scale + 0.5f);
111
    LinearLayout.LayoutParams objectParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.MATCH_PARENT);
111
    LinearLayout.LayoutParams objectParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 1);
112 112
    mObjButton = new ImageButton(act);
113 113
    mObjButton.setLayoutParams(objectParams);
114 114
    mObjButton.setPadding(padding,0,padding,0);
......
168 168
    {
169 169
    int spinnerPadding = (int)(scale* 10 + 0.5f);
170 170
    int spinnerMargin  = (int)(scale*  3 + 0.5f);
171
    int spinnerLength  = (int)(scale*150 + 0.5f);
172
    LinearLayout.LayoutParams spinnerLayoutParams = new LinearLayout.LayoutParams(spinnerLength,LinearLayout.LayoutParams.MATCH_PARENT);
171
    LinearLayout.LayoutParams spinnerLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 1);
173 172
    spinnerLayoutParams.topMargin    =   spinnerMargin;
174 173
    spinnerLayoutParams.bottomMargin =   spinnerMargin;
175 174
    spinnerLayoutParams.leftMargin   =   spinnerMargin;
......
204 203
  private void setupPlayButton(final RubikActivity act, final float scale)
205 204
    {
206 205
    int padding = (int)(3*scale + 0.5f);
207
    LinearLayout.LayoutParams backParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.MATCH_PARENT);
206
    LinearLayout.LayoutParams backParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 1);
208 207
    mPlayButton = new Button(act);
209 208
    mPlayButton.setLayoutParams(backParams);
210 209
    mPlayButton.setPadding(padding,0,padding,0);

Also available in: Unified diff