Revision a6d3b158
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/dialog/RubikDialogPatternView.java | ||
---|---|---|
73 | 73 |
{ |
74 | 74 |
DisplayMetrics metrics = act.getResources().getDisplayMetrics(); |
75 | 75 |
final float scale = metrics.density; |
76 |
int len = categories.length; |
|
77 | 76 |
int margin = (int)(3*scale + 0.5f); |
78 | 77 |
LinearLayout.LayoutParams bParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT); |
79 | 78 |
bParams.setMargins(margin, margin, margin, margin); |
80 | 79 |
|
81 | 80 |
final RubikActivity ract = (RubikActivity)getContext(); |
82 | 81 |
|
83 |
for(int i=0; i<len; i++)
|
|
82 |
for(String category: categories)
|
|
84 | 83 |
{ |
85 |
final int fi = i; |
|
86 | 84 |
Button button = new Button(act); |
87 | 85 |
button.setLayoutParams(bParams); |
88 |
button.setText(categories[i]);
|
|
86 |
button.setText(category);
|
|
89 | 87 |
|
90 | 88 |
button.setOnClickListener( new View.OnClickListener() |
91 | 89 |
{ |
Also available in: Unified diff
Progress with Pretty Patterns.