-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathactivity_main.xml
More file actions
321 lines (279 loc) · 12.3 KB
/
Copy pathactivity_main.xml
File metadata and controls
321 lines (279 loc) · 12.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.alibaba.android.arouter.demo.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_test_area"
android:orientation="vertical"
android:padding="@dimen/test_area_padding">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onClick"
android:padding="5dp"
android:text="基本设置" />
<Button
android:id="@+id/openLog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="打开日志并打印堆栈" />
<Button
android:id="@+id/openDebug"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="开启调试模式(InstantRun需要开启)"
android:visibility="gone" />
<Button
android:id="@+id/init"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="初始化ARouter"
android:textColor="@color/red" />
<Button
android:id="@+id/destroy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="关闭ARouter" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/between_cell"
android:background="@drawable/bg_test_area"
android:orientation="vertical"
android:padding="@dimen/test_area_padding">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="基础功能(请先初始化)" />
<Button
android:id="@+id/normalNavigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="简单的应用内跳转" />
<Button
android:id="@+id/kotlinNavigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="跳转到Kotlin页面" />
<Button
android:id="@+id/normalNavigation2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="跳转ForResult" />
<Button
android:id="@+id/getFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="获取Fragment实例" />
<Button
android:id="@+id/normalNavigationWithParams"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="携带参数的应用内跳转" />
<Button
android:id="@+id/oldVersionAnim"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="旧版本转场动画" />
<Button
android:id="@+id/newVersionAnim"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="新版本转场动画" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/between_cell"
android:background="@drawable/bg_test_area"
android:orientation="vertical"
android:padding="@dimen/test_area_padding">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="进阶用法(请先初始化)" />
<Button
android:id="@+id/navByUrl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="通过URL跳转" />
<Button
android:id="@+id/interceptor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="拦截器测试" />
<Button
android:id="@+id/autoInject"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="依赖注入(参照代码)" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/between_cell"
android:background="@drawable/bg_test_area"
android:orientation="vertical"
android:padding="@dimen/test_area_padding">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="服务管理(请先初始化)" />
<Button
android:id="@+id/navByName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="ByName调用服务" />
<Button
android:id="@+id/navByType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="ByType调用服务" />
<Button
android:id="@+id/callSingle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="调用单类" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/between_cell"
android:background="@drawable/bg_test_area"
android:orientation="vertical"
android:padding="@dimen/test_area_padding">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="多模块测试(请先初始化)" />
<Button
android:id="@+id/navToMoudle1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="跳转到模块1" />
<Button
android:id="@+id/navToMoudle2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="跳转到模块2" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/between_cell"
android:background="@drawable/bg_test_area"
android:orientation="vertical"
android:padding="@dimen/test_area_padding">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="跳转失败测试(请先初始化)" />
<Button
android:id="@+id/failNav"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="跳转失败,单独降级" />
<Button
android:id="@+id/failNav2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="跳转失败,全局降级" />
<Button
android:id="@+id/failNav3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="服务调用失败" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/between_cell"
android:background="@drawable/bg_test_area"
android:orientation="vertical"
android:padding="@dimen/test_area_padding">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="动态增加路由测试" />
<Button
android:id="@+id/addGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="动态增加路由" />
<Button
android:id="@+id/dynamicNavigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="动态路由测试" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/between_cell"
android:background="@drawable/bg_test_area"
android:orientation="vertical"
android:padding="@dimen/test_area_padding">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="多路由(同一个页面 or service 指定多个路由)" />
<Button
android:id="@+id/route1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="用路由1跳转" />
<Button
android:id="@+id/route2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="用路由2跳转" />
</LinearLayout>
</LinearLayout>
</ScrollView>