Compare commits

...

No commits in common. 'master' and 'main' have entirely different histories.
master ... main

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="MainActivity3">
<State />
</entry>
<entry key="app">
<State />
</entry>
</value>
</component>
</project>

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">

@ -12,10 +12,7 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Base.Theme.App1" android:theme="@style/Base.Theme.App1"
tools:targetApi="31"> tools:targetApi="31">
<activity <activity android:name=".shuju"/>
android:name=".Main4Activity"
android:exported="false" />
<activity android:name=".shuju" />
<activity <activity
android:name=".MainActivity3" android:name=".MainActivity3"
android:exported="false" /> android:exported="false" />
@ -39,7 +36,7 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".IndexActivity" /> <activity android:name=".IndexActivity"/>
</application> </application>
</manifest> </manifest>

@ -0,0 +1,116 @@
package com.example.app1;
import android.app.DatePickerDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.EdgeToEdge;
import androidx.annotation.IdRes;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
public class MainActivity3 extends AppCompatActivity implements View.OnClickListener{
private TextView reg_username;
private TextView reg_password;
private TextView reg_sure_password;
private RadioGroup radiogroup;
private CheckBox ah1,ah2,ah3,ah4;
private String sex="男";
private String aihao1="",aihao2="",aihao3="",aihao4="";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//这个是获取布局文件的,这里是你下一个页面的布局文件//注意这个是跳转界面的不能设置错,应该是第一个
setContentView(R.layout.user_register);
//组件初始化
reg_username = findViewById(R.id.reg_username);
reg_password = findViewById(R.id.reg_password);
reg_sure_password = findViewById(R.id.reg_sure_password);
findViewById(R.id.reg_register).setOnClickListener((View.OnClickListener) this);
radiogroup=findViewById(R.id.rp);
radiogroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
if(checkedId==R.id.man)
{sex="男";}
if(checkedId==R.id.woman)
{sex="女";}
}
});
ah1=findViewById(R.id.chang);
ah2=findViewById(R.id.tiao);
ah3=findViewById(R.id.rap);
ah4=findViewById(R.id.basketball);
CompoundButton.OnCheckedChangeListener occl=new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if(buttonView.getId()==R.id.chang){
if(isChecked){aihao1="唱";}
else{aihao1="";}
}
else if(buttonView.getId()==R.id.tiao){
if(isChecked){aihao2="跳";}
else{aihao2="";}
}
else if(buttonView.getId()==R.id.rap){
if(isChecked){aihao3="rap";}
else{aihao3="";}
}
else if(buttonView.getId()==R.id.basketball){
if(isChecked){aihao4="篮球";}
else{aihao4="";}
}
}
};
ah1.setOnCheckedChangeListener(occl);
ah2.setOnCheckedChangeListener(occl);
ah3.setOnCheckedChangeListener(occl);
ah4.setOnCheckedChangeListener(occl);
}
@Override
public void onClick(View view){
String password = reg_password.getText().toString();
String surepassword = reg_sure_password.getText().toString();
if(password.equals(surepassword)){
Intent intent1 = new Intent(this, shuju.class);
Bundle bundle = new Bundle();
bundle.putString("username",reg_username.getText().toString());
bundle.putString("paswd",reg_password.getText().toString());
bundle.putString("sex",sex);
bundle.putString("ah1",aihao1);
bundle.putString("ah2",aihao2);
bundle.putString("ah3",aihao3);
bundle.putString("ah4",aihao4);
intent1.putExtras(bundle);
startActivity(intent1);
}else{
Toast.makeText(MainActivity3.this,"两次输入密码错不一致!",Toast.LENGTH_SHORT).show();
}
}
public void fanhui(View view) {
Intent intent5 = new Intent(MainActivity3.this,MainActivity2.class);
this.startActivity(intent5);
}
}

