Skip to content

Commit fe239c6

Browse files
committed
v10.2 优化主界面ui
1 parent dad9a55 commit fe239c6

1 file changed

Lines changed: 87 additions & 40 deletions

File tree

‎app/src/main/res/layout/activity_main.xml‎

Lines changed: 87 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,69 +11,116 @@
1111
tools:context="com.example.jingbin.designpattern.MainActivity">
1212

1313
<LinearLayout
14+
1415
android:layout_width="match_parent"
1516
android:layout_height="match_parent"
1617
android:orientation="vertical">
1718

18-
<Button
19-
android:id="@+id/bt_observer"
19+
<LinearLayout
2020
android:layout_width="match_parent"
2121
android:layout_height="wrap_content"
22-
android:text="观察者模式" />
22+
android:orientation="horizontal">
2323

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="观察者模式" />
2930

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="工厂模式" />
3537

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>
4139

42-
<Button
43-
android:id="@+id/bt_adapter"
40+
<LinearLayout
4441
android:layout_width="match_parent"
4542
android:layout_height="wrap_content"
46-
android:text="适配器模式" />
43+
android:orientation="horizontal">
4744

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="单例设计模式" />
5351

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="策略模式" />
5958

60-
<Button
61-
android:id="@+id/bt_facade"
59+
</LinearLayout>
60+
61+
<LinearLayout
6262
android:layout_width="match_parent"
6363
android:layout_height="wrap_content"
64-
android:text="外观模式" />
64+
android:orientation="horizontal">
6565

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
6884
android:layout_width="match_parent"
6985
android:layout_height="wrap_content"
70-
android:text="模板方法模式" />
86+
android:orientation="horizontal">
7187

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
74105
android:layout_width="match_parent"
75106
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>
77124

78125
<Button
79126
android:id="@+id/bt_html"

0 commit comments

Comments
 (0)