|
11 | 11 | tools:context="com.example.jingbin.designpattern.MainActivity"> |
12 | 12 |
|
13 | 13 | <LinearLayout |
| 14 | + |
14 | 15 | android:layout_width="match_parent" |
15 | 16 | android:layout_height="match_parent" |
16 | 17 | android:orientation="vertical"> |
17 | 18 |
|
18 | | - <Button |
19 | | - android:id="@+id/bt_observer" |
| 19 | + <LinearLayout |
20 | 20 | android:layout_width="match_parent" |
21 | 21 | android:layout_height="wrap_content" |
22 | | - android:text="观察者模式" /> |
| 22 | + android:orientation="horizontal"> |
23 | 23 |
|
24 | | - <Button |
25 | | - android:id="@+id/bt_factory" |
26 | | - android:layout_width="match_parent" |
27 | | - android:layout_height="wrap_content" |
28 | | - android:text="工厂模式" /> |
| 24 | + <Button |
| 25 | + android:id="@+id/bt_observer" |
| 26 | + android:layout_width="0dp" |
| 27 | + android:layout_height="wrap_content" |
| 28 | + android:layout_weight="1" |
| 29 | + android:text="观察者模式" /> |
29 | 30 |
|
30 | | - <Button |
31 | | - android:id="@+id/bt_singleton" |
32 | | - android:layout_width="match_parent" |
33 | | - android:layout_height="wrap_content" |
34 | | - android:text="单例设计模式" /> |
| 31 | + <Button |
| 32 | + android:id="@+id/bt_factory" |
| 33 | + android:layout_width="0dp" |
| 34 | + android:layout_height="wrap_content" |
| 35 | + android:layout_weight="1" |
| 36 | + android:text="工厂模式" /> |
35 | 37 |
|
36 | | - <Button |
37 | | - android:id="@+id/bt_strategy" |
38 | | - android:layout_width="match_parent" |
39 | | - android:layout_height="wrap_content" |
40 | | - android:text="策略模式" /> |
| 38 | + </LinearLayout> |
41 | 39 |
|
42 | | - <Button |
43 | | - android:id="@+id/bt_adapter" |
| 40 | + <LinearLayout |
44 | 41 | android:layout_width="match_parent" |
45 | 42 | android:layout_height="wrap_content" |
46 | | - android:text="适配器模式" /> |
| 43 | + android:orientation="horizontal"> |
47 | 44 |
|
48 | | - <Button |
49 | | - android:id="@+id/bt_command" |
50 | | - android:layout_width="match_parent" |
51 | | - android:layout_height="wrap_content" |
52 | | - android:text="命令模式" /> |
| 45 | + <Button |
| 46 | + android:id="@+id/bt_singleton" |
| 47 | + android:layout_width="0dp" |
| 48 | + android:layout_height="wrap_content" |
| 49 | + android:layout_weight="1" |
| 50 | + android:text="单例设计模式" /> |
53 | 51 |
|
54 | | - <Button |
55 | | - android:id="@+id/bt_decorator" |
56 | | - android:layout_width="match_parent" |
57 | | - android:layout_height="wrap_content" |
58 | | - android:text="装饰者模式" /> |
| 52 | + <Button |
| 53 | + android:id="@+id/bt_strategy" |
| 54 | + android:layout_width="0dp" |
| 55 | + android:layout_height="wrap_content" |
| 56 | + android:layout_weight="1" |
| 57 | + android:text="策略模式" /> |
59 | 58 |
|
60 | | - <Button |
61 | | - android:id="@+id/bt_facade" |
| 59 | + </LinearLayout> |
| 60 | + |
| 61 | + <LinearLayout |
62 | 62 | android:layout_width="match_parent" |
63 | 63 | android:layout_height="wrap_content" |
64 | | - android:text="外观模式" /> |
| 64 | + android:orientation="horizontal"> |
65 | 65 |
|
66 | | - <Button |
67 | | - android:id="@+id/bt_template_method" |
| 66 | + <Button |
| 67 | + android:id="@+id/bt_adapter" |
| 68 | + android:layout_width="0dp" |
| 69 | + android:layout_height="wrap_content" |
| 70 | + android:layout_weight="1" |
| 71 | + android:text="适配器模式" /> |
| 72 | + |
| 73 | + <Button |
| 74 | + android:id="@+id/bt_command" |
| 75 | + android:layout_width="0dp" |
| 76 | + android:layout_height="wrap_content" |
| 77 | + android:layout_weight="1" |
| 78 | + android:text="命令模式" /> |
| 79 | + |
| 80 | + </LinearLayout> |
| 81 | + |
| 82 | + |
| 83 | + <LinearLayout |
68 | 84 | android:layout_width="match_parent" |
69 | 85 | android:layout_height="wrap_content" |
70 | | - android:text="模板方法模式" /> |
| 86 | + android:orientation="horizontal"> |
71 | 87 |
|
72 | | - <Button |
73 | | - android:id="@+id/bt_state" |
| 88 | + <Button |
| 89 | + android:id="@+id/bt_decorator" |
| 90 | + android:layout_width="0dp" |
| 91 | + android:layout_height="wrap_content" |
| 92 | + android:layout_weight="1" |
| 93 | + android:text="装饰者模式" /> |
| 94 | + |
| 95 | + <Button |
| 96 | + android:id="@+id/bt_facade" |
| 97 | + android:layout_width="0dp" |
| 98 | + android:layout_height="wrap_content" |
| 99 | + android:layout_weight="1" |
| 100 | + android:text="外观模式" /> |
| 101 | + |
| 102 | + </LinearLayout> |
| 103 | + |
| 104 | + <LinearLayout |
74 | 105 | android:layout_width="match_parent" |
75 | 106 | android:layout_height="wrap_content" |
76 | | - android:text="状态模式" /> |
| 107 | + android:orientation="horizontal"> |
| 108 | + |
| 109 | + <Button |
| 110 | + android:id="@+id/bt_template_method" |
| 111 | + android:layout_width="0dp" |
| 112 | + android:layout_height="wrap_content" |
| 113 | + android:layout_weight="1" |
| 114 | + android:text="模板方法模式" /> |
| 115 | + |
| 116 | + <Button |
| 117 | + android:id="@+id/bt_state" |
| 118 | + android:layout_width="0dp" |
| 119 | + android:layout_height="wrap_content" |
| 120 | + android:layout_weight="1" |
| 121 | + android:text="状态模式" /> |
| 122 | + |
| 123 | + </LinearLayout> |
77 | 124 |
|
78 | 125 | <Button |
79 | 126 | android:id="@+id/bt_html" |
|
0 commit comments