diff --git a/soft1614080902221/app/src/main/java/edu/hzuapps/androidlabs/soft1614080902221/Activity2.java b/soft1614080902221/app/src/main/java/edu/hzuapps/androidlabs/soft1614080902221/Activity2.java
index 9ebb67f06..a09bebec4 100644
--- a/soft1614080902221/app/src/main/java/edu/hzuapps/androidlabs/soft1614080902221/Activity2.java
+++ b/soft1614080902221/app/src/main/java/edu/hzuapps/androidlabs/soft1614080902221/Activity2.java
@@ -1,10 +1,28 @@
package edu.hzuapps.androidlabs.soft1614080902221;
+import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
+import android.view.View;
import android.view.WindowManager;
+import android.widget.AbsoluteLayout;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+import android.widget.TextView;
+import android.widget.Toast;
public class Activity2 extends AppCompatActivity {
+ private EditText etText = null;
+ private RadioGroup sex_rg = null;
+ private RadioGroup gameCharacters = null;
+ private TextView text2 = null;
+ private Button okButton = null;
+ private Button resetButton = null;
+ private Button goButton = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -12,5 +30,67 @@ protected void onCreate(Bundle savedInstanceState) {
getSupportActionBar().hide();// 隐藏ActionBar
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//remove notification bar 即全屏
setContentView(R.layout.activity_2);
+ initView();
}
+
+ private void initView() {
+ etText = (EditText) findViewById(R.id.edText1);
+ sex_rg = (RadioGroup) findViewById(R.id.sex_rg);
+ gameCharacters = (RadioGroup) findViewById(R.id.gameCharacters);
+ text2 = (TextView) findViewById(R.id.text2);
+ okButton = (Button) findViewById(R.id.okButton);
+ resetButton = (Button) findViewById(R.id.resetButton);
+ goButton = (Button) findViewById(R.id.goButton);
+ goButton.setVisibility(View.INVISIBLE);
+
+ okButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ String strPersonName = etText.getText().toString();
+
+ int sex = sex_rg.getCheckedRadioButtonId();
+ RadioButton sex_rb = (RadioButton) findViewById(sex);
+ String strSex = sex_rb.getText().toString();
+
+ int gameName = gameCharacters.getCheckedRadioButtonId();
+ RadioButton gameName_rb = (RadioButton) findViewById(gameName);
+ String strGameName = gameName_rb.getText().toString();
+
+ if (strPersonName.equals("")) {
+ goButton.setVisibility(View.INVISIBLE);
+ Toast.makeText(Activity2.this, "请输入您的名称", Toast.LENGTH_SHORT).show();
+ //text2.setText("请输入您的名称!!!");
+ } else {
+ goButton.setVisibility(View.VISIBLE);
+ text2.setText("亲爱的" + strPersonName + "玩家,\n" + "性别:" + strSex + "\n" +
+ "你选择的角色:" + strGameName);
+ }
+
+
+ }
+ });
+
+ resetButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ etText.setText("");
+
+ RadioButton sex_rb = (RadioButton) findViewById(R.id.male_rb);
+ sex_rb.setChecked(true);
+
+ RadioButton gameName_rb = (RadioButton) findViewById(R.id.muLing);
+ gameName_rb.setChecked(true);
+
+ text2.setText("");
+ goButton.setVisibility(View.INVISIBLE);
+
+
+ }
+ });
+
+
+ }
+
+
}
diff --git a/soft1614080902221/app/src/main/java/edu/hzuapps/androidlabs/soft1614080902221/Soft1614080902221Activity.java b/soft1614080902221/app/src/main/java/edu/hzuapps/androidlabs/soft1614080902221/Soft1614080902221Activity.java
index 94e0a7a2f..545d06fc0 100644
--- a/soft1614080902221/app/src/main/java/edu/hzuapps/androidlabs/soft1614080902221/Soft1614080902221Activity.java
+++ b/soft1614080902221/app/src/main/java/edu/hzuapps/androidlabs/soft1614080902221/Soft1614080902221Activity.java
@@ -11,6 +11,7 @@
public class Soft1614080902221Activity extends AppCompatActivity {
private Button startButton = null;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -18,15 +19,15 @@ protected void onCreate(Bundle savedInstanceState) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//remove notification bar 即全屏
setContentView(R.layout.activity_soft1614080902221);
- startButton = (Button)findViewById(R.id.startButton);
- startButton.setOnClickListener(new OnClickListener(){
+ startButton = (Button) findViewById(R.id.startButton);
+ startButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
- Intent intent = new Intent(Soft1614080902221Activity.this,Activity2.class);
- startActivity(intent);
+ Intent intent = new Intent(Soft1614080902221Activity.this, Activity2.class);
+ startActivity(intent);
}
- } );
+ });
}
diff --git a/soft1614080902221/app/src/main/res/layout/activity_2.xml b/soft1614080902221/app/src/main/res/layout/activity_2.xml
index b7ea61cac..263f8310d 100644
--- a/soft1614080902221/app/src/main/res/layout/activity_2.xml
+++ b/soft1614080902221/app/src/main/res/layout/activity_2.xml
@@ -6,12 +6,129 @@
android:layout_height="match_parent"
tools:context=".Activity2">
-
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/soft1614080902221/app/src/main/res/layout/activity_soft1614080902221.xml b/soft1614080902221/app/src/main/res/layout/activity_soft1614080902221.xml
index ec0330b1a..736b7c6fa 100644
--- a/soft1614080902221/app/src/main/res/layout/activity_soft1614080902221.xml
+++ b/soft1614080902221/app/src/main/res/layout/activity_soft1614080902221.xml
@@ -15,7 +15,7 @@
android:src="@drawable/picture1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="0.0"
+ app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
diff --git a/soft1614080902221/app/src/main/res/values/colors.xml b/soft1614080902221/app/src/main/res/values/colors.xml
deleted file mode 100644
index 3ab3e9cbc..000000000
--- a/soft1614080902221/app/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- #3F51B5
- #303F9F
- #FF4081
-
diff --git a/soft1614080902221/app/src/main/res/values/dimens.xml b/soft1614080902221/app/src/main/res/values/dimens.xml
deleted file mode 100644
index 59a0b0c4f..000000000
--- a/soft1614080902221/app/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- 16dp
-
diff --git a/soft1614080902221/app/src/main/res/values/styles.xml b/soft1614080902221/app/src/main/res/values/styles.xml
deleted file mode 100644
index 545b9c6d2..000000000
--- a/soft1614080902221/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git "a/soft1614080902221/\347\254\2544\346\254\241\345\256\236\351\252\214\346\210\252\345\233\2761.png" "b/soft1614080902221/\347\254\2544\346\254\241\345\256\236\351\252\214\346\210\252\345\233\2761.png"
new file mode 100644
index 000000000..5296e937d
Binary files /dev/null and "b/soft1614080902221/\347\254\2544\346\254\241\345\256\236\351\252\214\346\210\252\345\233\2761.png" differ
diff --git "a/soft1614080902221/\347\254\2544\346\254\241\345\256\236\351\252\214\346\210\252\345\233\2762.png" "b/soft1614080902221/\347\254\2544\346\254\241\345\256\236\351\252\214\346\210\252\345\233\2762.png"
new file mode 100644
index 000000000..0b632f042
Binary files /dev/null and "b/soft1614080902221/\347\254\2544\346\254\241\345\256\236\351\252\214\346\210\252\345\233\2762.png" differ
diff --git "a/soft1614080902221/\347\254\2544\346\254\241\345\256\236\351\252\214\346\210\252\345\233\2763.png" "b/soft1614080902221/\347\254\2544\346\254\241\345\256\236\351\252\214\346\210\252\345\233\2763.png"
new file mode 100644
index 000000000..3f3766a32
Binary files /dev/null and "b/soft1614080902221/\347\254\2544\346\254\241\345\256\236\351\252\214\346\210\252\345\233\2763.png" differ
diff --git "a/soft1614080902221/\347\254\2544\346\254\241\345\256\236\351\252\214\346\210\252\345\233\2764.png" "b/soft1614080902221/\347\254\2544\346\254\241\345\256\236\351\252\214\346\210\252\345\233\2764.png"
new file mode 100644
index 000000000..5b3f63b8b
Binary files /dev/null and "b/soft1614080902221/\347\254\2544\346\254\241\345\256\236\351\252\214\346\210\252\345\233\2764.png" differ