Skip to content

Commit 0e9ed5c

Browse files
committed
add reset button
1 parent cb4485a commit 0e9ed5c

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/wx/multiwindow/Activity2.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,16 @@ public void print(String msg, String color, boolean bold) {
122122
public void clear(View v) {
123123
mBuilder.delete(0, mBuilder.length());
124124
mTextView.setText("");
125+
}
126+
127+
/**
128+
* 重置
129+
*
130+
* @param v
131+
*/
132+
public void reset(View v) {
125133
mDrawImageView.setVisibility(View.GONE);
126134
mDrawTextView.setVisibility(View.VISIBLE);
135+
clear(v);
127136
}
128137
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
android:layout_height="wrap_content"
1212
android:orientation="vertical">
1313

14+
<Button
15+
android:layout_width="match_parent"
16+
android:layout_height="wrap_content"
17+
android:layout_margin="5dp"
18+
android:gravity="center"
19+
android:onClick="reset"
20+
android:text="重置" />
21+
1422
<Button
1523
android:layout_width="match_parent"
1624
android:layout_height="wrap_content"

0 commit comments

Comments
 (0)