Revision e31abc1e
Added by Leszek Koltunski over 4 years ago
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.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 1); |
|
111 |
LinearLayout.LayoutParams objectParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 1.2f);
|
|
112 | 112 |
mObjButton = new ImageButton(act); |
113 | 113 |
mObjButton.setLayoutParams(objectParams); |
114 | 114 |
mObjButton.setPadding(padding,0,padding,0); |
... | ... | |
140 | 140 |
}); |
141 | 141 |
} |
142 | 142 |
|
143 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
144 |
|
|
145 |
private void setupSettingsButton(final RubikActivity act, final float scale) |
|
146 |
{ |
|
147 |
int padding = (int)(3*scale + 0.5f); |
|
148 |
LinearLayout.LayoutParams objectParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.MATCH_PARENT); |
|
149 |
mSettingsButton = new ImageButton(act); |
|
150 |
mSettingsButton.setLayoutParams(objectParams); |
|
151 |
mSettingsButton.setPadding(padding,0,padding,0); |
|
152 |
mSettingsButton.setImageResource(R.drawable.settings); |
|
153 |
|
|
154 |
mSettingsButton.setOnClickListener( new View.OnClickListener() |
|
155 |
{ |
|
156 |
@Override |
|
157 |
public void onClick(View view) |
|
158 |
{ |
|
159 |
RubikDialogEffects settings = new RubikDialogEffects(); |
|
160 |
settings.show(act.getSupportFragmentManager(), null); |
|
161 |
} |
|
162 |
}); |
|
163 |
} |
|
164 |
|
|
165 | 143 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
166 | 144 |
|
167 | 145 |
private void setupLevelSpinner(final RubikActivity act, final float scale) |
168 | 146 |
{ |
169 | 147 |
int spinnerPadding = (int)(scale* 10 + 0.5f); |
170 | 148 |
int spinnerMargin = (int)(scale* 3 + 0.5f); |
171 |
LinearLayout.LayoutParams spinnerLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 1); |
|
149 |
LinearLayout.LayoutParams spinnerLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 1.0f);
|
|
172 | 150 |
spinnerLayoutParams.topMargin = spinnerMargin; |
173 | 151 |
spinnerLayoutParams.bottomMargin = spinnerMargin; |
174 | 152 |
spinnerLayoutParams.leftMargin = spinnerMargin; |
... | ... | |
203 | 181 |
private void setupPlayButton(final RubikActivity act, final float scale) |
204 | 182 |
{ |
205 | 183 |
int padding = (int)(3*scale + 0.5f); |
206 |
LinearLayout.LayoutParams backParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 1); |
|
184 |
LinearLayout.LayoutParams backParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 1.2f);
|
|
207 | 185 |
mPlayButton = new Button(act); |
208 | 186 |
mPlayButton.setLayoutParams(backParams); |
209 | 187 |
mPlayButton.setPadding(padding,0,padding,0); |
... | ... | |
219 | 197 |
}); |
220 | 198 |
} |
221 | 199 |
|
200 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
201 |
|
|
202 |
private void setupSettingsButton(final RubikActivity act, final float scale) |
|
203 |
{ |
|
204 |
int padding = (int)(3*scale + 0.5f); |
|
205 |
LinearLayout.LayoutParams objectParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.MATCH_PARENT); |
|
206 |
mSettingsButton = new ImageButton(act); |
|
207 |
mSettingsButton.setLayoutParams(objectParams); |
|
208 |
mSettingsButton.setPadding(padding,0,padding,0); |
|
209 |
mSettingsButton.setImageResource(R.drawable.settings); |
|
210 |
|
|
211 |
mSettingsButton.setOnClickListener( new View.OnClickListener() |
|
212 |
{ |
|
213 |
@Override |
|
214 |
public void onClick(View view) |
|
215 |
{ |
|
216 |
RubikDialogEffects settings = new RubikDialogEffects(); |
|
217 |
settings.show(act.getSupportFragmentManager(), null); |
|
218 |
} |
|
219 |
}); |
|
220 |
} |
|
221 |
|
|
222 | 222 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
223 | 223 |
|
224 | 224 |
private void setupSolveButton(final RubikActivity act, final float scale) |
Also available in: Unified diff
Minor tweak.