Revision 11877284
Added by Leszek Koltunski over 4 years ago
src/main/java/org/distorted/uistate/RubikStatePattern.java | ||
---|---|---|
23 | 23 |
import android.os.Bundle; |
24 | 24 |
import android.support.v4.app.FragmentManager; |
25 | 25 |
import android.util.DisplayMetrics; |
26 |
import android.view.Gravity; |
|
26 | 27 |
import android.view.LayoutInflater; |
27 | 28 |
import android.view.View; |
28 | 29 |
import android.widget.Button; |
... | ... | |
173 | 174 |
}); |
174 | 175 |
} |
175 | 176 |
|
176 |
|
|
177 | 177 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
178 | 178 |
|
179 | 179 |
private void setupPrevButton(final RubikActivity act, final float scale) |
180 | 180 |
{ |
181 | 181 |
int padding = (int)(3*scale + 0.5f); |
182 |
int length = (int)(40*scale + 0.5f); |
|
183 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(length,LinearLayout.LayoutParams.MATCH_PARENT); |
|
182 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
184 | 183 |
mPrevButton = new ImageButton(act); |
185 | 184 |
mPrevButton.setLayoutParams(params); |
186 | 185 |
mPrevButton.setPadding(padding,0,padding,0); |
... | ... | |
201 | 200 |
private void setupNextButton(final RubikActivity act, final float scale) |
202 | 201 |
{ |
203 | 202 |
int padding = (int)( 3*scale + 0.5f); |
204 |
int length = (int)(40*scale + 0.5f); |
|
205 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(length,LinearLayout.LayoutParams.MATCH_PARENT); |
|
203 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT, 1.0f); |
|
206 | 204 |
mNextButton = new ImageButton(act); |
207 | 205 |
mNextButton.setLayoutParams(params); |
208 | 206 |
mNextButton.setPadding(padding,0,padding,0); |
... | ... | |
223 | 221 |
private void setupTextView(final RubikActivity act, final float scale) |
224 | 222 |
{ |
225 | 223 |
int padding = (int)( 3*scale + 0.5f); |
226 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.MATCH_PARENT);
|
|
224 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT,2.0f);
|
|
227 | 225 |
|
228 | 226 |
mMovesText = new TextView(act); |
229 | 227 |
mMovesText.setLayoutParams(params); |
230 | 228 |
mMovesText.setPadding(padding,0,padding,0); |
229 |
mMovesText.setGravity(Gravity.CENTER); |
|
231 | 230 |
|
232 | 231 |
mMovesText.setText("aaa"); |
233 | 232 |
} |
Also available in: Unified diff
Beginnings of support for actual patterns!