|
@@ -42,8 +42,6 @@ public class ContextHome extends Activity {
|
42
|
42
|
private LinearLayout layout;
|
43
|
43
|
private final Module[] modules = new Module[]{
|
44
|
44
|
new SmsModule(), new SmsModule(), new SmsModule(), new SmsModule(),
|
45
|
|
- new SmsModule(), new SmsModule(), new SmsModule(), new SmsModule(),
|
46
|
|
- new SmsModule(), new SmsModule(),
|
47
|
45
|
};
|
48
|
46
|
|
49
|
47
|
/** Called when the activity is first created. */
|
|
@@ -52,7 +50,6 @@ public class ContextHome extends Activity {
|
52
|
50
|
super.onCreate(icicle);
|
53
|
51
|
|
54
|
52
|
layout = new LinearLayout(this);
|
55
|
|
- MODULE_PARAMS.weight = (float) 1 / 10;
|
56
|
53
|
layout.setOrientation(LinearLayout.VERTICAL);
|
57
|
54
|
setContentView(layout);
|
58
|
55
|
|
|
@@ -62,8 +59,11 @@ public class ContextHome extends Activity {
|
62
|
59
|
private void initLayout() {
|
63
|
60
|
layout.removeAllViews();
|
64
|
61
|
|
|
62
|
+ int i = 0;
|
65
|
63
|
for (Module module : modules) {
|
66
|
|
- layout.addView(module.getView(this, 1), MODULE_PARAMS);
|
|
64
|
+ final LayoutParams params = new LayoutParams(MODULE_PARAMS);
|
|
65
|
+ params.weight = (float) ++i / 10;
|
|
66
|
+ layout.addView(module.getView(this, i), params);
|
67
|
67
|
}
|
68
|
68
|
}
|
69
|
69
|
|