Skip to content

Commit bb443c4

Browse files
committed
[dev] 添加 Sample 相关的测试用例
1 parent d86ce2f commit bb443c4

File tree

5 files changed

+38
-1
lines changed

5 files changed

+38
-1
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
<activity android:name=".RecyclerViewActivity" />
2121
<activity android:name=".ListViewActivity" />
2222
<activity android:name=".GridViewActivity" />
23-
<activity android:name=".OtherActivity"></activity>
23+
<activity android:name=".OtherActivity" />
24+
<activity android:name=".SampleActivity"></activity>
2425
</application>
2526

2627
</manifest>

app/src/main/java/com/xiaweizi/androidtoolsexample/MainActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,8 @@ public void GridView(View view) {
3232
public void Other(View view) {
3333
startActivity(new Intent(MainActivity.this, OtherActivity.class));
3434
}
35+
36+
public void Sample(View view) {
37+
startActivity(new Intent(MainActivity.this, SampleActivity.class));
38+
}
3539
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.xiaweizi.androidtoolsexample;
2+
3+
import android.support.v7.app.AppCompatActivity;
4+
import android.os.Bundle;
5+
6+
public class SampleActivity extends AppCompatActivity {
7+
8+
@Override
9+
protected void onCreate(Bundle savedInstanceState) {
10+
super.onCreate(savedInstanceState);
11+
setContentView(R.layout.activity_sample);
12+
}
13+
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,13 @@
5454
android:onClick="Other"
5555
android:textAllCaps="false" />
5656

57+
<Button
58+
android:layout_width="match_parent"
59+
android:layout_height="wrap_content"
60+
android:layout_marginEnd="8dp"
61+
android:layout_marginStart="8dp"
62+
android:text="Sample"
63+
android:onClick="Sample"
64+
android:textAllCaps="false" />
65+
5766
</LinearLayout>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:orientation="vertical"
8+
tools:context="com.xiaweizi.androidtoolsexample.SampleActivity">
9+
10+
</LinearLayout>

0 commit comments

Comments
 (0)