@ -4,24 +4,16 @@ import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import java.sql.SQLClientInfoException;
import java.util.ArrayList;
public class shuju extends AppCompatActivity { public class shuju extends AppCompatActivity {
String name,paswd,age,telephone,sex,ah1,ah2,ah3,ah4; String name,paswd,sex,ah1,ah2,ah3,ah4;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -29,29 +21,19 @@ public class shuju extends AppCompatActivity {
setContentView(R.layout.shuju); setContentView(R.layout.shuju);
// 获取上一个Activity传递过来的用户信息 // 获取上一个Activity传递过来的用户信息
// Bundle bundle = this.getIntent().getExtras(); Bundle bundle = this.getIntent().getExtras();
// name = bundle.getString("username"); name = bundle.getString("username");
// paswd = bundle.getString("paswd"); paswd = bundle.getString("paswd");
// age= bundle.getString("age"); sex = bundle.getString("sex");
// telephone = bundle.getString("telephone"); ah1 = bundle.getString("ah1");
// sex = bundle.getString("sex"); ah2 = bundle.getString("ah2");
// ah1 = bundle.getString("ah1"); ah3 = bundle.getString("ah3");
// ah2 = bundle.getString("ah2"); ah4 = bundle.getString("ah4");
// ah3 = bundle.getString("ah3");
// ah4 = bundle.getString("ah4"); // 显示用户信息
TextView show_text = findViewById(R.id.tv_shuju);
// String[] data=bundle.getStringArray("data"); show_text.setText("账号:"+name+"\n"+"密码:"+paswd+"\n"+"性别:"+sex+"\n"+"爱好:"+ah1+ah2+ah3+ah4);
// String []data={"账号:"+name,"密码:"+paswd,"年龄:"+age,"电话号码:"+telephone,"性别:"+sex,"爱好:"+ah1+ah2+ah3+ah4};
ArrayList<String> data = getIntent().getStringArrayListExtra("data");
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1,data);
ListView listView=(ListView)findViewById(R.id.list0);
listView.setAdapter(adapter);
// ArrayAdapter adapter=new ArrayAdapter(shuju.this, android.R.layout.simple_list_item_1,data);
// ListView listView=(ListView)findViewById(R.id.list0);
// listView.setAdapter(adapter);
// 保存账号和密码 // 保存账号和密码
saveCredentials(this, name, paswd); saveCredentials(this, name, paswd);
} }
@ -89,21 +71,8 @@ public class shuju extends AppCompatActivity {
}); });
AlertDialog adialog=builder.create(); AlertDialog adialog=builder.create();
adialog.show(); adialog.show();
}
}
} }

Before

Width:  |  Height:  |  Size: 577 KiB

After

Width:  |  Height:  |  Size: 577 KiB

Before

Width:  |  Height:  |  Size: 895 KiB

After

Width:  |  Height:  |  Size: 895 KiB

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Before

Width:  |  Height:  |  Size: 945 B

After

Width:  |  Height:  |  Size: 945 B

Before

Width:  |  Height:  |  Size: 857 B

After

Width:  |  Height:  |  Size: 857 B

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Before

Width:  |  Height:  |  Size: 465 B

After

Width:  |  Height:  |  Size: 465 B

Before

Width:  |  Height:  |  Size: 447 B

After

Width:  |  Height:  |  Size: 447 B

Before

Width:  |  Height:  |  Size: 570 B

After

Width:  |  Height:  |  Size: 570 B

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Before

Width:  |  Height:  |  Size: 333 KiB

After

Width:  |  Height:  |  Size: 333 KiB

@ -5,22 +5,13 @@
android:orientation="vertical" android:orientation="vertical"
android:background="@drawable/tupianbackground1"> android:background="@drawable/tupianbackground1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button <Button
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="170dp"
android:text="返回登录界面" android:text="返回登录界面"
android:onClick="re1" /> android:onClick="re1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="查询界面"
android:onClick="re2" />
</LinearLayout>
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -30,8 +21,4 @@
android:textColor="@color/palevioletred" android:textColor="@color/palevioletred"
android:textSize="20sp"/> android:textSize="20sp"/>
<ListView
android:id="@+id/list0"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout> </LinearLayout>

@ -41,7 +41,6 @@
android:id="@+id/username" android:id="@+id/username"
android:layout_width="270dp" android:layout_width="270dp"
android:layout_height="60dp" android:layout_height="60dp"
android:layout_marginTop="60dp"
android:hint="username" android:hint="username"
android:maxLength="10" android:maxLength="10"
android:maxLines="1" android:maxLines="1"
@ -69,7 +68,6 @@
android:inputType="textPassword" android:inputType="textPassword"
android:textColorHint="@color/pink"/> android:textColorHint="@color/pink"/>
</LinearLayout> </LinearLayout>
<Button <Button
android:id="@+id/login" android:id="@+id/login"
android:onClick="denglu" android:onClick="denglu"
@ -77,7 +75,7 @@
android:layout_height="50dp" android:layout_height="50dp"
android:textSize="18sp" android:textSize="18sp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp" android:layout_marginTop="60dp"
android:textColor="#FFFFFF" android:textColor="#FFFFFF"
android:text="登录" android:text="登录"
/> />

@ -86,48 +86,6 @@
android:hint="再次输入密码" android:hint="再次输入密码"
android:textColorHint="@color/pink"/> android:textColorHint="@color/pink"/>
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:src="@drawable/baseline_vpn_key_24"/>
<EditText
android:layout_width="290dp"
android:layout_height="60dp"
android:id="@+id/age"
android:textAlignment="center"
android:maxLength="16"
android:maxLines="1"
android:inputType="numberDecimal"
android:hint="年龄"
android:textColorHint="@color/pink"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:src="@drawable/baseline_lock_24"/>
<EditText
android:layout_width="290dp"
android:layout_height="60dp"
android:id="@+id/telephone"
android:textAlignment="center"
android:maxLength="16"
android:maxLines="1"
android:inputType="numberDecimal"
android:hint="请输入电话号码"
android:textColorHint="@color/pink"/>
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save